playbook_ui_docs 15.5.0 → 15.6.0.pre.alpha.PLAY2686contactkittextonly13049

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  3. data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +1 -1
  4. data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +0 -1
  5. data/app/pb_kits/playbook/pb_background/docs/_background_light.md +1 -0
  6. data/app/pb_kits/playbook/pb_background/docs/example.yml +2 -2
  7. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  8. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  9. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +0 -1
  10. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +0 -3
  11. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.html.erb +33 -0
  12. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.jsx +46 -0
  13. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_rails.md +2 -0
  14. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_react.md +2 -0
  15. data/app/pb_kits/playbook/pb_contact/docs/example.yml +2 -0
  16. data/app/pb_kits/playbook/pb_contact/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +31 -0
  18. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  19. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +180 -0
  20. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +22 -0
  21. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +3 -2
  22. data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
  23. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +1 -1
  24. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +42 -0
  25. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +1 -0
  26. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +1 -0
  27. data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +1 -0
  28. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +34 -4
  29. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +16 -7
  30. data/app/pb_kits/playbook/pb_radio/docs/_radio_error.md +1 -1
  31. data/app/pb_kits/playbook/pb_select/docs/_select_error.md +1 -1
  32. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +16 -0
  33. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +30 -0
  34. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +1 -0
  35. data/app/pb_kits/playbook/pb_select/docs/example.yml +2 -0
  36. data/app/pb_kits/playbook/pb_select/docs/index.js +1 -0
  37. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx +134 -0
  38. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md +34 -0
  39. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb +101 -0
  40. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +33 -0
  41. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx +180 -0
  42. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.md +3 -0
  43. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.html.erb +122 -0
  44. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.md +3 -0
  45. data/app/pb_kits/playbook/pb_table/docs/example.yml +4 -0
  46. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  47. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md +1 -1
  48. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md +1 -1
  49. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +60 -0
  50. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +118 -0
  51. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +1 -0
  52. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
  53. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +2 -0
  54. data/app/pb_kits/playbook/pb_timeline/docs/index.js +1 -0
  55. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb +30 -0
  56. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx +37 -0
  57. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md +3 -0
  58. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  59. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +2 -1
  60. metadata +28 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c43efc66926d0ee9830960635e1323e4938d4f95f36e4b41f7abe2e5fc8c2cd7
4
- data.tar.gz: 4bcb3117782c9af03e530a2628c38a9f165e1b87b1d53ba586edb8ae82bdcd7e
3
+ metadata.gz: df8c1b66639787df5a081bd0af6a0940e8f7dd6266a5897f3644129ca6325a44
4
+ data.tar.gz: eb320160482e4aac99ff8bcdbb546ef1f114015a218e3611f5bf8a4ce7608710
5
5
  SHA512:
6
- metadata.gz: 27127b663eccb7ebdca85aefa0efa09ff5ef7ecf5ec00137b3a581cc49da5bfb5bf72025dba381773bdb93094c625e41dd7a169fe69dc28687eba9eda07ff575
7
- data.tar.gz: 1748676dcd1a0bc9240aacedf8133777405495c51771bf7ee713f4496a12287ed04e55396668d7fdb1b5b267d2a930eea6dece69f1c20e8074e52f508e95ce74
6
+ metadata.gz: 5dda7ea71552ef495a86f7ab8bf1b5a0eaeb77abd73a7459560becdf845488508e881da295c72380cdfbd83d88b49caf9df3e93554567c07fe351b26431f47d8
7
+ data.tar.gz: a58dfe70cfdf4b9a7676324da72caf29bc1801e1a4ab1d28d623219a0e99e5710cd942e0401e4ba61880a763da065e536d938cfaa083c9df0f9d49ea86aecc6e
@@ -30,4 +30,4 @@
30
30
  }
31
31
  ] %>
32
32
 
33
- <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
33
+ <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
@@ -1,3 +1,3 @@
1
- <%= pb_rails("background", props: { background_color: "light", padding: "xl" }) do %>
1
+ <%= pb_rails("background", props: { padding: "xl" }) do %>
2
2
 
3
3
  <% end %>
@@ -3,7 +3,6 @@ import Background from '../../pb_background/_background'
3
3
 
