playbook_ui_docs 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 (25) 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_date_time_stacked/docs/_date_time_stacked_default_swift.md +33 -0
  6. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_props_swift.md +18 -0
  7. data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +6 -1
  8. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.md +2 -2
  9. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md +1 -1
  10. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md +1 -1
  11. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +9 -0
  12. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +34 -0
  13. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
  14. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  15. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.html.erb +32 -0
  16. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.jsx +48 -0
  17. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  18. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  19. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.html.erb +6 -1
  20. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +21 -5
  21. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +1 -1
  22. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +1 -0
  23. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md +3 -1
  24. data/dist/playbook-doc.js +9 -9
  25. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f561299e831e96ce1418236e2bebc1a33e5655c53226bc50c877ab38d4a698d9
4
- data.tar.gz: 35ef55ef238504ef32ecb0ccd9d4108e3428272716437aecf1abcd081b059354
3
+ metadata.gz: 6cceb594cd31b390837b3358b6eca62a416027b0344fb09dffe7ba18e026dbc2
4
+ data.tar.gz: dcb581e8619d51cab0a93d3d7cf0fc07e1210aa0d9d50105d4730080f5ba2830
5
5
  SHA512:
6
- metadata.gz: d4a4e79a56df618ad59184c57aef9fd59bce593a98f06cffc3017d17c6d25e176bdfac1f63bdc373a0391f01e92aa3d71ea2ca3584761ed004f4486e6b0ac48a
7
- data.tar.gz: 6c3e50107b18352613cd01680687574fa752cd55320300a2106a4370117e42aa4447214b5f65739edc51359ea48b5f716bf473d13baaff4f3b8f5c2d910f011f
6
+ metadata.gz: 4831824bba5a5ae835508c73147d2e3158fc659ea9961851177aef285f2b92e9c0d279b20348724e010ef41928bf787baaf62b4e027e0e18b031ac5b67f0915f
7
+ data.tar.gz: 8cddbc6e8e59f9c0174d74a7b9c583825d3462b35990f921662b55b384012c355d2c887f1f7889141ed7977422c04dcea01e880e24bbf8847a9a6df18b7b3fa9
@@ -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
@@ -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
 
@@ -0,0 +1,9 @@
1
+ <%
2
+ options = [
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
+ ]
7
+ %>
8
+
9
+ <%= pb_rails("dropdown", props: { error: "Please make a valid selection", options: options }) %>
@@ -0,0 +1,34 @@
1
+ import React, { useState } from 'react'
2
+ import { Dropdown } from '../../'
3
+
4
+ const DropdownError = (props) => {
5
+ const [selectedOption, setSelectedOption] = useState()
6
+ const error = selectedOption?.value ? null : "Please make a valid selection"
7
+ const options = [
8
+ {
9
+ label: "United States",
10
+ value: "United States",
11
+ },
12
+ {
13
+ label: "Canada",
14
+ value: "Canada",
15
+ },
16
+ {
17
+ label: "Pakistan",
18
+ value: "Pakistan",
19
+ }
20
+ ]
21
+
22
+ return (
23
+ <>
24
+ <Dropdown
25
+ error={error}
26
+ onSelect={(selectedItem) => setSelectedOption(selectedItem)}
27
+ options={options}
28
+ {...props}
29
+ />
30
+ </>
31
+ )
32
+ }
33
+
34
+ export default DropdownError
@@ -7,6 +7,7 @@ examples:
7
7
  - dropdown_with_custom_display_rails: Custom Display
8
8
  - dropdown_with_custom_trigger_rails: Custom Trigger
9
9
  - dropdown_with_custom_padding: Custom Option Padding
10
+ - dropdown_error: Dropdown with Error
10
11
 
11
12
  react:
12
13
  - dropdown_default: Default
@@ -16,6 +17,7 @@ examples:
16
17
  - dropdown_with_custom_display: Custom Display
17
18
  - dropdown_with_custom_trigger: Custom Trigger
18
19
  - dropdown_with_custom_padding: Custom Option Padding
