playbook_ui_docs 13.34.1.pre.alpha.powerfontsexternal3403 → 14.0.0.pre.alpha.PA1477timestampkit3502

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.jsx +67 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.md +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
  6. data/app/pb_kits/playbook/pb_date_picker/docs/_description.md +3 -1
  7. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  8. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.html.erb +1 -0
  9. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_no_border.html.erb +1 -0
  10. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_no_border.jsx +14 -0
  11. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_size.html.erb +3 -0
  12. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_size.jsx +25 -0
  13. data/app/pb_kits/playbook/pb_online_status/docs/example.yml +6 -2
  14. data/app/pb_kits/playbook/pb_online_status/docs/index.js +2 -0
  15. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.html.erb +61 -0
  16. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.jsx +70 -0
  17. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.md +1 -0
  18. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +4 -2
  19. data/app/pb_kits/playbook/pb_overlay/docs/index.js +1 -0
  20. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +3 -1
  21. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +1 -1
  22. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.html.erb +1 -1
  23. data/dist/playbook-doc.js +1 -1
  24. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe08621fe6799bbcc1fad989d134d023e04d94f1aefe218d473ac4dc04eb0907
4
- data.tar.gz: 3017c3eab0a20393e5d89cbf550a2d2ff30ab4d664577bbeceb23f901d5f642a
3
+ metadata.gz: 386175249439e0921a868e95f68799390dffb24ca61d6894940dae694f7cc825
4
+ data.tar.gz: 7b6d8d48744b0f9ffd9d49a05692937b75114ae9956ee77db99e6d2d90109efa
5
5
  SHA512:
6
- metadata.gz: 5b84b0323ecdbfb6557175a6f97481730017be928d340f7a9742575be4f4db3847190def822aa40fef522c0d452c55c0820370e27fd93cb11ee849d5c7124cac
7
- data.tar.gz: 10026b6d8f9e56ebdf9e9f2ff4d051b9648b22ab281e34579a0664b396ae6156de946ee03e15ea674b9a0bb8173f4f6b5589ad709042830742b7a5a1d7d102a3
6
+ metadata.gz: 7aac1974c6c1b01651ca00c937d20d1fca49e4d91a2694ef1a91053f58d9e97fcc011f0790cbbb54bee0f8ac838056469f52d42aa7f41fe7697acf9d484e7689
7
+ data.tar.gz: 7dd17b3ddd5b0fa99d434784fe8ef8950d76aa084f15896bff7420d18ba74567e4ad686f244e5202a90ba49e25f5135e7f359e0827be330c59bec6e1b3428bbe
@@ -0,0 +1,67 @@
1
+ import React from "react"
2
+ import { AdvancedTable } from "playbook-ui"
3
+ import Title from '../../pb_title/_title'
4
+ import MOCK_DATA from "./advanced_table_mock_data.json"
5
+
6
+ const AdvancedTableResponsive = (props) => {
7
+ const columnDefinitions = [
8
+ {
9
+ accessor: "year",
10
+ label: "Year",
11
+ cellAccessors: ["quarter", "month", "day"],
12
+ },
13
+ {
14
+ accessor: "newEnrollments",
15
+ label: "New Enrollments",
16
+ },
17
+ {
18
+ accessor: "scheduledMeetings",
19
+ label: "Scheduled Meetings",
20
+ },
21
+ {
22
+ accessor: "attendanceRate",
23
+ label: "Attendance Rate",
24
+ },
25
+ {
26
+ accessor: "completedClasses",
27
+ label: "Completed Classes",
28
+ },
29
+ {
30
+ accessor: "classCompletionRate",
31
+ label: "Class Completion Rate",
32
+ },
33
+ {
34
+ accessor: "graduatedStudents",
35
+ label: "Graduated Students",
36
+ },
37
+ ]
38
+
39
+ return (
40
+ <div>
41
+ <Title
42
+ size={4}
43
+ text="Not Responsive"
44
+ {...props}
45
+ />
46
+ <AdvancedTable
47
+ columnDefinitions={columnDefinitions}
48
+ responsive="none"
49
+ tableData={MOCK_DATA}
50
+ {...props}
51
+ />
52
+ <Title
53
+ paddingTop="sm"
54
+ size={4}
55
+ text="Responsive as Default"
56
+ {...props}
57
+ />
58
+ <AdvancedTable
59
+ columnDefinitions={columnDefinitions}
60
+ tableData={MOCK_DATA}
61
+ {...props}
62
+ />
63
+ </div>
64
+ )
65
+ }
66
+
67
+ export default AdvancedTableResponsive
@@ -0,0 +1 @@
1
+ The `responsive` prop can be set to "scroll" or "none", and is set to "scroll" by default to make Advanced Tables responsive. To disable, set `responsive="none"`.
@@ -14,3 +14,4 @@ examples:
14
14
  - advanced_table_table_options: Table Options
