playbook_ui 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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
  3. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +2 -2
  4. data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +53 -0
  5. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
  6. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
  7. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
  9. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
  11. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
  13. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
  14. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
  15. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
  16. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
  17. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
  18. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
  19. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
  20. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +2 -3
  21. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +2 -1
  22. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +39 -1
  23. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +4 -0
  24. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +9 -1
  25. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +14 -0
  26. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +28 -0
  27. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +42 -0
  28. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +1 -0
  29. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
  30. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
  31. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +14 -0
  32. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +3 -0
  33. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
  34. data/app/pb_kits/playbook/pb_copy_button/index.js +46 -20
  35. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +12 -0
  36. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +12 -0
  37. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +50 -1
  38. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +4 -1
  39. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +4 -0
  40. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
  41. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +5 -1
  42. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +34 -0
  43. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +14 -0
  44. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +20 -0
  45. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +14 -0
  46. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  47. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  48. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +10 -0
  49. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +10 -1
  50. data/app/pb_kits/playbook/pb_dialog/dialog.rb +2 -0
  51. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +117 -0
  52. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +9 -0
  53. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
  54. data/app/pb_kits/playbook/pb_dialog/index.js +106 -14
  55. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +43 -0
  56. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +55 -0
  57. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +1 -0
  58. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -1
  59. data/app/pb_kits/playbook/pb_draggable/draggable.rb +9 -1
  60. data/app/pb_kits/playbook/pb_draggable/index.js +139 -142
  61. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -1
  62. data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +41 -0
  63. data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +1 -0
  64. data/app/pb_kits/playbook/pb_filter/docs/example.yml +1 -0
  65. data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +22 -18
  66. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +30 -0
  67. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
  68. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
  69. data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
  70. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +85 -0
  71. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +52 -0
  72. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +1 -0
  73. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +1 -0
  74. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
  75. data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +110 -0
  76. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +34 -0
  77. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +25 -4
  78. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +49 -0
  79. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +1 -0
  80. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +81 -0
  81. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +1 -0
  82. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +2 -0
  83. data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
  84. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +13 -0
  85. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +3 -1
  86. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +10 -0
  87. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +20 -0
  88. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +1 -0
  89. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +8 -1
  90. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
  91. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  92. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
  93. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +19 -0
  94. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +46 -0
  95. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +1 -0
  96. data/app/pb_kits/playbook/pb_popover/docs/example.yml +1 -0
  97. data/app/pb_kits/playbook/pb_popover/index.ts +13 -1
  98. data/app/pb_kits/playbook/pb_popover/popover.rb +2 -0
  99. data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +7 -2
  100. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +9 -1
  101. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +7 -1
  102. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +6 -2
  103. data/dist/chunks/_typeahead-D8CsVBZO.js +22 -0
  104. data/dist/chunks/_weekday_stacked-CHQsoCdP.js +45 -0
  105. data/dist/chunks/{lib-Cj4H6j1c.js → lib-BmTAc7Nc.js} +1 -1
  106. data/dist/chunks/{pb_form_validation-Bx1OK6xs.js → pb_form_validation-BWjy4bFn.js} +1 -1
  107. data/dist/chunks/vendor.js +1 -1
  108. data/dist/menu.yml +2 -2
  109. data/dist/playbook-doc.js +2 -2
  110. data/dist/playbook-rails-react-bindings.js +1 -1
  111. data/dist/playbook-rails.js +1 -1
  112. data/dist/playbook.css +1 -1
  113. data/lib/playbook/version.rb +2 -2
  114. metadata +42 -8
  115. data/dist/chunks/_typeahead-aRwivA3u.js +0 -22
  116. data/dist/chunks/_weekday_stacked-Bm5175-u.js +0 -45
  117. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors.md → _draggable_drop_zones_colors_react.md} +0 -0
  118. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones.md → _draggable_drop_zones_react.md} +0 -0