20
+ - dropdown_error: Dropdown with Error
19
21
  # - dropdown_with_autocomplete: Autocomplete
20
22
  # - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
21
23
  # - dropdown_with_external_control: useDropdown Hook
@@ -8,4 +8,5 @@ export { default as DropdownWithCustomPadding } from './_dropdown_with_custom_pa
8
8
  export { default as DropdownWithLabel } from './_dropdown_with_label.jsx'
9
9
  export { default as DropdownWithExternalControl } from './_dropdown_with_external_control.jsx'
10
10
  export { default as DropdownWithHook } from './_dropdown_with_hook.jsx'
11
- export { default as DropdownSubcomponentStructure } from './_dropdown_subcomponent_structure.jsx'
11
+ export { default as DropdownSubcomponentStructure } from './_dropdown_subcomponent_structure.jsx'
12
+ export { default as DropdownError } from './_dropdown_error.jsx'
@@ -0,0 +1,32 @@
1
+ <div>
2
+ <%= pb_rails("fixed_confirmation_toast", props: {
3
+ icon: "wrench",
4
+ text: "Fix before proceeding",
5
+ status: "error",
6
+ closeable: true,
7
+ margin_bottom: "md"
8
+ })%>
9
+ </div>
10
+ <div>
11
+ <%= pb_rails("fixed_confirmation_toast", props: {
12
+ icon: "star",
13
+ text: "Thank you for completing the form!",
14
+ status: "success",
15
+ margin_bottom: "md"
16
+ })%>
17
+ </div>
18
+ <div>
19
+ <%= pb_rails("fixed_confirmation_toast", props: {
20
+ icon: "file-pdf",
21
+ text: "Saved as PDF",
22
+ status: "neutral",
23
+ margin_bottom: "md"
24
+ })%>
25
+ </div>
26
+ <div>
27
+ <%= pb_rails("fixed_confirmation_toast", props: {
28
+ icon: "arrow-down",
29
+ text: "New Messages",
30
+ status: "tip"
31
+ })%>
32
+ </div>
@@ -0,0 +1,48 @@
1
+ import React from 'react'
2
+
3
+ import FixedConfirmationToast from '../_fixed_confirmation_toast'
4
+
5
+ const FixedConfirmationToastCustomIcon = (props) => {
6
+ return (
7
+ <div>
8
+ <div>
9
+ <FixedConfirmationToast
10
+ closeable
11
+ icon="wrench"
12
+ marginBottom="md"
13
+ status="error"
14
+ text="Fix before proceeding"
15
+ {...props}
16
+ />
17
+ </div>
18
+ <div>
19
+ <FixedConfirmationToast
20
+ icon="star"
21
+ marginBottom="md"
22
+ status="success"
23
+ text="Thank you for completing the form!"
24
+ {...props}
25
+ />
26
+ </div>
27
+ <div>
28
+ <FixedConfirmationToast
29
+ icon="file-pdf"
30
+ marginBottom="md"
31
+ status="neutral"
32
+ text="Saved as PDF"
33
+ {...props}
34
+ />
35
+ </div>
36
+ <div>
37
+ <FixedConfirmationToast
38
+ icon="arrow-down"
39
+ status="tip"
40
+ text="New Messages"
41
+ {...props}
42
+ />
43
+ </div>
44
+ </div>
45
+ )
46
+ }
47
+
48
+ export default FixedConfirmationToastCustomIcon
@@ -6,6 +6,7 @@ examples:
6
6
  - fixed_confirmation_toast_close: Click to Close
7
7
  - fixed_confirmation_toast_positions: Click to Show Positions
8
8
  - fixed_confirmation_toast_children: Children
9
+ - fixed_confirmation_toast_custom_icon: Custom Icon
9
10
 
10
11
  react:
11
12
  - fixed_confirmation_toast_default: Default
@@ -14,6 +15,7 @@ examples:
14
15
  - fixed_confirmation_toast_positions: Click to Show Positions
15
16
  - fixed_confirmation_toast_auto_close: Click to Show Auto Close