15
15
  - advanced_table_table_props: Table Props
16
16
  - advanced_table_inline_row_loading: Inline Row Loading
17
+ - advanced_table_responsive: Responsive Tables
@@ -7,4 +7,5 @@ export { default as AdvancedTableSubrowHeaders } from './_advanced_table_subrow_
7
7
  export { default as AdvancedTableCollapsibleTrail } from './_advanced_table_collapsible_trail.jsx'
8
8
  export { default as AdvancedTableTableOptions } from './_advanced_table_table_options.jsx'
9
9
  export { default as AdvancedTableTableProps } from './_advanced_table_table_props.jsx'
10
- export { default as AdvancedTableInlineRowLoading } from './_advanced_table_inline_row_loading.jsx'
10
+ export { default as AdvancedTableInlineRowLoading } from './_advanced_table_inline_row_loading.jsx'
11
+ export { default as AdvancedTableResponsive } from './_advanced_table_responsive.jsx'
@@ -6,4 +6,6 @@ Playbook's date picker is built using [flatpickr](https://flatpickr.js.org/), a
6
6
 
7
7
  To learn more [visit flatpickr's docs](https://flatpickr.js.org/instance-methods-properties-elements/) or see the hook doc section below for an applied example.
8
8
 
9
- The Date Picker works best with Javascript Date Objects or ISO Date strings. If you're programming in js use Date Objects. If you're using rails convert your date object (with timezone) to UTC and then to an ISO Date string. For example, `DateTime.now.utc.iso8601`. This ensures that the string passed to the Date Picker kit behaves as expected.
9
+ The Date Picker works best with Javascript Date Objects or ISO Date strings. If you're programming in js use Date Objects. If you're using rails convert your date object (with timezone) to UTC and then to an ISO Date string. For example, `DateTime.now.utc.iso8601`. This ensures that the string passed to the Date Picker kit behaves as expected.
10
+
11
+ The Date Picker expects a date format of `MM/DD/YYYY` by default. If a different date format (e.g. `DD/MM/YYYY`, `m/d/y`, etc.) is used, the component will not know how to handle it and use a default date instead. To change the date format used, read more [here](#format).
@@ -45,6 +45,7 @@
45
45
  class: "checkbox-class"
46
46
  %>
47
47
  <%= form.date_picker :example_date_picker_1, props: { label: true } %>
48
+ <%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true } %>
48
49
 
49
50
  <%= form.actions do |action| %>
50
51
  <%= action.submit %>
@@ -47,6 +47,7 @@
47
47
  value: 19.18,
48
48
  variant:"green"
49
49
  }) %>
