playbook_ui_docs 16.2.0 → 16.3.0.pre.alpha.PLAY2782RTEPOCs14847
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.html.erb +6 -4
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.jsx +14 -4
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_positions.md +1 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.html.erb +6 -24
- data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.jsx +35 -33
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.md +3 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.html.erb +18 -9
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx +24 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options.jsx +63 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.html.erb +16 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +2 -0
- data/app/pb_kits/playbook/pb_link/docs/_link_underline.jsx +31 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_react_reset_key.jsx +100 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_react_reset_key.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_lexxy_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_lexxy_default.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_quill_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_quill_default.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_tiptap_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_tiptap_default.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_required_indicator.html.erb +24 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_required_indicator.jsx +33 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_select/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.jsx +152 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.md +17 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.html.erb +121 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.md +17 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled.jsx +11 -13
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_disabled.html.erb +10 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_disabled.jsx +27 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.jsx +68 -0
- data/app/pb_kits/playbook/pb_textarea/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_textarea/docs/index.js +10 -8
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.html.erb +2 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.jsx +14 -0
- metadata +26 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: efef1934021c9309797dd15f3dbf712e4c95e8e8affebfa7192ff7f70e2048f0
|
|
4
|
+
data.tar.gz: a8bc4593e2739a3f311a48f2864e4a4591a35efabca6dc37d0633f1fd62e1a1c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bce457e3715a19e86a40cd38a254767aa433a05a36722af32916ec8ae03bbab1f69881af873befc897e5db34872d4a8e9397d91aeb4f21b93b11118d37929184
|
|
7
|
+
data.tar.gz: dc1acc8eb5433d3959757fc1a9a446367fc9a0d47ed0a837a365b808f04156b86827851c9d90d8916089ccee88a517a871329a9f1e277c78910c3b87e59fb089
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
4
|
+
|
|
5
|
+
const AdvancedTableCascadeCollapse = (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
|
+
return (
|
|
39
|
+
<div>
|
|
40
|
+
<AdvancedTable
|
|
41
|
+
cascadeCollapse
|
|
42
|
+
columnDefinitions={columnDefinitions}
|
|
43
|
+
tableData={MOCK_DATA}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default AdvancedTableCascadeCollapse
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
`cascadeCollapse` is an optional prop that is set to 'false' by default. If set to 'true', collapsing any parent row itself or by using the toggle exapansion buttons in any header or subheader row also collapses all descendants and clears their expansion state. Re-expanding then shows only direct children until the user expands deeper levels again.
|
|
@@ -42,6 +42,7 @@ examples:
|
|
|
42
42
|
- advanced_table_expanded_control: Expanded Control
|
|
43
43
|
- advanced_table_expand_by_depth: Expand by Depth
|
|
44
44
|
- advanced_table_subrow_headers: SubRow Headers
|
|
45
|
+
- advanced_table_cascade_collapse: Cascade Collapse
|
|
45
46
|
- advanced_table_collapsible_trail: Collapsible Trail
|
|
46
47
|
- advanced_table_table_options: Table Options
|
|
47
48
|
- advanced_table_table_props: Table Props
|
|
@@ -48,4 +48,5 @@ export { default as AdvancedTablePaddingControl } from './_advanced_table_paddin
|
|
|
48
48
|
export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
|
|
49
49
|
export { default as AdvancedTableColumnStylingBackground } from './_advanced_table_column_styling_background.jsx'
|
|
50
50
|
export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
|
|
51
|
-
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
51
|
+
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
52
|
+
export { default as AdvancedTableCascadeCollapse } from './_advanced_table_cascade_collapse.jsx'
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<%= pb_rails("caption", props: { text: "
|
|
2
|
-
<%= pb_rails("caption", props: { text: "
|
|
3
|
-
<%= pb_rails("caption", props: { text: "
|
|
4
|
-
<%= pb_rails("caption", props: { text: "
|
|
1
|
+
<%= pb_rails("caption", props: { text: "Caption light" }) %>
|
|
2
|
+
<%= pb_rails("caption", props: { text: "Caption default", color: "default" }) %>
|
|
3
|
+
<%= pb_rails("caption", props: { text: "Caption lighter", color: "lighter" }) %>
|
|
4
|
+
<%= pb_rails("caption", props: { text: "Caption success", color: "success" }) %>
|
|
5
|
+
<%= pb_rails("caption", props: { text: "Caption error", color: "error" }) %>
|
|
6
|
+
<%= pb_rails("caption", props: { text: "Caption link", color: "link" }) %>
|
|
@@ -4,23 +4,33 @@ import Caption from "../../pb_caption/_caption"
|
|
|
4
4
|
const CaptionColors = (props) => {
|
|
5
5
|
return (
|
|
6
6
|
<div>
|
|
7
|
+
<Caption
|
|
8
|
+
text="Caption light"
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
<Caption
|
|
12
|
+
color="default"
|
|
13
|
+
text="Caption default"
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
7
16
|
<Caption
|
|
8
|
-
|
|
17
|
+
color="lighter"
|
|
18
|
+
text="Caption lighter"
|
|
9
19
|
{...props}
|
|
10
20
|
/>
|
|
11
21
|
<Caption
|
|
12
22
|
color="success"
|
|
13
|
-
text="
|
|
23
|
+
text="Caption success"
|
|
14
24
|
{...props}
|
|
15
25
|
/>
|
|
16
26
|
<Caption
|
|
17
27
|
color="error"
|
|
18
|
-
text="
|
|
28
|
+
text="Caption error"
|
|
19
29
|
{...props}
|
|
20
30
|
/>
|
|
21
31
|
<Caption
|
|
22
32
|
color="link"
|
|
23
|
-
text="
|
|
33
|
+
text="Caption link"
|
|
24
34
|
{...props}
|
|
25
35
|
/>
|
|
26
36
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Datepicker supports `position` options from [Flatpickr Options Documentation](https://flatpickr.js.org/options/). There are multiple positioning options to choose from.
|
|
2
2
|
|
|
3
3
|
**Note:** In order for the above prop to work properly, you must also send `staticPosition={false}` to your Datepicker kit instance.
|
|
4
|
+
If you are using the Datepicker within a Dialog, you cannot use the `staticPosition`/`static_position` prop.
|
|
4
5
|
|
|
5
6
|
#### Affix Datepicker Upon Scrolling
|
|
6
7
|
|
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
<%= pb_rails("detail", props: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}) %>
|
|
5
|
-
|
|
6
|
-
<%= pb_rails("detail", props: {
|
|
7
|
-
text: "I am a detail kit",
|
|
8
|
-
color: "lighter"
|
|
9
|
-
}) %>
|
|
10
|
-
|
|
11
|
-
<%= pb_rails("detail", props: {
|
|
12
|
-
text: "I am a detail kit",
|
|
13
|
-
color: "link"
|
|
14
|
-
}) %>
|
|
15
|
-
|
|
16
|
-
<%= pb_rails("detail", props: {
|
|
17
|
-
text: "I am a detail kit",
|
|
18
|
-
color: "error"
|
|
19
|
-
}) %>
|
|
20
|
-
|
|
21
|
-
<%= pb_rails("detail", props: {
|
|
22
|
-
text: "I am a detail kit",
|
|
23
|
-
color: "success"
|
|
24
|
-
}) %>
|
|
1
|
+
<%= pb_rails("detail", props: { text: "I am a detail kit" }) %>
|
|
2
|
+
<%= pb_rails("detail", props: { text: "I am a detail kit", color: "default" }) %>
|
|
3
|
+
<%= pb_rails("detail", props: { text: "I am a detail kit", color: "lighter" }) %>
|
|
4
|
+
<%= pb_rails("detail", props: { text: "I am a detail kit", color: "link" }) %>
|
|
5
|
+
<%= pb_rails("detail", props: { text: "I am a detail kit", color: "error" }) %>
|
|
6
|
+
<%= pb_rails("detail", props: { text: "I am a detail kit", color: "success" }) %>
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Detail from '../../pb_detail/_detail'
|
|
3
3
|
|
|
4
|
-
const DetailColors = (props) =>
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
4
|
+
const DetailColors = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<div>
|
|
7
|
+
<Detail
|
|
8
|
+
text="I am a detail kit"
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
<Detail
|
|
12
|
+
color="default"
|
|
13
|
+
text="I am a detail kit"
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
<Detail
|
|
17
|
+
color="lighter"
|
|
18
|
+
text="I am a detail kit"
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
<Detail
|
|
22
|
+
color="link"
|
|
23
|
+
text="I am a detail kit"
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
<Detail
|
|
27
|
+
color="error"
|
|
28
|
+
text="I am a detail kit"
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
<Detail
|
|
32
|
+
color="success"
|
|
33
|
+
text="I am a detail kit"
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
37
39
|
|
|
38
40
|
export default DetailColors
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
The dialog kit also supports customizing your dialog with a [compound component](https://kentcdodds.com/blog/compound-components-with-react-hooks) structure.
|
|
2
2
|
This allows for greater flexibility and more complex dialogs.
|
|
3
3
|
|
|
4
|
-
For the Rails version, when using the kit as a compound component it is necessary to pass the same value as the id for the dialog, the dialog header and the dialog footer in order for the opening and closing of the dialog to function as expected.
|
|
4
|
+
For the Rails version, when using the kit as a compound component it is necessary to pass the same value as the id for the dialog, the dialog header and the dialog footer in order for the opening and closing of the dialog to function as expected.
|
|
5
|
+
|
|
6
|
+
If you are using the datepicker within the Rails dialog, do not use the `static_position` prop on the datepicker.
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
<%= pb_rails("button", props: { text: "Open Dialog", data: {"open-dialog": "dialog-1"} }) %>
|
|
2
2
|
|
|
3
|
-
<%= pb_rails("dialog", props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}) %>
|
|
3
|
+
<%= pb_rails("dialog", props: {
|
|
4
|
+
id:"dialog-1",
|
|
5
|
+
size: "md",
|
|
6
|
+
title: "Header Title is the Title Prop"
|
|
7
|
+
}) do %>
|
|
8
|
+
<%= pb_rails("dialog/dialog_body") do %>
|
|
9
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, margin_right: "lg", text: "Button Primary" }) %>
|
|
10
|
+
<div style="height: 800px; background-color: lightgray;"></div>
|
|
11
|
+
<%= pb_rails("button", props: { loading: true, text: "Loading..." }) %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<%= pb_rails("dialog/dialog_footer") do %>
|
|
15
|
+
<%= pb_rails("flex", props: { spacing: "between", padding_x: "md", padding_bottom: "md", padding: "sm" }) do %>
|
|
16
|
+
<%= pb_rails("button", props: { loading: true, text: "Send My Issue" }) %>
|
|
17
|
+
<%= pb_rails("button", props: { text: "Back", variant: "link", data: {"close-dialog": "dialog-1"} }) %>
|
|
18
|
+
<% end %>
|
|
19
|
+
<% end %>
|
|
20
|
+
<% end %>
|
|
@@ -12,16 +12,35 @@ const DialogDefault = () => {
|
|
|
12
12
|
<>
|
|
13
13
|
<Button onClick={open}>{'Open Dialog'}</Button>
|
|
14
14
|
<Dialog
|
|
15
|
-
cancelButton="Cancel Button"
|
|
16
|
-
confirmButton="Okay"
|
|
17
15
|
onCancel={close}
|
|
18
16
|
onClose={close}
|
|
19
17
|
onConfirm={close}
|
|
20
18
|
opened={isOpen}
|
|
21
|
-
size="
|
|
22
|
-
text="Hello Body Text, Nice to meet ya."
|
|
19
|
+
size="md"
|
|
23
20
|
title="Header Title is the Title Prop"
|
|
24
|
-
|
|
21
|
+
>
|
|
22
|
+
<Dialog.Body>
|
|
23
|
+
<Button
|
|
24
|
+
aria={{ label: 'Loading' }}
|
|
25
|
+
loading
|
|
26
|
+
text="Button Primary"
|
|
27
|
+
/>
|
|
28
|
+
<div style={{height: '800px', backgroundColor: 'lightgray'}} />
|
|
29
|
+
<Button
|
|
30
|
+
loading
|
|
31
|
+
text="Loading..."
|
|
32
|
+
/>
|
|
33
|
+
</Dialog.Body>
|
|
34
|
+
<Dialog.Footer>
|
|
35
|
+
<Button
|
|
36
|
+
loading
|
|
37
|
+
text="Send My Issue"
|
|
38
|
+
/>
|
|
39
|
+
<Button variant="link">
|
|
40
|
+
{"Back"}
|
|
41
|
+
</Button>
|
|
42
|
+
</Dialog.Footer>
|
|
43
|
+
</Dialog>
|
|
25
44
|
</>
|
|
26
45
|
)
|
|
27
46
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Dropdown from '../../pb_dropdown/_dropdown'
|
|
3
|
+
import Caption from '../../pb_caption/_caption'
|
|
4
|
+
|
|
5
|
+
const DropdownClosingOptions = (props) => {
|
|
6
|
+
const options = [
|
|
7
|
+
{
|
|
8
|
+
label: "United States",
|
|
9
|
+
value: "unitedStates",
|
|
10
|
+
id: "us"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: "Canada",
|
|
14
|
+
value: "canada",
|
|
15
|
+
id: "ca"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "Pakistan",
|
|
19
|
+
value: "pakistan",
|
|
20
|
+
id: "pk"
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<Caption
|
|
27
|
+
marginBottom="xs"
|
|
28
|
+
text="Any"
|
|
29
|
+
/>
|
|
30
|
+
<Dropdown
|
|
31
|
+
closeOnClick='any'
|
|
32
|
+
options={options}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<br />
|
|
37
|
+
|
|
38
|
+
<Caption
|
|
39
|
+
marginBottom="xs"
|
|
40
|
+
text="Outside"
|
|
41
|
+
/>
|
|
42
|
+
<Dropdown
|
|
43
|
+
closeOnClick='outside'
|
|
44
|
+
options={options}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<br />
|
|
49
|
+
|
|
50
|
+
<Caption
|
|
51
|
+
marginBottom="xs"
|
|
52
|
+
text="Inside"
|
|
53
|
+
/>
|
|
54
|
+
<Dropdown
|
|
55
|
+
closeOnClick='inside'
|
|
56
|
+
options={options}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
</>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default DropdownClosingOptions
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The `closeOnClick` prop allows you to control when the Dropdown closes in response to click interactions. The value `any` reflects the default behavior, where the dropdown will close after any click. Set it to `outside` to ensure interactive elements as dropdown options are able to be interacted with or modified. Set it to `inside` for a dropdown that only closes when the input or dropdown menu is clicked.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%
|
|
2
|
+
options = [
|
|
3
|
+
{ label: "United States", value: "unitedStates", id: "us" },
|
|
4
|
+
{ label: "Canada", value: "canada", id: "ca" },
|
|
5
|
+
{ label: "Pakistan", value: "pakistan", id: "pk" },
|
|
6
|
+
]
|
|
7
|
+
%>
|
|
8
|
+
|
|
9
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Any" }) %>
|
|
10
|
+
<%= pb_rails("dropdown", props: { options: options, close_on_click: "any", margin_bottom: "md" }) %>
|
|
11
|
+
|
|
12
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Outside" }) %>
|
|
13
|
+
<%= pb_rails("dropdown", props: { options: options, close_on_click: "outside", margin_bottom: "md" }) %>
|
|
14
|
+
|
|
15
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Inside" }) %>
|
|
16
|
+
<%= pb_rails("dropdown", props: { options: options, close_on_click: "inside" }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The `close_on_click` prop allows you to control when the Dropdown closes in response to click interactions. The value `any` reflects the default behavior, where the dropdown will close after any click. Set it to `outside` to ensure interactive elements as dropdown options are able to be interacted with or modified. Set it to `inside` for a dropdown that only closes when the input or dropdown menu is clicked.
|
|
@@ -25,6 +25,7 @@ examples:
|
|
|
25
25
|
- dropdown_separators_hidden: Separators Hidden
|
|
26
26
|
- dropdown_with_clearable: Clearable
|
|
27
27
|
- dropdown_with_constrain_height_rails: Constrain Height
|
|
28
|
+
- dropdown_closing_options_rails: Closing Options
|
|
28
29
|
- dropdown_quickpick_rails: Quick Pick Variant
|
|
29
30
|
- dropdown_quickpick_range_end_rails: Quick Pick Variant (Range Ends Today)
|
|
30
31
|
- dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
|
|
@@ -62,6 +63,7 @@ examples:
|
|
|
62
63
|
- dropdown_with_constrain_height: Constrain Height
|
|
63
64
|
- dropdown_separators_hidden: Separators Hidden
|
|
64
65
|
- dropdown_with_external_control: useDropdown Hook
|
|
66
|
+
- dropdown_closing_options: Closing Options
|
|
65
67
|
- dropdown_quickpick: Quick Pick Variant
|
|
66
68
|
- dropdown_quickpick_range_end: Quick Pick Variant (Range Ends Today)
|
|
67
69
|
- dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
|
|
@@ -31,4 +31,5 @@ export { default as DropdownQuickpickWithDatePickers } from './_dropdown_quickpi
|
|
|
31
31
|
export { default as DropdownQuickpickCustom } from './_dropdown_quickpick_custom.jsx'
|
|
32
32
|
export { default as DropdownWithClearable } from './_dropdown_with_clearable.jsx'
|
|
33
33
|
export { default as DropdownWithConstrainHeight } from './_dropdown_with_constrain_height.jsx'
|
|
34
|
+
export { default as DropdownClosingOptions } from './_dropdown_closing_options.jsx'
|
|
34
35
|
export { default as DropdownRequiredIndicator } from "./_dropdown_required_indicator.jsx";
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
<%= form.typeahead :example_typeahead, props: { data: { typeahead_example1: true, user: {} }, label: true, placeholder: "Search for a user" } %>
|
|
93
93
|
<%= form.text_field :example_text_field, props: { label: true } %>
|
|
94
94
|
<%= form.text_field :example_text_field_2, props: { label: "Text Field Custom Label" } %>
|
|
95
|
-
<%= form.phone_number_field :example_phone_number_field, props: { label:
|
|
95
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: true, hidden_inputs: true} %>
|
|
96
|
+
<%= form.intl_telephone :example_intl_telephone, props: { label: true, hidden_inputs: true } %>
|
|
96
97
|
<%= form.email_field :example_email_field, props: { label: true } %>
|
|
97
98
|
<%= form.number_field :example_number_field, props: { label: true } %>
|
|
98
99
|
<%= form.search_field :example_search_field, props: { label: true } %>
|
|
@@ -146,6 +146,8 @@
|
|
|
146
146
|
<%= form.time_picker :example_time_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
147
147
|
<%= form.date_picker :example_date_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
148
148
|
<%= form.date_picker :example_date_picker_required_indicator_custom, props: { label: "Custom Date Picker Label", required: true, required_indicator: true } %>
|
|
149
|
+
<%= form.select :example_select_required_indicator, [["Yes", 1], ["No", 2]], props: { label: true, required: true, required_indicator: true } %>
|
|
150
|
+
<%= form.select :example_select_required_indicator_2, [["Yes", 1], ["No", 2]], props: { label: "Example Select Field", required: true, required_indicator: true } %>
|
|
149
151
|
<%= form.multi_level_select :example_multi_level_select_required_indicator, props: {
|
|
150
152
|
label: true,
|
|
151
153
|
margin_y: 'sm',
|
|
@@ -4,7 +4,37 @@ import Link from '../../pb_link/_link'
|
|
|
4
4
|
const LinkUnderline = (props) => (
|
|
5
5
|
<div>
|
|
6
6
|
<Link
|
|
7
|
-
href="#
|
|
7
|
+
href="#underline1"
|
|
8
|
+
text="link example"
|
|
9
|
+
underline
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
<br />
|
|
14
|
+
|
|
15
|
+
<Link
|
|
16
|
+
color="body"
|
|
17
|
+
href="#underline2"
|
|
18
|
+
text="link example"
|
|
19
|
+
underline
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<br />
|
|
24
|
+
|
|
25
|
+
<Link
|
|
26
|
+
color="muted"
|
|
27
|
+
href="#underline3"
|
|
28
|
+
text="link example"
|
|
29
|
+
underline
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
<br />
|
|
34
|
+
|
|
35
|
+
<Link
|
|
36
|
+
color="destructive"
|
|
37
|
+
href="#underline4"
|
|
8
38
|
text="link example"
|
|
9
39
|
underline
|
|
10
40
|
{...props}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import MultiLevelSelect from "../_multi_level_select";
|
|
3
|
+
import { Button } from "playbook-ui";
|
|
4
|
+
|
|
5
|
+
const treeData = [
|
|
6
|
+
{
|
|
7
|
+
label: "Power Home Remodeling",
|
|
8
|
+
value: "powerHomeRemodeling",
|
|
9
|
+
id: "100",
|
|
10
|
+
expanded: true,
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
label: "People",
|
|
14
|
+
value: "people",
|
|
15
|
+
id: "101",
|
|
16
|
+
expanded: true,
|
|
17
|
+
children: [
|
|
18
|
+
{
|
|
19
|
+
label: "Talent Acquisition",
|
|
20
|
+
value: "talentAcquisition",
|
|
21
|
+
id: "102",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Business Affairs",
|
|
25
|
+
value: "businessAffairs",
|
|
26
|
+
id: "103",
|
|
27
|
+
children: [
|
|
28
|
+
{
|
|
29
|
+
label: "Initiatives",
|
|
30
|
+
value: "initiatives",
|
|
31
|
+
id: "104",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "Learning & Development",
|
|
35
|
+
value: "learningAndDevelopment",
|
|
36
|
+
id: "105",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "People Experience",
|
|
42
|
+
value: "peopleExperience",
|
|
43
|
+
id: "106",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "Contact Center",
|
|
49
|
+
value: "contactCenter",
|
|
50
|
+
id: "107",
|
|
51
|
+
children: [
|
|
52
|
+
{
|
|
53
|
+
label: "Appointment Management",
|
|
54
|
+
value: "appointmentManagement",
|
|
55
|
+
id: "108",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Customer Service",
|
|
59
|
+
value: "customerService",
|
|
60
|
+
id: "109",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "Energy",
|
|
64
|
+
value: "energy",
|
|
65
|
+
id: "110",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const MultiLevelSelectReactResetKey = (props) => {
|
|
74
|
+
const [resetKey, setResetKey] = useState(0);
|
|
75
|
+
|
|
76
|
+
const handleReset = () => {
|
|
77
|
+
setResetKey((k) => k + 1);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<>
|
|
82
|
+
<MultiLevelSelect
|
|
83
|
+
{...props}
|
|
84
|
+
id="multi-level-select-reset-example"
|
|
85
|
+
key={`multi-level-select-reset-${resetKey}`}
|
|
86
|
+
name="my_array"
|
|
87
|
+
returnAllSelected
|
|
88
|
+
treeData={treeData}
|
|
89
|
+
/>
|
|
90
|
+
<Button
|
|
91
|
+
id="multilevelselect-reset-button"
|
|
92
|
+
marginTop="lg"
|
|
93
|
+
onClick={handleReset}
|
|
94
|
+
text="Reset"
|
|
95
|
+
/>
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default MultiLevelSelectReactResetKey;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
When a parent resets a Multi Level Select (e.g., “Default” or “Clear”), the kit needs a `key` that changes with the selection because React uses the `key` to determine component identity and whether to preserve internal state. If the `key` doesn’t change, React reuses the existing instance and may keep showing the old selection instead of resetting to the new one.
|
|
@@ -39,3 +39,4 @@ examples:
|
|
|
39
39
|
- multi_level_select_disabled_options_parent: Disabled Parent Option (Return All Selected)
|
|
40
40
|
- multi_level_select_single_disabled: Disabled Options (Single Select)
|
|
41
41
|
- multi_level_select_required_indicator: Required Indicator
|
|
42
|
+
- multi_level_select_react_reset_key: Reset with Key (React)
|
|
@@ -17,3 +17,4 @@ export { default as MultiLevelSelectDisabledOptionsDefault } from "./_multi_leve
|
|
|
17
17
|
export { default as MultiLevelSelectLabel } from "./_multi_level_select_label.jsx"
|
|
18
18
|
export { default as MultiLevelSelectSingleDisabled } from "./_multi_level_select_single_disabled.jsx"
|
|
19
19
|
export { default as MultiLevelSelectRequiredIndicator } from "./_multi_level_select_required_indicator.jsx"
|
|
20
|
+
export { default as MultiLevelSelectReactResetKey } from "./_multi_level_select_react_reset_key.jsx"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("rich_text_editor_lexxy", props: { input_options: { id: 'lexxy_editor_id', name: "hidden_input_name" }, placeholder: "Write something…" }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Lexxy (37signals / Lexical) kit — form-associated custom element; submits with the form like a textarea. Attachments disabled in this demo. Use `pb_rails("rich_text_editor_lexxy", props: { input_options: { id: "...", name: "..." }, placeholder: "..." })`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("rich_text_editor_quill", props: { input_options: { id: 'hidden_input_id', name: "hidden_input_name" }, value: "Add your text here. You can format your text, add links, quotes, and bullets." }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Quill kit — framework-agnostic editor with Snow theme. Content is synced to a hidden input for Rails form submission. Use `pb_rails("rich_text_editor_quill", props: { input_options: { id: "...", name: "..." }, value: "..." })`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("rich_text_editor_tiptap", props: { input_options: { id: 'hidden_input_id', name: "hidden_input_name" }, value: "Add your text here. You can format your text, add links, quotes, and bullets." }) %>
|