playbook_ui_docs 14.18.0.pre.rc.4 → 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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
  3. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
  4. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
  6. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
  7. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
  8. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
  10. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
  11. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
  12. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
  13. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
  14. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
  15. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
  16. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
  17. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +2 -3
  18. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +2 -1
  19. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +28 -0
  20. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +42 -0
  21. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +1 -0
  22. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
  23. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
  24. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +14 -0
  25. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +3 -0
  26. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
  27. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +4 -1
  28. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +4 -0
  29. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
  30. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +5 -1
  31. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +34 -0
  32. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +14 -0
  33. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +20 -0
  34. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +14 -0
  35. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  36. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  37. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +117 -0
  38. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +9 -0
  39. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
  40. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -1
  41. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +30 -0
  42. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
  43. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
  44. data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
  45. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +49 -0
  46. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +1 -0
  47. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +81 -0
  48. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +1 -0
  49. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +2 -0
  50. data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
  51. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +8 -1
  52. data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +7 -2
  53. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +9 -1
  54. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +7 -1
  55. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +6 -2
  56. data/dist/playbook-doc.js +2 -2
  57. metadata +21 -2
@@ -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 : "Please make a valid selection"
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,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.
@@ -15,6 +15,7 @@ examples:
15
15
 
16
16
  react:
17
17
  - gauge_default: Default
18
+ - gauge_pb_styles: Playbook Styles
18
19
  - gauge_disable_animation: Disable Animation
19
20
  - gauge_title: Title
20
21
  - gauge_units: Units
@@ -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,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'
@@ -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="Missing phone number."
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="Please make a valid selection"
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="Please make a valid selection"
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="Please enter a valid email address"
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="This field has an 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 [errorState, setErrorState] = useState("Please make a valid selection");
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("Please make a valid selection")
26
+ setErrorState(error)
23
27
  }
24
28
  }, [searchValue])
25
29