playbook_ui_docs 14.18.0 → 14.19.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_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_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_dropdown/docs/_dropdown_error.jsx +4 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +8 -1
- 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 +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83bb09eec4f24bf680adf23f3a5e114f6d8c1a14141f7b1503325f609381d595
|
4
|
+
data.tar.gz: b61c4e8aa1722ecd3113d26e83aed971bbc57510fe2f1d292ef836f502c176a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d6a0a1627676b4c4b56b942fd7a9628ce3842ae780fe9be6e8124012527320703bb5d0c2fca29197fc9660790f573e2aede020e7bcd0b55ca527950c9083aff
|
7
|
+
data.tar.gz: 13e8f7a44ec6ff76f7da043eda697a1e2631607a341cb0d2d337e9b20be39e2c2909d26cb2a1c17f2e1b76bc6b9d8e85acaf6be2d1f563a95181fc7d921d1400
|
@@ -7,7 +7,7 @@
|
|
7
7
|
value: 49,
|
8
8
|
},
|
9
9
|
{
|
10
|
-
name: 'After
|
10
|
+
name: 'After Call',
|
11
11
|
value: 10,
|
12
12
|
}
|
13
13
|
] %>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
chart_data: data_51,
|
19
19
|
id: "with-a-block-2",
|
20
20
|
rounded: true,
|
21
|
-
}) do %>
|
21
|
+
}) do %>
|
22
22
|
<%= pb_rails('title', props: {text: "83", size: 1, tag: 'div'}) %>
|
23
23
|
<% end %>
|
24
24
|
|
@@ -14,7 +14,7 @@ const CircleChartLiveData = (props) => {
|
|
14
14
|
value: 49,
|
15
15
|
},
|
16
16
|
{
|
17
|
-
name: 'After
|
17
|
+
name: 'After Call',
|
18
18
|
value: 10,
|
19
19
|
},
|
20
20
|
])
|
@@ -29,7 +29,7 @@ const CircleChartLiveData = (props) => {
|
|
29
29
|
value: 12,
|
30
30
|
},
|
31
31
|
{
|
32
|
-
name: 'After
|
32
|
+
name: 'After Call',
|
33
33
|
value: 140,
|
34
34
|
},
|
35
35
|
]
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import circleChartTheme from '../circleChartTheme'
|
3
|
+
import Highcharts from "highcharts"
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
5
|
+
|
6
|
+
const data = [
|
7
|
+
{
|
8
|
+
name: 'Waiting for Calls',
|
9
|
+
y: 41,
|
10
|
+
},
|
11
|
+
{
|
12
|
+
name: 'On Call',
|
13
|
+
y: 49,
|
14
|
+
},
|
15
|
+
{
|
16
|
+
name: 'After Call',
|
17
|
+
y: 10,
|
18
|
+
},
|
19
|
+
]
|
20
|
+
|
21
|
+
const baseOptions = {
|
22
|
+
series: [{ data: data }],
|
23
|
+
}
|
24
|
+
|
25
|
+
const CircleChartPbStyles = () => {
|
26
|
+
const options = Highcharts.merge({}, circleChartTheme, baseOptions )
|
27
|
+
|
28
|
+
return (
|
29
|
+
<div>
|
30
|
+
<HighchartsReact
|
31
|
+
highcharts={Highcharts}
|
32
|
+
options={options}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
);
|
36
|
+
};
|
37
|
+
|
38
|
+
export default CircleChartPbStyles;
|
@@ -0,0 +1 @@
|
|
1
|
+
You don't need to use the Circle Chart Kit to apply Playbook styles to your Highcharts circle chart. Just import circleChartTheme.ts and merge it with your chart options—Playbook’s styling will apply automatically.
|
@@ -14,6 +14,7 @@ examples:
|
|
14
14
|
|
15
15
|
react:
|
16
16
|
- circle_chart_default: Default Style
|
17
|
+
- circle_chart_pb_styles: Playbook Styles
|
17
18
|
- circle_chart_live_data: Live Data
|
18
19
|
- circle_chart_rounded: Rounded Corners
|
19
20
|
- circle_chart_block: Accepts Any Block
|
@@ -22,7 +23,5 @@ examples:
|
|
22
23
|
- circle_chart_with_legend_kit: Legend
|
23
24
|
- circle_chart_legend_position: Legend Position
|
24
25
|
- circle_chart_with_title: Title
|
25
|
-
- circle_chart_inner_sizes: Inner Circle Size Options
|
26
|
+
- circle_chart_inner_sizes: Inner Circle Size Options
|
26
27
|
- circle_chart_custom_tooltip: Tooltip Customization
|
27
|
-
|
28
|
-
|
@@ -8,4 +8,5 @@ export { default as CircleChartWithLegendKit } from './_circle_chart_with_legend
|
|
8
8
|
export { default as CircleChartLegendPosition } from './_circle_chart_legend_position.jsx'
|
9
9
|
export { default as CircleChartWithTitle } from './_circle_chart_with_title.jsx'
|
10
10
|
export { default as CircleChartInnerSizes } from './_circle_chart_inner_sizes.jsx'
|
11
|
-
export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
|
11
|
+
export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
|
12
|
+
export { default as CircleChartPbStyles } from "./_circle_chart_pb_styles.jsx"
|
@@ -1,11 +1,14 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
|
3
3
|
import DatePicker from '../_date_picker'
|
4
|
+
import Icon from '../../pb_icon/_icon'
|
4
5
|
|
5
6
|
const DatePickerError = (props) => (
|
6
7
|
<div>
|
7
8
|
<DatePicker
|
8
|
-
error=
|
9
|
+
error={<>
|
10
|
+
<Icon icon="warning" /> Invalid date. Please pick a valid date.
|
11
|
+
</>}
|
9
12
|
pickerId="date-picker-error"
|
10
13
|
{...props}
|
11
14
|
/>
|
@@ -1,3 +1,7 @@
|
|
1
|
+
To use the `quickpick`:
|
2
|
+
- prop `mode` must be set to `range`
|
3
|
+
- prop `selection_type` must be set to `quickpick`
|
4
|
+
|
1
5
|
This date range variant uses hidden inputs to handle start and end dates. While they are not required props, it is advisable to specify a unique `start_date_id`, `start_date_name`, `end_date_id`, and `end_date_name` for each quick pick instance you place in a form and/or on a page.
|
2
6
|
|
3
7
|
Like all other date pickers, the quick pick does require a `picker_id`.
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Use `this_ranges_end_today`/`thisRangesEndToday` to set end date on all ranges that start with 'this' to today's date. For instance, by default 'This Year' will set end day to 12/31/(current year), but if the `this_ranges_end_today`/`thisRangesEndToday` prop is used, end date on that range will be today's date.
|
@@ -1 +1,5 @@
|
|
1
|
-
|
1
|
+
To use the `quickpick`:
|
2
|
+
- prop `mode` must be set to `range`
|
3
|
+
- prop `selectionType` must be set to `quickpick`
|
4
|
+
|
5
|
+
Use the `onClose` handler function to access the startDate and endDate values. Check the [`onClose` example](https://playbook.powerapp.cloud/kits/date_picker/react#onclose) for more information.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import DatePicker from "../_date_picker";
|
3
|
+
|
4
|
+
const DatePickerRangePattern = (props) => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<DatePicker
|
8
|
+
controlsEndId="end-date-picker"
|
9
|
+
controlsStartId="start-date-picker"
|
10
|
+
mode="range"
|
11
|
+
pickerId="quickpick-for-range"
|
12
|
+
placeholder="Select a Range"
|
13
|
+
selectionType="quickpick"
|
14
|
+
{...props}
|
15
|
+
/>
|
16
|
+
|
17
|
+
<DatePicker
|
18
|
+
pickerId="start-date-picker"
|
19
|
+
placeholder="Select a Start Date"
|
20
|
+
syncStartWith="quickpick-for-range"
|
21
|
+
{...props}
|
22
|
+
/>
|
23
|
+
|
24
|
+
<DatePicker
|
25
|
+
pickerId="end-date-picker"
|
26
|
+
placeholder="Select a End Date"
|
27
|
+
syncEndWith="quickpick-for-range"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
</>
|
31
|
+
);
|
32
|
+
};
|
33
|
+
|
34
|
+
export default DatePickerRangePattern;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
You can link a Quickpick DatePicker to standard DatePickers using the following props:
|
2
|
+
|
3
|
+
**For the Quickpick DatePicker**:
|
4
|
+
`controlsStartId`: ID of the DatePicker that should receive the start date.
|
5
|
+
|
6
|
+
`controlsEndId`: ID of the DatePicker that should receive the end date.
|
7
|
+
|
8
|
+
When a quickpick option like “This Year” is selected, it automatically populates the linked start and end inputs.
|
9
|
+
|
10
|
+
**For the Start/End DatePickers**:
|
11
|
+
`syncStartWith`: ID of the quickpick this start date is synced to.
|
12
|
+
`syncEndWith`: ID of the quickpick this end date is synced to.
|
13
|
+
|
14
|
+
When a user manually edits the start or end date, it clears the selected quickpick to prevent conflicting values.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%= pb_rails("date_picker", props: {
|
2
|
+
mode: "range",
|
3
|
+
picker_id: "quick-pick-date-range",
|
4
|
+
placeholder: "Select a Date Range",
|
5
|
+
selection_type: "quickpick",
|
6
|
+
controls_end_id: "quick-pick-date-range-end",
|
7
|
+
controls_start_id: "quick-pick-date-range-start",
|
8
|
+
}) %>
|
9
|
+
|
10
|
+
<%= pb_rails("date_picker", props: {
|
11
|
+
picker_id: "quick-pick-date-range-start",
|
12
|
+
placeholder: "Select a Start Date",
|
13
|
+
sync_start_with:"quick-pick-date-range",
|
14
|
+
}) %>
|
15
|
+
|
16
|
+
<%= pb_rails("date_picker", props: {
|
17
|
+
picker_id: "quick-pick-date-range-end",
|
18
|
+
placeholder: "Select an End Date",
|
19
|
+
sync_end_with:"quick-pick-date-range",
|
20
|
+
}) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
You can link a Quickpick DatePicker to standard DatePickers using the following props:
|
2
|
+
|
3
|
+
**For the Quickpick DatePicker**:
|
4
|
+
`controls_start_id`: ID of the DatePicker that should receive the start date.
|
5
|
+
|
6
|
+
`controls_end_id`: ID of the DatePicker that should receive the end date.
|
7
|
+
|
8
|
+
When a quickpick option like “This Year” is selected, it automatically populates the linked start and end inputs.
|
9
|
+
|
10
|
+
**For the Start/End DatePickers**:
|
11
|
+
`sync_start_with`: ID of the quickpick this start date is synced to.
|
12
|
+
`sync_end_with`: ID of the quickpick this end date is synced to.
|
13
|
+
|
14
|
+
When a user manually edits the start or end date, it clears the selected quickpick to prevent conflicting values.
|
@@ -15,6 +15,7 @@ examples:
|
|
15
15
|
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
16
16
|
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
17
17
|
- date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
|
18
|
+
- date_picker_range_pattern_rails: Range with 2 Date Pickers and a Quick Pick
|
18
19
|
- date_picker_format: Format
|
19
20
|
- date_picker_disabled: Disabled Dates
|
20
21
|
- date_picker_min_max: Min Max
|
@@ -47,6 +48,7 @@ examples:
|
|
47
48
|
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
48
49
|
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
49
50
|
- date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
|
51
|
+
- date_picker_range_pattern: Range with 2 Date Pickers and a Quick Pick
|
50
52
|
- date_picker_format: Format
|
51
53
|
- date_picker_disabled: Disabled Dates
|
52
54
|
- date_picker_min_max: Min Max
|
@@ -26,3 +26,4 @@ export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
|
|
26
26
|
export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_custom'
|
27
27
|
export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'
|
28
28
|
export { default as DatePickerQuickPickDefaultDate } from './_date_picker_quick_pick_default_date'
|
29
|
+
export { default as DatePickerRangePattern } from './_date_picker_range_pattern'
|
@@ -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",
|
@@ -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}
|
@@ -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
|
/>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
|
3
3
|
import TextInput from '../_text_input'
|
4
|
+
import Icon from '../../pb_icon/_icon'
|
4
5
|
|
5
6
|
const TextInputError = (props) => {
|
6
7
|
const [email, setEmail] = useState('')
|
@@ -8,11 +9,18 @@ const TextInputError = (props) => {
|
|
8
9
|
const handleUpdateEmail = ({ target }) => {
|
9
10
|
setEmail(target.value)
|
10
11
|
}
|
12
|
+
|
13
|
+
const error = (
|
14
|
+
<>
|
15
|
+
<Icon icon="warning" /> Please enter a valid email address
|
16
|
+
</>
|
17
|
+
)
|
18
|
+
|
11
19
|
return (
|
12
20
|
<div>
|
13
21
|
<TextInput
|
14
22
|
addOn={{ icon: 'user', alignment: 'left', border: true }}
|
15
|
-
error=
|
23
|
+
error={error}
|
16
24
|
label="Email Address"
|
17
25
|
onChange={handleUpdateEmail}
|
18
26
|
placeholder="Enter email address"
|
@@ -1,15 +1,21 @@
|
|
1
1
|
import React, {useState} from 'react'
|
2
2
|
import Textarea from '../../pb_textarea/_textarea'
|
3
|
+
import Icon from '../../pb_icon/_icon'
|
3
4
|
|
4
5
|
const TextareaError = (props) => {
|
5
6
|
const [value, setValue] = useState('default value text')
|
6
7
|
const handleChange = (event) => {
|
7
8
|
setValue(event.target.value)
|
8
9
|
}
|
10
|
+
const error = (
|
11
|
+
<>
|
12
|
+
<Icon icon="warning" /> This field has an error!
|
13
|
+
</>
|
14
|
+
)
|
9
15
|
return (
|
10
16
|
<div>
|
11
17
|
<Textarea
|
12
|
-
error=
|
18
|
+
error={error}
|
13
19
|
label="Label"
|
14
20
|
name="comment"
|
15
21
|
onChange={(e)=> handleChange(e)}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
2
2
|
|
3
3
|
import Typeahead from '../_typeahead'
|
4
|
+
import Icon from '../../pb_icon/_icon'
|
4
5
|
|
5
6
|
const options = [
|
6
7
|
{ label: 'Orange', value: '#FFA500' },
|
@@ -10,7 +11,10 @@ const options = [
|
|
10
11
|
]
|
11
12
|
|
12
13
|
const TypeaheadErrorState = (props) => {
|
13
|
-
const
|
14
|
+
const error = (<>
|
15
|
+
<Icon icon="warning" /> Please make a valid selection
|
16
|
+
</>)
|
17
|
+
const [errorState, setErrorState] = useState(error);
|
14
18
|
const [searchValue, setSearchValue] = useState(null);
|
15
19
|
|
16
20
|
const handleOnChange = (value) => setSearchValue(value)
|
@@ -19,7 +23,7 @@ const TypeaheadErrorState = (props) => {
|
|
19
23
|
if(searchValue) {
|
20
24
|
setErrorState("")
|
21
25
|
} else {
|
22
|
-
setErrorState(
|
26
|
+
setErrorState(error)
|
23
27
|
}
|
24
28
|
}, [searchValue])
|
25
29
|
|