@@ -0,0 +1,85 @@
1
+ import colors from '../tokens/exports/_colors.module.scss'
2
+ import typography from '../tokens/exports/_typography.module.scss'
3
+
4
+ const gaugeTheme = {
5
+ title: { text: "" },
6
+ chart: {
7
+ type: "solidgauge",
8
+ events: {
9
+ render() {
10
+ this.container
11
+ const arc = this.container.querySelector('path.gauge-pane');
12
+ if (arc) arc.setAttribute('stroke-linejoin', 'round');
13
+ }
14
+ }
15
+ },
16
+ pane: {
17
+ size: "90%",
18
+ startAngle: -100,
19
+ endAngle: 100,
20
+ background: [
21
+ {
22
+ borderWidth: 20,
23
+ innerRadius: "90%",
24
+ outerRadius: "90%",
25
+ shape: "arc",
26
+ className: "gauge-pane",
27
+ borderColor: colors.border_light,
28
+ borderRadius: '50%',
29
+ },
30
+ ],
31
+ },
32
+ tooltip: {
33
+ backgroundColor: {
34
+ linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
35
+ stops: [
36
+ [0, colors.bg_dark],
37
+ [1, colors.bg_dark],
38
+ ],
39
+ },
40
+ pointFormat:
41
+ '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
42
+ "<b>{point.y}</b>",
43
+ followPointer: true,
44
+ shadow: false,
45
+ borderWidth: 0,
46
+ borderRadius: 10,
47
+ style: {
48
+ fontFamily: typography.font_family_base,
49
+ color: colors.text_dk_default,
50
+ fontWeight: typography.regular,
51
+ fontSize: typography.text_smaller,
52
+ },
53
+ },
54
+ yAxis: {
55
+ min: 0,
56
+ max: 100,
57
+ lineWidth: 0,
58
+ tickPositions: [] as number[],
59
+ },
60
+ plotOptions: {
61
+ solidgauge: {
62
+ borderColor: colors.data_1,
63
+ borderWidth: 20,
64
+ color: colors.data_1,
65
+ radius: 90,
66
+ innerRadius: "90%",
67
+ y: -26,
68
+ dataLabels: {
69
+ borderWidth: 0,
70
+ color: colors.text_lt_default,
71
+ enabled: true,
72
+ format: '<span class="fix">{y:,f}</span>',
73
+ style: {
74
+ fontFamily: typography.font_family_base,
75
+ fontWeight: typography.regular,
76
+ fontSize: typography.heading_2,
77
+ },
78
+ y: -26,
79
+ },
80
+ },
81
+ },
82
+ credits: { enabled: false }
83
+ }
84
+
85
+ export default gaugeTheme;
@@ -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.
@@ -11,6 +11,7 @@ examples:
11
11
 
12
12
  react:
13
13
  - line_graph_default: Default
14
+ - line_graph_pb_styles: Playbook Styles
14
15
  - line_graph_legend: Legend
15
16
  - line_graph_legend_position: Legend Position
16
17
  - line_graph_legend_nonclickable: Legend Nonclickable
