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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.18.0.pre.alpha.play2149overlaykitdynamicbug7619
4
+ version: 14.18.0.pre.alpha.revert4567revert4553PLAY2056ATcolbordercolors7469
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-05-07 00:00:00.000000000 Z
12
+ date: 2025-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -83,18 +83,18 @@ files:
83
83
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb
84
84
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.jsx
85
85
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.md
86
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.html.erb
86
87
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx
87
- - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md
88
88
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx
89
89
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md
90
90
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx
91
91
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md
92
- - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.html.erb
92
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.html.erb
93
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx
93
94
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md
94
- - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_react.jsx
95
95
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_react.md
96
- - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb
97
96
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md
97
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_react.md
98
98
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx
99
99
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md
100
100
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx
@@ -747,16 +747,11 @@ files:
747
747
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx
748
748
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md
749
749
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_react.md
750
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.html.erb
751
750
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx
752
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line_rails.md
753
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line_react.md
754
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_rails.md
751
+ - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md
755
752
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_react.md
756
753
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.html.erb
757
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.jsx
758
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_rails.md
759
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md
754
+ - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.md
760
755
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.html.erb
761
756
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx
762
757
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md
@@ -817,12 +812,10 @@ files:
817
812
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb
818
813
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx
819
814
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md
820
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb
821
815
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx
822
816
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.md
823
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb
824
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.jsx
825
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.md
817
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx
818
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md
826
819
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx
827
820
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md
828
821
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb
@@ -839,14 +832,10 @@ files:
839
832
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.html.erb
840
833
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.md
841
834
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx
842
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.md
835
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx
843
836
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb
844
837
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx
845
838
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md
846
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx
847
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.md
848
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb
849
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.md
850
839
  - app/pb_kits/playbook/pb_dropdown/docs/example.yml
851
840
  - app/pb_kits/playbook/pb_dropdown/docs/index.js
852
841
  - app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.jsx