4
4
  const BackgroundLight = (props) => (
5
5
  <Background
6
- backgroundColor="light"
7
6
  padding="xl"
8
7
  {...props}
9
8
  />
@@ -0,0 +1 @@
1
+ By default, the Background kit sets background color to 'light' as seen here.
@@ -1,7 +1,7 @@
1
1
  examples:
2
2
 
3
3
  rails:
4
- - background_light: Light
4
+ - background_light: Default
5
5
  - background_white: White
6
6
  - background_gradient: Gradient
7
7
  - background_image: Image
@@ -11,7 +11,7 @@ examples:
11
11
  - background_size: Size
12
12
 
13
13
  react:
14
- - background_light: Light
14
+ - background_light: Default
15
15
  - background_white: White
16
16
  - background_gradient: Gradient
17
17
  - background_image: Image
@@ -1 +1 @@
1
- Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/token/colors" target="_blank">here</a>.
1
+ Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a>.
@@ -1 +1 @@
1
- Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/token/colors" target="_blank">here</a>.
1
+ Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a>.
@@ -7,7 +7,6 @@ const CollapsibleIcons = (props) => {
7
7
  <>
8
8
  <Collapsible
9
9
  icon={['plus','minus']}
10
- iconColor='white'
11
10
  >
12
11
  <Collapsible.Main {...props}>
13
12
  <div>{'Main Section'}</div>
@@ -22,7 +22,6 @@ const CollapsibleState = (props) => {
22
22
  <Collapsible
23
23
  collapsed={isCollapsed}
24
24
  icon={["plus", "minus"]}
25
- iconColor='white'
26
25
  padding="none"
27
26
  >
28
27
  <Collapsible.Main padding="sm"
@@ -41,7 +40,6 @@ const CollapsibleState = (props) => {
41
40
  <Collapsible
42
41
  collapsed={isCollapsed}
43
42
  icon={["plus", "minus"]}
44
- iconColor='white'
45
43
  padding="none"
46
44
  >
47
45
  <Collapsible.Main padding="sm"
@@ -60,7 +58,6 @@ const CollapsibleState = (props) => {
60
58
  <Collapsible
61
59
  collapsed={isCollapsed}
62
60
  icon={["plus", "minus"]}
63
- iconColor='white'
64
61
  padding="none"
65
62
  >
66
63
  <Collapsible.Main padding="sm"
@@ -0,0 +1,33 @@
1
+ <%= pb_rails("body", props: { color: "default" }) do %>
2
+ <%= pb_rails("contact", props: {
3
+ contact_value: "2125551234",
4
+ icon_enabled: false,
5
+ unstyled: true
6
+ }) %>
7
+ <% end %>
8
+
9
+ <%= pb_rails("body", props: { color: "light" }) do %>
10
+ <%= pb_rails("contact", props: {
11
+ contact_value: "12125551234",
12
+ icon_enabled: false,
13
+ unstyled: true
14
+ }) %>
15
+ <% end %>
16
+
17
+ <%= pb_rails("body", props: { color: "lighter" }) do %>
18
+ <%= pb_rails("contact", props: {
19
+ contact_value: "4155551234",
20
+ icon_enabled: false,
21
+ unstyled: true
22
+ }) %>
23
+ <% end %>
24
+
25
+ <%= pb_rails("body", props: { color: "default" }) do %>
26
+ <%= pb_rails("contact", props: {
27
+ contact_type: "extension",
28
+ contact_value: "1234",
29
+ icon_enabled: false,
30
+ unstyled: true
31
+ }) %>
32
+ <% end %>
33
+
@@ -0,0 +1,46 @@
1
+ import React from 'react'
2
+ import Contact from "../../pb_contact/_contact"
3
+ import Body from "../../pb_body/_body"
4
+
5
+ const ContactUnstyled = (props) => {
6
+ return (
7
+ <div>
8
+ <Body color="default">
9
+ <Contact
10
+ contactValue="2125551234"
11
+ iconEnabled={false}
12
+ unstyled
13
+ {...props}
14
+ />
15
+ </Body>
16
+ <Body color="light">
17
+ <Contact
18
+ contactValue="12125551234"
19
+ iconEnabled={false}
20
+ unstyled
21
+ {...props}
22
+ />
23
+ </Body>
24
+ <Body color="lighter">
25
+ <Contact
26
+ contactValue="4155551234"
27
+ iconEnabled={false}
28
+ unstyled
29
+ {...props}
30
+ />
31
+ </Body>
32
+ <Body color="default">
33
+ <Contact
34
+ contactType="extension"
35
+ contactValue="1234"
36
+ iconEnabled={false}
37
+ unstyled
38
+ {...props}
39
+ />
40
+ </Body>
41
+ </div>
42
+ )
43
+ }
44
+
45
+ export default ContactUnstyled
46
+
@@ -0,0 +1,2 @@
1
+ Use the Contact kit with `icon_enabled: false` and `unstyled: true` to display phone numbers with full typography control. When `unstyled: true`, the Contact kit renders just the formatted text without a Body wrapper, allowing you to wrap it in your own Typography kit to control the color and styling.
2
+
@@ -0,0 +1,2 @@
1
+ Use the Contact kit with `iconEnabled={false}` and `unstyled` to display phone numbers with full typography control. With `unstyled`, the Contact kit renders just the formatted text without a Body wrapper, allowing you to wrap it in your own Typography kit to control the color and styling.
2
+
@@ -3,11 +3,13 @@ examples:
3
3
  rails:
4
4
  - contact_default: Default
5
5
  - contact_with_detail: Detail Indicator
6
+ - contact_unstyled: Unstyled
6
7
 
7
8
 
8
9
  react:
9
10
  - contact_default: Default
10
11
  - contact_with_detail: Detail Indicator
12
+ - contact_unstyled: Unstyled
11
13
 
12
14
 
13
15
  swift:
@@ -1,2 +1,3 @@
1
1
  export { default as ContactDefault } from './_contact_default.jsx'
2
2
  export { default as ContactWithDetail } from './_contact_with_detail.jsx'
3
+ export { default as ContactUnstyled } from './_contact_unstyled.jsx'
@@ -1,3 +1,24 @@
1
+ <%
2
+ options = [
3
+ {
4
+ label: "United States",
5
+ value: "unitedStates",
6
+ id: "us"
7
+ },
8
+ {
9
+ label: "United Kingdom",
10
+ value: "unitedKingdom",
11
+ id: "gb"
12
+ },
13
+ {
14
+ label: "Pakistan",
15
+ value: "pakistan",
16
+ id: "pk"
17
+ }
18
+ ]
19
+ %>
20
+
21
+
1
22
  <%= pb_rails("button", props: { text: "Open Complex Dialog", data:{"open-dialog": "dialog-complex"} }) %>
2
23
 
3
24
  <%= pb_rails("dialog", props: { id:"dialog-complex", size: "lg", full_height: true }) do %>
@@ -10,6 +31,16 @@
10
31
  <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
11
32
  <%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
12
33
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
34
+ <%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
35
+ <%= pb_rails("typeahead", props: {
36
+ id: "typeahead-default",
37
+ placeholder: "Select one...",
38
+ options: options,
39
+ name: :foo,
40
+ margin_top: "sm",
41
+ is_multi: false
42
+ })
43
+ %>
13
44
 
14
45
  <% end %>
15
46
  <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Back", confirm_button: "Send my Issue", confirm_button_id:"confirm-complex", id: "dialog-complex"}) %>
@@ -1 +1 @@
1
- You can customize the order of the colors you would like to use by using the `colors` prop. Only the data and status colors will work for Playbook charts. See the [design page](https://playbook.powerapp.cloud/token/colors) for reference.
1
+ You can customize the order of the colors you would like to use by using the `colors` prop. Only the data and status colors will work for Playbook charts. See the [design page](https://playbook.powerapp.cloud/tokens/colors) for reference.
@@ -0,0 +1,180 @@
1
+ import React, { useState } from "react";
2
+
3
+ import Flex from '../../pb_flex/_flex'
4
+ import Draggable from '../../pb_draggable/_draggable'
5
+ import { DraggableProvider } from '../../pb_draggable/context'
6
+ import Badge from '../../pb_badge/_badge'
7
+ import Title from '../../pb_title/_title'
8
+ import Caption from '../../pb_caption/_caption'
9
+ import Card from '../../pb_card/_card'
10
+ import FlexItem from '../../pb_flex/_flex_item'
11
+ import Avatar from '../../pb_avatar/_avatar'
12
+ import Body from '../../pb_body/_body'
13
+
14
+ // Initial groups to drag between
15
+ const containers = ["To Do", "In Progress", "Done"];
16
+
17
+ // Initial items to be dragged
18
+ const data = [
19
+ {
20
+ id: "11",
21
+ container: "To Do",
22
+ title: "Task 1",
23
+ description: "Bug fixes",
24
+ assignee_name: "Terry Miles",
25
+ assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
26
+ },
27
+ {
28
+ id: "12",
29
+ container: "To Do",
30
+ title: "Task 2",
31
+ description: "Documentation",
32
+ assignee_name: "Sophia Miles",
33
+ assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
34
+ },
35
+ {
36
+ id: "13",
37
+ container: "In Progress",
38
+ title: "Task 3",
39
+ description: "Add a variant",
40
+ assignee_name: "Alice Jones",
41
+ assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
42
+ },
43
+ {
44
+ id: "14",
45
+ container: "To Do",
46
+ title: "Task 4",
47
+ description: "Add jest tests",
48
+ assignee_name: "Mike James",
49
+ assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
50
+ },
51
+ {
52
+ id: "15",
53
+ container: "Done",
54
+ title: "Task 5",
55
+ description: "Alpha testing",
56
+ assignee_name: "James Guy",
57
+ assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
58
+ },
59
+ {
60
+ id: "16",
61
+ container: "In Progress",
62
+ title: "Task 6",
63
+ description: "Release",
64
+ assignee_name: "Sally Jones",
65
+ assignee_img: "https://randomuser.me/api/portraits/women/28.jpg",
66
+ },
67
+ ];
68
+
69
+ const DraggableMultipleContainersDropzone = (props) => {
70
+ const [initialState, setInitialState] = useState(data);
71
+
72
+ const badgeProperties = (container) => {
73
+ switch (container) {
74
+ case "To Do":
75
+ return { text: "queue", color: "warning" };
76
+ case "In Progress":
77
+ return { text: "progress", color: "primary" };
78
+ default:
79
+ return { text: "done", color: "success" };
80
+ }
81
+ };
82
+
83
+ return (
84
+ <DraggableProvider
85
+ dropZone={{type: "outline"}}
86
+ enableCrossContainerPreview
87
+ initialItems={data}
88
+ onDragEnd={(draggedItemId, finalContainer, originalContainer, itemAbove, itemBelow) => {
89
+ console.log(`Dragged Item ID: ${draggedItemId}`);
90
+ console.log(`Final Container: ${finalContainer}`);
91
+ console.log(`Original Container: ${originalContainer}`);
92
+ console.log('Item Above:', itemAbove);
93
+ console.log('Item Below:', itemBelow);
94
+ }}
95
+ onDrop={(draggedItemId, droppedContainer, originalContainer, item, itemAbove, itemBelow) => {
96
+ console.log(`Dragged Item ID: ${draggedItemId}`);
97
+ console.log(`Dropped Container: ${droppedContainer}`);
98
+ console.log(`Original Container: ${originalContainer}`);
99
+ console.log('Dropped Item:', item);
100
+ console.log('Item Above:', itemAbove);
101
+ console.log('Item Below:', itemBelow);
102
+ }}
103
+ onReorder={(items) => setInitialState(items)}
104
+ >
105
+ <Flex
106
+ justifyContent="center"
107
+ {...props}
108
+ >
109
+ {containers?.map((container) => (
110
+ <Draggable.Container
111
+ container={container}
112
+ htmlOptions={{style:{ width: "200px", height: "70vh"}}}
113
+ key={container}
114
+ padding="sm"
115
+ >
116
+ <Caption textAlign="center">{container}</Caption>
117
+ <Flex
118
+ alignItems="stretch"
119
+ gap="sm"
120
+ orientation="column"
121
+ >
122
+ {initialState
123
+ .filter((item) => item.container === container)
124
+ .map(
125
+ ({
126
+ assignee_img,
127
+ assignee_name,
128
+ description,
129
+ id,
130
+ title,
131
+ }) => (
132
+ <Draggable.Item
133
+ container={container}
134
+ dragId={id}
135
+ key={id}
136
+ >
137
+ <Card
138
+ padding="sm"
139
+ {...props}
140
+ >
141
+ <Flex justify="between">
142
+ <FlexItem>
143
+ <Flex>
144
+ <Avatar
145
+ imageUrl={assignee_img}
146
+ name={assignee_name}
147
+ size="xxs"
148
+ />
149
+ <Title paddingLeft="xs"
150
+ size={4}
151
+ text={title}
152
+ {...props}
153
+ />
154
+ </Flex>
155
+ </FlexItem>
156
+ <Badge
157
+ marginLeft="sm"
158
+ rounded
159
+ text={badgeProperties(container).text}
160
+ variant={badgeProperties(container).color}
161
+ {...props}
162
+ />
163
+ </Flex>
164
+ <Body paddingTop="xs"
165
+ text={description}
166
+ {...props}
167
+ />
168
+ </Card>
169
+ </Draggable.Item>
170
+ )
171
+ )}
172
+ </Flex>
173
+ </Draggable.Container>
174
+ ))}
175
+ </Flex>
176
+ </DraggableProvider>
177
+ );
178
+ };
179
+
180
+ export default DraggableMultipleContainersDropzone;
@@ -0,0 +1,22 @@
1
+ The multiple container functionality also supports customized dropzone styling as shown here.
2
+
3
+ In addition to this, the `enableCrossContainerPreview` prop can be used on the `DraggableProvider` as shown here to enable dropzone preview for cross-container dragging.
4
+
5
+ With `enableCrossContainerPreview`, the `onDrop` and `onDragEnd` event listeners will also provide several arguments to allow developers more context from the drag event.
6
+
7
+ The `onDrop` callback is triggered when an item is successfully dropped into a container. It provides the following arguments:
8
+
9
+ - `draggedItemId` - The ID of the item that was dragged
10
+ - `droppedContainer` - The container where the item was dropped
11
+ - `originalContainer` - The container where the drag started
12
+ - `item` - The complete item object with all properties (including the updated container)
13
+ - `itemAbove` - The item directly above the dropped item in the final position (null if at the top)
14
+ - `itemBelow` - The item directly below the dropped item in the final position (null if at the bottom)
15
+
16
+ The `onDragEnd` callback is triggered when a drag operation ends, whether it was dropped or cancelled. It provides the following arguments:
17
+
18
+ - `draggedItemId` - The ID of the item that was dragged
19
+ - `finalContainer` - The container where the item ended up (could be same as original if drag was cancelled)
20
+ - `originalContainer` - The container where the drag started
21
+ - `itemAbove` - The item directly above the dragged item in the final position (null if at the top)
22
+ - `itemBelow` - The item directly below the dragged item in the final position (null if at the bottom)
@@ -5,11 +5,12 @@ examples:
5
5
  - draggable_with_selectable_list: Draggable with SelectableList Kit
6
6
  - draggable_with_cards: Draggable with Cards
7
7
  - draggable_with_table: Draggable with Table
8
- - draggable_multiple_containers: Dragging Across Multiple Containers
9
8
  - draggable_drop_zones: Draggable Drop Zones
10
9
  - draggable_drop_zones_colors: Draggable Drop Zones Colors
11
10
  - draggable_drop_zones_line: Draggable Drop Zones Line
12
11
  - draggable_event_listeners: Draggable Event Listeners
12
+ - draggable_multiple_containers: Dragging Across Multiple Containers
13
+ - draggable_multiple_containers_dropzone: Dragging Across Multiple Containers with Dropzones
13
14
 
14
15
  rails:
15
16
  - draggable_default: Default
@@ -17,8 +18,8 @@ examples:
17
18
  - draggable_with_selectable_list: Draggable with SelectableList Kit
18
19
  - draggable_with_cards: Draggable with Cards
19
20
  - draggable_with_table: Draggable with Table
20
- - draggable_multiple_containers: Dragging Across Multiple Containers
21
21
  - draggable_drop_zones: Draggable Drop Zones
22
22
  - draggable_drop_zones_colors: Draggable Drop Zones Colors
23
23
  - draggable_drop_zones_line: Draggable Drop Zones Line
24
24
  - draggable_event_listeners: Draggable Event Listeners
25
+ - draggable_multiple_containers: Dragging Across Multiple Containers
@@ -7,4 +7,5 @@ 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
9
  export { default as DraggableDropZonesLine } from './_draggable_drop_zones_line.jsx'
10
- export { default as DraggableEventListeners } from './_draggable_event_listeners.jsx'
10
+ export { default as DraggableEventListeners } from './_draggable_event_listeners.jsx'
11
+ export { default as DraggableMultipleContainersDropzone } from './_draggable_multiple_containers_dropzone.jsx'
@@ -8,4 +8,4 @@
8
8
  state: "PA",
9
9
  zipcode: "19382",
10
10
  territory: "PHL",
11
- }) %>
11
+ }) %>
@@ -0,0 +1,42 @@
1
+ import React from 'react'
2
+ import MultipleUsers from '../../pb_multiple_users/_multiple_users'
3
+
4
+ const MultipleUsersWithTooltip = (props) => {
5
+ return (
6
+ <div>
7
+ <MultipleUsers
8
+ users={[
9
+ {
10
+ name: 'Patrick Welch',
11
+ imageUrl: 'https://randomuser.me/api/portraits/men/9.jpg',
12
+ tooltip: "Patrick Welch - Online"
13
+ },
14
+ {
15
+ name: 'Lucille Sanchez',
16
+ imageUrl: 'https://randomuser.me/api/portraits/women/6.jpg',
17
+ tooltip: "Lucille Sanchez - Offline"
18
+ },
19
+ {
20
+ name: 'Beverly Reyes',
21
+ imageUrl: 'https://randomuser.me/api/portraits/women/74.jpg',
22
+ tooltip: "Beverly Reyes - Online"
23
+ },
24
+ {
25
+ name: 'Keith Craig',
26
+ imageUrl: 'https://randomuser.me/api/portraits/men/40.jpg',
27
+ tooltip: "Keith Craig - Away"
28
+ },
29
+ {
30
+ name: 'Alicia Cooper',
31
+ imageUrl: 'https://randomuser.me/api/portraits/women/46.jpg',
32
+ tooltip: "Alicia Cooper - Busy"
33
+ },
34
+ ]}
35
+ withTooltip
36
+ {...props}
37
+ />
38
+ </div>
39
+ )
40
+ }
41
+ ``
42
+ export default MultipleUsersWithTooltip
@@ -0,0 +1 @@
1
+ Use the `withTooltip` boolean prop to enable setting user-specific tooltip content via the `tooltip` property in the users array.
@@ -10,6 +10,7 @@ examples:
10
10
  - multiple_users_default: Default
11
11
  - multiple_users_reverse: Reverse
12
12
  - multiple_users_size: Size
13
+ - multiple_users_with_tooltip: With Tooltip
13
14
 
14
15
  swift:
15
16
  - multiple_users_default_swift: Default
@@ -1,3 +1,4 @@
1
1
  export { default as MultipleUsersDefault } from './_multiple_users_default.jsx'
2
2
  export { default as MultipleUsersReverse } from './_multiple_users_reverse.jsx'
3
3
  export { default as MultipleUsersSize } from './_multiple_users_size.jsx'
4
+ export { default as MultipleUsersWithTooltip } from './_multiple_users_with_tooltip.jsx'
@@ -1,12 +1,42 @@
1
1
  <form id="example-form-validation" action="" method="get">
2
- <%= pb_rails("phone_number_input", props: { error: "Missing phone number", id: "validation", initial_country: "af", value: "", required: true }) %>
2
+ <%= pb_rails("phone_number_input", props: {
3
+ id: "validation",
4
+ initial_country: "af",
5
+ value: "",
6
+ required: true
7
+ }) %>
3
8
  <%= pb_rails("button", props: {html_type: "submit", text: "Save Phone Number"}) %>
4
9
  </form>
5
10
 
6
11
  <%= javascript_tag do %>
7
12
  document.addEventListener('DOMContentLoaded', function () {
8
- document.querySelector('#example-form-validation').addEventListener('submit', function (e) {
9
- if (e.target.querySelectorAll('[error]:not([error=""])').length > 0) e.preventDefault();
10
- })
13
+ const form = document.querySelector('#example-form-validation');
14
+
15
+ // Wait for React component to mount
16
+ function waitForComponent() {
17
+ const phoneInput = form.querySelector('#validation');
18
+
19
+ if (!phoneInput) {
20
+ setTimeout(waitForComponent, 100);
21
+ return;
22
+ }
23
+
24
+ // Wait for intl-tel-input to initialize, then focus and blur to trigger validation
25
+ setTimeout(function() {
26
+ phoneInput.focus({ preventScroll: true });
27
+ setTimeout(function() {
28
+ phoneInput.blur();
29
+ }, 100);
30
+ }, 500);
31
+ }
32
+
33
+ waitForComponent();
34
+
35
+ // Prevent form submission if there are validation errors
36
+ form.addEventListener('submit', function (e) {
37
+ if (e.target.querySelectorAll('[error]:not([error=""])').length > 0) {
38
+ e.preventDefault();
39
+ }
40
+ });
11
41
  })
12
42
  <% end %>