playbook_ui 13.30.0.pre.alpha.PBNTR353draggablev53136 → 13.30.0.pre.alpha.20240515remotebuildkitconversion3150

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +59 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.md +6 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +4 -4
  6. data/app/pb_kits/playbook/pb_collapsible/index.js +6 -1
  7. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_default_swift.md +33 -0
  8. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_props_swift.md +18 -0
  9. data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +6 -1
  10. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.md +2 -2
  11. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md +1 -1
  12. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md +1 -1
  13. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +18 -0
  14. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +228 -218
  15. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +9 -0
  16. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +34 -0
  17. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
  18. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  19. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +14 -12
  20. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +7 -0
  21. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +17 -2
  22. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +9 -3
  23. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.html.erb +32 -0
  24. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.jsx +48 -0
  25. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  26. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  27. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +16 -11
  28. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +72 -0
  29. data/app/pb_kits/playbook/pb_icon/_icon.tsx +37 -6
  30. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.html.erb +6 -1
  31. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +21 -5
  32. data/app/pb_kits/playbook/pb_icon/icon.rb +21 -1
  33. data/app/pb_kits/playbook/pb_icon/icon_aliases.json +39 -0
  34. data/app/pb_kits/playbook/pb_icon/types.d.ts +1 -0
  35. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +1 -0
  37. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md +3 -1
  38. data/app/pb_kits/playbook/pb_nav/item.html.erb +1 -1
  39. data/app/pb_kits/playbook/pb_nav/item.rb +1 -0
  40. data/app/pb_kits/playbook/pb_table/table_header.html.erb +16 -2
  41. data/dist/playbook-rails.js +7 -7
  42. data/lib/playbook/version.rb +1 -1
  43. metadata +13 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d681e69c84f185b628e40d1d517d5cee70c28972186ee4b47b21641a4ca4637
4
- data.tar.gz: 0c5933b2d3d51c8d8c891f4604f1f11447f1edcf5227446b68db72a4b169731e
3
+ metadata.gz: 566e8e55a2019e4b07f21aaf87d7c9cdec4882133ffff612eb28eea86a6e4ffa
4
+ data.tar.gz: '0197bd9877b5b0ed9002660f011dbea1fe06b6cf258481cea72cb3be712b2c10'
5
5
  SHA512:
6
- metadata.gz: 80a03f749ddd4bf241009567ecc83c161a4cbbefc6779d8db7c2b717242ff4ac536afb263715bae97bca4cfb73bbb2c29d11c8747592ea341bed2b4547572ae2
7
- data.tar.gz: 9cdc6ecc0caeab5ee99f8846513121233f191f28c3b9dd1b9bf3c631133f707dbde9bec819db905663ca437fd2ba66a43e03a871e055e74874a61de87059ff00
6
+ metadata.gz: 85abde5d0af055ed6e080eeb6d767c38a93b495b9c4d6404b1a2f2e202131344089776a2d0f1b22de9ba2d48bb6940bab23237277b9e5f2031601c418e5ce24f
7
+ data.tar.gz: bd1b40be0a0d261605f2835806562f91ec2c8248dbb39cbe4cb4591cb9d4a20fb25fb90d93f1e346cd7b71c23a66c71ad7dc09aa200dcc637ebeb27184551df9
@@ -0,0 +1,59 @@
1
+ <%# Example sort method for demonstration purposes %>
2
+ <% if params["sort"] %>
3
+ <% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
4
+ <% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
5
+ <% @table_data.sort! do |a, b|
6
+ value_a = a[sort_param]
7
+ value_b = b[sort_param]
8
+
9
+ value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
10
+ value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
11
+
12
+ sort_direction * (value_a <=> value_b)
13
+ end %>
14
+ <% end %>
15
+
16
+ <%
17
+ column_definitions = [
18
+ {
19
+ accessor: "year",
20
+ label: "Year",
21
+ cellAccessors: ["quarter", "month", "day"],
22
+ sort_menu: [
23
+ { item: "Year", link: "?sort=year_asc#table-sort", active: params["sort"] == "year_asc", direction: "asc" },
24
+ { item: "Year", link: "?sort=year_desc#table-sort", active: params["sort"] == "year_desc", direction: "desc" }
25
+ ],
26
+ },
27
+ {
28
+ accessor: "newEnrollments",
29
+ label: "New Enrollments",
30
+ },
31
+ {
32
+ accessor: "scheduledMeetings",
33
+ label: "Scheduled Meetings",
34
+ },
35
+ {
36
+ accessor: "attendanceRate",
37
+ label: "Attendance Rate",
38
+ },
39
+ {
40
+ accessor: "completedClasses",
41
+ label: "Completed Classes",
42
+ },
43
+ {
44
+ accessor: "classCompletionRate",
45
+ label: "Class Completion Rate",
46
+ },
47
+ {
48
+ accessor: "graduatedStudents",
49
+ label: "Graduated Students",
50
+ }
51
+ ]
52
+
53
+ subrow_headers = ["Quarter", "Month", "Day"]
54
+ %>
55
+
56
+ <%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions }) do %>
57
+ <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
58
+ <%= pb_rails("advanced_table/table_body", props: { id: "subrow_headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
59
+ <% end %>
@@ -0,0 +1,6 @@
1
+ Optionally enable sorting by passing `sort_menu` to any `column_definition`(s). Sort options are determined by an array of `item` objects passed to the `sort_menu` prop.
2
+
3
+ </br>
4
+ <div class="pb_pill_kit_warning"><div class="pb_title_kit_size_4 pb_pill_text">Disclaimer</div></div>
5
+
6
+ This example uses a custom sort method that may need to be modified or replaced within your project.
@@ -2,14 +2,15 @@ examples:
2
2
  rails:
3
3
  - advanced_table_beta: Default (Required Props)
4
4
  - advanced_table_beta_subrow_headers: SubRow Headers
5
+ - advanced_table_beta_sort: Enable Sorting
5
6
  react:
6
7
  - advanced_table_default: Default (Required Props)
7
8
  - advanced_table_loading: Loading State
8
- - advanced_table_sort: enable Sorting
9
+ - advanced_table_sort: Enable Sorting
9
10
  - advanced_table_sort_control: Sort Control
10
11
  - advanced_table_expanded_control: Expanded Control
11
12
  - advanced_table_subrow_headers: SubRow Headers
12
13
  - advanced_table_collapsible_trail: Collapsible Trail
13
14
  - advanced_table_table_options: Table Options
14
15
  - advanced_table_table_props: Table Props
15
- - advanced_table_inline_row_loading: inline Row Loading
16
+ - advanced_table_inline_row_loading: Inline Row Loading
@@ -1,11 +1,11 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("table/table_row", props: {tag:"div"}) do %>
2
+ <%= pb_rails("table/table_row", props: { tag: "div" }) do %>
3
3
  <% object.column_definitions.each_with_index do |item, index| %>
4
- <%= pb_rails("table/table_header", props: { tag:"div", id:item[:accessor], classname:object.th_classname}) do %>
5
- <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align:"end" }) do %>
4
+ <%= pb_rails("table/table_header", props: { tag: "div", id: item[:accessor], classname: object.th_classname, sort_menu: item[:sort_menu] }) do %>
5
+ <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align: "end" }) do %>
6
6
  <% if index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") %>
