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
@@ -25,6 +25,8 @@ module Playbook
25
25
  default: false
26
26
  prop :hidden_inputs, type: Playbook::Props::Boolean,
27
27
  default: false
28
+ prop :country_search, type: Playbook::Props::Boolean,
29
+ default: false
28
30
 
29
31
  def classname
30
32
  generate_classname("pb_phone_number_input")
@@ -45,6 +47,7 @@ module Playbook
45
47
  preferredCountries: preferred_countries,
46
48
  required: required,
47
49
  value: value,
50
+ countrySearch: country_search,
48
51
  }
49
52
  end
50
53
  end
@@ -139,3 +139,22 @@ test("should format phone number as '555-555-5555' with formatAsYouType and 'us'
139
139
 
140
140
  expect(input.value).toBe("555-555-5555");
141
141
  });
142
+
143
+ test("should pass countrySearch prop to component", () => {
144
+ window.intlTelInput = jest.fn(() => ({
145
+ getSelectedCountryData: jest.fn(() => ({})),
146
+ isValidNumber: jest.fn(() => true),
147
+ getValidationError: jest.fn(() => 0),
148
+ }));
149
+
150
+ const props = {
151
+ id: testId,
152
+ countrySearch: true,
153
+ data: { testid: 'phone-input-with-search' }
154
+ };
155
+
156
+ render(<PhoneNumberInput {...props} />);
157
+
158
+ const wrapper = screen.getByTestId('phone-input-with-search');
159
+ expect(wrapper).toBeInTheDocument();
160
+ });
@@ -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
+ &nbsp;
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
+ &nbsp;
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.
@@ -6,6 +6,7 @@ examples:
6
6
  - popover_z_index: Set Z-Index
7
7
  - popover_scroll_height: Scroll and Height Settings
8
8
  - popover_actionable_content: With Actionable Content
9
+ - popover_append_to: Append To
9
10
 
10
11
  react:
11
12
  - popover_default: Default
@@ -13,7 +13,15 @@ export default class PbPopover extends PbEnhancedElement {
13
13
  }
14
14
 
15
15
  moveTooltip() {
16
- document.querySelector('body').appendChild(this.tooltip)
16
+ let container: HTMLElement | null;
17
+
18
+ if (this.appendTo === "parent") {
19
+ container = this.element.parentElement;
20
+ } else if (this.appendTo) {
21
+ container = document.querySelector(this.appendTo);
22
+ }
23
+
24
+ (container || document.body).appendChild(this.tooltip);
17
25
  }
18
26
 
19
27
  connect() {
@@ -108,4 +116,8 @@ export default class PbPopover extends PbEnhancedElement {
108
116
  get closeOnClick() {
109
117
  return this.element.dataset.pbPopoverCloseOnClick
110
118
  }
119
+
120
+ get appendTo() {
121
+ return this.element.dataset.pbPopoverAppendTo;
122
+ }
111
123
  }
@@ -3,6 +3,7 @@
3
3
  module Playbook
4
4
  module PbPopover
5
5
  class Popover < Playbook::KitBase
6
+ prop :append_to, type: Playbook::Props::String, default: "body"
6
7
  prop :position, type: Playbook::Props::Enum,
7
8
  values: %w[top bottom left right top-start top-end bottom-start bottom-end right-start right-end left-start left-end],
8
9
  default: "left"
@@ -47,6 +48,7 @@ module Playbook
47
48
 
48
49
  def data
49
50
  Hash(values[:data]).merge(
51
+ pb_popover_append_to: append_to,
50
52
  pb_popover_kit: true,
51
53
  pb_popover_position: position,
52
54
  pb_popover_trigger_element_id: trigger_element_id,
@@ -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