@@ -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,110 @@
1
+ import colors from '../tokens/exports/_colors.module.scss'
2
+ import typography from '../tokens/exports/_typography.module.scss'
3
+
4
+ const lineGraphTheme = {
5
+ title: {
6
+ text: "",
7
+ style: {
8
+ color: colors.text_lt_default,
9
+ fontFamily: typography.font_family_base,
10
+ fontWeight: typography.bold,
11
+ fontSize: typography.heading_3,
12
+ },
13
+ },
14
+ subtitle: {
15
+ text: "" ,
16
+ style: {
17
+ fontFamily: typography.font_family_base,
18
+ color: colors.text_lt_light,
19
+ fontWeight: typography.regular,
20
+ fontSize: typography.text_base,
21
+ },
22
+ },
23
+ chart: {
24
+ type: "line",
25
+ },
26
+ tooltip: {
27
+ backgroundColor: {
28
+ linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
29
+ stops: [
30
+ [0, colors.bg_dark],
31
+ [1, colors.bg_dark],
32
+ ],
33
+ },
34
+ followPointer: true,
35
+ shadow: false,
36
+ borderWidth: 0,
37
+ borderRadius: 10,
38
+ style: {
39
+ fontFamily: typography.font_family_base,
40
+ color: colors.text_dk_default,
41
+ fontWeight: typography.regular,
42
+ fontSize: typography.text_smaller,
43
+ },
44
+ },
45
+ plotOptions: {
46
+ line: {
47
+ dataLabels: {
48
+ enabled: false,
49
+ },
50
+ },
51
+ },
52
+ credits: { enabled: false },
53
+ legend: { enabled: false },
54
+ colors: [
55
+ colors.data_1,
56
+ colors.data_2,
57
+ colors.data_3,
58
+ colors.data_4,
59
+ colors.data_5,
60
+ colors.data_6,
61
+ colors.data_7,
62
+ ],
63
+ xAxis: {
64
+ gridLineWidth: 0,
65
+ lineColor: colors.border_light,
66
+ tickColor: colors.border_light,
67
+ labels: {
68
+ style: {
69
+ fontFamily: typography.font_family_base,
70
+ color: colors.text_lt_lighter,
71
+ fontWeight: typography.bold,
72
+ fontSize: typography.text_smaller,
73
+ },
74
+ },
75
+ title: {
76
+ style: {
77
+ color: colors.text_lt_default,
78
+ fontFamily: typography.font_family_base,
79
+ fontWeight: typography.regular,
80
+ fontSize: typography.heading_4,
81
+ },
82
+ },
83
+ },
84
+ yAxis: {
85
+ alternateGridColor: undefined as string | undefined,
86
+ minorTickInterval: null as number | null,
87
+ gridLineColor: colors.border_light,
88
+ minorGridLineColor: colors.border_light,
89
+ lineWidth: 0,
90
+ tickWidth: 0,
91
+ labels: {
92
+ style: {
93
+ fontFamily: typography.font_family_base,
94
+ color: colors.text_lt_lighter,
95
+ fontWeight: typography.bold,
96
+ fontSize: typography.text_smaller,
97
+ },
98
+ },
99
+ title: {
100
+ style: {
101
+ fontFamily: typography.font_family_base,
102
+ color: colors.text_lt_lighter,
103
+ fontWeight: typography.bold,
104
+ fontSize: typography.text_smaller,
105
+ },
106
+ },
107
+ },
108
+ }
109
+
110
+ export default lineGraphTheme;
@@ -88,6 +88,40 @@ $overlay_colors: (
88
88
  }
89
89
  }
90
90
 