@@ -1,55 +0,0 @@
1
- <% initial_items = [
2
- {
3
- id: "211",
4
- url: "https://unsplash.it/500/400/?image=633",
5
- },
6
- {
7
- id: "212",
8
- url: "https://unsplash.it/500/400/?image=634",
9
- },
10
- {
11
- id: "213",
12
- url: "https://unsplash.it/500/400/?image=637",
13
- },
14
- ] %>
15
-
16
- <% next_init_items = [
17
- {
18
- id: "2111",
19
- url: "https://unsplash.it/500/400/?image=633",
20
- },
21
- {
22
- id: "2112",
23
- url: "https://unsplash.it/500/400/?image=634",
24
- },
25
- {
26
- id: "2113",
27
- url: "https://unsplash.it/500/400/?image=637",
28
- },
29
- ] %>
30
-
31
- <%= pb_rails("draggable", props: {initial_items: initial_items, drop_zone_type: "line"}) do %>
32
- <%= pb_rails("draggable/draggable_container", props: { drop_zone_direction: "vertical" }) do %>
33
- <%= pb_rails("flex", props: { gap: "sm", orientation: "column", height: "367px" }) do %>
34
- <% initial_items.each do |item| %>
35
- <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id], drop_zone_line_color: "purple"}) do %>
36
- <%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
37
- <% end %>
38
- <% end %>
39
- <% end %>
40
- <% end %>
41
- <% end %>
42
-
43
- <br/>
44
-
45
- <%= pb_rails("draggable", props: {initial_items: next_init_items, drop_zone_type: "line"}) do %>
46
- <%= pb_rails("draggable/draggable_container", props: { drop_zone_direction: "horizontal" }) do %>
47
- <%= pb_rails("flex", props: { gap: "sm", html_options: { style: "width: 332px;" } }) do %>
48
- <% initial_items.each do |item| %>
49
- <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id], drop_zone_line_color: "primary"}) do %>
50
- <%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
51
- <% end %>
52
- <% end %>
53
- <% end %>
54
- <% end %>
55
- <% end %>
@@ -1,5 +0,0 @@
1
- When using the "line" style, make sure to set the appropriate `direction` attribute within the `drop_zone_direction` prop on the `draggable/draggable_container` component based on the orientation of your draggable view: "vertical" or "horizontal." Note that the direction attribute only applies to the "line" style and does not affect other drop zone styles. Also, set the `drop_zone_line_color` prop on the `draggable/draggable_item` component to "primary" or "purple".
2
-
3
- The length of the line is calculated based off of the width (for "vertical") or height (for "horizontal") of the parent container holding the draggable items.
4
-
5
- Additionally, if the parent container of the `draggable`/`draggable/draggable_container` (or a subcontainer within) does not have a set height (for "vertical") or width (for "horizontal"), like the [Draggable Drop Zones doc example](https://playbook.powerapp.cloud/kits/draggable/rails#draggable-drop-zones) does, elements on the page may jump up (for "vertical") or to the left (for "horizontal") when an item is actively being dragged. To prevent this, give a parent element a fixed height (for "vertical") or width (for "horizontal") as demonstrated in this doc example.
@@ -1,5 +0,0 @@
1
- The Draggable kit lets you customize the style of drop zones that appear when dragging an item.
2
-
3
- By default, drop zones are in the "ghost" style, but you can also choose from "shadow," "outline," and "line."
4
-
5
- When using the "line" type, make sure to set the appropriate `direction` attribute on the `draggable/draggable_container` component based on the orientation of your draggable view: "vertical" or "horizontal." Note that the direction attribute only applies to the "line" type and does not affect other drop zone styles. For more on the "line" style in particular, check out the [Draggable Drop Zones Line doc example](https://playbook.powerapp.cloud/kits/draggable/rails#draggable-drop-zones-line).
@@ -1,59 +0,0 @@
1
- import React, { useState } from "react";
2
-
3
- import Flex from '../../pb_flex/_flex'
4
- import Image from '../../pb_image/_image'
5
- import Draggable from '../../pb_draggable/_draggable'
6
- import { DraggableProvider } from '../../pb_draggable/context'
7
-
8
- const data = [
9
- {
10
- id: "100",
11
- url: "https://unsplash.it/500/400/?image=638",
12
- },
13
- {
14
- id: "200",
15
- url: "https://unsplash.it/500/400/?image=639",
16
- },
17
- {
18
- id: "300",
19
- url: "https://unsplash.it/500/400/?image=640",
20
- },
21
- ];
22
-
23
- const DraggableDefault = (props) => {
24
- const [initialState, setInitialState] = useState(data);
25
-
26
- return (
27
- <>
28
- <DraggableProvider initialItems={data}
29
- onReorder={(items) => setInitialState(items)}
30
- >
31
- <Draggable.Container {...props}>
32
- <Flex>
33
- {initialState.map(({ id, url }) => (
34
- <Draggable.Item dragId={id}
35
- key={id}
36
- onDrag={() => console.log(`${id} drag!`)}
37
- onDragEnd={() => console.log(`${id} drag end!`)}
38
- onDragEnter={() => console.log(`${id} drag enter!`)}
39
- onDragLeave={() => console.log(`${id} drag leave!`)}
40
- onDragOver={() => console.log(`${id} drag over!`)}
41
- onDragStart={() => console.log(`${id} drag start!`)}
42
- onDrop={() => console.log(`${id} drop!`)}
43
- >
44
- <Image alt={id}
45
- margin="xs"
46
- size="md"
47
- url={url}
48
- />
49
- </Draggable.Item>
50
- ))}
51
- </Flex>
52
- </Draggable.Container>
53
- </DraggableProvider>
54
- </>
55
-
56
- );
57
- };
58
-
59
- export default DraggableDefault;
@@ -1 +0,0 @@
1
- You can add drag event listeners for `onDrag`, `onDragEnd`, `onDragEnter`, `onDragLeave`, `onDragOver`, `onDragStart`, and `onDrop`.
@@ -1,28 +0,0 @@
1
- <%
2
- options = [
3
- {
4
- label: "United States",
5
- value: "United States",
6
- areaCode: "+1",
7
- icon: "🇺🇸",
8
- id: "us"
9
- },
10
- {
11
- label: "United Kingdom",
12
- value: "United Kingdom",
13
- areaCode: "+44",
14
- icon: "🇬🇧",
15
- id: "gb"
16
- },
17
- {
18
- label: "Pakistan",
19
- value: "Pakistan",
20
- areaCode: "+92",
21
- icon: "🇵🇰",
22
- id: "pk"
23
- }
24
- ]
25
-
26
- %>
27
-
28
- <%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
@@ -1,58 +0,0 @@
1
- <%
2
- options = [
3
- {
4
- label: "Jasper Furniss",
5
- value: "Jasper Furniss",
6
- territory: "PHL",
7
- title: "Lead UX Engineer",
8
- id: "jasper-furniss",
9
- status: "Offline"
10
- },
11
- {
12
- label: "Ramon Ruiz",
13
- value: "Ramon Ruiz",
14
- territory: "PHL",
15
- title: "Senior UX Designer",
16
- id: "ramon-ruiz",
17
- status: "Away"
18
- },
19
- {
20
- label: "Carlos Lima",
21
- value: "Carlos Lima",
22
- territory: "PHL",
23
- title: "Nitro Developer",
24
- id: "carlos-lima",
25
- status: "Online"
26
- },
27
- {
28
- label: "Courtney Long",
29
- value: "Courtney Long",
30
- territory: "PHL",
31
- title: "Lead UX Designer",
32
- id: "courtney-long",
33
- status: "Online"
34
- }
35
- ];
36
-
37
- %>
38
-
39
- <%= pb_rails("dropdown", props: {options: options}) do %>
40
- <%= pb_rails("dropdown/dropdown_trigger", props: {placeholder: "Search...", autocomplete: true}) %>
41
- <%= pb_rails("dropdown/dropdown_container") do %>
42
- <% options.each do |option| %>
43
- <%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
44
- <%= pb_rails("flex", props: {
45
- align: "center",
46
- justify: "between",
47
- }) do %>
48
- <%= pb_rails("flex/flex_item") do %>
49
- <%= pb_rails("user", props: {name: option[:label], align:"left", avatar: true, orientation:"horizontal", territory:option[:territory], title: option[:title]}) %>
50
- <% end %>
51
- <%= pb_rails("flex/flex_item") do %>
52
- <%= pb_rails("badge", props: {rounded: true, dark: true, text: option[:status], variant: option[:status] == "Offline" ? "neutral" : option[:status] == "Online" ? "success" : "warning" }) %>
53
- <% end %>
54
- <% end %>
55
- <% end %>
56
- <% end %>
57
- <% end %>
58
- <% end %>
@@ -1 +0,0 @@
1
- `autocomplete` prop can also be used in conjunction with the subcomponent structure.
@@ -1 +0,0 @@
1
- The `useDropdown` hook can also be used to toggle the dropdown open and closed using an external control. To do so, you must manage state with the custom hook, pass the `dropdown:'pb-dropdown-trigger'` data attribute to the external control and use the `isClosed` prop as shown.
@@ -1,61 +0,0 @@
1
- import React, { useState } from 'react'
2
- import Dropdown from '../../pb_dropdown/_dropdown'
3
- import IconCircle from '../../pb_icon_circle/_icon_circle';
4
-
5
- const DropdownWithSearch = (props) => {
6
- const [selectedOption, setSelectedOption] = useState();
7
-
8
- const options = [
9
- {
10
- label: "United States",
11
- value: "United States",
12
- icon: "🇺🇸",
13
- id: "United-states"
14
-
15
- },
16
- {
17
- label: "United Kingdom",
18
- value: "United Kingdom",
19
- icon: "🇬🇧",
20
- id: "united-kingdom"
21
- },
22
- {
23
- label: "Pakistan",
24
- value: "Pakistan",
25
- icon: "🇵🇰",
26
- id: "pakistan"
27
- }
28
- ];
29
-
30
-
31
- return (
32
- <div>
33
- <Dropdown
34
- onSelect={(selectedItem) => setSelectedOption(selectedItem)}
35
- options={options}
36
- {...props}
37
- >
38
- <Dropdown.Trigger>
39
- <div key={selectedOption ? selectedOption.icon : "flag"}>
40
- <IconCircle
41
- cursor="pointer"
42
- icon={selectedOption ? selectedOption.icon : "flag"}
43
- variant="royal"
44
- />
45
- </div>
46
- </Dropdown.Trigger>
47
- <Dropdown.Container maxWidth="xs"
48
- searchbar
49
- >
50
- {options.map((option) => (
51
- <Dropdown.Option key={option.id}
52
- option={option}
53
- />
54
- ))}
55
- </Dropdown.Container>
56
- </Dropdown>
57
- </div>
58
- )
59
- }
60
-
61
- export default DropdownWithSearch
@@ -1,2 +0,0 @@
1
- The optional `searchbar` boolean prop can also be used on the `Dropdown.Container` to render a searchbar with typeahead functionality within the dropdown itself. This is especially useful when a custom trigger is being used.
2
- `searchbar` is set to false by default.
@@ -1,52 +0,0 @@
1
- <%
2
- options = [
3
- {
4
- label: "United States",
5
- value: "United States",
6
- areaCode: "+1",
7
- icon: "🇺🇸",
8
- id: "us"
9
- },
10
- {
11
- label: "United Kingdom",
12
- value: "United Kingdom",
13
- areaCode: "+44",
14
- icon: "🇬🇧",
15
- id: "gb"
16
- },
17
- {
18
- label: "Pakistan",
19
- value: "Pakistan",
20
- areaCode: "+92",
21
- icon: "🇵🇰",
22
- id: "pk"
23
- }
24
- ]
25
-
26
- %>
27
-
28
- <%= pb_rails("dropdown", props: {options: options}) do %>
29
- <%= pb_rails("dropdown/dropdown_trigger") do %>
30
- <%= pb_rails("icon_circle", props: {icon:"flag", cursor: "pointer", variant:"royal"}) %>
31
- <% end %>
32
- <%= pb_rails("dropdown/dropdown_container", props:{max_width:"xs", searchbar: true}) do %>
33
- <% options.each do |option| %>
34
- <%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
35
- <%= pb_rails("flex", props: {
36
- align: "center",
37
- justify: "between",
38
- }) do %>
39
- <%= pb_rails("flex/flex_item") do %>
40
- <%= pb_rails("flex") do %>
41
- <%= pb_rails("icon", props: {icon: option[:icon]}) %>
42
- <%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
43
- <% end %>
44
- <% end %>
45
- <%= pb_rails("flex/flex_item") do %>
46
- <%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
47
- <% end %>
48
- <% end %>
49
- <% end %>
50
- <% end %>
51
- <% end %>
52
- <% end %>
@@ -1,2 +0,0 @@
1
- The optional `searchbar` boolean prop can also be used on the `dropdown/dropdown_container` to render a searchbar with typeahead functionality within the dropdown itself. This is especially useful when a custom trigger is being used.
2
- `searchbar` is set to false by default.