playbook_ui_docs 14.12.0.pre.rc.12 → 14.13.0.pre.alpha.play1834depupdatesass6024

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb +33 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading_rails.md +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_loading.md → _advanced_table_loading_react.md} +2 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb +38 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +3 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +55 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
  12. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +9 -3
  13. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +6 -2
  14. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -0
  15. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +21 -0
  16. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +5 -0
  17. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +45 -0
  18. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.md +1 -0
  19. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +8 -0
  20. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -0
  21. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +2 -1
  22. data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +13 -5
  23. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.html.erb +99 -0
  24. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +1 -0
  25. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +1 -3
  26. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +7 -0
  27. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +61 -0
  28. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +1 -0
  29. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -5
  30. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +58 -0
  31. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +3 -0
  32. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +1 -0
  33. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
  34. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
  35. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
  36. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
  37. data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
  38. data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
  39. data/app/pb_kits/playbook/pb_link/docs/_link_target.html.erb +15 -0
  40. data/app/pb_kits/playbook/pb_link/docs/_link_target.jsx +29 -0
  41. data/app/pb_kits/playbook/pb_link/docs/example.yml +5 -3
  42. data/app/pb_kits/playbook/pb_link/docs/index.js +2 -1
  43. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tooltip.html.erb +6 -6
  44. data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.html.erb +6 -9
  45. data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.jsx +6 -9
  46. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +12 -8
  47. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.html.erb +52 -0
  48. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.md +0 -0
  49. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.html.erb +52 -0
  50. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -0
  51. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.html.erb +80 -0
  52. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -0
  53. data/app/pb_kits/playbook/pb_table/docs/example.yml +3 -0
  54. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +1 -1
  55. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
  56. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb +42 -0
  57. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx +59 -0
  58. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md +2 -0
  59. data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
  60. data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
  61. data/dist/playbook-doc.js +1 -1
  62. metadata +37 -4
  63. /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close.md → _fixed_confirmation_toast_auto_close_react.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aed297192a31a68c2796f904fe15b530b772dc0ddf08b72d26853e0edae7fe62
4
- data.tar.gz: eec28062248b92ed7ad275c23f7c0abb2fbed1638906a5a83e9d71c9d9281c0c
3
+ metadata.gz: 8959f4e044f98f997bc00e892515f32a53293b4578af27d1df70f614cf5b109c
4
+ data.tar.gz: 390a4a4db074cf370c7077e44d28da7464e65c2b3f45589895b504122abf7cd6
5
5
  SHA512:
6
- metadata.gz: f629b83b8df92f300c594fb57af36233e082b6e0817042dbd95f28a2b0cd1f74cfffce441d5622c4485f437fc3b1c4529befc154e7c04ab9321c3266c1b09974
7
- data.tar.gz: 551aefb013795967ece1c48bd135d0b060b77a71d85546148ea85653224b50e06a9ccb3d216126399e03d12ee67b818fa2b0fb9a415f6ec877664296b859a9d7
6
+ metadata.gz: 479ab080372c8cf57722ed9ed5560a07a5f7dcae9fba16ce4caa75822a3d264fc79d946a01e3e1965665409f039eb744644e1ba52aa958c0e791fa21d0f1fd9d
7
+ data.tar.gz: 67202e0e401242fc4fcecee47f6a328d2ff1c8c1555d06cc75860c2e562cab49f221eddfce0064889221f3292518171ad20732c374d483f12e0fd582e0e2bb83
@@ -0,0 +1,33 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ }
31
+ ] %>
32
+
33
+ <%= pb_rails("advanced_table", props: { id: "beta_table", table_data: @table_data, column_definitions: column_definitions, loading: true }) %>
@@ -0,0 +1 @@
1
+ The optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
@@ -1,3 +1,3 @@
1
- the optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
1
+ The optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
2
2
 
