playbook_ui 10.6.2.pre.alpha.dep → 10.7.0

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: 361df619e970d5e3d935da11689effd50fda787b550e94a0b2ffa918d6d4e558
4
- data.tar.gz: 725ccf3c38f4cb117bf8845bc7d5cdf852f1146b70e632e3cc2456a354d3301b
3
+ metadata.gz: 4cc29f190a9363d0d6a74453b37c8807e0e81533b81f723f355581ee48fe3334
4
+ data.tar.gz: d40f1847c1dc95b50c33efed09025c72b21eadd8074db0ba37f0264d23f5dd0d
5
5
  SHA512:
6
- metadata.gz: 00f7c8a62559d90263a71aaeba3f837c37448e170eff51eee848964321028a6fc7ac1e19a9341a98140d474adc7c9081ab40f8a004335058e6a3549602b4b3d1
7
- data.tar.gz: 07d4883c55d61a9e8e2ced35c43d738995a4bb7fe3f8625e7d2b2744bbf0bac181846216676cf5f5e2e598a9496063ff0c476a1356e538b78e922803391b4120
6
+ metadata.gz: 281a0091d738cf52dfa459683d9be8a3ce94da37254647461942be3de9a1ab973ef2204f9cf3b071ba5150ca7010d1d661ba22674f2faf0da98568da5440fc69
7
+ data.tar.gz: bac6f97aa5b91c888cc50d929e12d9090963b597f43fdfb11dd238f7f6b9683a8adf9960aee6a500422d1a41a6496996901c3a9f962c4aa9f16f73002c2f7f35
@@ -27,6 +27,7 @@ type DatePickerProps = {
27
27
  hideIcon?: Boolean,
28
28
  hideLabel?: Boolean,
29
29
  id?: String,
30
+ inLine?: Boolean,
30
31
  inputAria?: object,
31
32
  inputData?: object,
32
33
  inputOnChange?: (String) => void,
@@ -59,6 +60,7 @@ const DatePicker = (props: DatePickerProps) => {
59
60
  hideIcon = false,
60
61
  hideLabel = false,
61
62
  id,
63
+ inLine = true,
62
64
  inputAria,
63
65
  inputData,
64
66
  inputOnChange,
@@ -92,6 +94,7 @@ const DatePicker = (props: DatePickerProps) => {
92
94
  disableWeekdays: disableWeekdays,
93
95
  format: format,
94
96
  hideIcon: hideIcon,
97
+ inLine: inLine,
95
98
  maxDate: maxDate,
96
99
  minDate: minDate,
97
100
  mode: mode,
@@ -137,6 +140,7 @@ const DatePicker = (props: DatePickerProps) => {
137
140
  placeholder={placeholder}
138
141
  value={inputValue}
139
142
  />
143
+
140
144
  <If condition={!hideIcon}>
141
145
  <div
142
146
  className={iconWrapperClass()}
@@ -148,6 +152,28 @@ const DatePicker = (props: DatePickerProps) => {
148
152
  />
149
153
  </div>
150
154
  </If>
155
+
156
+ <If condition={hideIcon && inLine}>
157
+ <div
158
+ className={iconWrapperClass()}
159
+ id={`${pickerId}-icon-plus`}
160
+ >
161
+ <Icon
162
+ className="date-picker-plus-icon"
163
+ icon="plus"
164
+ />
165
+ </div>
166
+ <div
167
+ className={iconWrapperClass()}
168
+ id={`${pickerId}-angle-down`}
169
+ >
170
+ <Icon
171
+ className="angle_down_icon"
172
+ icon="angle-down"
173
+ />
174
+ </div>
175
+ </If>
176
+
151
177
  </div>
152
178
  </div>
153
179
  )
@@ -2,6 +2,7 @@
2
2
  @import "../pb_textarea/textarea_mixin";
3
3
  @import "../tokens/colors";
4
4
  @import "./sass_partials/flatpickr_styles";
5
+ @import "./sass_partials/inline_styles";
5
6
 
6
7
  [class^=pb_date_picker_kit] {
7
8
  .input_wrapper {
@@ -36,5 +37,5 @@
36
37
  border-color: $primary;
37
38
  }
38
39
  }
39
-
40
+
40
41
  }
@@ -32,6 +32,31 @@
32
32
  }) %>
33
33
  </div>
34
34
  <% end %>
35
+
36
+ <!-- Inline -->
37
+ <% if object.hide_icon && object.inline %>
38
+ <!-- Plus Icon -->
39
+ <div
40
+ class="<%= object.icon_wrapper_class %>"
41
+ id="<%= object.picker_id %>-icon-plus"
42
+ >
43
+ <%= pb_rails("icon", props: {
44
+ classname: "plus-icon",
45
+ icon: "plus"
46
+ }) %>
47
+ </div>
48
+
49
+ <!-- Angle Down Icon -->
50
+ <div
51
+ class="<%= object.icon_wrapper_class %>"
52
+ id="<%= object.picker_id %>-angle-down"
53
+ >
54
+ <%= pb_rails("icon", props: {
55
+ classname: "angle_down_icon",
56
+ icon: "angle-down"
57
+ }) %>
58
+ </div>
59
+ <% end %>
35
60
  </div>
36
61
 
37
62
  <%= javascript_tag do %>
@@ -24,6 +24,8 @@ module Playbook
24
24
  default: false
25
25
  prop :hide_label, type: Playbook::Props::Boolean,
26
26
  default: false
27
+ prop :inline, type: Playbook::Props::Boolean,
28
+ default: false
27
29
  prop :label, type: Playbook::Props::String,
28
30
  default: "Date Picker"
29
31
  prop :input_aria, type: Playbook::Props::Hash,
@@ -57,6 +59,7 @@ module Playbook
57
59
  disableWeekdays: disable_weekdays,
58
60
  format: format,
59
61
  hideIcon: hide_icon,
62
+ inline: inline,
60
63
  maxDate: max_date,
61
64
  minDate: min_date,
62
65
  mode: mode,
@@ -0,0 +1,17 @@
1
+ <%= pb_rails("date_picker", props: {
2
+ classname: "inline-date-picker",
3
+ hide_icon: true,
4
+ inline: true,
5
+ picker_id: "date-picker-inline"
6
+ }) %>
7
+
8
+ <%= javascript_tag do %>
9
+ window.addEventListener("DOMContentLoaded", (event) => {
10
+ const fpInline = document.querySelector("#date-picker-inline")._flatpickr
11
+ <!-- Display the angle-down icon when a date has been selected -->
12
+ const showAngleDownHandler = () => {
13
+ document.querySelector('.inline-date-picker').classList.add('show-angle-down-icon')
14
+ }
15
+ fpInline.config.onChange.push(showAngleDownHandler)
16
+ })
17
+ <% end %>
@@ -0,0 +1,26 @@
1
+ import React from 'react'
2
+
3
+ import DatePicker from '../_date_picker'
4
+
5
+ const DatePickerInline = (props) => {
6
+ const showAngleDownHandler = (dateSelected) => {
7
+ if (dateSelected) {
8
+ document.querySelector('.inline-date-picker').classList.add('show-angle-down-icon')
9
+ }
10
+ }
11
+
12
+ return (
13
+ <div>
14
+ <DatePicker
15
+ className="inline-date-picker"
16
+ hideIcon
17
+ inLine
18
+ onChange={showAngleDownHandler}
19
+ pickerId="date-picker-inline"
20
+ {...props}
21
+ />
22
+ </div>
23
+ )
24
+ }
25
+
26
+ export default DatePickerInline
@@ -1,5 +1,5 @@
1
1
  examples:
2
-
2
+
3
3
  rails:
4
4
  - date_picker_default: Default
5
5
  - date_picker_hide_icon: Hide Input Icon
@@ -15,8 +15,9 @@ examples:
15
15
  - date_picker_hooks: Hooks
16
16
  - date_picker_year_range: Year Range
17
17
  - date_picker_anti_patterns: Anti-Patterns
18
-
19
-
18
+ - date_picker_inline: Inline
19
+
20
+
20
21
  react:
21
22
  - date_picker_default: Default
22
23
  - date_picker_hide_icon: Hide Input Icon
@@ -32,3 +33,4 @@ examples:
32
33
  - date_picker_flatpickr_methods: Flatpickr Methods
33
34
  - date_picker_hooks: Hooks
34
35
  - date_picker_year_range: Year Range
36
+ - date_picker_inline: Inline
@@ -12,3 +12,4 @@ export { default as DatePickerError } from './_date_picker_error.jsx'
12
12
  export { default as DatePickerHooks } from './_date_picker_hooks.jsx'
13
13
  export { default as DatePickerFlatpickrMethods } from './_date_picker_flatpickr_methods.jsx'
14
14
  export { default as DatePickerYearRange } from './_date_picker_year_range.jsx'
15
+ export { default as DatePickerInline } from './_date_picker_inline.jsx'
@@ -0,0 +1,169 @@
1
+ /*
2
+ === Date Picker States ===
3
+ Default - No value in date picker - display grey Plus icon
4
+ Hover - No value in date picker - display blue Plus icon
5
+ - After Value in Date Picker -
6
+ Default - display grey caret icon
7
+ Hover - display blue caret icon
8
+ */
9
+ [class^=pb_date_picker_kit] {
10
+ /*Default - No value in date picker*/
11
+ &.inline-date-picker {
12
+ &:not(:hover) {
13
+ #date-picker-inline-angle-down {
14
+ svg {
15
+ display: none;
16
+ }
17
+ }
18
+ #date-picker-inline-icon-plus {
19
+ svg {
20
+ color: $slate;
21
+ display: inline-block;
22
+ }
23
+ }
24
+ }
25
+ &:hover {
26
+ [class^="pb_text_input_kit"] .text_input_wrapper input,
27
+ [class^="pb_text_input_kit"] .text_input_wrapper .text_input,
28
+ [class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper input::placeholder,
29
+ [class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper .text_input .placeholder {
30
+ color: $primary;
31
+ }
32
+ #date-picker-inline-angle-down {
33
+ svg {
34
+ display: none;
35
+ }
36
+ }
37
+ #date-picker-inline-icon-plus {
38
+ svg {
39
+ display: inline-block;
40
+ color: $primary;
41
+ }
42
+ }
43
+ }
44
+ &.show-angle-down-icon {
45
+ &:not(:hover) {
46
+ #date-picker-inline-angle-down {
47
+ svg {
48
+ display: inline-block;
49
+ color: $text_lt_light;
50
+ }
51
+ }
52
+ #date-picker-inline-icon-plus {
53
+ svg {
54
+ display: none;
55
+ }
56
+ }
57
+ }
58
+ #date-picker-inline-icon-plus {
59
+ svg {
60
+ display: none;
61
+ }
62
+ }
63
+ #date-picker-inline-angle-down {
64
+ svg {
65
+ display: inline-block;
66
+ color: $primary;
67
+ }
68
+ }
69
+ }
70
+ #date-picker-inline,
71
+ #date-picker-inline .active {
72
+ border: none;
73
+ padding: 5px 5px 5px 10px;
74
+ background-color: #FFF;
75
+ &:hover {
76
+ background: rgba(0,130,255,0.1);
77
+ transition: background-color 0.2s ease;
78
+ box-shadow: none;
79
+ }
80
+ }
81
+ #date-picker-inline-angle-down,
82
+ #date-picker-inline-icon-plus {
83
+ height: 33px;
84
+ border: none;
85
+ }
86
+ }
87
+ }
88
+
89
+ /*
90
+ DARK MODE
91
+ */
92
+ [class^=pb_date_picker_kit].dark {
93
+ &.inline-date-picker {
94
+ &:not(:hover) {
95
+ #date-picker-inline-angle-down {
96
+ svg {
97
+ display: none;
98
+ }
99
+ }
100
+ #date-picker-inline-icon-plus {
101
+ svg {
102
+ display: inline-block;
103
+ color: $white;
104
+ }
105
+ }
106
+ }
107
+ &:hover {
108
+ [class^="pb_text_input_kit"] .text_input_wrapper input,
109
+ [class^="pb_text_input_kit"] .text_input_wrapper .text_input,
110
+ [class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper input::placeholder,
111
+ [class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper .text_input .placeholder {
112
+ color: $white;
113
+ }
114
+ #date-picker-inline-angle-down {
115
+ svg {
116
+ display: none;
117
+ }
118
+ }
119
+ #date-picker-inline-icon-plus {
120
+ svg {
121
+ display: inline-block;
122
+ color: $white;
123
+ }
124
+ }
125
+ }
126
+ &.show-angle-down-icon {
127
+ &:not(:hover) {
128
+ #date-picker-inline-angle-down {
129
+ svg {
130
+ display: inline-block;
131
+ color: $white;
132
+ }
133
+ }
134
+ #date-picker-inline-icon-plus {
135
+ svg {
136
+ display: none;
137
+ }
138
+ }
139
+ }
140
+ #date-picker-inline-icon-plus {
141
+ svg {
142
+ display: none;
143
+ }
144
+ }
145
+ #date-picker-inline-angle-down {
146
+ svg {
147
+ display: inline-block;
148
+ color: $white;
149
+ }
150
+ }
151
+ }
152
+ #date-picker-inline,
153
+ #date-picker-inline .active {
154
+ background-color: rgba($white,.10);
155
+ border: none;
156
+ padding: 5px 5px 5px 10px;
157
+ &:hover {
158
+ background: rgba(0,130,255,0.1);
159
+ transition: background-color 0.2s ease;
160
+ box-shadow: none;
161
+ }
162
+ }
163
+ #date-picker-inline-angle-down,
164
+ #date-picker-inline-icon-plus {
165
+ height: 33px;
166
+ border: none;
167
+ }
168
+ }
169
+ }
@@ -115,9 +115,10 @@ const RichTextEditor = (props: RichTextEditorProps) => {
115
115
  const trixEditorContainer = clickedElement.closest('.pb_rich_text_editor_kit')
116
116
  if (!trixEditorContainer) return
117
117
 
118
- if (clickedElement.nodeName === 'A' && clickedElement.hasAttribute('href')) {
119
- window.open(clickedElement.href)
120
- }
118
+ const anchorElement = clickedElement.closest('a')
119
+ if (!anchorElement) return
120
+
121
+ if (anchorElement.hasAttribute('href')) window.open(anchorElement.href)
121
122
  }
