playbook_ui_docs 14.22.0.pre.alpha.popoverkittransitionpoppertofloatingui8856 → 14.22.0.pre.rc.0
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_beta_sort.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +3 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.html.erb +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +15 -33
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +72 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +6 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +15 -33
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +22 -52
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +16 -12
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +15 -31
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +16 -39
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +38 -86
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +15 -32
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +22 -72
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +1 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +15 -31
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +16 -37
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +26 -71
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +16 -29
- data/app/pb_kits/playbook/pb_circle_chart/docs/{_circle_chart_colors_rails.md → _circle_chart_colors.md} +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +16 -28
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +2 -4
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +15 -23
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +51 -81
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +75 -103
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +6 -3
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +13 -19
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +17 -30
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +20 -34
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +20 -29
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +20 -28
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.jsx +42 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select.jsx +10 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display.jsx +10 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.jsx +11 -20
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.jsx +8 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.jsx +14 -23
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +8 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +8 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_tooltip/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -1
- data/dist/playbook-doc.js +19 -1
- metadata +30 -37
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +0 -51
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +0 -77
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.html.erb +0 -63
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +0 -38
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.jsx +0 -65
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.jsx +0 -69
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.jsx +0 -99
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_react.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.html.erb +0 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +0 -47
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_sidebar.jsx +0 -224
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.html.erb +0 -14
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.jsx +0 -25
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_rails.md +0 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_react.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input.html.erb +0 -18
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input_rails.md +0 -1
- /data/app/pb_kits/playbook/pb_typeahead/docs/{_typeahead_preserve_input_react.md → _typeahead_preserve_input.md} +0 -0
@@ -1,69 +0,0 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
|
-
import Icon from "../../pb_icon/_icon"
|
4
|
-
import Flex from "../../pb_flex/_flex"
|
5
|
-
import Caption from "../../pb_caption/_caption"
|
6
|
-
import Tooltip from "../../pb_tooltip/_tooltip"
|
7
|
-
import MOCK_DATA from "./advanced_table_mock_data.json"
|
8
|
-
|
9
|
-
const AdvancedTableWithCustomHeader = (props) => {
|
10
|
-
const columnDefinitions = [
|
11
|
-
{
|
12
|
-
accessor: "year",
|
13
|
-
label: "Year",
|
14
|
-
cellAccessors: ["quarter", "month", "day"],
|
15
|
-
},
|
16
|
-
{
|
17
|
-
accessor: "newEnrollments",
|
18
|
-
label: "New Enrollments",
|
19
|
-
header: () => (
|
20
|
-
<Flex alignItems="center"
|
21
|
-
justifyContent="center"
|
22
|
-
>
|
23
|
-
<Caption marginRight="xs">New Enrollments</Caption>
|
24
|
-
<Tooltip placement="top"
|
25
|
-
text="Whoa. I'm a Tooltip"
|
26
|
-
zIndex={10}
|
27
|
-
>
|
28
|
-
<Icon cursor="pointer"
|
29
|
-
icon="info"
|
30
|
-
size="xs"
|
31
|
-
/>
|
32
|
-
</Tooltip>
|
33
|
-
</Flex>
|
34
|
-
),
|
35
|
-
},
|
36
|
-
{
|
37
|
-
accessor: "scheduledMeetings",
|
38
|
-
label: "Scheduled Meetings",
|
39
|
-
},
|
40
|
-
{
|
41
|
-
accessor: "attendanceRate",
|
42
|
-
label: "Attendance Rate",
|
43
|
-
},
|
44
|
-
{
|
45
|
-
accessor: "completedClasses",
|
46
|
-
label: "Completed Classes",
|
47
|
-
},
|
48
|
-
{
|
49
|
-
accessor: "classCompletionRate",
|
50
|
-
label: "Class Completion Rate",
|
51
|
-
},
|
52
|
-
{
|
53
|
-
accessor: "graduatedStudents",
|
54
|
-
label: "Graduated Students",
|
55
|
-
},
|
56
|
-
];
|
57
|
-
|
58
|
-
return (
|
59
|
-
<div>
|
60
|
-
<AdvancedTable
|
61
|
-
columnDefinitions={columnDefinitions}
|
62
|
-
tableData={MOCK_DATA}
|
63
|
-
{...props}
|
64
|
-
/>
|
65
|
-
</div>
|
66
|
-
)
|
67
|
-
}
|
68
|
-
|
69
|
-
export default AdvancedTableWithCustomHeader
|
@@ -1 +0,0 @@
|
|
1
|
-
The optional `header` key/value pair can be used within `columnDefinitions` to render a custom header. This example shows an Icon and Tooltip being used but other kits can be used as well.
|
@@ -1,3 +0,0 @@
|
|
1
|
-
By default, Highcharts have a height of 400px, but this can be customized. You can override the default by specifying either a percentage or a fixed pixel value.
|
2
|
-
|
3
|
-
Using a percentage maintains a consistent aspect ratio across different responsive sizes. For example, setting the height to 50% makes the chart’s height half of its width.
|
@@ -1 +0,0 @@
|
|
1
|
-
**Important Note for the React Kit**: In order to leverage this kit, you must install `highcharts` and `highcharts-react-official` into your project as shown below. To then apply Playbook styles to your Highchart, import circleChartTheme.ts from playbook-ui and merge it with your Highchart options. Then, pass the merged value to the options prop. Playbook’s styling will be applied automatically. See the examples in the documentation below.
|
@@ -1,52 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
options = [
|
3
|
-
{ label: "Item 1", value: "item-1", id: "1" },
|
4
|
-
{ label: "Item 2", value: "item-2", id: "2" },
|
5
|
-
{ label: "Item 3", value: "item-3", id: "3" }
|
6
|
-
]
|
7
|
-
%>
|
8
|
-
|
9
|
-
<%= pb_rails("dropdown", props: { label: "Multiple Icons", options: options }) do %>
|
10
|
-
<%= pb_rails("dropdown/dropdown_trigger") %>
|
11
|
-
<%= pb_rails("dropdown/dropdown_container") do %>
|
12
|
-
<% options.each do |option| %>
|
13
|
-
<%= pb_rails("dropdown/dropdown_option", props: { option: option }) do %>
|
14
|
-
<%= pb_rails("flex", props: { align: "center", justify: "between" }) do %>
|
15
|
-
<%= pb_rails("flex") do %>
|
16
|
-
<%= pb_rails("icon", props: { icon: "calendar", padding_right: "xs" }) %>
|
17
|
-
<%= pb_rails("body", props: { color: "default", text: option[:label] }) %>
|
18
|
-
<% end %>
|
19
|
-
<%= pb_rails("icon", props: { icon: "check" }) %>
|
20
|
-
<% end %>
|
21
|
-
<% end %>
|
22
|
-
<% end %>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
25
|
-
|
26
|
-
<%= pb_rails("dropdown", props: { label: "Icon on Left", options: options, padding_y: "md" }) do %>
|
27
|
-
<%= pb_rails("dropdown/dropdown_trigger") %>
|
28
|
-
<%= pb_rails("dropdown/dropdown_container") do %>
|
29
|
-
<% options.each do |option| %>
|
30
|
-
<%= pb_rails("dropdown/dropdown_option", props: { option: option }) do %>
|
31
|
-
<%= pb_rails("flex", props: { align: "center" }) do %>
|
32
|
-
<%= pb_rails("icon", props: { icon: "calendar", padding_right: "xs" }) %>
|
33
|
-
<%= pb_rails("body", props: { color: "default", text: option[:label] }) %>
|
34
|
-
<% end %>
|
35
|
-
<% end %>
|
36
|
-
<% end %>
|
37
|
-
<% end %>
|
38
|
-
<% end %>
|
39
|
-
|
40
|
-
<%= pb_rails("dropdown", props: { label: "Icon on Right", options: options }) do %>
|
41
|
-
<%= pb_rails("dropdown/dropdown_trigger") %>
|
42
|
-
<%= pb_rails("dropdown/dropdown_container") do %>
|
43
|
-
<% options.each do |option| %>
|
44
|
-
<%= pb_rails("dropdown/dropdown_option", props: { option: option }) do %>
|
45
|
-
<%= pb_rails("flex", props: { align: "center", justify: "between" }) do %>
|
46
|
-
<%= pb_rails("body", props: { color: "default", text: option[:label] }) %>
|
47
|
-
<%= pb_rails("icon", props: { icon: "check" }) %>
|
48
|
-
<% end %>
|
49
|
-
<% end %>
|
50
|
-
<% end %>
|
51
|
-
<% end %>
|
52
|
-
<% end %>
|
@@ -1,99 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Dropdown from '../_dropdown'
|
3
|
-
|
4
|
-
import Body from '../../pb_body/_body'
|
5
|
-
import Flex from '../../pb_flex/_flex'
|
6
|
-
import Icon from '../../pb_icon/_icon'
|
7
|
-
|
8
|
-
const DropdownCustomIconOptions = (props) => {
|
9
|
-
|
10
|
-
const options = [
|
11
|
-
{ label: "Item 1", value: "item-1", id: "1" },
|
12
|
-
{ label: "Item 2", value: "item-2", id: "2" },
|
13
|
-
{ label: "Item 3", value: "item-3", id: "3" },
|
14
|
-
]
|
15
|
-
|
16
|
-
|
17
|
-
return (
|
18
|
-
<div>
|
19
|
-
<Dropdown label="Multiple Icons"
|
20
|
-
options={options}
|
21
|
-
{...props}
|
22
|
-
>
|
23
|
-
{options.map((option) => (
|
24
|
-
<Dropdown.Option key={option.id}
|
25
|
-
option={option}
|
26
|
-
>
|
27
|
-
<Flex align="center"
|
28
|
-
justify="between"
|
29
|
-
>
|
30
|
-
<Flex align="center">
|
31
|
-
<Icon icon="calendar"
|
32
|
-
paddingRight="xs"
|
33
|
-
{...props}
|
34
|
-
/>
|
35
|
-
<Body color="default"
|
36
|
-
text={option.label}
|
37
|
-
{...props}
|
38
|
-
/>
|
39
|
-
</Flex>
|
40
|
-
<Icon icon="check"
|
41
|
-
{...props}
|
42
|
-
/>
|
43
|
-
</Flex>
|
44
|
-
</Dropdown.Option>
|
45
|
-
))}
|
46
|
-
</Dropdown>
|
47
|
-
|
48
|
-
<Dropdown label="Icon on Left"
|
49
|
-
options={options}
|
50
|
-
paddingY="md"
|
51
|
-
{...props}
|
52
|
-
>
|
53
|
-
{options.map((option) => (
|
54
|
-
<Dropdown.Option key={option.id}
|
55
|
-
option={option}
|
56
|
-
>
|
57
|
-
<Flex align="center">
|
58
|
-
<Icon icon="calendar"
|
59
|
-
paddingRight="xs"
|
60
|
-
{...props}
|
61
|
-
/>
|
62
|
-
<Body color="default"
|
63
|
-
text={option.label}
|
64
|
-
{...props}
|
65
|
-
/>
|
66
|
-
</Flex>
|
67
|
-
</Dropdown.Option>
|
68
|
-
))}
|
69
|
-
</Dropdown>
|
70
|
-
|
71
|
-
<Dropdown label="Icon on Right"
|
72
|
-
options={options}
|
73
|
-
{...props}
|
74
|
-
>
|
75
|
-
{options.map((option) => (
|
76
|
-
<Dropdown.Option key={option.id}
|
77
|
-
option={option}
|
78
|
-
>
|
79
|
-
<Flex align="center"
|
80
|
-
justify="between"
|
81
|
-
>
|
82
|
-
<Flex align="center">
|
83
|
-
<Body color="default"
|
84
|
-
text={option.label}
|
85
|
-
{...props}
|
86
|
-
/>
|
87
|
-
</Flex>
|
88
|
-
<Icon icon="check"
|
89
|
-
{...props}
|
90
|
-
/>
|
91
|
-
</Flex>
|
92
|
-
</Dropdown.Option>
|
93
|
-
))}
|
94
|
-
</Dropdown>
|
95
|
-
</div>
|
96
|
-
)
|
97
|
-
}
|
98
|
-
|
99
|
-
export default DropdownCustomIconOptions
|
@@ -1 +0,0 @@
|
|
1
|
-
Use the `dropdown/dropdown_option` subcomponent structure to include custom layouts inside dropdown menus. Icons can be placed alongside the Body label text.
|
@@ -1 +0,0 @@
|
|
1
|
-
Use the `Dropdown.Option` subcomponent structure to include custom layouts inside dropdown menus. Icons can be placed alongside the Body label text.
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
options = [
|
3
|
-
{ label: "Item 1", value: "item-1", id: "1" },
|
4
|
-
{ label: "Item 2", value: "item-2", id: "2" },
|
5
|
-
{ label: "Item 3", value: "item-3", id: "3" }
|
6
|
-
]
|
7
|
-
|
8
|
-
selected_value = params[:selected_value]
|
9
|
-
%>
|
10
|
-
|
11
|
-
<%= pb_rails("dropdown", props: { label: "Choose Item", options: options }) do %>
|
12
|
-
<%= pb_rails("dropdown/dropdown_trigger") %>
|
13
|
-
<%= pb_rails("dropdown/dropdown_container") do %>
|
14
|
-
<% options.each do |option| %>
|
15
|
-
<% checked = (option[:value] == selected_value) %>
|
16
|
-
<%= pb_rails("dropdown/dropdown_option", props: { option: option }) do %>
|
17
|
-
<%= pb_rails("flex", props: { align: "center" }) do %>
|
18
|
-
<%= pb_rails("radio", props: {
|
19
|
-
text: option[:label],
|
20
|
-
name: "dropdown_radio",
|
21
|
-
value: option[:value],
|
22
|
-
checked: checked,
|
23
|
-
}) %>
|
24
|
-
<% end %>
|
25
|
-
<% end %>
|
26
|
-
<% end %>
|
27
|
-
<% end %>
|
28
|
-
<% end %>
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import React, { useState } from 'react'
|
2
|
-
import Dropdown from '../_dropdown'
|
3
|
-
|
4
|
-
import Body from '../../pb_body/_body'
|
5
|
-
import Flex from '../../pb_flex/_flex'
|
6
|
-
import Radio from '../../pb_radio/_radio'
|
7
|
-
|
8
|
-
const DropdownCustomRadioOptions = (props) => {
|
9
|
-
const [selectedValue, setSelectedValue] = useState(null)
|
10
|
-
|
11
|
-
const options = [
|
12
|
-
{ label: "Item 1", value: "item-1", id: "1" },
|
13
|
-
{ label: "Item 2", value: "item-2", id: "2" },
|
14
|
-
{ label: "Item 3", value: "item-3", id: "3" },
|
15
|
-
]
|
16
|
-
|
17
|
-
|
18
|
-
return (
|
19
|
-
<div>
|
20
|
-
<Dropdown
|
21
|
-
label="Select Item"
|
22
|
-
onSelect={(selectedItem) => setSelectedValue(selectedItem?.value)}
|
23
|
-
options={options}
|
24
|
-
{...props}
|
25
|
-
>
|
26
|
-
{options.map((option) => {
|
27
|
-
return (
|
28
|
-
<Dropdown.Option key={option.id}
|
29
|
-
option={option}
|
30
|
-
>
|
31
|
-
<Flex align="center">
|
32
|
-
<Radio
|
33
|
-
checked={selectedValue === option.value}
|
34
|
-
name="dropdown_radio"
|
35
|
-
value={option.value}
|
36
|
-
/>
|
37
|
-
<Body text={option.label} />
|
38
|
-
</Flex>
|
39
|
-
</Dropdown.Option>
|
40
|
-
)
|
41
|
-
})}
|
42
|
-
</Dropdown>
|
43
|
-
</div>
|
44
|
-
)
|
45
|
-
}
|
46
|
-
|
47
|
-
export default DropdownCustomRadioOptions
|
@@ -1 +0,0 @@
|
|
1
|
-
Radio inputs can be used inside `dropdown/dropdown_option` for a custom layout that mimics form-like selection within a dropdown.
|
@@ -1 +0,0 @@
|
|
1
|
-
Radio inputs can be used inside `Dropdown.Option` for a custom layout that mimics form-like selection within a dropdown.
|
@@ -1,224 +0,0 @@
|
|
1
|
-
import React, { useState } from 'react'
|
2
|
-
|
3
|
-
import Filter from '../../pb_filter/_filter'
|
4
|
-
import Select from '../../pb_select/_select'
|
5
|
-
import TextInput from '../../pb_text_input/_text_input'
|
6
|
-
import useCollapsible from '../../pb_collapsible/useCollapsible'
|
7
|
-
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
8
|
-
import Checkbox from '../../pb_checkbox/_checkbox'
|
9
|
-
import Flex from '../../pb_flex/_flex'
|
10
|
-
import Table from '../../pb_table/_table'
|
11
|
-
import Caption from '../../pb_caption/_caption'
|
12
|
-
import Icon from '../../pb_icon/_icon'
|
13
|
-
|
14
|
-
const people = [
|
15
|
-
{ name: 'Hera Syndulla', territory: 'A galaxy far far away, like really far away...', products: ['Insulation'] },
|
16
|
-
{ name: 'Kanan Jarrus', territory: 'USA', products: ['Siding', 'Roofing', 'Gutters'] },
|
17
|
-
{ name: 'C1-10P', territory: 'USA', products: ['Roofing'] },
|
18
|
-
{ name: 'Anakin Skywalker', territory: 'A galaxy far far away, like really far away...', products: ['Doors', 'Windows', 'Solar'] },
|
19
|
-
{ name: 'Leia Organa', territory: 'Canada', products: ['Windows', 'Doors'] },
|
20
|
-
{ name: 'Luke Skywalker', territory: 'Brazil', products: ['Solar', 'Roofing'] },
|
21
|
-
{ name: 'Padmé Amidala', territory: 'Philippines', products: ['Siding', 'Gutters'] },
|
22
|
-
{ name: 'Obi-Wan Kenobi', territory: 'USA', products: ['Windows', 'Siding'] },
|
23
|
-
{ name: 'Ahsoka Tano', territory: 'Canada', products: ['Insulation', 'Solar'] },
|
24
|
-
{ name: 'Boba Fett', territory: 'Brazil', products: ['Roofing', 'Gutters'] },
|
25
|
-
{ name: 'Mace Windu', territory: 'Philippines', products: ['Doors', 'Siding'] },
|
26
|
-
{ name: 'Grogu', territory: 'A galaxy far far away, like really far away...', products: ['Insulation'] },
|
27
|
-
{ name: 'Sabine Wren', territory: 'Canada', products: ['Solar', 'Doors'] },
|
28
|
-
{ name: 'C-3PO', territory: 'Brazil', products: ['Windows'] },
|
29
|
-
{ name: 'R2-D2', territory: 'Philippines', products: ['Doors', 'Gutters'] },
|
30
|
-
]
|
31
|
-
|
32
|
-
const FilterSidebar = (props) => {
|
33
|
-
const [name, setName] = useState('')
|
34
|
-
const [ territory, setTerritory ] = useState('')
|
35
|
-
const [ products, setProducts ] = useState({})
|
36
|
-
const handleUpdateName = ({ target }) => {
|
37
|
-
setName(target.value)
|
38
|
-
}
|
39
|
-
const handleUpdateTerritory = ({ target }) => {
|
40
|
-
setTerritory(target.value)
|
41
|
-
}
|
42
|
-
const handleCheckboxChange = ({ target }) => {
|
43
|
-
setProducts(prev => ({
|
44
|
-
...prev,
|
45
|
-
[target.name]: !prev[target.name],
|
46
|
-
}))
|
47
|
-
}
|
48
|
-
const [isCollapsed, setIsCollapsed] = useCollapsible(true)
|
49
|
-
const [isProductsCollapsed, setIsProductsCollapsed] = useCollapsible(true)
|
50
|
-
const options = [
|
51
|
-
{ value: 'USA' },
|
52
|
-
{ value: 'Canada' },
|
53
|
-
{ value: 'Brazil' },
|
54
|
-
{ value: 'Philippines' },
|
55
|
-
{ value: 'A galaxy far far away, like really far away...' },
|
56
|
-
]
|
57
|
-
|
58
|
-
const filteredPeople = people.filter((person) => {
|
59
|
-
const matchesName = person.name.toLowerCase().includes(name.toLowerCase())
|
60
|
-
|
61
|
-
const matchesTerritory = territory === '' ? true : person.territory === territory
|
62
|
-
|
63
|
-
const matchesProducts = Object.values(products).every((product) => !product) ? true : person.products.some(product => products[product])
|
64
|
-
|
65
|
-
return matchesName && matchesTerritory && matchesProducts
|
66
|
-
})
|
67
|
-
|
68
|
-
return (
|
69
|
-
<>
|
70
|
-
<Flex>
|
71
|
-
<Filter
|
72
|
-
isCollapsed={isCollapsed}
|
73
|
-
marginRight="xs"
|
74
|
-
onCollapse={() => setIsCollapsed(!isCollapsed)}
|
75
|
-
results={filteredPeople.length}
|
76
|
-
sortOptions={{
|
77
|
-
popularity: 'Popularity',
|
78
|
-
// eslint-disable-next-line
|
79
|
-
manager_title: 'Manager\'s Title',
|
80
|
-
// eslint-disable-next-line
|
81
|
-
manager_name: 'Manager\'s Name',
|
82
|
-
}}
|
83
|
-
sortValue={[{ name: 'popularity', dir: 'desc' }]}
|
84
|
-
variant="sidebar"
|
85
|
-
width="xs"
|
86
|
-
{...props}
|
87
|
-
>
|
88
|
-
<Filter.Section
|
89
|
-
collapsed={isCollapsed}
|
90
|
-
headerText="Full Name"
|
91
|
-
>
|
92
|
-
<TextInput
|
93
|
-
onChange={handleUpdateName}
|
94
|
-
placeholder="Enter name"
|
95
|
-
value={name}
|
96
|
-
{...props}
|
97
|
-
/>
|
98
|
-
</Filter.Section>
|
99
|
-
<SectionSeparator />
|
100
|
-
<Filter.Section
|
101
|
-
collapsed={isCollapsed}
|
102
|
-
collapsible
|
103
|
-
headerText="Territory"
|
104
|
-
>
|
105
|
-
<Select
|
106
|
-
blankSelection="Select One..."
|
107
|
-
name="location"
|
108
|
-
onChange={handleUpdateTerritory}
|
109
|
-
options={options}
|
110
|
-
{...props}
|
111
|
-
/>
|
112
|
-
</Filter.Section>
|
113
|
-
<SectionSeparator />
|
114
|
-
<Filter.Section
|
115
|
-
collapsed={isCollapsed}
|
116
|
-
collapsible
|
117
|
-
headerText="Products"
|
118
|
-
>
|
119
|
-
<div>
|
120
|
-
<Checkbox
|
121
|
-
marginBottom="sm"
|
122
|
-
name="Doors"
|
123
|
-
onChange={handleCheckboxChange}
|
124
|
-
text="Doors"
|
125
|
-
/>
|
126
|
-
</div>
|
127
|
-
<div>
|
128
|
-
<Checkbox
|
129
|
-
marginBottom="sm"
|
130
|
-
name="Windows"
|
131
|
-
onChange={handleCheckboxChange}
|
132
|
-
text="Windows"
|
133
|
-
/>
|
134
|
-
</div>
|
135
|
-
<div>
|
136
|
-
<Checkbox
|
137
|
-
marginBottom="sm"
|
138
|
-
name="Siding"
|
139
|
-
onChange={handleCheckboxChange}
|
140
|
-
text="Siding"
|
141
|
-
/>
|
142
|
-
</div>
|
143
|
-
{!isProductsCollapsed &&
|
144
|
-
<>
|
145
|
-
<div>
|
146
|
-
<Checkbox
|
147
|
-
checked={products["Roofing"]}
|
148
|
-
marginBottom="sm"
|
149
|
-
name="Roofing"
|
150
|
-
onChange={handleCheckboxChange}
|
151
|
-
text="Roofing"
|
152
|
-
/>
|
153
|
-
</div>
|
154
|
-
<div>
|
155
|
-
<Checkbox
|
156
|
-
checked={products["Gutters"]}
|
157
|
-
marginBottom="sm"
|
158
|
-
name="Gutters"
|
159
|
-
onChange={handleCheckboxChange}
|
160
|
-
text="Gutters"
|
161
|
-
/>
|
162
|
-
</div>
|
163
|
-
<div>
|
164
|
-
<Checkbox
|
165
|
-
checked={products["Solar"]}
|
166
|
-
marginBottom="sm"
|
167
|
-
name="Solar"
|
168
|
-
onChange={handleCheckboxChange}
|
169
|
-
text="Solar"
|
170
|
-
/>
|
171
|
-
</div>
|
172
|
-
<div>
|
173
|
-
<Checkbox
|
174
|
-
checked={products["Insulation"]}
|
175
|
-
marginBottom="sm"
|
176
|
-
name="Insulation"
|
177
|
-
onChange={handleCheckboxChange}
|
178
|
-
text="Insulation"
|
179
|
-
/>
|
180
|
-
</div>
|
181
|
-
</>
|
182
|
-
}
|
183
|
-
<div onClick={() => setIsProductsCollapsed(!isProductsCollapsed)}>
|
184
|
-
<Flex
|
185
|
-
cursor="pointer"
|
186
|
-
marginBottom="sm"
|
187
|
-
>
|
188
|
-
<Caption
|
189
|
-
color="link"
|
190
|
-
marginRight="xxs"
|
191
|
-
size="xs"
|
192
|
-
text={isProductsCollapsed ? "Show More" : "Show Less"}
|
193
|
-
/>
|
194
|
-
<Icon
|
195
|
-
icon={isProductsCollapsed ? "chevron-down" : "chevron-up"}
|
196
|
-
/>
|
197
|
-
</Flex>
|
198
|
-
</div>
|
199
|
-
</Filter.Section>
|
200
|
-
</Filter>
|
201
|
-
<Table
|
202
|
-
size="sm"
|
203
|
-
>
|
204
|
-
<thead>
|
205
|
-
<tr>
|
206
|
-
<th>{'Name'}</th>
|
207
|
-
<th>{'Territory'}</th>
|
208
|
-
<th>{'Products'}</th>
|
209
|
-
</tr>
|
210
|
-
</thead>
|
211
|
-
<tbody>
|
212
|
-
{filteredPeople.map((person) => (<tr key={person.name}>
|
213
|
-
<td>{ person.name }</td>
|
214
|
-
<td>{ person.territory }</td>
|
215
|
-
<td>{ person.products.join(", ") }</td>
|
216
|
-
</tr>))}
|
217
|
-
</tbody>
|
218
|
-
</Table>
|
219
|
-
</Flex>
|
220
|
-
</>
|
221
|
-
)
|
222
|
-
}
|
223
|
-
|
224
|
-
export default FilterSidebar
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%= pb_rails("button", props: {
|
2
|
-
text: "Click to Open",
|
3
|
-
id: "click-tooltip-trigger-1",
|
4
|
-
variant: "primary"
|
5
|
-
}) %>
|
6
|
-
|
7
|
-
<%= pb_rails("tooltip", props: {
|
8
|
-
trigger_element_selector: "#click-tooltip-trigger-1",
|
9
|
-
tooltip_id: "click-tooltip-1",
|
10
|
-
position: "top",
|
11
|
-
use_click_to_open: true
|
12
|
-
}) do %>
|
13
|
-
Tooltip opened by click! Click trigger again to close.
|
14
|
-
<% end %>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Button from '../../pb_button/_button'
|
3
|
-
import Tooltip from '../_tooltip'
|
4
|
-
import Flex from '../../pb_flex/_flex'
|
5
|
-
|
6
|
-
const TooltipClickOpen = (props) => {
|
7
|
-
return (
|
8
|
-
<Flex flexDirection='row'
|
9
|
-
gap='md'
|
10
|
-
wrap
|
11
|
-
>
|
12
|
-
<Tooltip
|
13
|
-
placement='top'
|
14
|
-
text='Tooltip Opened'
|
15
|
-
useClickToOpen
|
16
|
-
zIndex={10}
|
17
|
-
{...props}
|
18
|
-
>
|
19
|
-
<Button text='Click to Open' />
|
20
|
-
</Tooltip>
|
21
|
-
</Flex>
|
22
|
-
)
|
23
|
-
}
|
24
|
-
|
25
|
-
export default TooltipClickOpen
|
@@ -1 +0,0 @@
|
|
1
|
-
Set the prop `use_click_to_open` as `true` so that the tooltip will only appear when an item is clicked rather than hovered over.
|
@@ -1 +0,0 @@
|
|
1
|
-
Set the prop `useClickToOpen` so that the tooltip will only appear when an item is clicked rather than hovered over.
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
options = [
|
3
|
-
{ label: 'Orange', value: '#FFA500' },
|
4
|
-
{ label: 'Red', value: '#FF0000' },
|
5
|
-
{ label: 'Green', value: '#00FF00' },
|
6
|
-
{ label: 'Blue', value: '#0000FF' },
|
7
|
-
]
|
8
|
-
%>
|
9
|
-
|
10
|
-
<%= pb_rails("typeahead", props: {
|
11
|
-
id: "typeahead-preserve-search-input",
|
12
|
-
is_multi: false,
|
13
|
-
label: "Colors",
|
14
|
-
options: options,
|
15
|
-
placeholder: "Select...",
|
16
|
-
preserve_search_input: true,
|
17
|
-
})
|
18
|
-
%>
|
@@ -1 +0,0 @@
|
|
1
|
-
By default, text is not preserved in the typeahead kit when you click off of the input field. You can utilize the `preserve_search_input` prop in order to prevent text from being cleared when the field loses focus
|
File without changes
|