3
- By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
3
+ By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowsCount` prop can be used to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
@@ -0,0 +1,38 @@
1
+
2
+ <% column_definitions = [
3
+ {
4
+ accessor: "year",
5
+ label: "Year",
6
+ cellAccessors: ["quarter", "month", "day"],
7
+ },
8
+ {
9
+ accessor: "newEnrollments",
10
+ label: "New Enrollments",
11
+ },
12
+ {
13
+ accessor: "scheduledMeetings",
14
+ label: "Scheduled Meetings",
15
+ },
16
+ {
17
+ accessor: "attendanceRate",
18
+ label: "Attendance Rate",
19
+ },
20
+ {
21
+ accessor: "completedClasses",
22
+ label: "Completed Classes",
23
+ },
24
+ {
25
+ accessor: "classCompletionRate",
26
+ label: "Class Completion Rate",
27
+ },
28
+ {
29
+ accessor: "graduatedStudents",
30
+ label: "Graduated Students",
31
+ },
32
+ ] %>
33
+
34
+ <%= pb_rails("title", props: { size: 4 }) do %> Not Responsive <% end %>
35
+ <%= pb_rails("advanced_table", props: { id: "table_props_table_non_responsive", table_data: @table_data, column_definitions: column_definitions, responsive: "none" }) %>
36
+
37
+ <%= pb_rails("title", props: { padding_top: "sm", size: 4 }) do %> Responsive as Default <% end %>
38
+ <%= pb_rails("advanced_table", props: { id: "table_props_table_responsive", table_data: @table_data, column_definitions: column_definitions }) %>
@@ -44,6 +44,7 @@ const AdvancedTableTableProps = (props) => {
44
44
  <div>
45
45
  <AdvancedTable
46
46
  columnDefinitions={columnDefinitions}
47
+ responsive="none"
47
48
  tableData={MOCK_DATA}
48
49
  tableProps={tableProps}
49
50
  {...props}
@@ -1 +1,3 @@
1
- This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `tableProps` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table/react).
1
+ This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `tableProps` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table/react).
2
+
3
+ This doc example showcases how to set a sticky header for a nonresponsive table. To achieve sticky header AND responsive functionality, see the ["Table Props Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table/react#table-props-sticky-header) doc example below.
@@ -0,0 +1,55 @@
1
+ import React from "react"
2
+ import { AdvancedTable } from "playbook-ui"
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
4
+
5
+ const AdvancedTableTablePropsStickyHeader = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ const tableProps = {
39
+ sticky: true
40
+ }
41
+
42
+ return (
43
+ <div>
44
+ <AdvancedTable
45
+ columnDefinitions={columnDefinitions}
46
+ maxHeight="xs"
47
+ tableData={MOCK_DATA}
48
+ tableProps={tableProps}
49
+ {...props}
50
+ />
51
+ </div>
52
+ )
53
+ }
54
+
55
+ export default AdvancedTableTablePropsStickyHeader
@@ -0,0 +1,3 @@
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop. This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
2
+
3
+ A sticky header on a nonresponsive table is demonstrated in the ["Table Props"](https://playbook.powerapp.cloud/kits/advanced_table/react#table-props) doc example above.
@@ -1,10 +1,12 @@
1
1
  examples:
2
2
  rails:
3
3
  - advanced_table_beta: Default (Required Props)
4
+ - advanced_table_loading: Loading State
4
5
  - advanced_table_beta_subrow_headers: SubRow Headers
5
6
  - advanced_table_collapsible_trail_rails: Collapsible Trail
6
7
  - advanced_table_table_props: Table Props
7
8
  - advanced_table_beta_sort: Enable Sorting
9
+ - advanced_table_responsive: Responsive Tables
8
10
  - advanced_table_custom_cell_rails: Custom Components for Cells
9
11
  - advanced_table_column_headers: Multi-Header Columns
10
12
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
@@ -20,6 +22,7 @@ examples:
20
22
  - advanced_table_collapsible_trail: Collapsible Trail
21
23
  - advanced_table_table_options: Table Options
22
24
  - advanced_table_table_props: Table Props
25
+ - advanced_table_table_props_sticky_header: Table Props Sticky Header
23
26
  - advanced_table_inline_row_loading: Inline Row Loading
24
27
  - advanced_table_responsive: Responsive Tables
25
28
  - advanced_table_custom_cell: Custom Components for Cells
@@ -18,4 +18,5 @@ export { default as AdvancedTableSelectableRows } from './_advanced_table_select
18
18
  export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
19
19
  export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
20
20
  export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
21
- export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
21
+ export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
22
+ export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
@@ -1,18 +1,19 @@
1
1
  import React from "react";
2
2
  import { Avatar } from 'playbook-ui'
3
3
 
4
- const AvatarBadgeComponentOverlay = () => {
4
+ const AvatarBadgeComponentOverlay = (props) => {
5
5
  return (
6
6
  <div>
7
7
  <Avatar
8
8
  componentOverlay={{
9
9
  component: "badge",
10
10
  placement: "bottom-right",
11
- text: "12"
11
+ text: "12",
12
12
  }}
13
13
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
14
14
  marginBottom="sm"
15
15
  size="sm"
16
+ {...props}
16
17
  />
17
18
 
18
19
  <Avatar
@@ -24,6 +25,8 @@ const AvatarBadgeComponentOverlay = () => {
24
25
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
25
26
  marginBottom="sm"
26
27
  size="md"
28
+ {...props}
29
+
27
30
  />
28
31
 
29
32
  <Avatar
@@ -36,6 +39,8 @@ const AvatarBadgeComponentOverlay = () => {
36
39
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
37
40
  marginBottom="sm"
38
41
  size="lg"
42
+ {...props}
43
+
39
44
  />
40
45
 
41
46
  <Avatar
@@ -48,7 +53,8 @@ const AvatarBadgeComponentOverlay = () => {
48
53
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
49
54
  marginBottom="sm"
50
55
  size="xl"
51
- />
56
+ {...props}
57
+ />
52
58
  </div>
53
59
  )
54
60
  }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Avatar } from 'playbook-ui'
3
3
 
4
- const AvatarCircleIconComponentOverlay = () => {
4
+ const AvatarCircleIconComponentOverlay = (props) => {
5
5
  return (
6
6
  <div>
7
7
  <Avatar
@@ -14,6 +14,7 @@ const AvatarCircleIconComponentOverlay = () => {
14
14
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
15
15
  marginBottom="sm"
16
16
  size="sm"
17
+ {...props}
17
18
  />
18
19
 
19
20
  <Avatar
@@ -26,6 +27,7 @@ const AvatarCircleIconComponentOverlay = () => {
26
27
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
27
28
  marginBottom="sm"
28
29
  size="md"
30
+ {...props}
29
31
  />
30
32
 
31
33
  <Avatar
@@ -38,6 +40,7 @@ const AvatarCircleIconComponentOverlay = () => {
38
40
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
39
41
  marginBottom="sm"
40
42
  size="lg"
43
+ {...props}
41
44
  />
42
45
 
43
46
  <Avatar
@@ -50,7 +53,8 @@ const AvatarCircleIconComponentOverlay = () => {
50
53
  imageUrl="https://randomuser.me/api/portraits/men/44.jpg"
51
54
  marginBottom="sm"
52
55
  size="xl"
53
- />
56
+ {...props}
57
+ />
54
58
  </div>
55
59
  )
56
60
  }
@@ -0,0 +1,2 @@
1
+ <%= pb_rails("copy_button", props: { id: "default-copy-button", text: "Copy Text", value: "Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease." } ) %>
2
+ <%= pb_rails("textarea", props: { margin_top: "xs", placeholder: "Copy and paste here" }) %>
@@ -0,0 +1,21 @@
1
+ import React from 'react'
2
+ import { CopyButton, Textarea } from 'playbook-ui'
3
+
4
+ const CopyButtonDefault = (props) => (
5
+ <div>
6
+ <CopyButton
7
+ {...props}
8
+ text="Copy Text"
9
+ tooltipPlacement="right"
10
+ tooltipText="Text copied!"
11
+ value="Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease."
12
+ />
13
+
14
+ <Textarea
15
+ {...props}
16
+ placeholder="Copy and paste here"
17
+ />
18
+ </div>
19
+ )
20
+
21
+ export default CopyButtonDefault
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("body", props: { id: "body", text: "Copy this body text!"}) %>
2
+ <%= pb_rails("copy_button", props: { text: "Copy Body text", from: "body", id: "copy-body-button" }) %>
3
+ <%= pb_rails("text_input", props: { margin_top: "xs", placeholder: "Copy and paste here" }) %>
4
+ <%= pb_rails("copy_button", props: { text: "Copy Text Input", from: "copy-input", id: "copy-input-button" }) %>
5
+ <%= pb_rails("text_input", props: { margin_top: "xs", id: "copy-input" , value: "Copy and paste here" }) %>
@@ -0,0 +1,45 @@
1
+ import React, { useState } from 'react'
2
+ import { CopyButton, Body, TextInput, Textarea } from 'playbook-ui'
3
+
4
+ const CopyButtonFrom = (props) => {
5
+ const [text, setText] = useState("Copy this text input text")
6
+
7
+ const handleChange = (event) => {
8
+ setText(event.target.value);
9
+ }
10
+
11
+ return (<div>
12
+ <Body id="body">Copy this body text!</Body>
13
+ <CopyButton
14
+ {...props}
15
+ from="body"
16
+ marginBottom="sm"
17
+ text="Copy Body text"
18
+ tooltipPlacement="right"
19
+ tooltipText="Body text copied!"
20
+ />
21
+
22
+ <TextInput
23
+ {...props}
24
+ id="textinput"
25
+ onChange={handleChange}
26
+ value={text}
27
+ />
28
+ <CopyButton
29
+ {...props}
30
+ from="textinput"
31
+ marginBottom="sm"
32
+ text="Copy Text Input"
33
+ tooltipPlacement="right"
34
+ tooltipText="Text input copied!"
35
+ />
36
+
37
+ <Textarea
38
+ {...props}
39
+ placeholder="Copy and paste here"
40
+ />
41
+ </div>
42
+ )
43
+ }
44
+
45
+ export default CopyButtonFrom
@@ -0,0 +1 @@
1
+ Provide an element's ID as the `from` parameter, and its text will be copied. If the element is an input, its `value` will be copied; otherwise, the `innerText` will be used. Additionally, if a `value` prop is provided, it will override the content from the `from` element and be copied instead.
@@ -0,0 +1,8 @@
1
+ examples:
2
+ rails:
3
+ - copy_button_default: Default
4
+ - copy_button_from: Copy From
5
+
6
+ react:
7
+ - copy_button_default: Default
8
+ - copy_button_from: Copy From
@@ -0,0 +1,2 @@
1
+ export { default as CopyButtonDefault } from './_copy_button_default.jsx'
2
+ export { default as CopyButtonFrom } from './_copy_button_from.jsx'
@@ -18,7 +18,7 @@ const DateDefault = (props) => {
18
18
  value={"2012-08-03"}
19
19
  {...props}
20
20
  />
21
- <Caption>{"(Hyphenated Date)"}</Caption>
21
+ <Caption {...props}>{"(Hyphenated Date)"}</Caption>
22
22
  </div>
23
23
 
24
24
  <br />
@@ -56,6 +56,7 @@ const DateDefault = (props) => {
56
56
  <Title
57
57
  size={4}
58
58
  text={"(Hyphenated Date)"}
59
+ {...props}
59
60
  />
60
61
  </div>
61
62
 
@@ -4,7 +4,8 @@ import { Caption, Date as FormattedDate, Title } from 'playbook-ui'
4
4
  const DateUnstyled = (props) => {
5
5
  return (
6
6
  <>
7
- <Caption size="xs"
7
+ <Caption {...props}
8
+ size="xs"
8
9
  text="Basic unstyled example"
9
10
  />
10
11
  <FormattedDate
@@ -15,10 +16,14 @@ const DateUnstyled = (props) => {
15
16
 
16
17
  <br />
17
18
 
18
- <Caption size="xs"
19
+ <Caption {...props}
20
+
21
+ size="xs"
19
22
  text="Example with wrapping typography kit"
20
23
  />
21
- <Title size={1}>
24
+ <Title {...props}
25
+ size={1}
26
+ >
22
27
  <FormattedDate
23
28
  unstyled
24
29
  value={new Date('25 Dec 1995')}
@@ -28,10 +33,13 @@ const DateUnstyled = (props) => {
28
33
 
29
34
  <br />
30
35
 
31
- <Caption size="xs"
36
+ <Caption {...props}
37
+ size="xs"
32
38
  text="Example with icon + subcaption"
33
39
  />
34
- <Caption size="xs">
40
+ <Caption {...props}
41
+ size="xs"
42
+ >
35
43
  <FormattedDate
36
44
  showDayOfWeek
37
45
  showIcon
@@ -0,0 +1,99 @@
1
+ <% containers = [
2
+ "To Do",
3
+ "In Progress",
4
+ "Done"
5
+ ] %>
6
+
7
+ <% items_data = [
8
+ {
9
+ id: "11",
10
+ container: "To Do",
11
+ title: "Task 1",
12
+ description: "Bug fixes",
13
+ assignee_name: "Terry Miles",
14
+ assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
15
+ },
16
+ {
17
+ id: "12",
18
+ container: "To Do",
19
+ title: "Task 2",
20
+ description: "Documentation",
21
+ assignee_name: "Sophia Miles",
22
+ assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
23
+ },
24
+ {
25
+ id: "13",
26
+ container: "In Progress",
27
+ title: "Task 3",
28
+ description: "Add a variant",
29
+ assignee_name: "Alice Jones",
30
+ assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
31
+ },
32
+ {
33
+ id: "14",
34
+ container: "To Do",
35
+ title: "Task 4",
36
+ description: "Add jest tests",
37
+ assignee_name: "Mike James",
38
+ assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
39
+ },
40
+ {
41
+ id: "15",
42
+ container: "Done",
43
+ title: "Task 5",
44
+ description: "Alpha testing",
45
+ assignee_name: "James Guy",
46
+ assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
47
+ },
48
+ {
49
+ id: "16",
50
+ container: "In Progress",
51
+ title: "Task 6",
52
+ description: "Release",
53
+ assignee_name: "Sally Jones",
54
+ assignee_img: "https://randomuser.me/api/portraits/women/28.jpg",
55
+ },
56
+ ] %>
57
+
58
+ <%= pb_rails("draggable", props: { initial_items: items_data }) do %>
59
+ <%= pb_rails("flex", props: { justify_content: "center" }) do %>
60
+ <% containers.each do |container| %>
61
+ <%= pb_rails("draggable/draggable_container", props: {
62
+ container: container,
63
+ width: "xs",
64
+ padding: "sm",
65
+ data: { container: container }
66
+ }) do %>
67
+ <%= pb_rails("caption", props: { text_align: "center" }) do %><%= container %><% end %>
68
+ <%= pb_rails("flex", props: {align_items: "stretch", orientation: "column"}) do %>
69
+ <% items_data.select { |item| item[:container] == container }.each do |item| %>
70
+ <%= pb_rails("draggable/draggable_item", props: {
71
+ container: container,
72
+ drag_id: item[:id]
73
+ }) do %>
74
+ <%= pb_rails("card", props: { margin_bottom: "sm", padding: "sm"}) do %>
75
+ <%= pb_rails("flex", props: { justify: "between" }) do %>
76
+ <%= pb_rails("flex/flex_item") do %>
77
+ <%= pb_rails("flex") do %>
78
+ <%= pb_rails("avatar", props: {
79
+ image_url: item[:assignee_img],
80
+ name: item[:assignee_name],
81
+ size: "xxs"
82
+ }) %>
83
+ <%= pb_rails("title", props: {
84
+ padding_left: "xs",
85
+ size: 4,
86
+ text: item[:title]
87
+ }) %>
88
+ <% end %>
89
+ <% end %>
90
+ <% end %>
91
+ <%= pb_rails("body", props: { padding_top: "xs", text: item[:description] }) %>
92
+ <% end %>
93
+ <% end %>
94
+ <% end %>
95
+ <% end %>
96
+ <% end %>
97
+ <% end %>
98
+ <% end %>
99
+ <% end %>
@@ -0,0 +1 @@
1
+ The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
@@ -7,8 +7,7 @@
7
7
  <%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
8
8
  <%= pb_rails("draggable/draggable_container") do %>
9
9
  <% initial_items.each do |item| %>
10
- <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
11
- <%= pb_rails("card", props: {highlight: {position: "side", color:"primary"}, margin_bottom: "xs", padding: "xs"}) do %>
10
+ <%= pb_rails("card", props: {highlight: {position: "side", color:"primary"}, margin_bottom: "xs", padding: "xs", drag_id: item[:id], draggable_item: true }) do %>
12
11
  <%= pb_rails("flex", props:{align_items: "stretch", flex_direction:"column"}) do %>
13
12
  <%= pb_rails("flex", props:{gap: "xs"}) do %>
14
13
  <%= pb_rails("title", props: { text: item[:name], tag: "h4", size: 4 }) %>
@@ -32,7 +31,6 @@
32
31
  <% end %>
33
32
  <% end %>
34
33
  <% end %>
35
- <% end %>
36
34
  <% end %>
37
35
  <% end %>
38
36
  <% end %>
@@ -0,0 +1,7 @@
1
+ For a simplified version of the Draggable API for the Card kit, you can do the following:
2
+
3
+ Use the `draggable` kit and manage state as shown.
4
+
5
+ `draggable/draggable_container` kit creates the container within which the cards can be dragged and dropped.
6
+
7
+ The Card kit is optimized to work with the draggable kit. To enable drag, use the `draggable_item` and `drag_id` props on the Card kit as shown. An additional optional boolean prop (set to true by default) of `drag_handle` is also available to show the drag handle icon.
@@ -0,0 +1,61 @@
1
+ <% initial_items = [
2
+ {
3
+ id: "1",
4
+ title: "Task 1",
5
+ assignee_name: "Terry Miles",
6
+ assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
7
+ },
8
+ {
9
+ id: "2",
10
+ title: "Task 2",
11
+ assignee_name: "Sophia Miles",
12
+ assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
13
+ },
14
+ {
15
+ id: "3",
16
+ title: "Task 3",
17
+ assignee_name: "Alice Jones",
18
+ assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
19
+ },
20
+ {
21
+ id: "4",
22
+ title: "Task 4",
23
+ assignee_name: "Mike James",
24
+ assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
25
+ },
26
+ {
27
+ id: "5",
28
+ title: "Task 5",
29
+ assignee_name: "James Guy",
30
+ assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
31
+ }
32
+ ] %>
33
+
34
+
35
+
36
+ <%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
37
+ <%= pb_rails("table", props: { size: "sm", responsive:"none" }) do %>
38
+ <%= pb_rails("table/table_head") do %>
39
+ <%= pb_rails("table/table_row") do %>
40
+ <%= pb_rails("table/table_header", props: { text: "id"}) %>
41
+ <%= pb_rails("table/table_header", props: { text: "name"}) %>
42
+ <%= pb_rails("table/table_header", props: { text: "task number"}) %>
43
+ <% end %>
44
+ <% end %>
45
+
46
+ <%= pb_rails("draggable/draggable_container", props: {tag:"tbody"}) do %>
47
+ <% initial_items.each do |item| %>
48
+ <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id], tag:"tr"}) do %>
49
+ <%= pb_rails("table/table_cell", props: { text: item[:id]}) %>
50
+ <%= pb_rails("table/table_cell") do %>
51
+ <%= pb_rails("flex", props:{align:"center"}) do %>
52
+ <%= pb_rails("avatar", props: {size: "xs", image_url: item[:assignee_img]}) %>
53
+ <%= pb_rails("body", props: {text: item[:assignee_name], padding_left:"sm"}) %>
54
+ <% end %>
55
+ <% end %>
56
+ <%= pb_rails("table/table_cell", props: { text: item[:title]}) %>
57
+ <% end %>
58
+ <% end %>
59
+ <% end %>
60
+ <% end %>
61
+ <% end %>
@@ -0,0 +1 @@
1
+ The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this, make use of the `tag` prop on the draggable_container to set it to 'tbody' and the same prop on the draggable_item to set that to 'tr'. This will create the functionality seen here.