playbook_ui_docs 14.18.0.pre.rc.4 → 14.18.1.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_circle_chart/docs/_circle_chart_block.html.erb +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
- 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.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +28 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +42 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +1 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +14 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +3 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +4 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +5 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +20 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +117 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +9 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +43 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +55 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +41 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +1 -0
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +30 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +52 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +49 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +81 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +10 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +20 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +8 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +46 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +7 -2
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +9 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +7 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +6 -2
- data/dist/playbook-doc.js +2 -2
- metadata +35 -4
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors.md → _draggable_drop_zones_colors_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones.md → _draggable_drop_zones_react.md} +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
<% data_shadow = [
|
2
|
+
{ id: "51", text: "Task 1" },
|
3
|
+
{ id: "52", text: "Task 2" },
|
4
|
+
{ id: "53", text: "Task 3" }
|
5
|
+
] %>
|
6
|
+
|
7
|
+
<% data_outline = [
|
8
|
+
{ id: "61", text: "Task 1" },
|
9
|
+
{ id: "62", text: "Task 2" },
|
10
|
+
{ id: "63", text: "Task 3" }
|
11
|
+
] %>
|
12
|
+
|
13
|
+
<%= pb_rails("flex", props: { justify: "around" }) do %>
|
14
|
+
<%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
|
15
|
+
<%= pb_rails("draggable", props: { drop_zone_type: "shadow", initial_items: data_shadow }) do %>
|
16
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Shadow", text_align: "center" }) %>
|
17
|
+
<%= pb_rails("draggable/draggable_container", props: { html_options: { style: { width: "200px" } } }) do %>
|
18
|
+
<% data_shadow.each do |item| %>
|
19
|
+
<%= pb_rails("card", props: { drag_id: item[:id], draggable_item: true, margin_bottom: "xs", padding: "xs", padding_right: "xl" }) do %>
|
20
|
+
<%= pb_rails("flex", props: { align_items: "stretch", flex_direction: "column" }) do %>
|
21
|
+
<%= pb_rails("body", props: { text: item[:text] }) %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
|
30
|
+
<%= pb_rails("draggable", props: { drop_zone_type: "outline", initial_items: data_outline }) do %>
|
31
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Outline", text_align: "center" }) %>
|
32
|
+
<%= pb_rails("draggable/draggable_container", props: { html_options: { style: { width: "200px" } } }) do %>
|
33
|
+
<% data_outline.each do |item| %>
|
34
|
+
<%= pb_rails("card", props: { drag_id: item[:id], draggable_item: true, margin_bottom: "xs", padding: "xs", padding_right: "xl" }) do %>
|
35
|
+
<%= pb_rails("flex", props: { align_items: "stretch", flex_direction: "column" }) do %>
|
36
|
+
<%= pb_rails("body", props: { text: item[:text] }) %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
<% end %>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<% initial_items = [
|
2
|
+
{
|
3
|
+
id: "141",
|
4
|
+
url: "https://unsplash.it/500/400/?image=633",
|
5
|
+
},
|
6
|
+
{
|
7
|
+
id: "142",
|
8
|
+
url: "https://unsplash.it/500/400/?image=634",
|
9
|
+
},
|
10
|
+
{
|
11
|
+
id: "143",
|
12
|
+
url: "https://unsplash.it/500/400/?image=637",
|
13
|
+
},
|
14
|
+
] %>
|
15
|
+
|
16
|
+
<% next_init_items = [
|
17
|
+
{
|
18
|
+
id: "151",
|
19
|
+
url: "https://unsplash.it/500/400/?image=633",
|
20
|
+
},
|
21
|
+
{
|
22
|
+
id: "152",
|
23
|
+
url: "https://unsplash.it/500/400/?image=634",
|
24
|
+
},
|
25
|
+
{
|
26
|
+
id: "153",
|
27
|
+
url: "https://unsplash.it/500/400/?image=637",
|
28
|
+
},
|
29
|
+
] %>
|
30
|
+
|
31
|
+
<%= pb_rails("draggable", props: {initial_items: initial_items, drop_zone_type: "shadow", drop_zone_color: "primary"}) do %>
|
32
|
+
<%= pb_rails("draggable/draggable_container") do %>
|
33
|
+
<%= pb_rails("flex", props: { gap: "sm" }) do %>
|
34
|
+
<% initial_items.each do |item| %>
|
35
|
+
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
36
|
+
<%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<br/>
|
44
|
+
|
45
|
+
<%= pb_rails("draggable", props: {initial_items: next_init_items, drop_zone_type: "outline", drop_zone_color: "purple"}) do %>
|
46
|
+
<%= pb_rails("draggable/draggable_container") do %>
|
47
|
+
<%= pb_rails("flex", props: { gap: "sm" }) do %>
|
48
|
+
<% initial_items.each do |item| %>
|
49
|
+
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
50
|
+
<%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
|
51
|
+
<% end %>
|
52
|
+
<% end %>
|
53
|
+
<% end %>
|
54
|
+
<% end %>
|
55
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
The default `color` for Draggable kit drop zones is "neutral", with "primary" or "purple" as additional options.
|
@@ -17,5 +17,6 @@ examples:
|
|
17
17
|
- draggable_with_cards: Draggable with Cards
|
18
18
|
- draggable_with_table: Draggable with Table
|
19
19
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
20
|
+
- draggable_drop_zones: Draggable Drop Zones
|
21
|
+
- draggable_drop_zones_colors: Draggable Drop Zones Colors
|
20
22
|
- draggable_event_listeners: Draggable Event Listeners
|
21
|
-
|
@@ -1,9 +1,12 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
import Dropdown from '../../pb_dropdown/_dropdown'
|
3
|
+
import Icon from '../../pb_icon/_icon'
|
3
4
|
|
4
5
|
const DropdownError = (props) => {
|
5
6
|
const [selectedOption, setSelectedOption] = useState()
|
6
|
-
const error = selectedOption?.value ? null :
|
7
|
+
const error = selectedOption?.value ? null : (<>
|
8
|
+
<Icon icon="warning" /> Please make a valid selection
|
9
|
+
</>)
|
7
10
|
const options = [
|
8
11
|
{
|
9
12
|
label: "United States",
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<%=
|
2
|
+
pb_rails("filter", props: {
|
3
|
+
id: "filter_within_trubo_frames",
|
4
|
+
position: "top",
|
5
|
+
filters: [
|
6
|
+
{ name: "name", value: "John Wick" },
|
7
|
+
{ name: "city", value: "San Francisco"}
|
8
|
+
],
|
9
|
+
sort_menu: [
|
10
|
+
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
11
|
+
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
12
|
+
{ item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
|
13
|
+
],
|
14
|
+
template: "default",
|
15
|
+
results: 1,
|
16
|
+
popover_props: { append_to: "parent" },
|
17
|
+
}) do
|
18
|
+
%>
|
19
|
+
<%
|
20
|
+
example_collection = [
|
21
|
+
OpenStruct.new(name: "USA", value: 1),
|
22
|
+
OpenStruct.new(name: "Canada", value: 2),
|
23
|
+
OpenStruct.new(name: "Brazil", value: 3),
|
24
|
+
OpenStruct.new(name: "Philippines", value: 4),
|
25
|
+
OpenStruct.new(name: "A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...", value: 5)
|
26
|
+
]
|
27
|
+
%>
|
28
|
+
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
29
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
30
|
+
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
|
31
|
+
|
32
|
+
<%= form.actions do |action| %>
|
33
|
+
<%= action.submit props: {
|
34
|
+
text: "Apply",
|
35
|
+
data: {
|
36
|
+
disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
|
37
|
+
},}%>
|
38
|
+
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
By default, the filter popover attaches to the `<body>`. To attach it elsewhere, like inside a Turbo Frame, pass the `append_to` prop through `popover_props`. Set it to `"parent"` to place the tooltip inside its parent element, or pass any CSS selector (`#id` or `.class`) to specify a custom container.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import gaugeTheme from '../gaugeTheme'
|
3
|
+
import Highcharts from "highcharts"
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
5
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
6
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
7
|
+
|
8
|
+
HighchartsMore(Highcharts);
|
9
|
+
SolidGauge(Highcharts);
|
10
|
+
|
11
|
+
const data = [{ name: "Name", y: 45 }]
|
12
|
+
|
13
|
+
const baseOptions = {
|
14
|
+
series: [{ data: data }],
|
15
|
+
};
|
16
|
+
|
17
|
+
const GaugePbStyles = () => {
|
18
|
+
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
19
|
+
|
20
|
+
return (
|
21
|
+
<div>
|
22
|
+
<HighchartsReact
|
23
|
+
highcharts={Highcharts}
|
24
|
+
options={options}
|
25
|
+
/>
|
26
|
+
</div>
|
27
|
+
);
|
28
|
+
};
|
29
|
+
|
30
|
+
export default GaugePbStyles;
|
@@ -0,0 +1 @@
|
|
1
|
+
You don't need to use the Gauge Kit to apply Playbook styles to your Highcharts gauge chart. Just import gaugeTheme.ts and merge it with your chart options—Playbook’s styling will apply automatically.
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export { default as GaugeDefault } from './_gauge_default.jsx'
|
2
|
+
export { default as GaugePbStyles } from './_gauge_pb_styles.jsx'
|
2
3
|
export { default as GaugeDisableAnimation } from './_gauge_disable_animation.jsx'
|
3
4
|
export { default as GaugeFullCircle } from './_gauge_full_circle.jsx'
|
4
5
|
export { default as GaugeHeight } from './_gauge_height.jsx'
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import lineGraphTheme from '../lineGraphTheme'
|
3
|
+
import Highcharts from "highcharts"
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
5
|
+
|
6
|
+
const data = [{
|
7
|
+
name: 'Installation',
|
8
|
+
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
9
|
+
}, {
|
10
|
+
name: 'Manufacturing',
|
11
|
+
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434],
|
12
|
+
}, {
|
13
|
+
name: 'Sales & Distribution',
|
14
|
+
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387],
|
15
|
+
}, {
|
16
|
+
name: 'Project Development',
|
17
|
+
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227],
|
18
|
+
}, {
|
19
|
+
name: 'Other',
|
20
|
+
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111],
|
21
|
+
}]
|
22
|
+
|
23
|
+
const categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
24
|
+
|
25
|
+
const baseOptions = {
|
26
|
+
series: data,
|
27
|
+
title: { text: "Solar Employment Growth by Sector, 2010-2016" },
|
28
|
+
subtitle: { text: "Source: thesolarfoundation.com" },
|
29
|
+
xAxis: {
|
30
|
+
categories: categories,
|
31
|
+
},
|
32
|
+
yAxis: {
|
33
|
+
title: {
|
34
|
+
text: "Number of Employees",
|
35
|
+
},
|
36
|
+
},
|
37
|
+
}
|
38
|
+
|
39
|
+
const LineGraphPbStyles = () => {
|
40
|
+
const options = Highcharts.merge({}, lineGraphTheme, baseOptions)
|
41
|
+
|
42
|
+
return(
|
43
|
+
<div>
|
44
|
+
<HighchartsReact
|
45
|
+
highcharts={Highcharts}
|
46
|
+
options={options}
|
47
|
+
/>
|
48
|
+
</div>
|
49
|
+
)
|
50
|
+
}
|
51
|
+
|
52
|
+
export default LineGraphPbStyles
|
@@ -0,0 +1 @@
|
|
1
|
+
You don't need to use the Line Graph Kit to apply Playbook styles to your Highcharts line graph. Just import lineGraphTheme.ts and merge it with your graph options—Playbook’s styling will apply automatically.
|
@@ -4,3 +4,4 @@ export { default as LineGraphLegendPosition } from './_line_graph_legend_positio
|
|
4
4
|
export { default as LineGraphLegendNonclickable } from './_line_graph_legend_nonclickable.jsx'
|
5
5
|
export { default as LineGraphHeight } from './_line_graph_height.jsx'
|
6
6
|
export { default as LineGraphColors } from './_line_graph_colors.jsx'
|
7
|
+
export { default as LineGraphPbStyles } from './_line_graph_pb_styles.jsx'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import Overlay from '../../pb_overlay/_overlay'
|
3
|
+
import Button from '../../pb_button/_button'
|
4
|
+
import FixedConfirmationToast from '../../pb_fixed_confirmation_toast/_fixed_confirmation_toast'
|
5
|
+
|
6
|
+
const OverlayFullscreenBackground = () => {
|
7
|
+
const [openBackground, setOpenBackground] = useState(false)
|
8
|
+
|
9
|
+
const handleClickBackground = () => {
|
10
|
+
setOpenBackground(true)
|
11
|
+
}
|
12
|
+
|
13
|
+
const handleCloseBackground = () => {
|
14
|
+
setOpenBackground(false)
|
15
|
+
}
|
16
|
+
|
17
|
+
return (
|
18
|
+
<>
|
19
|
+
<div>
|
20
|
+
<Button
|
21
|
+
onClick={handleClickBackground}
|
22
|
+
text="Background Dark"
|
23
|
+
variant="secondary"
|
24
|
+
/>
|
25
|
+
|
26
|
+
{openBackground && (
|
27
|
+
<Overlay
|
28
|
+
color="bg_dark"
|
29
|
+
fullScreen
|
30
|
+
gradient={false}
|
31
|
+
opacity="opacity_4"
|
32
|
+
>
|
33
|
+
<FixedConfirmationToast
|
34
|
+
closeable
|
35
|
+
horizontal='center'
|
36
|
+
onClose={handleCloseBackground}
|
37
|
+
open={openBackground}
|
38
|
+
status="tip"
|
39
|
+
text='Fullscreen Overlay with color set to Background Dark.'
|
40
|
+
vertical='top'
|
41
|
+
/>
|
42
|
+
</Overlay>
|
43
|
+
)}
|
44
|
+
</div>
|
45
|
+
</>
|
46
|
+
)
|
47
|
+
}
|
48
|
+
|
49
|
+
export default OverlayFullscreenBackground
|
@@ -0,0 +1 @@
|
|
1
|
+
The `fullScreen` prop also allows you to use `color` along with it.
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
|
3
|
+
import Overlay from '../../pb_overlay/_overlay'
|
4
|
+
import Button from '../../pb_button/_button'
|
5
|
+
import FixedConfirmationToast from '../../pb_fixed_confirmation_toast/_fixed_confirmation_toast'
|
6
|
+
|
7
|
+
const OverlayFullscreenOpacity = () => {
|
8
|
+
const [openOpacity40, setOpenOpacity40] = useState(false)
|
9
|
+
const [openOpacity80, setOpenOpacity80] = useState(false)
|
10
|
+
|
11
|
+
const handleClickOpacity40 = () => {
|
12
|
+
setOpenOpacity40(true)
|
13
|
+
}
|
14
|
+
const handleCloseOpacity40 = () => {
|
15
|
+
setOpenOpacity40(false)
|
16
|
+
}
|
17
|
+
|
18
|
+
const handleClickOpacity80 = () => {
|
19
|
+
setOpenOpacity80(true)
|
20
|
+
}
|
21
|
+
const handleCloseOpacity80 = () => {
|
22
|
+
setOpenOpacity80(false)
|
23
|
+
}
|
24
|
+
|
25
|
+
return (
|
26
|
+
<>
|
27
|
+
<div>
|
28
|
+
<Button
|
29
|
+
onClick={handleClickOpacity40}
|
30
|
+
text="40% Opacity"
|
31
|
+
variant="secondary"
|
32
|
+
/>
|
33
|
+
{' '}
|
34
|
+
<Button
|
35
|
+
onClick={handleClickOpacity80}
|
36
|
+
text="80% Opacity"
|
37
|
+
variant="secondary"
|
38
|
+
/>
|
39
|
+
|
40
|
+
{openOpacity40 && (
|
41
|
+
<Overlay
|
42
|
+
fullScreen
|
43
|
+
gradient={false}
|
44
|
+
opacity="opacity_4"
|
45
|
+
>
|
46
|
+
<FixedConfirmationToast
|
47
|
+
closeable
|
48
|
+
horizontal='center'
|
49
|
+
onClose={handleCloseOpacity40}
|
50
|
+
open={openOpacity40}
|
51
|
+
status="tip"
|
52
|
+
text='Fullscreen Overlay at 40% Opacity.'
|
53
|
+
vertical='top'
|
54
|
+
/>
|
55
|
+
</Overlay>
|
56
|
+
)}
|
57
|
+
|
58
|
+
{openOpacity80 && (
|
59
|
+
<Overlay
|
60
|
+
fullScreen
|
61
|
+
gradient={false}
|
62
|
+
opacity="opacity_8"
|
63
|
+
>
|
64
|
+
<FixedConfirmationToast
|
65
|
+
closeable
|
66
|
+
display="block"
|
67
|
+
horizontal='center'
|
68
|
+
onClose={handleCloseOpacity80}
|
69
|
+
open={openOpacity80}
|
70
|
+
status="tip"
|
71
|
+
text='Fullscreen Overlay at 80% Opacity.'
|
72
|
+
vertical='top'
|
73
|
+
/>
|
74
|
+
</Overlay>
|
75
|
+
)}
|
76
|
+
</div>
|
77
|
+
</>
|
78
|
+
)
|
79
|
+
}
|
80
|
+
|
81
|
+
export default OverlayFullscreenOpacity
|
@@ -0,0 +1 @@
|
|
1
|
+
To enable the overlay to cover the full size of your screen, you can pass the `fullScreen` prop. You can also pass an opacity along with it.
|
@@ -8,6 +8,8 @@ examples:
|
|
8
8
|
- overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
|
9
9
|
- overlay_toggle: Toggle
|
10
10
|
- overlay_hide_scroll_bar: Hide Scroll Bar
|
11
|
+
- overlay_fullscreen_opacity: Full Page Opacity
|
12
|
+
- overlay_fullscreen_background: Full Page Using Background Color Tokens
|
11
13
|
|
12
14
|
rails:
|
13
15
|
- overlay_default: Default
|
@@ -6,3 +6,5 @@ export { default as OverlayMultiDirectional } from './_overlay_multi_directional
|
|
6
6
|
export { default as OverlayToggle } from './_overlay_toggle.jsx'
|
7
7
|
export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'
|
8
8
|
export { default as OverlayHideScrollBar } from './_overlay_hide_scroll_bar.jsx'
|
9
|
+
export { default as OverlayFullscreenOpacity } from './_overlay_fullscreen_opacity.jsx'
|
10
|
+
export { default as OverlayFullscreenBackground } from './_overlay_fullscreen_background.jsx'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PhoneNumberInput from '../_phone_number_input'
|
3
|
+
|
4
|
+
const PhoneNumberInputCountrySearch = (props) => (
|
5
|
+
<>
|
6
|
+
<PhoneNumberInput
|
7
|
+
countrySearch
|
8
|
+
id='country-search'
|
9
|
+
{...props}
|
10
|
+
/>
|
11
|
+
<PhoneNumberInput
|
12
|
+
countrySearch
|
13
|
+
id='country-search-limited'
|
14
|
+
onlyCountries={["br", "us", "ph", "gb"]}
|
15
|
+
{...props}
|
16
|
+
/>
|
17
|
+
</>
|
18
|
+
)
|
19
|
+
|
20
|
+
export default PhoneNumberInputCountrySearch
|
@@ -0,0 +1 @@
|
|
1
|
+
Set `country_search` / `countrySearch` to true to allow users to search for a specific Country within the dropdown. If the range of countries has been limited, only the selected countries will be searchable.
|
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react";
|
|
3
3
|
import Button from '../../pb_button/_button'
|
4
4
|
import FixedConfirmationToast from '../../pb_fixed_confirmation_toast/_fixed_confirmation_toast'
|
5
5
|
import PhoneNumberInput from '../../pb_phone_number_input/_phone_number_input'
|
6
|
+
import Icon from '../../pb_icon/_icon'
|
6
7
|
|
7
8
|
const PhoneNumberInputValidation = (props) => {
|
8
9
|
const [formErrors, setFormErrors] = useState("");
|
@@ -29,6 +30,12 @@ const PhoneNumberInputValidation = (props) => {
|
|
29
30
|
setShowFormErrors(formErrors.length > 0);
|
30
31
|
}, [formErrors]);
|
31
32
|
|
33
|
+
const error = (
|
34
|
+
<>
|
35
|
+
<Icon icon="warning" /> Missing phone number.
|
36
|
+
</>
|
37
|
+
)
|
38
|
+
|
32
39
|
return (
|
33
40
|
<form
|
34
41
|
action=""
|
@@ -43,7 +50,7 @@ const PhoneNumberInputValidation = (props) => {
|
|
43
50
|
/>
|
44
51
|
)}
|
45
52
|
<PhoneNumberInput
|
46
|
-
error=
|
53
|
+
error={error}
|
47
54
|
id="validation"
|
48
55
|
initialCountry={countryCode}
|
49
56
|
onChange={handleOnChange}
|
@@ -9,6 +9,7 @@ examples:
|
|
9
9
|
- phone_number_input_clear_field: Clearing the Input Field
|
10
10
|
- phone_number_input_access_input_element: Accessing the Input Element
|
11
11
|
- phone_number_input_format: Format as You Type
|
12
|
+
- phone_number_input_country_search: Country Search
|
12
13
|
|
13
14
|
rails:
|
14
15
|
- phone_number_input_default: Default
|
@@ -18,4 +19,5 @@ examples:
|
|
18
19
|
- phone_number_input_validation: Form Validation
|
19
20
|
- phone_number_input_format: Format as You Type
|
20
21
|
- phone_number_input_hidden_inputs: Hidden Inputs
|
22
|
+
- phone_number_input_country_search: Country Search
|
21
23
|
|
@@ -6,3 +6,4 @@ export { default as PhoneNumberInputValidation } from './_phone_number_input_val
|
|
6
6
|
export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
|
7
7
|
export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
|
8
8
|
export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
|
9
|
+
export { default as PhoneNumberInputCountrySearch } from './_phone_number_input_country_search'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<%= pb_rails("flex", props: {
|
2
|
+
dark: true,
|
3
|
+
orientation: "row",
|
4
|
+
vertical: "center",
|
5
|
+
margin_bottom: "md"
|
6
|
+
}) do %>
|
7
|
+
<%= pb_rails("body", props: { text: "Click info for more details" }) %>
|
8
|
+
|
9
|
+
<%= pb_rails("circle_icon_button", props: {
|
10
|
+
variant: "secondary",
|
11
|
+
icon: "info",
|
12
|
+
id: "append-to-popover-1"
|
13
|
+
}) %>
|
14
|
+
<%= pb_rails("popover", props: {
|
15
|
+
trigger_element_id: "append-to-popover-1",
|
16
|
+
tooltip_id: "append-to-tooltip-1",
|
17
|
+
offset: true,
|
18
|
+
position: "top",
|
19
|
+
append_to: "parent",
|
20
|
+
}) do %>
|
21
|
+
I'm a popover. I have been appended to my parent element.
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<%= pb_rails("flex", props: {
|
26
|
+
dark: true,
|
27
|
+
orientation: "row",
|
28
|
+
vertical: "center"
|
29
|
+
}) do %>
|
30
|
+
<%= pb_rails("body", props: { text: "Click info for more details" }) %>
|
31
|
+
|
32
|
+
<%= pb_rails("circle_icon_button", props: {
|
33
|
+
variant: "secondary",
|
34
|
+
icon: "info",
|
35
|
+
id: "append-to-popover-2"
|
36
|
+
}) %>
|
37
|
+
<%= pb_rails("popover", props: {
|
38
|
+
trigger_element_id: "append-to-popover-2",
|
39
|
+
tooltip_id: "append-to-tooltip-2",
|
40
|
+
offset: true,
|
41
|
+
position: "top",
|
42
|
+
append_to: ".kit-show-wrapper",
|
43
|
+
}) do %>
|
44
|
+
I'm a popover. I have been appended to the .kit-show-wrapper.
|
45
|
+
<% end %>
|
46
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
By default, the popover tooltip attaches to the `<body>`. To attach it elsewhere, use the `append_to` prop. Set it to `"parent"` to place the tooltip inside its parent element, or pass any CSS selector (`#id` or `.class`) to specify a custom container.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import Body from '../../pb_body/_body'
|
3
3
|
import Select from '../../pb_select/_select'
|
4
|
+
import Icon from '../../pb_icon/_icon'
|
4
5
|
|
5
6
|
const SelectError = (props) => {
|
6
7
|
const options = [
|
@@ -18,10 +19,14 @@ const SelectError = (props) => {
|
|
18
19
|
},
|
19
20
|
]
|
20
21
|
|
22
|
+
const error = (<>
|
23
|
+
<Icon icon="warning" /> Please make a valid selection
|
24
|
+
</>)
|
25
|
+
|
21
26
|
return (
|
22
27
|
<div>
|
23
28
|
<Select
|
24
|
-
error=
|
29
|
+
error={error}
|
25
30
|
label="Favorite Food"
|
26
31
|
name="food"
|
27
32
|
options={options}
|
@@ -29,7 +34,7 @@ const SelectError = (props) => {
|
|
29
34
|
{...props}
|
30
35
|
/>
|
31
36
|
<Body
|
32
|
-
error=
|
37
|
+
error={error}
|
33
38
|
status="negative"
|
34
39
|
{...props}
|
35
40
|
/>
|