playbook_ui_docs 14.13.0.pre.alpha.play1852reacthookformsupportradio6153 → 14.13.0.pre.alpha.play1852reacthookformsupportradio6213
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_custom_cell.jsx +75 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +69 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +1 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +37 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +18 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
- data/dist/playbook-doc.js +1 -1
- metadata +14 -13
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b821b28c3a6280c5100ff8da75b06d250e15df3c72966bf506bf292e34b93b05
|
4
|
+
data.tar.gz: '04280846dba578783674460a34f60c035418d0d19f44ed7d3d9da1e407756928'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d917ac2e0875c716d90cf84a7998e3d0371c5c1f014c646d4ef6c64b4721474e092c07f790a8d29f4faacb7e54391cb4c3dcf0ff25cdf4653e75b11b0f2f1c80
|
7
|
+
data.tar.gz: 840dfc516ef713cd24a8fdc8d7a7044aa2f9c7d43418de4530af3751bf08215d3ac4697587c5cfbbe781c62c472b4457270162c84b7e58550d70238fbd87dee6
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_custom_cell.jsx
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { AdvancedTable, Pill } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableColumnHeadersCustomCell = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
label: "Enrollment Data",
|
14
|
+
columns: [
|
15
|
+
{
|
16
|
+
accessor: "newEnrollments",
|
17
|
+
label: "New Enrollments",
|
18
|
+
customRenderer: (row, value) => (
|
19
|
+
<Pill text={value}
|
20
|
+
variant="success"
|
21
|
+
/>
|
22
|
+
),
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "scheduledMeetings",
|
26
|
+
label: "Scheduled Meetings",
|
27
|
+
customRenderer: (row, value) => (
|
28
|
+
<Pill text={value}
|
29
|
+
variant="info"
|
30
|
+
/>
|
31
|
+
),
|
32
|
+
},
|
33
|
+
],
|
34
|
+
},
|
35
|
+
{
|
36
|
+
label: "Performance Data",
|
37
|
+
columns: [
|
38
|
+
{
|
39
|
+
accessor: "attendanceRate",
|
40
|
+
label: "Attendance Rate",
|
41
|
+
},
|
42
|
+
{
|
43
|
+
accessor: "completedClasses",
|
44
|
+
label: "Completed Classes",
|
45
|
+
customRenderer: (row, value) => (
|
46
|
+
<Pill text={value}
|
47
|
+
variant="error"
|
48
|
+
/>
|
49
|
+
),
|
50
|
+
},
|
51
|
+
{
|
52
|
+
accessor: "classCompletionRate",
|
53
|
+
label: "Class Completion Rate",
|
54
|
+
},
|
55
|
+
{
|
56
|
+
accessor: "graduatedStudents",
|
57
|
+
label: "Graduated Students",
|
58
|
+
},
|
59
|
+
],
|
60
|
+
},
|
61
|
+
];
|
62
|
+
|
63
|
+
|
64
|
+
return (
|
65
|
+
<>
|
66
|
+
<AdvancedTable
|
67
|
+
columnDefinitions={columnDefinitions}
|
68
|
+
tableData={MOCK_DATA}
|
69
|
+
{...props}
|
70
|
+
/>
|
71
|
+
</>
|
72
|
+
)
|
73
|
+
}
|
74
|
+
|
75
|
+
export default AdvancedTableColumnHeadersCustomCell
|
@@ -30,4 +30,4 @@
|
|
30
30
|
}
|
31
31
|
] %>
|
32
32
|
|
33
|
-
<%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false, sticky: true }}) %>
|
33
|
+
<%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, responsive: "none", table_props: { container: false, sticky: true }}) %>
|
@@ -1 +1,3 @@
|
|
1
|
-
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table) under the hood which comes with
|
1
|
+
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table) under the hood which comes with its own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `table_props` 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).
|
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#table-props-sticky-header) doc example below.
|
@@ -1,3 +1,3 @@
|
|
1
|
-
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with
|
1
|
+
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with its 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
2
|
|
3
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.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb
ADDED
@@ -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: "table_props_table", table_data: @table_data, column_definitions: column_definitions, max_height: "xs", table_props: { sticky: true }}) %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `table_props` and giving the AdvancedTable a `max_height` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop. This behavior requires a `max_height` 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#table-props) doc example above.
|
@@ -5,6 +5,7 @@ examples:
|
|
5
5
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
6
6
|
- advanced_table_collapsible_trail_rails: Collapsible Trail
|
7
7
|
- advanced_table_table_props: Table Props
|
8
|
+
- advanced_table_table_props_sticky_header: Table Props Sticky Header
|
8
9
|
- advanced_table_beta_sort: Enable Sorting
|
9
10
|
- advanced_table_responsive: Responsive Tables
|
10
11
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
@@ -30,6 +31,7 @@ examples:
|
|
30
31
|
- advanced_table_pagination_with_props: Pagination Props
|
31
32
|
- advanced_table_column_headers: Multi-Header Columns
|
32
33
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
34
|
+
- advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
|
33
35
|
# - advanced_table_no_subrows: Table with No Subrows
|
34
36
|
- advanced_table_selectable_rows: Selectable Rows
|
35
37
|
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
@@ -19,4 +19,5 @@ export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_tab
|
|
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
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'
|
22
|
+
export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
|
23
|
+
export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React, { useState } from "react"
|
2
|
+
import { useForm } from "react-hook-form"
|
3
|
+
import { Button, Checkbox, Flex, Body } from "playbook-ui"
|
4
|
+
|
5
|
+
const CheckboxReactHook = () => {
|
6
|
+
const { register, handleSubmit } = useForm({
|
7
|
+
defaultValues: {
|
8
|
+
Small: false,
|
9
|
+
Medium: false,
|
10
|
+
Large: false,
|
11
|
+
},
|
12
|
+
})
|
13
|
+
|
14
|
+
const [submittedData, setSubmittedData] = useState({
|
15
|
+
Small: false,
|
16
|
+
Medium: false,
|
17
|
+
Large: false,
|
18
|
+
})
|
19
|
+
|
20
|
+
const onSubmit = (data) => {
|
21
|
+
setSubmittedData(data)
|
22
|
+
}
|
23
|
+
|
24
|
+
return (
|
25
|
+
<Flex orientation="row">
|
26
|
+
<Flex align="start"
|
27
|
+
orientation="column"
|
28
|
+
paddingRight="lg"
|
29
|
+
>
|
30
|
+
<form onSubmit={handleSubmit(onSubmit)}>
|
31
|
+
<Checkbox padding="xs"
|
32
|
+
text="Small"
|
33
|
+
{...register("Small")}
|
34
|
+
/>
|
35
|
+
<br />
|
36
|
+
<Checkbox padding="xs"
|
37
|
+
text="Medium"
|
38
|
+
{...register("Medium")}
|
39
|
+
/>
|
40
|
+
<br />
|
41
|
+
<Checkbox padding="xs"
|
42
|
+
text="Large"
|
43
|
+
{...register("Large")}
|
44
|
+
/>
|
45
|
+
<br />
|
46
|
+
<Button htmlType="submit"
|
47
|
+
marginTop="sm"
|
48
|
+
text="submit"
|
49
|
+
/>
|
50
|
+
</form>
|
51
|
+
</Flex>
|
52
|
+
<Flex align="start"
|
53
|
+
orientation="column"
|
54
|
+
>
|
55
|
+
<Body padding="xs"
|
56
|
+
text={`Small: ${submittedData.Small ? "true" : "false"}`}
|
57
|
+
/>
|
58
|
+
<Body padding="xs"
|
59
|
+
text={`Medium: ${submittedData.Medium ? "true" : "false"}`}
|
60
|
+
/>
|
61
|
+
<Body padding="xs"
|
62
|
+
text={`Large: ${submittedData.Large ? "true" : "false"}`}
|
63
|
+
/>
|
64
|
+
</Flex>
|
65
|
+
</Flex>
|
66
|
+
)
|
67
|
+
}
|
68
|
+
|
69
|
+
export default CheckboxReactHook
|
@@ -0,0 +1 @@
|
|
1
|
+
You can pass react hook props to the checkbox kit.
|
@@ -11,6 +11,7 @@ examples:
|
|
11
11
|
react:
|
12
12
|
- checkbox_default: Default
|
13
13
|
- checkbox_checked: Load as checked
|
14
|
+
- checkbox_react_hook: React Hook Form
|
14
15
|
- checkbox_custom: Custom Checkbox
|
15
16
|
- checkbox_error: Default w/ Error
|
16
17
|
- checkbox_indeterminate: Indeterminate Checkbox
|
@@ -21,4 +22,4 @@ examples:
|
|
21
22
|
- checkbox_error_swift: Default w/ Error
|
22
23
|
- checkbox_indeterminate_swift: Indeterminate Checkbox
|
23
24
|
- checkbox_props_swift: ""
|
24
|
-
|
25
|
+
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export { default as CheckboxDefault } from './_checkbox_default.jsx'
|
2
2
|
export { default as CheckboxCustom } from './_checkbox_custom.jsx'
|
3
|
+
export { default as CheckboxReactHook } from './_checkbox_react_hook.jsx'
|
3
4
|
export { default as CheckboxError } from './_checkbox_error.jsx'
|
4
5
|
export { default as CheckboxChecked } from './_checkbox_checked.jsx'
|
5
6
|
export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import React, { forwardRef } from 'react'
|
2
|
+
import {
|
3
|
+
Overlay,
|
4
|
+
Card,
|
5
|
+
Flex,
|
6
|
+
FlexItem,
|
7
|
+
} from 'playbook-ui'
|
8
|
+
|
9
|
+
const InlineCardsExample = forwardRef(function InlineCardsExample(ref) {
|
10
|
+
return (
|
11
|
+
<Flex
|
12
|
+
columnGap="lg"
|
13
|
+
orientation="row"
|
14
|
+
ref={ref}
|
15
|
+
>
|
16
|
+
{Array.from({ length: 15 }, (_, index) => (
|
17
|
+
<FlexItem key={index}>
|
18
|
+
<Card>{"Card Content"}</Card>
|
19
|
+
</FlexItem>
|
20
|
+
))}
|
21
|
+
</Flex>
|
22
|
+
)
|
23
|
+
})
|
24
|
+
|
25
|
+
const OverlayVerticalDynamicMultiDirectional = () => (
|
26
|
+
<>
|
27
|
+
<Overlay
|
28
|
+
color="card_light"
|
29
|
+
dynamic
|
30
|
+
layout={{"x": "xl"}}
|
31
|
+
>
|
32
|
+
<InlineCardsExample />
|
33
|
+
</Overlay>
|
34
|
+
</>
|
35
|
+
)
|
36
|
+
|
37
|
+
export default OverlayVerticalDynamicMultiDirectional
|
data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Pass the `dynamic` prop to make the overlay render while the scrollbar isn't at either end on the scrollbar. You must also add a `ref` to the child that's being passed through the Overlay.
|
@@ -1,3 +1,4 @@
|
|
1
1
|
export { default as OverlayDefault } from './_overlay_default.jsx'
|
2
2
|
export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
|
3
3
|
export { default as OverlayToggle } from './_overlay_toggle.jsx'
|
4
|
+
export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'
|
@@ -0,0 +1 @@
|
|
1
|
+
Progress pills start at `45px` wide if the container allows, but will shrink down to `1px` as the container gets smaller. Resize this window to see each pill shrink.
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= pb_rails("progress_pills", props: { aria: { label: "2 out of 5 steps complete" }, steps: 5, active: 2, full_width_pill: true }) %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import ProgressPills from '../_progress_pills'
|
3
|
+
|
4
|
+
const ProgressPillsFullWidth = (props) => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<ProgressPills
|
8
|
+
active={2}
|
9
|
+
aria={{ label: '2 out of 5 steps complete' }}
|
10
|
+
fullWidthPill
|
11
|
+
steps={5}
|
12
|
+
{...props}
|
13
|
+
/>
|
14
|
+
</>
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
export default ProgressPillsFullWidth
|
@@ -0,0 +1 @@
|
|
1
|
+
Pass `full_width_pill: true` to the Progress Pill kit to get true 100% full width pills. The kit will take up the full width of the container that it is in.
|
@@ -0,0 +1 @@
|
|
1
|
+
Pass `fullWidthPill` to the Progress Pill kit to get true 100% full width pills. The kit will take up the full width of the container that it is in.
|
@@ -3,9 +3,11 @@ examples:
|
|
3
3
|
rails:
|
4
4
|
- progress_pills_default: Default
|
5
5
|
- progress_pills_status: Status
|
6
|
+
- progress_pills_full_width: Full Container Width
|
6
7
|
|
7
8
|
|
8
9
|
|
9
10
|
react:
|
10
11
|
- progress_pills_default: Default
|
11
12
|
- progress_pills_status: Status
|
13
|
+
- progress_pills_full_width: Full Container Width
|