16
17
  - fixed_confirmation_toast_children: Children
18
+ - fixed_confirmation_toast_custom_icon: Custom Icon
17
19
 
18
20
  swift:
19
21
  - fixed_confirmation_toast_default_swift: Default
@@ -4,3 +4,4 @@ export { default as FixedConfirmationToastClose } from './_fixed_confirmation_to
4
4
  export { default as FixedConfirmationToastPositions } from './_fixed_confirmation_toast_positions.jsx'
5
5
  export { default as FixedConfirmationToastAutoClose } from './_fixed_confirmation_toast_auto_close.jsx'
6
6
  export { default as FixedConfirmationToastChildren } from './_fixed_confirmation_toast_children.jsx'
7
+ export { default as FixedConfirmationToastCustomIcon } from './_fixed_confirmation_toast_custom_icon.jsx'
@@ -1 +1,6 @@
1
- <%= pb_rails("icon", props: { icon: "user", fixed_width: true }) %>
1
+ <%= pb_rails("icon", props: { icon: "angles-down", fixed_width: true }) %>
2
+ <%= pb_rails("icon", props: { icon: "circle-arrow-right", fixed_width: true }) %>
3
+ <%= pb_rails("icon", props: { icon: "arrow-circle-right", fixed_width: true }) %>
4
+
5
+ <%= pb_rails("caption", props: { text: "Font Awesome (no alias & not in our Playbook-icons lib)", margin_y: "md" }) %>
6
+ <%= pb_rails("icon", props: { icon: "elephant", fixed_width: true }) %>
@@ -1,13 +1,29 @@
1
- import React from 'react'
1
+ import React from "react"
2
2
 
3
- import Icon from '../_icon'
3
+ import Icon from "../_icon"
4
+ import {Caption} from "../.."
4
5
 
5
6
  const IconDefault = (props) => {
6
7
  return (
7
8
  <div>
8
- <Icon
9
- fixedWidth
10
- icon="user"
9
+ <Icon fixedWidth
10
+ icon='angles-down'
11
+ {...props}
12
+ />
13
+ <Icon fixedWidth
14
+ icon='circle-arrow-right'
15
+ {...props}
16
+ />
17
+ <Icon fixedWidth
18
+ icon='arrow-circle-right'
19
+ {...props}
20
+ />
21
+ <Caption
22
+ marginY='md'
23
+ text='Font Awesome (no alias & not in our Playbook-icons lib)'
24
+ />
25
+ <Icon fixedWidth
26
+ icon='elephant'
11
27
  {...props}
12
28
  />
13
29
  </div>
@@ -1,5 +1,5 @@
1
1
  <%= pb_rails("nav", props: { variant: "bold" }) do %>
2
- <%= pb_rails("nav/item", props: { text: "Overview", link: "#", collapsible: true, icon_left:"city" }) do %>
2
+ <%= pb_rails("nav/item", props: { text: "Overview", link: "#", collapsible: true, icon_left:"city", collapsed: false }) do %>
3
3
  <%= pb_rails("nav", props: { variant: "bold" }) do %>
4
4
  <%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
5
5
  <%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
@@ -9,6 +9,7 @@ const CollapsibleNav = (props) => {
9
9
  >
10
10
  <NavItem
11
11
  active
12
+ collapsed={false}
12
13
  collapsible
13
14
  iconLeft="city"
14
15
  link="#"
@@ -1 +1,3 @@
1
- The `collapsible` prop allows users to create a nested, collapsible nav. Pass `collapsible` to any NavItem and pass that navItem any number of NavItems as children to create a collapsible nav.
1
+ The `collapsible` prop allows users to create a nested, collapsible nav. Pass `collapsible` to any NavItem and pass that navItem any number of NavItems as children to create a collapsible nav.
2
+
3
+ The optional `collapsed` prop can also be used to set the default state for the collapsed nav on first render of the page. `collapsed` takes a boolean value that is set to true (meaning nav is collapsed) by default. Set it to false as shown here to have the nav open on first render.