50
+ <br>
50
51
  <%= pb_rails("icon_stat_value", props: { icon: "globe",
51
52
  text: "Uranus",
52
53
  unit: "AU",
@@ -0,0 +1 @@
1
+ <%= pb_rails("online_status", props: { no_border: true }) %>
@@ -0,0 +1,14 @@
1
+ import React from 'react'
2
+
3
+ import OnlineStatus from '../_online_status'
4
+
5
+ const OnlineStatusNoBorder = (props) => (
6
+ <>
7
+ <OnlineStatus
8
+ noBorder
9
+ {...props}
10
+ />
11
+ </>
12
+ )
13
+
14
+ export default OnlineStatusNoBorder
@@ -0,0 +1,3 @@
1
+ <%= pb_rails("online_status", props: { size: "sm", margin_y: "xs" }) %>
2
+ <%= pb_rails("online_status", props: { size: "md", margin_y: "xs" }) %>
3
+ <%= pb_rails("online_status", props: { size: "lg", margin_y: "xs" }) %>
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+
3
+ import OnlineStatus from '../_online_status'
4
+
5
+ const OnlineStatusSize = (props) => (
6
+ <>
7
+ <OnlineStatus
8
+ marginY="xs"
9
+ size="sm"
10
+ {...props}
11
+ />
12
+ <OnlineStatus
13
+ marginY="xs"
14
+ size="md"
15
+ {...props}
16
+ />
17
+ <OnlineStatus
18
+ marginY="xs"
19
+ size="lg"
20
+ {...props}
21
+ />
22
+ </>
23
+ )
24
+
25
+ export default OnlineStatusSize
@@ -1,8 +1,12 @@
1
1
  examples:
2
2
 
3
3
  rails:
4
- - online_status_default: Default
4
+ - online_status_default: Colors
5
+ - online_status_size: Size
6
+ - online_status_no_border: No Border
5
7
 
6
8
 
7
9
  react:
8
- - online_status_default: Default
10
+ - online_status_default: Colors
11
+ - online_status_size: Size
12
+ - online_status_no_border: No Border
@@ -1 +1,3 @@
1
1
  export { default as OnlineStatusDefault } from './_online_status_default.jsx'
2
+ export { default as OnlineStatusSize } from './_online_status_size.jsx'
3
+ export { default as OnlineStatusNoBorder } from './_online_status_no_border.jsx'
@@ -0,0 +1,61 @@
1
+ <div id="outer-container">
2
+ <%= pb_rails("overlay", props: { id: "overlay-container", overflow: "hidden" }) do %>
3
+ <div id="underlying-table">
4
+ <%= pb_rails("table", props: { size: "sm" }) do %>
5
+ <thead>
6
+ <tr>
7
+ <th>Column 1</th>
8
+ <th>Column 2</th>
9
+ <th>Column 3</th>
10
+ <th>Column 4</th>
11
+ <th>Column 5</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+ <% 7.times do %>
16
+ <tr>
17
+ <td>Value 1</td>
18
+ <td>Value 2</td>
19
+ <td>Value 3</td>
20
+ <td>Value 4</td>
21
+ <td>Value 5</td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ <% end %>
26
+ </div>
27
+ <% end %>
28
+ <%= pb_rails("button", props: { text: "Show More", id: "show-more-button", variant: "link", full_width: true, icon: "chevron-down", icon_right: true }) %>
29
+ <%= pb_rails("button", props: { text: "Show Less", id: "show-less-button", variant: "link", full_width: true, icon: "chevron-up", icon_right: true }) %>
30
+ </div>
31
+
32
+ <script type="text/javascript">
33
+ document.addEventListener("DOMContentLoaded", () => {
34
+ const showMoreButton = document.getElementById("show-more-button");
35
+ const showLessButton = document.getElementById("show-less-button");
36
+ const overlayContainer = document.getElementById("overlay-container");
37
+ const underlyingTable = document.getElementById("underlying-table");
38
+ const outerContainer = document.getElementById("outer-container");
39
+
40
+ showLessButton.style.display = "none";
41
+ underlyingTable.style.height = "200px";
42
+
43
+ const showMore = () => {
44
+ outerContainer.appendChild(underlyingTable);
45
+ outerContainer.appendChild(showLessButton);
46
+ showMoreButton.style.display = "none";
47
+ showLessButton.style.display = "flex";
48
+ underlyingTable.style.height = "auto";
49
+ };
50
+
51
+ const showLess = () => {
52
+ overlayContainer.appendChild(underlyingTable);
53
+ showMoreButton.style.display = "flex";
54
+ showLessButton.style.display = "none";
55
+ underlyingTable.style.height = "200px";
56
+ };
57
+
58
+ showMoreButton.addEventListener("click", showMore);
59
+ showLessButton.addEventListener("click", showLess);
60
+ });
61
+ </script>
@@ -0,0 +1,70 @@
1
+ /* eslint-disable react/no-multi-comp */
2
+ import React, { useState } from "react";
3
+ import { Overlay, Table, Button } from "playbook-ui";
4
+
5
+ const TableExample = () => {
6
+ return (
7
+ <Table size="sm">
8
+ <thead>
9
+ <tr>
10
+ <th>{"Column 1"}</th>
11
+ <th>{"Column 2"}</th>
12
+ <th>{"Column 3"}</th>
13
+ <th>{"Column 4"}</th>
14
+ <th>{"Column 5"}</th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+ {Array.from({ length: 7 }, (_, index) => (
19
+ <tr key={index}>
20
+ {Array.from({ length: 5 }, (_, columnIndex) => (
21
+ <td key={columnIndex}>{`Value ${columnIndex + 1}`}</td>
22
+ ))}
23
+ </tr>
24
+ ))}
25
+ </tbody>
26
+ </Table>
27
+ );
28
+ };
29
+
30
+ const OverlayToggle = () => {
31
+ const [showOverlay, setShowOverlay] = useState(true);
32
+
33
+ return (
34
+ <>
35
+ {showOverlay ? (
36
+ <>
37
+ <Overlay overflow="hidden">
38
+ <div style={{ height: 200 }}>
39
+ <TableExample />
40
+ </div>
41
+ </Overlay>
42
+ <Button
43
+ fullWidth
44
+ icon="chevron-down"
45
+ iconRight
46
+ key="chevron-down"
47
+ onClick={() => setShowOverlay(false)}
48
+ text="Show More"
49
+ variant="link"
50
+ />
51
+ </>
52
+ ) : (
53
+ <>
54
+ <TableExample />
55
+ <Button
56
+ fullWidth
57
+ icon="chevron-up"
58
+ iconRight
59
+ key="chevron-up"
60
+ onClick={() => setShowOverlay(true)}
61
+ text="Show Less"
62
+ variant="link"
63
+ />
64
+ </>
65
+ )}
66
+ </>
67
+ );
68
+ };
69
+
70
+ export default OverlayToggle;
@@ -0,0 +1 @@
1
+ To toggle an overlay, add a button with an event handler. Remove the overlay container to reveal the underlying content. Re-wrap the overlay container to add the overlay back.
@@ -2,7 +2,9 @@ examples:
2
2
  react:
3
3
  - overlay_default: Default
4
4
  - overlay_multi_directional: Multi-directional
5
+ - overlay_toggle: Toggle
5
6
 
6
7
  rails:
7
- - overlay_default: Default
8
- - overlay_multi_directional: Multi-directional
8
+ - overlay_default: Default
9
+ - overlay_multi_directional: Multi-directional
10
+ - overlay_toggle: Toggle
@@ -1,2 +1,3 @@
1
1
  export { default as OverlayDefault } from './_overlay_default.jsx'
2
2
  export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
3
+ export { default as OverlayToggle } from './_overlay_toggle.jsx'
@@ -6,6 +6,7 @@ examples:
6
6
  - star_rating_hide: Layout Options
7
7
  - star_rating_number_config: Number Config
8
8
  - star_rating_size_options: Size Options
9
+ - star_rating_interactive: Interactive
9
10
 
10
11
  react:
11
12
  - star_rating_default: Default
@@ -13,4 +14,5 @@ examples:
13
14
  - star_rating_background_options: Background Options
14
15
  - star_rating_hide: Layout Options
15
16
  - star_rating_number_config: Number Config
16
- - star_rating_size_options: Size Options
17
+ - star_rating_size_options: Size Options
18
+ - star_rating_interactive: Interactive
@@ -5,12 +5,12 @@ import TextInput from '../../pb_text_input/_text_input'
5
5
  import Title from '../../pb_title/_title'
6
6
 
7
7
  const TextInputDefault = (props) => {
8
+ const [firstName, setFirstName] = useState('')
8
9
  const handleOnChangeFirstName = ({ target }) => {
9
10
  setFirstName(target.value)
10
11
  }
11
12
  const ref = React.createRef()
12
13
 
13
- const [firstName, setFirstName] = useState('')
14
14
  const [formFields, setFormFields] = useState({
15
15
  firstName: 'Jane',
16
16
  lastName: 'Doe',
@@ -31,5 +31,5 @@
31
31
  options: expressionists,
32
32
  label: "Small Pills",
33
33
  multi_kit: "smallPill",
34
- pills: true,
34
+ pills: true
35
35
  }) %>