playbook_ui 12.0.0 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e25065accaa0dd497f68c944bfb31b60695e3a4f2430e1818ec656b672763186
4
- data.tar.gz: 8605a87938bde42563130661b9f1213e23958f2ad5e53342c2f162933c101c38
3
+ metadata.gz: 637dc98a1badc91927d22a80c40b7dab9ff223d0beef1585f2d588f34aea833d
4
+ data.tar.gz: 1d95711beb58f0c37cf3dafc98f6c8c38cbd59e6a390290f2574fa612fbcc14e
5
5
  SHA512:
6
- metadata.gz: 85ba42392ecca25ae72e124adcdca9dce9e2122fa2eb961d7be15450ceb3042f1f41573fa55ad6305375db4749f41263e85b01e82c0dfb8b0d8e77b2ad82b853
7
- data.tar.gz: 8bd52867cb7e21d0616d7a8ba8e5a9a1b0dc4170796bf8c547013f74778c348f0248ecbf3a8fecc2fb9d120c02383264a97c934836903079b1e2ce2a2d283c3d
6
+ metadata.gz: 449796d0443af564166cd7fea3d5b3ec3354553c7263aaf00def68b6bbd809aac65b3dc680034faa04564f79d692c3c11618f78a88fe07fa6dbe79c6c56822a3
7
+ data.tar.gz: 17c5ef327dec5cd35db9d780af9bc4af5b7a7eb6ec8f474ecce9a726e2b8c89f8bf379c4b07e32b9a776abcf630529faf7fb6d37d558cdde5dadf5c75309adbc
@@ -56,6 +56,7 @@
56
56
  @import 'pb_multiple_users_stacked/multiple_users_stacked';
57
57
  @import 'pb_nav/nav';
58
58
  @import 'pb_online_status/online_status';
59
+ @import 'pb_pagination/pagination';
59
60
  @import 'pb_passphrase/passphrase';
60
61
  @import 'pb_person/person';
61
62
  @import 'pb_person_contact/person_contact';
@@ -60,6 +60,7 @@ kits:
60
60
  - badge
61
61
  - hashtag
62
62
  - pill
63
+ - pagination
63
64
  - popover
64
65
  - progress:
65
66
  - progress_pills
@@ -103,4 +104,4 @@ kits:
103
104
  - title_count
104
105
  - title_detail
105
106
  - user_badge
106
- - walkthrough
107
+ - walkthrough
@@ -227,6 +227,11 @@
227
227
  height: 100%;
228
228
  max-height: 100%;
229
229
  max-width: none;