122
123
 
123
124
  const handleClick = (event) => {
data/dist/reset.css CHANGED
@@ -1,61 +1,2 @@
1
- /* CLEAN UP AND REMOVE */
2
- /* Headings */
3
- /* Standard Font Weights */
4
- /* Non_Standard Font Weights */
5
- /*=====================================
6
- Base colors should not be documented.
7
- Only document color use.
8
-
9
- Colors -----------------------------*/
10
- /* Specialty Gradient -----------------*/
11
- /* Interface colors -------------------*/
12
- /* Main colors ------------------------*/
13
- /*=====================================
14
-
15
- Background colors ------------------*/
16
- /* Card colors ------------------*/
17
- /* Active colors ----------------------*/
18
- /* Hover colors -----------------------*/
19
- /* Focus colors -----------------------*/
20
- /* Border colors ----------------------*/
21
- /* Shadow colors ----------------------*/
22
- /* Text colors ------------------------*/
23
- /* Data colors ------------------------*/
24
- /* Status colors ----------------------*/
25
- /* Link colors ------------------------*/
26
- /* Product colors ---------------------*/
27
- /* Category colors ---------------------*/
28
- * {
29
- box-sizing: border-box;
30
- margin: 0;
31
- padding: 0; }
32
- *:before, *:after {
33
- box-sizing: border-box; }
34
-
35
- html {
36
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
37
- height: 100vh;
38
- overflow-x: hidden; }
39
-
40
- body {
41
- font-family: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans_serif;
42
- font-size: 16px;
43
- line-height: 1.5;
44
- background-color: #F3F7FB;
45
- height: 100%;
46
- letter-spacing: 0;
47
- font-weight: 400;
48
- font-style: normal;
49
- text-rendering: optimizeLegibility;
50
- -moz-font-feature-settings: "liga" on;
51
- color: #242B42;
52
- margin: 0 !important;
53
- padding: 0 !important;
54
- box-sizing: border-box;
55
- min-height: 100vh;
56
- padding: 50px; }
57
-
58
- a {
59
- text-decoration: none;
60
- color: #0056CF; }
1
+ *{box-sizing:border-box;margin:0;padding:0}*:before,*:after{box-sizing:border-box}html{-webkit-tap-highlight-color:rgba(0,0,0,0);height:100vh;overflow-x:hidden}body{font-family:"Proxima Nova","Helvetica Neue",Helvetica,Arial,sans_serif;font-size:16px;line-height:1.5;background-color:#F3F7FB;height:100%;letter-spacing:0;font-weight:400;font-style:normal;text-rendering:optimizeLegibility;-moz-font-feature-settings:"liga" on;color:#242B42;margin:0 !important;padding:0 !important;box-sizing:border-box;min-height:100vh;padding:50px}a{text-decoration:none;color:#0056CF}
61
2
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "10.5.0"
5
- VERSION = "10.6.2.pre.alpha.dep"
4
+ PREVIOUS_VERSION = "10.6.0"
5
+ VERSION = "10.7.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.2.pre.alpha.dep
4
+ version: 10.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -661,6 +661,8 @@ files:
661
661
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
662
662
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.jsx
663
663
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.md
664
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb
665
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx
664
666
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.html.erb
665
667
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.jsx
666
668
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.md
@@ -683,6 +685,7 @@ files:
683
685
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_day_styles.scss
684
686
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss
685
687
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss
688
+ - app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss
686
689
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss
687
690
  - app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx
688
691
  - app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss
@@ -2082,9 +2085,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
2082
2085
  version: '0'
2083
2086
  required_rubygems_version: !ruby/object:Gem::Requirement
2084
2087
  requirements:
2085
- - - ">"
2088
+ - - ">="
2086
2089
  - !ruby/object:Gem::Version
2087
- version: 1.3.1
2090
+ version: '0'
2088
2091
  requirements: []
2089
2092
  rubygems_version: 3.0.3
2090
2093
  signing_key: