playbook_ui_docs 14.18.0.pre.alpha.play2149overlaykitdynamicbug7619 → 14.18.0.pre.alpha.revert4567revert4553PLAY2056ATcolbordercolors7469

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +6 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_react.jsx → _advanced_table_selectable_rows_no_subrows.jsx} +2 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +2 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -4
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -1
  8. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +2 -2
  9. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +1 -22
  10. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -2
  11. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
  12. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +2 -5
  13. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +64 -17
  14. data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_autocomplete_with_subcomponents.jsx → _dropdown_with_autocomplete_and_custom_display.jsx} +25 -11
  15. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +1 -0
  16. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx +79 -0
  17. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -7
  18. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -2
  19. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +1 -1
  20. data/app/pb_kits/playbook/pb_select/docs/_select_error.html.erb +1 -1
  21. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +7 -7
  22. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +1 -1
  23. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.html.erb +1 -5
  24. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb +1 -8
  25. data/dist/playbook-doc.js +1 -1
  26. metadata +11 -22
  27. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.html.erb +0 -55
  28. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line_rails.md +0 -5
  29. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_rails.md +0 -5
  30. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.jsx +0 -59
  31. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md +0 -1
  32. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +0 -28
  33. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +0 -58
  34. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.md +0 -1
  35. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.md +0 -1
  36. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +0 -61
  37. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.md +0 -2
  38. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +0 -52
  39. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.md +0 -2
  40. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_rails.html.erb → _advanced_table_selectable_rows.html.erb} +0 -0
  41. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_rails.html.erb → _advanced_table_selectable_rows_no_subrows.html.erb} +0 -0
  42. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
  43. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_line_react.md → _draggable_drop_zones_line.md} +0 -0
  44. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_event_listeners_rails.md → _draggable_event_listeners.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4f5097456169ec2e1f15739618585856bdf21a7881a19a6058aa1d5d16c4238
4
- data.tar.gz: c90b0404fe4e8e4b91baf5703cc4947c69dd55c1e73063b7ccba1a63b8a35c31
3
+ metadata.gz: 0f74313cf69e4a7ebb2200402fbaed0b99e9f89b94a69954079a1153b6c48743
4
+ data.tar.gz: 602871eddcf556ef7f26449aa460baff9be835ee8189cd8392f9a60ca19e9fd0
5
5
  SHA512:
6
- metadata.gz: fcf2bf4cd2871a514a0de0dd4f54ae0cbcad453fc61838995c237b5c1dcd2c8fad9b5f1b91c0089a7cf57aa8d5450367e92f11e3d8164dee400236a9ae2bcc55
7
- data.tar.gz: 450ca4e999393de45cae446181e50db44631be4daaa281fd5f2e819a005913b25c2435c2fe1c35864f79d2cd928b7ad5ab91b544d820eb8df8bd479d78c38760
6
+ metadata.gz: 2804f4a7e6ee8c14ae6249237c23c0ae3dd445a47834625f4d2396dcf767b82da7ca1d86646cfbf82d6f90bcb0332a7545154b93ee8c5054b652da818708485d
7
+ data.tar.gz: f9760df3c5c9b2382d70807c2f82d9249f3ff762624d4a3198496b0cdf7ee6616b586fa034a844503d969d79aef5b44fe319ee60f26cea7e3c569d4cd5d3bc79
@@ -1,3 +1,9 @@
1
+ **BETA VERSION**
2
+ This kit's Rails version is currently under development. Some features may not work as expected, and breaking changes may still occur; use with caution.
3
+ <br />
4
+ <br />
5
+ <br />
6
+
1
7
  The AdvancedTable kit accepts tree data and automatically renders expansion controls for nested subrows, to any depth, based on the data it is given. In it's simplest form, __the kit has two required props__:
2
8
 
3
9
  ### table_data
@@ -2,7 +2,7 @@ import React from "react"
2
2
  import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
3
  import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
4
4
 
5
- const AdvancedTableSelectableRowsNoSubrowsReact = (props) => {
5
+ const AdvancedTableSelectableRowsNoSubrows = (props) => {
6
6
  const columnDefinitions = [
7
7
  {
8
8
  accessor: "year",
@@ -49,4 +49,4 @@ const AdvancedTableSelectableRowsNoSubrowsReact = (props) => {
49
49
  )
50
50
  }
51
51
 
52
- export default AdvancedTableSelectableRowsNoSubrowsReact
52
+ export default AdvancedTableSelectableRowsNoSubrows
@@ -1,5 +1 @@
1
- `selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
2
-
3
- The data attribute `data-selected-rows` on the parent `pb_advanced_table` div will update dynamically with each selection to show an array of ids corresponding to the current selection.
4
-
5
- __NOTE__: Each object within the `table_data` Array must contain a unique id in order to attach an id to all Rows for this to function.
1
+ `selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
@@ -2,6 +2,5 @@
2
2
 
3
3
  When a parent row is clicked, it will check all nested children rows, Children rows can be manually checked or unchecked as well.
4
4
 
5
- The data attribute `data-selected-rows` on the parent `pb_advanced_table` div will update dynamically with each selection to show an array of ids corresponding to the current selection.
6
-
7
- __NOTE__: Each object within the `table_data` Array must contain a unique id in order to attach an id to all Rows for this to function.
5
+ __ALERT TO DEVS__: UPDATE THIS PARAGRAPH IN THE FOLLOW UP STORY WHEN CHECKBOX FUNCTIONALITY IS SET PLEASE
6
+ The `onRowSelectionChange` prop returns an array of ids of all Rows that have been selected. Open the console on this example and check and uncheck checkboxes to see this is action! __NOTE__: Each object within the `tableData`Array must contain a unique id in order to attach an id to all Rows for this to function.
@@ -12,9 +12,10 @@ examples:
12
12
  - advanced_table_custom_cell_rails: Custom Components for Cells
13
13
  - advanced_table_column_headers: Multi-Header Columns
14
14
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
15
+ # - advanced_table_selectable_rows: Selectable Rows
16
+ # - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
15
17
  - advanced_table_column_border_color_rails: Column Group Border Color
16
- - advanced_table_selectable_rows_rails: Selectable Rows
17
- - advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
18
+
18
19
 
19
20
  react:
20
21
  - advanced_table_default: Default (Required Props)
@@ -39,11 +40,11 @@ examples:
39
40
  - advanced_table_column_headers: Multi-Header Columns
40
41
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
41
42
  - advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
42
- - advanced_table_column_border_color: Column Group Border Color
43
43
  # - advanced_table_no_subrows: Table with No Subrows
44
44
  - advanced_table_selectable_rows: Selectable Rows
45
- - advanced_table_selectable_rows_no_subrows_react: Selectable Rows (No Subrows)
45
+ - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
46
46
  - advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
47
47
  - advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
48
48
  - advanced_table_inline_editing: Inline Cell Editing
49
49
  - advanced_table_fullscreen: Fullscreen
50
+ - advanced_table_column_border_color: Column Group Border Color
@@ -15,7 +15,7 @@ export { default as AdvancedTablePaginationWithProps } from './_advanced_table_p
15
15
  export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
16
16
  export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
17
17
  export { default as AdvancedTableSelectableRows } from './_advanced_table_selectable_rows.jsx'
18
- export { default as AdvancedTableSelectableRowsNoSubrowsReact } from './_advanced_table_selectable_rows_no_subrows_react.jsx'
18
+ export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
19
19
  export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
20
20
  export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
21
21
  export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
@@ -1,4 +1,4 @@
1
- <%= pb_rails("date_picker", props: {
2
- error: raw(pb_rails("icon", props: { icon: "warning" }) + " Invalid date. Please pick a valid date."),
1
+ <%= pb_rails("date_picker", props: {
2
+ error: "Invalid date. Please pick a valid date.",
3
3
  picker_id: "date-picker-error"
4
4
  }) %>
@@ -10,13 +10,7 @@
10
10
  { id: "63", text: "Task 3" }
11
11
  ] %>
12
12
 
13
- <% data_line = [
14
- { id: "71", text: "Task 1" },
15
- { id: "72", text: "Task 2" },
16
- { id: "73", text: "Task 3" }
17
- ] %>
18
-
19
- <%= pb_rails("flex", props: { justify: "between" }) do %>
13
+ <%= pb_rails("flex", props: { justify: "around" }) do %>
20
14
  <%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
21
15
  <%= pb_rails("draggable", props: { drop_zone_type: "shadow", initial_items: data_shadow }) do %>
22
16
  <%= pb_rails("caption", props: { margin_bottom: "xs", text: "Shadow", text_align: "center" }) %>
@@ -46,19 +40,4 @@
46
40
  <% end %>
47
41
  <% end %>
48
42
  <% end %>
49
-
50
- <%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
51
- <%= pb_rails("draggable", props: { drop_zone_type: "line", initial_items: data_line }) do %>
52
- <%= pb_rails("caption", props: { margin_bottom: "xs", text: "Line", text_align: "center" }) %>
53
- <%= pb_rails("draggable/draggable_container", props: { drop_zone_direction: "vertical", html_options: { style: { width: "200px" } } }) do %>
54
- <% data_line.each do |item| %>
55
- <%= pb_rails("card", props: { drag_id: item[:id], draggable_item: true, margin_bottom: "xs", padding: "xs", padding_right: "xl", drop_zone_line_color: "primary" }) do %>
56
- <%= pb_rails("flex", props: { align_items: "stretch", flex_direction: "column" }) do %>
57
- <%= pb_rails("body", props: { text: item[:text] }) %>
58
- <% end %>
59
- <% end %>
60
- <% end %>
61
- <% end %>
62
- <% end %>
63
- <% end %>
64
43
  <% end %>
@@ -9,7 +9,6 @@ examples:
9
9
  - draggable_drop_zones: Draggable Drop Zones
10
10
  - draggable_drop_zones_colors: Draggable Drop Zones Colors
11
11
  - draggable_drop_zones_line: Draggable Drop Zones Line
12
- - draggable_event_listeners: Draggable Event Listeners
13
12
 
14
13
  rails:
15
14
  - draggable_default: Default
@@ -20,5 +19,4 @@ examples:
20
19
  - draggable_multiple_containers: Dragging Across Multiple Containers
21
20
  - draggable_drop_zones: Draggable Drop Zones
22
21
  - draggable_drop_zones_colors: Draggable Drop Zones Colors
23
- - draggable_drop_zones_line: Draggable Drop Zones Line
24
22
  - draggable_event_listeners: Draggable Event Listeners
@@ -6,5 +6,4 @@ export { default as DraggableMultipleContainers } from './_draggable_multiple_co
6
6
  export { default as DraggableWithTable } from './_draggable_with_table.jsx'
7
7
  export { default as DraggableDropZones } from './_draggable_drop_zones.jsx'
8
8
  export { default as DraggableDropZonesColors } from './_draggable_drop_zones_colors.jsx'
9
- export { default as DraggableDropZonesLine } from './_draggable_drop_zones_line.jsx'
10
- export { default as DraggableEventListeners } from './_draggable_event_listeners.jsx'
9
+ export { default as DraggableDropZonesLine } from './_draggable_drop_zones_line.jsx'
@@ -1,4 +1,4 @@
1
- <%
1
+ <%
2
2
  options = [
3
3
  { label: 'United States', value: 'United States', id: 'us' },
4
4
  { label: 'Canada', value: 'Canada', id: 'ca' },
@@ -6,7 +6,4 @@
6
6
  ]
7
7
  %>
8
8
 
9
- <%= pb_rails("dropdown", props: {
10
- error: raw(pb_rails("icon", props: { icon: "warning" }) + " Please make a valid selection"),
11
- options: options
12
- }) %>
9
+ <%= pb_rails("dropdown", props: { error: "Please make a valid selection", options: options }) %>
@@ -1,39 +1,86 @@
1
1
  import React from 'react'
2
2
 
3
3
  import Dropdown from '../../pb_dropdown/_dropdown'
4
+ import Badge from '../../pb_badge/_badge'
5
+ import FlexItem from '../../pb_flex/_flex_item'
6
+ import User from '../../pb_user/_user'
4
7
 
5
8
  const DropdownWithAutocomplete = (props) => {
6
9
 
7
10
  const options = [
8
11
  {
9
- label: "United States",
10
- value: "United States",
11
- areaCode: "+1",
12
- icon: "🇺🇸",
13
- id: "us"
12
+ label: "Jasper Furniss",
13
+ value: "Jasper Furniss",
14
+ territory: "PHL",
15
+ title: "Lead UX Engineer",
16
+ id: "jasper-furniss",
17
+ status: "Offline"
14
18
  },
15
19
  {
16
- label: "United Kingdom",
17
- value: "United Kingdom",
18
- areaCode: "+44",
19
- icon: "🇬🇧",
20
- id: "gb"
20
+ label: "Ramon Ruiz",
21
+ value: "Ramon Ruiz",
22
+ territory: "PHL",
23
+ title: "Senior UX Designer",
24
+ id: "ramon-ruiz",
25
+ status: "Away"
21
26
  },
22
27
  {
23
- label: "Pakistan",
24
- value: "Pakistan",
25
- areaCode: "+92",
26
- icon: "🇵🇰",
27
- id: "pk"
28
+ label: "Carlos Lima",
29
+ value: "Carlos Lima",
30
+ territory: "PHL",
31
+ title: "Nitro Developer",
32
+ id: "carlos-lima",
33
+ status: "Online"
34
+ },
35
+ {
36
+ label: "Courtney Long",
37
+ value: "Courtney Long",
38
+ territory: "PHL",
39
+ title: "Lead UX Designer",
40
+ id: "courtney-long",
41
+ status: "Online"
28
42
  }
29
- ]
43
+ ];
44
+
30
45
 
31
46
  return (
32
47
  <div>
33
48
  <Dropdown autocomplete
34
49
  options={options}
35
50
  {...props}
36
- />
51
+ >
52
+ {options.map((option) => (
53
+ <Dropdown.Option key={option.id}
54
+ option={option}
55
+ >
56
+ <>
57
+ <FlexItem>
58
+ <User
59
+ align="left"
60
+ avatar
61
+ name={option.label}
62
+ orientation="horizontal"
63
+ territory={option.territory}
64
+ title={option.title}
65
+ />
66
+ </FlexItem>
67
+ <FlexItem>
68
+ <Badge
69
+ rounded
70
+ text={option.status}
71
+ variant={`${
72
+ option.status === "Offline"
73
+ ? "neutral"
74
+ : option.status === "Online"
75
+ ? "success"
76
+ : "warning"
77
+ }`}
78
+ />
79
+ </FlexItem>
80
+ </>
81
+ </Dropdown.Option>
82
+ ))}
83
+ </Dropdown>
37
84
  </div>
38
85
  )
39
86
  }
@@ -1,13 +1,15 @@
1
- import React from 'react'
1
+ import React, { useState } from 'react'
2
2
 
3
- import Dropdown from '../_dropdown'
3
+ import Dropdown from '../../pb_dropdown/_dropdown'
4
4
  import Badge from '../../pb_badge/_badge'
5
- import Flex from '../../pb_flex/_flex'
6
5
  import FlexItem from '../../pb_flex/_flex_item'
6
+ import Avatar from '../../pb_avatar/_avatar'
7
7
  import User from '../../pb_user/_user'
8
8
 
9
9
 
10
- const DropdownWithAutocompleteWithSubcomponents = (props) => {
10
+ const DropdownWithAutocompleteAndCustomDisplay = (props) => {
11
+ const [selectedOption, setSelectedOption] = useState();
12
+
11
13
  const options = [
12
14
  {
13
15
  label: "Jasper Furniss",
@@ -43,21 +45,34 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
43
45
  }
44
46
  ];
45
47
 
48
+ const CustomDisplay = () => {
49
+ return (
50
+ <>
51
+ {
52
+ selectedOption && (
53
+ <Avatar
54
+ name={selectedOption.label}
55
+ size="xs"
56
+ />
57
+ )
58
+ }
59
+ </>
60
+ )
61
+ };
46
62
 
47
63
  return (
48
64
  <div>
49
65
  <Dropdown autocomplete
66
+ onSelect={(selectedItem) => setSelectedOption(selectedItem)}
50
67
  options={options}
51
68
  {...props}
52
69
  >
70
+ <Dropdown.Trigger customDisplay={<CustomDisplay/>} />
53
71
  {options.map((option) => (
54
72
  <Dropdown.Option key={option.id}
55
73
  option={option}
56
74
  >
57
- <Flex
58
- align="center"
59
- justify="between"
60
- >
75
+ <>
61
76
  <FlexItem>
62
77
  <User
63
78
  align="left"
@@ -70,7 +85,6 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
70
85
  </FlexItem>
71
86
  <FlexItem>
72
87
  <Badge
73
- dark
74
88
  rounded
75
89
  text={option.status}
76
90
  variant={`${
@@ -82,7 +96,7 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
82
96
  }`}
83
97
  />
84
98
  </FlexItem>
85
- </Flex>
99
+ </>
86
100
  </Dropdown.Option>
87
101
  ))}
88
102
  </Dropdown>
@@ -90,4 +104,4 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
90
104
  )
91
105
  }
92
106
 
93
- export default DropdownWithAutocompleteWithSubcomponents
107
+ export default DropdownWithAutocompleteAndCustomDisplay
@@ -0,0 +1 @@
1
+ `autocomplete` prop can also be used in conjunction with the `customDisplay` prop.
@@ -0,0 +1,79 @@
1
+ import React, { useRef } from 'react'
2
+
3
+ import Dropdown from '../../pb_dropdown/_dropdown'
4
+ import useDropdown from '../../pb_dropdown/hooks/useDropdown'
5
+ import CircleIconButton from '../../pb_circle_icon_button/_circle_icon_button'
6
+ import FlexItem from '../../pb_flex/_flex_item'
7
+ import Icon from '../../pb_icon/_icon'
8
+ import Body from '../../pb_body/_body'
9
+ import Flex from '../../pb_flex/_flex'
10
+
11
+ const DropdownWithHook = (props) => {
12
+ const [isDropDownClosed, setIsDropdownClosed] = useDropdown(true);
13
+ const buttonRef = useRef(null);
14
+
15
+ const options = [
16
+ {
17
+ label: "United States",
18
+ value: "United States",
19
+ areaCode: "+1",
20
+ icon: "🇺🇸",
21
+ id: "United-states"
22
+ },
23
+ {
24
+ label: "Canada",
25
+ value: "Canada",
26
+ areaCode: "+1",
27
+ icon: "🇨🇦",
28
+ id: "canada"
29
+ },
30
+ {
31
+ label: "Pakistan",
32
+ value: "Pakistan",
33
+ areaCode: "+92",
34
+ icon: "🇵🇰",
35
+ id: "pakistan"
36
+ }
37
+ ];
38
+
39
+ return (
40
+ <div>
41
+ <CircleIconButton
42
+ htmlOptions={{ref: buttonRef}}
43
+ icon={"flag"}
44
+ onClick={() => setIsDropdownClosed(!isDropDownClosed)}
45
+ variant="secondary"
46
+ />
47
+ <Dropdown
48
+ isClosed={isDropDownClosed}
49
+ options={options}
50
+ triggerRef={buttonRef}
51
+ {...props}
52
+ >
53
+ {options.map((option) => (
54
+ <Dropdown.Option key={option.id}
55
+ option={option}
56
+ >
57
+ <>
58
+ <FlexItem>
59
+ <Flex paddingRight='md'>
60
+ <Icon icon={option.icon}
61
+ paddingRight="xs"
62
+ />
63
+ <Body text={option.label} />
64
+ </Flex>
65
+ </FlexItem>
66
+ <FlexItem>
67
+ <Body color="light"
68
+ text={option.areaCode}
69
+ />
70
+ </FlexItem>
71
+ </>
72
+ </Dropdown.Option>
73
+ ))}
74
+ </Dropdown>
75
+ </div>
76
+ )
77
+ }
78
+
79
+ export default DropdownWithHook
@@ -1,15 +1,12 @@
1
1
  examples:
2
2
  rails:
3
3
  - dropdown_default: Default
4
- - dropdown_with_autocomplete: Autocomplete
5
4
  - dropdown_subtle_variant: Subtle Variant
6
5
  - dropdown_subcomponent_structure_rails: Subcomponent Structure
7
- - dropdown_with_autocomplete_with_subcomponents: Autocomplete with Subcomponent Structure
8
6
  - dropdown_with_label: With Label
9
7
  - dropdown_with_custom_options_rails: Custom Options
10
8
  - dropdown_with_custom_display_rails: Custom Display
11
9
  - dropdown_with_custom_trigger_rails: Custom Trigger
12
- - dropdown_with_search_rails: Custom Trigger Dropdown with Search
13
10
  - dropdown_with_custom_padding: Custom Option Padding
14
11
  - dropdown_error: Dropdown with Error
15
12
  - dropdown_default_value: Default Value
@@ -18,20 +15,20 @@ examples:
18
15
 
19
16
  react:
20
17
  - dropdown_default: Default
21
- - dropdown_with_autocomplete: Autocomplete
22
18
  - dropdown_subtle_variant: Subtle Variant
23
19
  - dropdown_subcomponent_structure: Subcomponent Structure
24
- - dropdown_with_autocomplete_with_subcomponents: Autocomplete with Subcomponent Structure
25
20
  - dropdown_with_label: With Label
26
21
  - dropdown_with_custom_options: Custom Options
27
22
  - dropdown_with_custom_display: Custom Display
28
23
  - dropdown_with_custom_trigger: Custom Trigger
29
- - dropdown_with_search: Custom Trigger Dropdown with Search
30
24
  - dropdown_with_custom_padding: Custom Option Padding
31
25
  - dropdown_error: Dropdown with Error
32
26
  - dropdown_default_value: Default Value
33
27
  - dropdown_blank_selection: Blank Selection
34
28
  - dropdown_clear_selection: Clear Selection
35
29
  - dropdown_separators_hidden: Separators Hidden
36
- - dropdown_with_external_control: useDropdown Hook
30
+ # - dropdown_with_autocomplete: Autocomplete
31
+ # - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
32
+ # - dropdown_with_external_control: useDropdown Hook
33
+ # - dropdown_with_hook: useDropdown Hook with Any Trigger
37
34
 
@@ -3,10 +3,11 @@ export { default as DropdownWithCustomDisplay } from './_dropdown_with_custom_di
3
3
  export { default as DropdownWithCustomOptions } from './_dropdown_with_custom_options.jsx'
4
4
  export { default as DropdownWithCustomTrigger } from './_dropdown_with_custom_trigger.jsx'
5
5
  export { default as DropdownWithAutocomplete } from './_dropdown_with_autocomplete.jsx'
6
- export { default as DropdownWithAutocompleteWithSubcomponents } from './_dropdown_with_autocomplete_with_subcomponents.jsx'
6
+ export { default as DropdownWithAutocompleteAndCustomDisplay } from './_dropdown_with_autocomplete_and_custom_display.jsx'
7
7
  export { default as DropdownWithCustomPadding } from './_dropdown_with_custom_padding.jsx'
8
8
  export { default as DropdownWithLabel } from './_dropdown_with_label.jsx'
9
9
  export { default as DropdownWithExternalControl } from './_dropdown_with_external_control.jsx'
10
+ export { default as DropdownWithHook } from './_dropdown_with_hook.jsx'
10
11
  export { default as DropdownSubcomponentStructure } from './_dropdown_subcomponent_structure.jsx'
11
12
  export { default as DropdownError } from './_dropdown_error.jsx'
12
13
  export { default as DropdownDefaultValue } from './_dropdown_default_value.jsx'
@@ -14,4 +15,3 @@ export { default as DropdownBlankSelection } from './_dropdown_blank_selection.j
14
15
  export { default as DropdownClearSelection } from './_dropdown_clear_selection.jsx'
15
16
  export { default as DropdownSubtleVariant } from './_dropdown_subtle_variant.jsx'
16
17
  export { default as DropdownSeparatorsHidden } from './_dropdown_separators_hidden.jsx'
17
- export {default as DropdownWithSearch} from './_dropdown_with_search.jsx'
@@ -9,7 +9,7 @@ const InlineCardsExample = forwardRef(function InlineCardsExample(ref) {
9
9
  <Flex
10
10
  columnGap="lg"
11
11
  orientation="row"
12
- ref={ref}
12
+ ref={ref}
13
13
  >
14
14
  {Array.from({ length: 15 }, (_, index) => (
15
15
  <FlexItem key={index}>
@@ -1,5 +1,5 @@
1
1
  <%= pb_rails("select", props: {
2
- error: raw(pb_rails("icon", props: { icon: "warning" }) + " Please make a valid selection"),
2
+ error: "Please make a valid selection",
3
3
  label: "Favorite Food",
4
4
  name: "food",
5
5
  options: [
@@ -8,7 +8,7 @@ const TableWithCollapsibleWithCustomClick = (props) => {
8
8
 
9
9
  const Content = () => {
10
10
  return (
11
- <Card
11
+ <Card
12
12
  borderNone
13
13
  borderRadius="none"
14
14
  padding="md"
@@ -37,7 +37,7 @@ return (
37
37
 
38
38
  </Table.Head>
39
39
  <Table.Body>
40
- <Table.Row collapsible
40
+ <Table.Row collapsible
41
41
  collapsibleContent={<Content/>}
42
42
  toggleCellId="cell-1"
43
43
  {...props}
@@ -47,7 +47,7 @@ return (
47
47
  <Table.Cell>{'Value 3'}</Table.Cell>
48
48
  <Table.Cell>{'Value 4'}</Table.Cell>
49
49
  <Table.Cell>{'Value 5'}</Table.Cell>
50
- <Table.Cell cursor="pointer"
50
+ <Table.Cell cursor="pointer"
51
51
  id="cell-1"
52
52
  textAlign="right"
53
53
  >
@@ -59,7 +59,7 @@ return (
59
59
  </Table.Cell>
60
60
 
61
61
  </Table.Row>
62
- <Table.Row collapsible
62
+ <Table.Row collapsible
63
63
  collapsibleContent={<Content/>}
64
64
  toggleCellId="cell-2"
65
65
  {...props}
@@ -69,7 +69,7 @@ return (
69
69
  <Table.Cell>{'Value 3'}</Table.Cell>
70
70
  <Table.Cell>{'Value 4'}</Table.Cell>
71
71
  <Table.Cell>{'Value 5'}</Table.Cell>
72
- <Table.Cell cursor="pointer"
72
+ <Table.Cell cursor="pointer"
73
73
  id="cell-2"
74
74
  textAlign="right"
75
75
  >
@@ -81,7 +81,7 @@ return (
81
81
  </Table.Cell>
82
82
 
83
83
  </Table.Row>
84
- <Table.Row collapsible
84
+ <Table.Row collapsible
85
85
  collapsibleContent={<Content/>}
86
86
  toggleCellId="cell-3"
87
87
  {...props}
@@ -91,7 +91,7 @@ return (
91
91
  <Table.Cell>{'Value 3'}</Table.Cell>
92
92
  <Table.Cell>{'Value 4'}</Table.Cell>
93
93
  <Table.Cell>{'Value 5'}</Table.Cell>
94
- <Table.Cell cursor="pointer"
94
+ <Table.Cell cursor="pointer"
95
95
  id="cell-3"
96
96
  textAlign="right"
97
97
  >
@@ -4,7 +4,7 @@
4
4
  border: true,
5
5
  icon: "user"
6
6
  },
7
- error: raw(pb_rails("icon", props: { icon: "warning" }) + " Please enter a valid email address"),
7
+ error: "Please enter a valid email address",
8
8
  label: "Email Address",
9
9
  placeholder: "Enter email address",
10
10
  type: "email"
@@ -1,5 +1 @@
1
- <%= pb_rails("textarea", props: {
2
- error: raw(pb_rails("icon", props: { icon: "warning" }) + " This field has an error!"),
3
- label: "Label",
4
- rows: 4
5
- }) %>
1
+ <%= pb_rails("textarea", props: { error: "This field has an error!", label: "Label", rows: 4}) %>
@@ -8,14 +8,7 @@
8
8
 
9
9
  %>
10
10
 
11
- <%= pb_rails("typeahead", props: {
12
- id: "typeahead-error-example",
13
- options: options,
14
- error: "Please make a valid selection",
15
- label: "Products",
16
- name: :foo,
17
- is_multi: false
18
- }) %>
11
+ <%= pb_rails("typeahead", props: { id: "typeahead-error-example", options: options, error: "Please make a valid selection", label: "Products", name: :foo, is_multi: false }) %>
19
12
 
20
13
  <!-- This section is an example of the available JavaScript event hooks -->
21
14
  <%= javascript_tag defer: "defer" do %>