230
+ //this empty div only has height when dialog is full height.
231
+ //fix for dialog body content disappearing behind sticky footer
232
+ .dialog-pseudo-footer {
233
+ height: $space_xl * 2;
234
+ }
230
235
  .dialog_footer {
231
236
  position:fixed;
232
237
  bottom: 0;
@@ -287,6 +292,11 @@
287
292
  height: 100% !important;
288
293
  max-height: 100% !important;
289
294
  max-width: 100%;
295
+ //this empty div only has height when dialog is full height.
296
+ //fix for dialog body content disappearing behind sticky footer
297
+ .dialog-pseudo-footer {
298
+ height: $space_xl * 2;
299
+ }
290
300
  .dialog_footer {
291
301
  position:fixed;
292
302
  bottom: 0;
@@ -316,6 +326,7 @@
316
326
  // fixes for stylesheets in nitro that were conflicting with our kit. DO NOT REMOVE.
317
327
  //conflicts were only apparent in nitro, not in playbook local env
318
328
  .pb_dialog_rails {
329
+ position: fixed !important;
319
330
  top: 0 !important;
320
331
  padding: unset !important;
321
332
  margin: auto;
@@ -41,6 +41,8 @@ const DialogFooter = (props: DialogFooterProps) => {
41
41
  {separator &&
42
42
  <SectionSeparator />
43
43
  }
44
+ <div className="dialog-pseudo-footer">
45
+ </div>
44
46
  <Flex
45
47
  className={classnames(footerCSS, footerSpacing, className)}
46
48
  spacing={spacing}
@@ -3,6 +3,7 @@
3
3
  data: object.data,
4
4
  aria: object.aria) do %>
5
5
  <% if object.confirm_button && object.cancel_button %>
6
+ <div class="dialog-pseudo-footer"></div>
6
7
  <%= pb_rails("flex", props: { classname:object.classname, spacing:"between", padding_x:"sm", padding:"sm", padding_bottom:"sm" }) do %>
7
8
  <%= pb_rails("button", props: { type: "submit", id: object.confirm_button_id }) do %>
8
9
  <%= object.confirm_button %>
@@ -0,0 +1,69 @@
1
+ @import "../tokens/colors";
2
+ @import "../tokens/typography";
3
+ @import "../tokens/border_radius";
4
+ @import "../tokens/shadows";
5
+
6
+ $pagination_padding: 7px 13px 6px 13px;
7
+ $top_bottom_radius: 0px;
8
+
9
+ .pb_pagination {
10
+ display: inline-block;
11
+ border-radius: $border_rad_light;
12
+ border: $border_rad_lightest solid $border_light;
13
+ background-color: $white;
14
+ padding: $space_xxs 0px;
15
+ li {
16
+ display: inline;
17
+ > a, li > span {
18
+ padding: $pagination_padding;
19
+ text-decoration: none;
20
+ }}
21
+ li:first-child > a, li:first-child > span {
22
+ padding: $pagination_padding;
23
+ border-right: $border_rad_lightest solid $border_light;
24
+ z-index: 2;
25
+ border-top-right-radius: $top_bottom_radius;
26
+ border-bottom-right-radius: $top_bottom_radius;
27
+ }
28
+ li:last-child > a, li:last-child > span {
29
+ padding: $pagination_padding;
30
+ border-left: $border_rad_lightest solid $border_light;
31
+ z-index: 2;
32
+ border-top-left-radius: $top_bottom_radius;
33
+ border-bottom-left-radius: $top_bottom_radius;
34
+ }
35
+ a {
36
+ color: $text_lt_default;
37
+ font-size: $text_small;
38
+ font-weight: $regular;
39
+ border: none;
40
+ transition: all $transition_default ease-out;
41
+
42
+ &:hover {
43
+ background-color: $active_light;
44
+ color: $primary;
45
+ border-radius: $border_rad_light;
46
+ }
47
+
48
+ &:focus-visible {
49
+ outline: 1px solid $primary;
50
+ border-color: transparent !important;
51
+ border-radius: $border_rad_light !important;
52
+ transition: none;
53
+ }
54
+ }
55
+ .active > span {
56
+ background-color: $primary;
57
+ border-radius: $border_rad_light;
58
+ color: #fff;
59
+ padding: $pagination_padding;
60
+ border: 0;
61
+ text-decoration: none;
62
+ font-weight: $bold;
63
+ font-size: $text_small;
64
+ }
65
+ .disabled > span {
66
+ padding: $pagination_padding;
67
+ font-size: $text_small;
68
+ }
69
+ }
@@ -0,0 +1 @@
1
+ <%= pb_rails("pagination", props: { model: @users, view: self}) %>
@@ -0,0 +1,6 @@
1
+ <div class="pb_pill_kit_warning"><div class="pb_title_kit_size_4 pb_pill_text">Disclaimer</div></div>
2
+ Our Pagination kit depends on the <a href="https://github.com/mislav/will_paginate" target="_blank"> will\_paginate library. </a> Please follow the basic will\_paginate setup.
3
+
4
+ Once you have perfomed the paginated query in your controller file you can use our kit (see code example below) instead of `<%= will_paginate @users %>` in your view file.
5
+
6
+ You need to add: <code>require "playbook/pagination_renderer"</code> in your apps controller file.
@@ -0,0 +1,6 @@
1
+ examples:
2
+
3
+ rails:
4
+ - pagination_default: Default
5
+
6
+
@@ -0,0 +1,7 @@
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id) do %>
6
+ <%= will_paginate object.model, renderer: Playbook::Pagination::Rails %>
7
+ <% end %>
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbPagination
5
+ class Pagination < ::Playbook::KitBase
6
+ prop :model
7
+ prop :view
8
+
9
+ def classname
10
+ generate_classname("pb_paginate")
11
+ end
12
+
13
+ def url_for(options = nil)
14
+ view.url_for(options)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -93,7 +93,7 @@ const Typeahead = ({
93
93
  const handleOnChange = (_data, { action, option, removedValue }) => {
94
94
  if (action === 'select-option') {
95
95
  if (selectProps.onMultiValueClick) selectProps.onMultiValueClick(option)
96
- const multiValueClearEvent = new CustomEvent(`pb-typeahead-kit-${selectProps.id}-result-option-select`, { detail: option })
96
+ const multiValueClearEvent = new CustomEvent(`pb-typeahead-kit-${selectProps.id}-result-option-select`, { detail: option ? option : _data })
97
97
  document.dispatchEvent(multiValueClearEvent)
98
98
  }
99
99
  if (action === 'remove-value' || action === 'pop-value') {
@@ -8,7 +8,7 @@
8
8
  %>
9
9
 
10
10
  <%= pb_rails("typeahead", props: {
11
- id: "typeahead-pills-example1",
11
+ id: "typeahead-without-pills-example1",
12
12
  placeholder: "All Colors",
13
13
  options: options,
14
14
  label: "Colors",
@@ -19,19 +19,12 @@
19
19
 
20
20
  <!-- This section is an example of the available JavaScript event hooks -->
21
21
  <%= javascript_tag defer: "defer" do %>
22
- document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-select", function(event) {
23
- console.log('Option selected')
22
+ document.addEventListener("pb-typeahead-kit-typeahead-without-pills-example1-result-option-select", function(event) {
23
+ console.log('Single Option selected')
24
24
  console.dir(event.detail)
25
25
  })
26
- document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-remove", function(event) {
27
- console.log('Option removed')
28
- console.dir(event.detail)
29
- })
30
- document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-clear", function() {
26
+ document.addEventListener("pb-typeahead-kit-typeahead-without-pills-example1-result-clear", function() {
31
27
  console.log('All options cleared')
32
28
  })
33
29
 
34
- document.querySelector('#clear-pills').addEventListener('click', function() {
35
- document.dispatchEvent(new CustomEvent('pb-typeahead-kit-typeahead-pills-example1:clear'))
36
- })
37
30
  <% end %>
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "will_paginate/view_helpers/action_view"
4
+
5
+ module Playbook
6
+ module Pagination
7
+ class Rails < WillPaginate::ActionView::LinkRenderer
8
+ def container_attributes
9
+ { class: "pb_pagination" }
10
+ end
11
+
12
+ def page_number(page)
13
+ if page == current_page
14
+ tag("li", tag("span", page), class: "active")
15
+ else
16
+ tag("li", link(page, page, rel: rel_value(page)))
17
+ end
18
+ end
19
+
20
+ def previous_or_next_page(page, text, classname)
21
+ if page
22
+ tag("li", link(text, page), class: classname)
23
+ else
24
+ tag("li", tag("span", text), class: "%s disabled")
25
+ end
26
+ end
27
+
28
+ def gap; end
29
+
30
+ def previous_page
31
+ num = @collection.current_page > 1 && @collection.current_page - 1
32
+ previous_or_next_page(num, "<i class='far fa-chevron-left fa-xs'></i>", "prev")
33
+ end
34
+
35
+ def next_page
36
+ num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
37
+ previous_or_next_page(num, "<i class='far fa-chevron-right fa-xs'></i>", "next")
38
+ end
39
+ end
40
+ end
41
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "11.20.0"
5
- VERSION = "12.0.0"
4
+ PREVIOUS_VERSION = "12.0.0"
5
+ VERSION = "12.1.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: 12.0.0
4
+ version: 12.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-01-30 00:00:00.000000000 Z
12
+ date: 2023-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -269,6 +269,20 @@ dependencies:
269
269
  - - '='
270
270
  - !ruby/object:Gem::Version
271
271
  version: 1.2018.9
272
+ - !ruby/object:Gem::Dependency
273
+ name: will_paginate
274
+ requirement: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - '='
277
+ - !ruby/object:Gem::Version
278
+ version: 3.3.1
279
+ type: :development
280
+ prerelease: false
281
+ version_requirements: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - '='
284
+ - !ruby/object:Gem::Version
285
+ version: 3.3.1
272
286
  description: Playbook Design System. Built for Nitro, but powering all.
273
287
  email:
274
288
  - nitroux@powerhrg.com
@@ -1467,6 +1481,12 @@ files:
1467
1481
  - app/pb_kits/playbook/pb_online_status/docs/index.js
1468
1482
  - app/pb_kits/playbook/pb_online_status/online_status.html.erb
1469
1483
  - app/pb_kits/playbook/pb_online_status/online_status.rb
1484
+ - app/pb_kits/playbook/pb_pagination/_pagination.scss
1485
+ - app/pb_kits/playbook/pb_pagination/docs/_pagination_default.html.erb
1486
+ - app/pb_kits/playbook/pb_pagination/docs/_pagination_default.md
1487
+ - app/pb_kits/playbook/pb_pagination/docs/example.yml
1488
+ - app/pb_kits/playbook/pb_pagination/pagination.html.erb
1489
+ - app/pb_kits/playbook/pb_pagination/pagination.rb
1470
1490
  - app/pb_kits/playbook/pb_passphrase/_passphrase.jsx
1471
1491
  - app/pb_kits/playbook/pb_passphrase/_passphrase.scss
1472
1492
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb
@@ -2330,6 +2350,7 @@ files:
2330
2350
  - lib/playbook/markdown/template_handler.rb
2331
2351
  - lib/playbook/number_spacing.rb
2332
2352
  - lib/playbook/order.rb
2353
+ - lib/playbook/pagination_renderer.rb
2333
2354
  - lib/playbook/pb_doc_helper.rb
2334
2355
  - lib/playbook/pb_forms_helper.rb
2335
2356
  - lib/playbook/pb_kit_helper.rb