7
7
  <button class="gray-icon toggle-all-icon" onclick="expandAllRows(this)">
8
- <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right:"xs" }) %>
8
+ <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
9
9
  </button>
10
10
  <% end %>
11
11
  <%= item[:label] %>
@@ -14,7 +14,12 @@ export default class PbCollapsible extends PbEnhancedElement {
14
14
  this.element.addEventListener('click', () => {
15
15
  this.toggleElement(this.target)
16
16
  })
17
- this.displayDownArrow()
17
+ // Check the initial state of the collapsible content and set the arrow accordingly
18
+ if (this.target.classList.contains('is-visible')) {
19
+ this.displayUpArrow()
20
+ } else {
21
+ this.displayDownArrow()
22
+ }
18
23
  // Listen for a custom event to toggle the collapsible
19
24
  document.addEventListener(`${this.target.id}`, () => {
20
25
  this.toggleElement(this.target)
@@ -0,0 +1,33 @@
1
+ ![Date-Time-Stacked-Default](https://github.com/powerhome/playbook/assets/54749071/b877dd01-32fa-49ff-af2d-1f8d819f6f39)
2
+
3
+ ```swift
4
+ VStack(alignment: .leading, spacing: Spacing.small) {
5
+ PBDateTimeStacked(
6
+ timeZoneIdentifier: "EDT",
7
+ isLowercase: true,
8
+ isMonthStacked: true,
9
+ isMonthBold: true
10
+ )
11
+ PBDateTimeStacked(
12
+ timeZoneIdentifier: "EDT",
13
+ isYearDisplayed: true,
14
+ isLowercase: true,
15
+ isMonthStacked: true,
16
+ isMonthBold: true,
17
+ isYearBold: true,
18
+ dateVariant: .standard
19
+ )
20
+ PBDateTimeStacked(
21
+ timeZoneIdentifier: "GMT+9",
22
+ isLowercase: true,
23
+ isMonthStacked: true,
24
+ isMonthBold: true
25
+ )
26
+ PBDateTimeStacked(
27
+ timeZoneIdentifier: "MDT",
28
+ isLowercase: true,
29
+ isMonthStacked: true,
30
+ isMonthBold: true
31
+ )
32
+ }
33
+ ```
@@ -0,0 +1,18 @@
1
+ ### Props
2
+ | Name | Type | Description | Default | Values |
3
+ | --- | ----------- | --------- | --------- | --------- |
4
+ | **dateTime** | `Date` | Takes a date type to calculate the current date | `Date()` | |
5
+ | **timeDate** | `Date` | Takes a date type to calculate the current time | `Date()` | |
6
+ | **timeZoneIdentifier** | `String` | A string value that is used in a function to get the correct time in the corrresponding time zone. This value is also used to display the time zone next to the time | | |
7
+ | **isYearDisplayed** | `Bool` | Determines whether or not the year is displayed with the month and day | `false` | `true` `false` |
8
+ | **isLowercase** | `Bool` | Determines whether or not am/pm is capitalized | `false` | `true` `false` |
9
+ | **isMonthStacked** | `Bool` | Determines whether or not the value for month is stacked over the date | `false` | `true` `false` |
10
+ | **isMonthBold** | `Bool` | Determines whether or not the month is in bold | `false` | `true` `false` |
11
+ | **isYearBold** | `Bool` | Determines whether or not the year is in bold | `false` | `true` `false` |
12
+ | **dateAlignment** | `HorizontalAlignment` | Sets alignment of date | `.trailing` | `leading` `center` `trailing` |
13
+ | **timeAlignment** | `HorizontalAlignment` | Sets alignment of the time zone | `.leading` | `leading` `center` `trailing` |
14
+ | **dateVariant** | `Variant` | Allows user to choose the style in which the date is displayed | `.short(showIcon: false)` | `.short(showIcon: false)` `.dayDate(showYear: false)` `.standard` ` .withIcon(isStandard: true)` `.withIcon(isStandard: false)` |
15
+ | **timeVariant** | `Variant` | Allows user to choose the style in which the time is displayed | `.time` | `.time` `.iconTimeZone` `.withTimeZoneHeader` |
16
+ | **dateSize** | `String` | Allows user to choose the size of the date that is being displayed | `.title4` | `title4` `body` `caption` `large` `subcaption` |
17
+ | **timeStyle** | `PBFont` | Allows user to choose the size of the time that is being displayed | `.caption` | `body` `caption` `large` `subcaption`|
18
+ | **timeZoneStyle** | `PBFont` | Allows user to choose the size of the time zone that is being displayed | `.caption` | `body` `caption` `large` `subcaption`|
@@ -2,6 +2,11 @@ examples:
2
2
 
3
3
  rails:
4
4
  - date_time_stacked_default: Default
5
-
5
+
6
6
  react:
7
7
  - date_time_stacked_default: Default
8
+
9
+ swift:
10
+ - date_time_stacked_default_swift: Default
11
+ - date_time_stacked_props_swift: ""
12
+
@@ -1,5 +1,5 @@
1
- For a simplified version of the Draggable API for the Card kit, You can use the Card kit as the Draggable Item by using the `draggableItem` prop. The dragHandle is added by default but this can be opted out of by setting `dragHandle` to false on the Card kit.
1
+ For a simplified version of the Draggable API for the Card kit, You can use the the Card kit as the Draggable Item by using the `draggableItem` prop. The dragHandle is added by default but this can be opted out of by setting `dragHandle` to false on the Card kit.
2
2
 
3
- In addition to the above, `dragId` is a REQUIRED prop to be passed to the Card kit when implementing dragging.
3
+ In addition to the above `dragId` is a REQUIRED prop to be passedd to the Card kit when implementing dragging.
4
4
 
5
5
  The dev must manage state as shown.
@@ -1,6 +1,6 @@
1
1
  For a simplified version of the Draggable API for the List kit, use the DraggableProvider to wrap the List kit and use the `enableDrag` prop.
2
2
 
3
- In addition to the above, `dragId` is a REQUIRED prop to be passed to the List kit when implementing dragging.
3
+ In addition to the above `dragId` is a REQUIRED prop to be passed to the List kit when implementing dragging.
4
4
 
5
5
  The dev must manage state as shown.
6
6
 
@@ -1,6 +1,6 @@
1
1
  For a simplified version of the Draggable API for the SelectableList kit, use the DraggableProvider to wrap the SelectableList kit and use the `enableDrag` prop.
2
2
 
3
- In addition to the above, `dragId` is a REQUIRED prop to be passed to the SelectableList kit when implementing dragging.
3
+ In addition to the above `dragId` is a REQUIRED prop to be passed to the SelectableList kit when implementing dragging.
4
4
 
5
5
  The dev must manage state as shown.
6
6
 
@@ -96,6 +96,7 @@
96
96
  width: 100%;
97
97
  }
98
98
  }
99
+
99
100
  .close {
100
101
  display: none;
101
102
  animation-name: fadeOut;
@@ -111,6 +112,17 @@
111
112
  animation-timing-function: linear;
112
113
  animation-fill-mode: forwards;
113
114
  }
115
+
116
+ &.error {
117
+ [class*=pb_body_kit] {
118
+ margin-top: $space_xs / 2;
119
+ }
120
+
121
+ [class*="dropdown_trigger_wrapper"] {
122
+ border-color: $error;
123
+ box-shadow: none !important;
124
+ }
125
+ }
114
126
  }
115
127
 
116
128
  &.dark {
@@ -138,6 +150,12 @@
138
150
  color: $white;
139
151
  }
140
152
  }
153
+
154
+ &.error {
155
+ [class*="dropdown_trigger_wrapper"] {
156
+ border-color: $error_dark;
157
+ }
158
+ }
141
159
  }
142
160
  .pb_dropdown_container {
143
161
  background-color: $bg_dark !important;