91
+ &.overlay-full-screen {
92
+ position: fixed;
93
+ top: 0;
94
+ left: 0;
95
+ right: 0;
96
+ bottom: 0;
97
+ width: 100vw;
98
+ height: 100vh;
99
+ z-index: 9999;
100
+
101
+ &.no_gradient {
102
+ @each $color_name, $color in $overlay_colors {
103
+ &[data-overlay-color="#{$color_name}"] {
104
+ &::before {
105
+ content: "";
106
+ position: absolute;
107
+ top: 0;
108
+ left: 0;
109
+ right: 0;
110
+ bottom: 0;
111
+ background: $color;
112
+ pointer-events: none;
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ @each $key, $value in $opacity {
119
+ &.#{$key}::before {
120
+ opacity: $value;
121
+ }
122
+ }
123
+ }
124
+
91
125
  &.no_gradient {
92
126
  @each $color_name, $color in $overlay_colors {
93
127
  .overlay_#{$color_name} {
@@ -9,6 +9,7 @@ export type OverlayChildrenProps = {
9
9
  children: React.ReactNode[] | React.ReactNode,
10
10
  color: "card_light" | "bg_light" | "card_dark" | "bg_dark" | "black" | "white" | "success" | "error",
11
11
  dynamic?: boolean,
12
+ gradient?: boolean,
12
13
  position: string,
13
14
  size: string,
14
15
  scrollBarNone?: boolean,
@@ -21,6 +22,7 @@ type OverlayProps = {
21
22
  color: "card_light" | "bg_light" | "card_dark" | "bg_dark" | "black" | "white" | "success" | "error",
22
23
  data?: { [key: string]: string },
23
24
  dynamic?: false,
25
+ fullScreen?: boolean,
24
26
  gradient?: boolean,
25
27
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
26
28
  id?: string,
@@ -38,6 +40,7 @@ const Overlay = (props: OverlayProps) => {
38
40
  color = "card_light",
39
41
  data = {},
40
42
  dynamic = false,
43
+ fullScreen = false,
41
44
  gradient = true,
42
45
  htmlOptions = {},
43
46
  id,
@@ -51,8 +54,9 @@ const Overlay = (props: OverlayProps) => {
51
54
  const classes = classnames(
52
55
  buildCss('pb_overlay'),
53
56
  { 'overlay-hide-scrollbar': scrollBarNone },
57
+ { 'overlay-full-screen': fullScreen },
58
+ { 'no_gradient': gradient === false },
54
59
  globalProps(props),
55
- gradient === false ? 'no_gradient' : '',
56
60
  opacity,
57
61
  className
58
62
  )
@@ -64,6 +68,9 @@ const Overlay = (props: OverlayProps) => {
64
68
  }
65
69
 
66
70
  const getSize = () => {
71
+ if (fullScreen) {
72
+ return "100%"
73
+ }
67
74
  return Object.values(layout)[0]
68
75
  }
69
76
 
@@ -75,23 +82,37 @@ const Overlay = (props: OverlayProps) => {
75
82
  {...dataProps}
76
83
  {...htmlProps}
77
84
  className={classes}
85
+ data-overlay-color={color}
78
86
  id={id}
79
- style={dynamicInlineProps}
87
+ style={{
88
+ ...(fullScreen ? {
89
+ position: 'fixed',
90
+ top: 0,
91
+ left: 0,
92
+ right: 0,
93
+ bottom: 0,
94
+ zIndex: 9999,
95
+ '--overlay-color': `var(--${color})`,
96
+ } : {}),
97
+ ...dynamicInlineProps
98
+ }}
80
99
  >
81
100
  {isSizePercentage ?
82
101
  OverlayPercentage({
83
102
  children,
84
103
  color,
104
+ gradient,
85
105
  position: getPosition(),
86
106
  scrollBarNone,
87
- size: getSize()
107
+ size: getSize(),
88
108
  }) : OverlayToken({
89
109
  children,
90
110
  color,
91
111
  dynamic: dynamic,
112
+ gradient,
92
113
  position: getPosition(),
93
114
  scrollBarNone,
94
- size: getSize()
115
+ size: getSize(),
95
116
  })
96
117
  }
97
118
  </div>
@@ -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'
@@ -39,6 +39,9 @@ $flag-min-resolution: 192dpi;
39
39
  color: $charcoal;
40
40
  }
41
41
 
42
+ .iti__country-list {
43
+ min-width: $dropdown-min-width;
44
+ }
42
45
  // iti-spacer-horizontal's default is 8px, or $space_xs
43
46
  .iti__country-list .iti__flag, .iti__country-name {
44
47
  margin-right: $space_xs;
@@ -227,6 +230,16 @@ $flag-min-resolution: 192dpi;
227
230
  .iti__dropdown-content {
228
231
  border-radius: $space_xs;
229
232
  border: 1px solid $border_dark !important;
233
+ .iti__search-input {
234
+ background-color: $bg_dark_card;
235
+ &:hover {
236
+ background-color: $bg_dark_card;
237
+ }
238
+ &:active,
239
+ &:focus {
240
+ background-color: $card_dark;
241
+ }
242
+ }
230
243
  }
231
244
 
232
245
  .iti__divider {
@@ -37,6 +37,7 @@ type PhoneNumberInputProps = {
37
37
  required?: boolean,
38
38
  value?: string,
39
39
  formatAsYouType?: boolean,
40
+ countrySearch?: boolean,
40
41
  }
41
42
 
42
43
  enum ValidationError {
@@ -91,6 +92,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
91
92
  preferredCountries = [],
92
93
  value = "",
93
94
  formatAsYouType = false,
95
+ countrySearch = false,
94
96
  } = props
95
97
 
96
98
  const ariaProps = buildAriaProps(aria)
@@ -242,7 +244,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
242
244
  autoInsertDialCode: false,
243
245
  initialCountry: initialCountry || fallbackCountry,
244
246
  onlyCountries,
245
- countrySearch: false,
247
+ countrySearch: countrySearch,
246
248
  fixDropdownWidth: false,
247
249
  formatAsYouType: formatAsYouType,
248
250
  hiddenInput: hiddenInputs ? () => ({
@@ -0,0 +1,10 @@
1
+ <%= pb_rails("phone_number_input", props: {
2
+ country_search: true,
3
+ id: "country-search",
4
+ }) %>
5
+
6
+ <%= pb_rails("phone_number_input", props: {
7
+ country_search: true,
8
+ id: "country-search-limited",
9
+ only_countries: ["br", "us", "ph", "gb"],
10
+ }) %>
@@ -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="Missing phone number."
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'