playbook_ui_docs 14.0.0 → 14.1.0.pre.alpha.PA1477timestampkit3536

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 +14 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 100ded5640f86b97412add22ed482400333157a24bc4a22ffe2b8c42a965a458
4
- data.tar.gz: 94779c01b98f026171ac020ce2bb5c7e201ce434e2e6f3fd42c2a70395c4d633
3
+ metadata.gz: a9a56199c55751b0622186a61c0072d89817f864fecd9cf1181b13d2555c84bf
4
+ data.tar.gz: c88fde11c878878b9b14e115b9fcbfcdb63bea5d5f2c296aa422b1aa09164221
5
5
  SHA512:
6
- metadata.gz: 05173a2c815b226c74ad40b8006293eec9c2c451c642dac0b86e24ad138805bb807aae8ffc60d605c89e22310a0ff663966b2752a5bc8422c1b1766abea85c9c
7
- data.tar.gz: 7fede7cdd21bd27a82b1839f4ac6d3972bb5d172a1783058c0e3aafead1d5071d089dbb882d05a695e0cc96a99541304c52d09429249265abd7bfb89ca85350b
6
+ metadata.gz: feb420d2480a3dfe7acc94e307ac4f98c613fa20957af19d990dc40d770c46aadcac3799c9cb30000c05d21bae6c4253f619868150ef0fcab35a4f7c5eb6b348
7
+ data.tar.gz: 98f2d9232423d8d2ff37a4607123f8caa31e7ae3b5d951707c100e48fc60defad52497a0e063de1ca0689be93f8d0796c40fbc4362d1e15f199ee5d071224ad4
@@ -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
  }) %>