playbook_ui 14.19.0.pre.alpha.play2125phonenumberinputcountrysearcherrorstylefix7698 → 14.19.0.pre.rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +21 -304
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +6 -0
- 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
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/index.js +11 -228
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -1
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -4
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +0 -3
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +3 -3
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +0 -2
- data/app/pb_kits/playbook/pb_avatar/avatar.test.js +0 -18
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_avatar/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +0 -12
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_draggable/draggable.rb +1 -9
- data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +1 -11
- data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +1 -11
- data/app/pb_kits/playbook/pb_draggable/index.js +142 -141
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +5 -33
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -5
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +16 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +2 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +64 -17
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_autocomplete_with_subcomponents.jsx → _dropdown_with_autocomplete_and_custom_display.jsx} +25 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx +79 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +0 -4
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -45
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +0 -3
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +2 -12
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +1 -3
- data/app/pb_kits/playbook/pb_dropdown/index.js +0 -57
- data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +0 -26
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +2 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +4 -4
- data/app/pb_kits/playbook/pb_empty_state/_empty_state.scss +1 -8
- data/app/pb_kits/playbook/pb_empty_state/docs/example.yml +1 -5
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +18 -22
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.scss +3 -0
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +72 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/_gantt_chart_default.jsx +53 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_gantt_chart/gantt_chart.test.jsx +19 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +0 -3
- data/app/pb_kits/playbook/pb_message/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_message/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_message/message.html.erb +1 -2
- data/app/pb_kits/playbook/pb_message/message.rb +0 -1
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +1 -2
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +1 -1
- data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +4 -5
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -21
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +0 -19
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_popover/index.ts +1 -13
- data/app/pb_kits/playbook/pb_popover/popover.rb +0 -2
- data/app/pb_kits/playbook/pb_select/_select.scss +0 -10
- data/app/pb_kits/playbook/pb_select/docs/_select_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +7 -7
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +5 -5
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +2 -4
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.html.erb +1 -5
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb +1 -8
- data/app/pb_kits/playbook/pb_user/_user.tsx +0 -3
- data/app/pb_kits/playbook/pb_user/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_user/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -2
- data/app/pb_kits/playbook/pb_user/user.rb +0 -1
- data/dist/chunks/_typeahead-BX8IifKY.js +22 -0
- data/dist/chunks/_weekday_stacked-DfMD7HJz.js +45 -0
- data/dist/chunks/{lib-DwFasxbk.js → lib-96_ZmvAo.js} +1 -1
- data/dist/chunks/{pb_form_validation-nnXW3T-3.js → pb_form_validation-Vv2TqXVC.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +14 -6
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +23 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +0 -106
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_grayscale.html.erb +0 -5
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_grayscale.jsx +0 -16
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +0 -64
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line_rails.md +0 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_rails.md +0 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.jsx +0 -59
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +0 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +0 -58
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +0 -61
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.md +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.md +0 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.html.erb +0 -27
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.html.erb +0 -7
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.html.erb +0 -12
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.html.erb +0 -23
- data/app/pb_kits/playbook/pb_empty_state/empty_state.html.erb +0 -19
- data/app/pb_kits/playbook/pb_empty_state/empty_state.rb +0 -123
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +0 -41
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -110
- data/app/pb_kits/playbook/pb_message/docs/_message_grayscale.html.erb +0 -9
- data/app/pb_kits/playbook/pb_message/docs/_message_grayscale.jsx +0 -21
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +0 -20
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +0 -46
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +0 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_grayscale.html.erb +0 -6
- data/app/pb_kits/playbook/pb_user/docs/_user_grayscale.jsx +0 -16
- data/dist/chunks/_typeahead-BQV04mOl.js +0 -22
- data/dist/chunks/_weekday_stacked-CVwWr8B2.js +0 -45
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_rails.html.erb → _advanced_table_selectable_rows.html.erb} +0 -0
- /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
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_react.md → _draggable_drop_zones.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors_react.md → _draggable_drop_zones_colors.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_line_react.md → _draggable_drop_zones_line.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_event_listeners_rails.md → _draggable_event_listeners.md} +0 -0
@@ -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}) %>
|
data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb
DELETED
@@ -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 %>
|
data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.md
DELETED
@@ -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,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,27 +0,0 @@
|
|
1
|
-
<%= pb_rails("flex", props: {align: "center", spacing: "evenly", wrap: true}) do %>
|
2
|
-
<%= pb_rails("empty_state", props: {
|
3
|
-
description: "Body text goes into detail with possible steps for user to take",
|
4
|
-
header: "Title Explains",
|
5
|
-
image: "default",
|
6
|
-
primary_button: "Next Action",
|
7
|
-
primary_button_url: "#primary_button_url",
|
8
|
-
alignment: "left",
|
9
|
-
}) %>
|
10
|
-
|
11
|
-
<%= pb_rails("empty_state", props: {
|
12
|
-
description: "Body text goes into detail with possible steps for user to take",
|
13
|
-
header: "Title Explains",
|
14
|
-
image: "default",
|
15
|
-
primary_button: "Next Action",
|
16
|
-
primary_button_url: "#primary_button_url",
|
17
|
-
}) %>
|
18
|
-
|
19
|
-
<%= pb_rails("empty_state", props: {
|
20
|
-
description: "Body text goes into detail with possible steps for user to take",
|
21
|
-
header: "Title Explains",
|
22
|
-
image: "default",
|
23
|
-
primary_button: "Next Action",
|
24
|
-
primary_button_url: "#primary_button_url",
|
25
|
-
alignment: "right",
|
26
|
-
}) %>
|
27
|
-
<% end %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%= pb_rails("flex", props: {align: "center", justify: "center", wrap: true}) do %>
|
2
|
-
<%= pb_rails("empty_state", props: {
|
3
|
-
description: "Body text goes into detail with possible steps for user to take",
|
4
|
-
header: "Title Explains",
|
5
|
-
image: "default",
|
6
|
-
orientation:"horizontal",
|
7
|
-
alignment: "left",
|
8
|
-
size: "lg",
|
9
|
-
primary_button: "Next Action",
|
10
|
-
primary_button_url: "#primary_button_url",
|
11
|
-
}) %>
|
12
|
-
<% end %>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<%= pb_rails("flex", props: {align: "center", spacing: "evenly", wrap: true}) do %>
|
2
|
-
<%= pb_rails("empty_state", props: {
|
3
|
-
description: "Body text goes into detail with possible steps for user to take",
|
4
|
-
header: "Title Explains",
|
5
|
-
image: "default",
|
6
|
-
primary_button: "Next Action",
|
7
|
-
primary_button_url: "#primary_button_url",
|
8
|
-
link_button: "Alt Action",
|
9
|
-
link_button_url: "#link_button_url",
|
10
|
-
size: "sm",
|
11
|
-
}) %>
|
12
|
-
|
13
|
-
<%= pb_rails("empty_state", props: {
|
14
|
-
description: "Body text goes into detail with possible steps for user to take",
|
15
|
-
header: "Title Explains",
|
16
|
-
image: "default",
|
17
|
-
primary_button: "Next Action",
|
18
|
-
primary_button_url: "#primary_button_url",
|
19
|
-
link_button: "Alt Action",
|
20
|
-
link_button_url: "#link_button_url",
|
21
|
-
size: "lg",
|
22
|
-
}) %>
|
23
|
-
<% end %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<%= pb_content_tag do %>
|
2
|
-
<%= pb_rails("flex", props: { align: flex_align, orientation: config[:flex_direction], padding_left: padding_size, padding_right: padding_size, vertical: "center", classname: config[:scss_class], max_width: "100%" }) do %>
|
3
|
-
<%= pb_rails("image", props: { url: image == "default" ? default_image_data_uri : image, alt: "Empty State Image", html_options: { width: config[:image_width], height: "auto", alignment: "start" } }) %>
|
4
|
-
<%= pb_rails("flex/flex_item") do %>
|
5
|
-
<%= pb_rails("title", props: { text: object.header, size: config[:title_size], padding_bottom: config[:title_padding], text_align: alignment }) %>
|
6
|
-
<% if size == "sm" %>
|
7
|
-
<%= pb_rails("detail", props: { text: object.description, padding_bottom: config[:description_pad], text_align: alignment }) %>
|
8
|
-
<% else %>
|
9
|
-
<%= pb_rails("body", props: { text: object.description, padding_bottom: config[:description_pad], text_align: alignment }) %>
|
10
|
-
<% end %>
|
11
|
-
<% if primary_button.present? %>
|
12
|
-
<%= pb_rails("button", props: { text: primary_button, variant: "primary", width: "100%", size: config[:button_size], link: primary_button_url, margin_bottom: config[:button_margin] }) %>
|
13
|
-
<% end %>
|
14
|
-
<% if link_button.present? %>
|
15
|
-
<%= pb_rails("button", props: { text: link_button, variant: "link", size: config[:button_size], link: link_button_url, width: "100%" }) %>
|
16
|
-
<% end %>
|
17
|
-
<% end %>
|
18
|
-
<% end %>
|
19
|
-
<% end %>
|
@@ -1,123 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbEmptyState
|
5
|
-
class EmptyState < Playbook::KitBase
|
6
|
-
prop :alignment, type: Playbook::Props::Enum,
|
7
|
-
values: %w[center left right],
|
8
|
-
default: "center"
|
9
|
-
prop :description
|
10
|
-
prop :header
|
11
|
-
prop :image
|
12
|
-
prop :link_button
|
13
|
-
prop :link_button_url
|
14
|
-
prop :orientation, type: Playbook::Props::Enum,
|
15
|
-
values: %w[horizontal vertical],
|
16
|
-
default: "vertical"
|
17
|
-
prop :primary_button
|
18
|
-
prop :primary_button_url
|
19
|
-
prop :size, type: Playbook::Props::Enum,
|
20
|
-
values: %w[sm md lg],
|
21
|
-
default: "md"
|
22
|
-
|
23
|
-
SIZE_CONFIGS = {
|
24
|
-
sm: {
|
25
|
-
vertical: {
|
26
|
-
image_width: "100px",
|
27
|
-
title_size: 4,
|
28
|
-
title_padding: "xxs",
|
29
|
-
description_pad: "sm",
|
30
|
-
button_size: "sm",
|
31
|
-
button_margin: "xs",
|
32
|
-
scss_class: "sm-state-vertical",
|
33
|
-
flex_direction: "column",
|
34
|
-
},
|
35
|
-
horizontal: {
|
36
|
-
image_width: "100px",
|
37
|
-
title_size: 4,
|
38
|
-
title_padding: "xxs",
|
39
|
-
description_pad: "sm",
|
40
|
-
button_size: "sm",
|
41
|
-
button_margin: "xs",
|
42
|
-
scss_class: "sm-state-horizontal",
|
43
|
-
flex_direction: "row",
|
44
|
-
},
|
45
|
-
},
|
46
|
-
md: {
|
47
|
-
vertical: {
|
48
|
-
image_width: "140px",
|
49
|
-
title_size: 3,
|
50
|
-
title_padding: "xs",
|
51
|
-
description_pad: "md",
|
52
|
-
button_size: "md",
|
53
|
-
button_margin: "sm",
|
54
|
-
scss_class: "md-state-vertical",
|
55
|
-
flex_direction: "column",
|
56
|
-
},
|
57
|
-
horizontal: {
|
58
|
-
image_width: "140px",
|
59
|
-
title_size: 3,
|
60
|
-
title_padding: "xs",
|
61
|
-
description_pad: "md",
|
62
|
-
button_size: "md",
|
63
|
-
button_margin: "sm",
|
64
|
-
scss_class: "md-state-horizontal",
|
65
|
-
flex_direction: "row",
|
66
|
-
},
|
67
|
-
},
|
68
|
-
lg: {
|
69
|
-
vertical: {
|
70
|
-
image_width: "100%",
|
71
|
-
title_size: 1,
|
72
|
-
title_padding: "sm",
|
73
|
-
description_pad: "lg",
|
74
|
-
button_size: "md",
|
75
|
-
button_margin: "md",
|
76
|
-
scss_class: "lg-state-vertical",
|
77
|
-
flex_direction: "column",
|
78
|
-
},
|
79
|
-
horizontal: {
|
80
|
-
image_width: "100%",
|
81
|
-
title_size: 2,
|
82
|
-
title_padding: "sm",
|
83
|
-
description_pad: "lg",
|
84
|
-
button_size: "md",
|
85
|
-
button_margin: "md",
|
86
|
-
scss_class: "lg-state-horizontal",
|
87
|
-
flex_direction: "row",
|
88
|
-
},
|
89
|
-
},
|
90
|
-
}.freeze
|
91
|
-
|
92
|
-
def classname
|
93
|
-
generate_classname("pb_empty_state_kit")
|
94
|
-
end
|
95
|
-
|
96
|
-
def config
|
97
|
-
SIZE_CONFIGS[size.to_sym][orientation.to_sym]
|
98
|
-
end
|
99
|
-
|
100
|
-
def default_image_data_uri
|
101
|
-
svg_path = __dir__.then { |d| File.join(d, "docs", "default_image", "computer_fly_no_branding.svg") }
|
102
|
-
svg = File.read(svg_path)
|
103
|
-
encoded = ERB::Util.url_encode(svg)
|
104
|
-
"data:image/svg+xml,#{encoded}"
|
105
|
-
end
|
106
|
-
|
107
|
-
def padding_size
|
108
|
-
size == "sm" ? "xs" : "xl"
|
109
|
-
end
|
110
|
-
|
111
|
-
def flex_align
|
112
|
-
case alignment
|
113
|
-
when "left"
|
114
|
-
"start"
|
115
|
-
when "right"
|
116
|
-
"end"
|
117
|
-
else
|
118
|
-
"center"
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<%=
|
2
|
-
pb_rails("filter", props: {
|
3
|
-
id: "filter_within_trubo_frames",
|
4
|
-
position: "top",
|
5
|
-
filters: [
|
6
|
-
{ name: "name", value: "John Wick" },
|
7
|
-
{ name: "city", value: "San Francisco"}
|
8
|
-
],
|
9
|
-
sort_menu: [
|
10
|
-
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
11
|
-
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
12
|
-
{ item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
|
13
|
-
],
|
14
|
-
template: "default",
|
15
|
-
results: 1,
|
16
|
-
popover_props: { append_to: "parent" },
|
17
|
-
}) do
|
18
|
-
%>
|
19
|
-
<%
|
20
|
-
example_collection = [
|
21
|
-
OpenStruct.new(name: "USA", value: 1),
|
22
|
-
OpenStruct.new(name: "Canada", value: 2),
|
23
|
-
OpenStruct.new(name: "Brazil", value: 3),
|
24
|
-
OpenStruct.new(name: "Philippines", value: 4),
|
25
|
-
OpenStruct.new(name: "A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...", value: 5)
|
26
|
-
]
|
27
|
-
%>
|
28
|
-
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
29
|
-
<%= form.text_field :example_text_field, props: { label: true } %>
|
30
|
-
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
|
31
|
-
|
32
|
-
<%= form.actions do |action| %>
|
33
|
-
<%= action.submit props: {
|
34
|
-
text: "Apply",
|
35
|
-
data: {
|
36
|
-
disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
|
37
|
-
},}%>
|
38
|
-
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
39
|
-
<% end %>
|
40
|
-
<% end %>
|
41
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
By default, the filter popover attaches to the `<body>`. To attach it elsewhere, like inside a Turbo Frame, pass the `append_to` prop through `popover_props`. 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.
|
@@ -1,52 +0,0 @@
|
|
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
|