playbook_ui_docs 15.6.0.pre.alpha.play266013023 → 15.6.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +163 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +190 -0
  4. data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +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 +1 -0
  10. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +3 -0
  11. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +0 -31
  12. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -2
  13. data/app/pb_kits/playbook/pb_dialog/docs/index.js +1 -2
  14. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  15. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -3
  16. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
  17. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +1 -1
  18. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +0 -1
  19. data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +0 -1
  20. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +4 -34
  21. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +7 -16
  22. data/app/pb_kits/playbook/pb_radio/docs/_radio_error.md +1 -1
  23. data/app/pb_kits/playbook/pb_select/docs/_select_error.md +1 -1
  24. data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -2
  25. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
  26. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md +1 -1
  27. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md +1 -1
  28. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
  29. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +0 -2
  30. data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
  31. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  32. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
  33. metadata +2 -19
  34. data/app/pb_kits/playbook/pb_background/docs/_background_light.md +0 -1
  35. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb +0 -24
  36. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx +0 -60
  37. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md +0 -3
  38. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +0 -180
  39. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +0 -22
  40. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +0 -42
  41. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +0 -1
  42. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +0 -16
  43. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +0 -30
  44. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +0 -1
  45. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +0 -60
  46. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +0 -118
  47. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +0 -1
  48. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb +0 -30
  49. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx +0 -37
  50. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md +0 -3
@@ -10,19 +10,8 @@ const PhoneNumberInputValidation = (props) => {
10
10
  const [showFormErrors, setShowFormErrors] = useState(false);
11
11
  const [phoneNumber, setPhoneNumber] = useState("");
12
12
  const [countryCode, setCountryCode] = useState("af");
13
- const [isValid, setIsValid] = useState(false);
14
- const [hasInteracted, setHasInteracted] = useState(false);
15
-
16
- // Start with initial error - will be cleared on blur if valid
17
- const initialError = (
18
- <>
19
- <Icon icon="warning" /> Missing phone number.
20
- </>
21
- );
22
13
 
23
14
  const handleOnValidate = (valid) => {
24
- setIsValid(valid);
25
- setHasInteracted(true);
26
15
  setFormErrors(
27
16
  valid ? "" : "Please correct the fields below and try again."
28
17
  );
@@ -34,16 +23,18 @@ const PhoneNumberInputValidation = (props) => {
34
23
  };
35
24
 
36
25
  const handleOnSubmit = (e) => {
37
- if (!isValid) e.preventDefault()
26
+ if (showFormErrors) e.preventDefault()
38
27
  }
39
28
 
40
29
  useEffect(() => {
41
30
  setShowFormErrors(formErrors.length > 0);
42
31
  }, [formErrors]);
43
32
 
44
- // Only show error prop initially, or if invalid after interaction
45
- // Clear error prop once valid (component handles validation on blur)
46
- const shouldShowError = !hasInteracted || (hasInteracted && !isValid);
33
+ const error = (
34
+ <>
35
+ <Icon icon="warning" /> Missing phone number.
36
+ </>
37
+ )
47
38
 
48
39
  return (
49
40
  <form
@@ -59,7 +50,7 @@ const PhoneNumberInputValidation = (props) => {
59
50
  />
60
51
  )}
61
52
  <PhoneNumberInput
62
- error={shouldShowError ? initialError : undefined}
53
+ error={error}
63
54
  id="validation"
64
55
  initialCountry={countryCode}
65
56
  onChange={handleOnChange}
@@ -1 +1 @@
1
- Error shows that the radio option must be selected or is invalid (i.e. when used in a form it signals a user to fix an error).
1
+ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
@@ -1 +1 @@
1
- Select w/ Error shows that an option must be selected or is invalid (i.e. when used in a form it signals a user to fix an error).
1
+ Select w/ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
@@ -15,7 +15,6 @@ examples:
15
15
  - select_inline_compact: Select Inline Compact
16
16
  - select_attributes: Select W/ Attributes
17
17
  - select_multiple: Select Multiple
18
- - select_input_options: Input Options
19
18
 
20
19
 
21
20
 
@@ -34,7 +33,6 @@ examples:
34
33
  - select_inline_compact: Select Inline Compact
35
34
  - select_multiple: Select Multiple
36
35
  - select_react_hook: React Hook
37
- - select_input_options: Input Options
38
36
 
39
37
  swift:
40
38
  - select_default_swift: Default
@@ -12,4 +12,3 @@ export { default as SelectInlineCompact } from './_select_inline_compact.jsx'
12
12
  export { default as SelectMultiple } from './_select_multiple.jsx'
13
13
  export { default as SelectReactHook } from './_select_react_hook.jsx'
14
14
  export { default as SelectCustomSelectSubheaders } from './_select_custom_select_subheaders.jsx'
15
- export { default as SelectInputOptions } from './_select_input_options.jsx'
@@ -1 +1 @@
1
- Text Input w/ Error shows that the input must be filled out (i.e. when used in a form it signals a user to fix an error).
1
+ Text Input w/ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
@@ -1 +1 @@
1
- Textarea w/ Error shows that the input must be filled out (i.e. when used in a form it signals a user to fix an error).
1
+ Textarea w/ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
@@ -1 +1 @@
1
- Use the optional `showDate` prop to render the timeline kit with a visible date. By default, if the date is from the current year, the year will not be displayed; however, if the date is NOT from the current year, the kit will display the year as well.
1
+ Use the optional `showDate` prop to render the timeline kit with a visible date. If the date is from the current year, the year will not be displayed, however if date is NOT from the current year, the kit will display the year as well.
@@ -5,7 +5,6 @@ examples:
5
5
  - timeline_vertical: Vertical
6
6
  - timeline_with_date: With Date
7
7
  - timeline_with_children: With Children
8
- - timeline_show_current_year: Show Current Year
9
8
  - timeline_with_gap: With Gap
10
9
 
11
10
 
@@ -14,5 +13,4 @@ examples:
14
13
  - timeline_vertical: Vertical
15
14
  - timeline_with_date: With Date
16
15
  - timeline_with_children: With Children
17
- - timeline_show_current_year: Show Current Year
18
16
  - timeline_with_gap: With Gap
@@ -3,5 +3,4 @@ export { default as TimelineVertical } from './_timeline_vertical.jsx'
3
3
  export { default as TimelineWithDate } from './_timeline_with_date.jsx'
4
4
  export { default as TimelineWithChildren } from './_timeline_with_children.jsx'
5
5
  export { default as TimelineWithGap } from './_timeline_with_gap.jsx'
6
- export { default as TimelineShowCurrentYear } from './_timeline_show_current_year.jsx'
7
6
 
@@ -5,7 +5,6 @@ examples:
5
5
  - typeahead_default_options: With Default Options
6
6
  - typeahead_with_context: With Context
7
7
  - typeahead_with_pills: With Pills
8
- - typeahead_input_display: Input Display
9
8
  - typeahead_without_pills: Without Pills (Single Select)
10
9
  - typeahead_with_pills_async: With Pills (Async Data)
11
10
  - typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
@@ -27,7 +26,6 @@ examples:
27
26
  - typeahead_react_hook: React Hook
28
27
  - typeahead_with_highlight: With Highlight
29
28
  - typeahead_with_pills: With Pills
30
- - typeahead_input_display: Input Display
31
29
  - typeahead_with_pills_async: With Pills (Async Data)
32
30
  - typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
33
31
  - typeahead_with_pills_async_custom_options: With Pills (Async Data w/ Custom Options)
@@ -17,5 +17,4 @@ export { default as TypeaheadReactHook } from './_typeahead_react_hook.jsx'
17
17
  export { default as TypeaheadDisabled } from './_typeahead_disabled.jsx'
18
18
  export { default as TypeaheadPreserveInput } from './_typeahead_preserve_input.jsx'
19
19
  export { default as TypeaheadDefaultValue } from './_typeahead_default_value.jsx'
20
- export { default as TypeaheadCustomOptions } from './_typeahead_custom_options.jsx'
21
- export { default as TypeaheadInputDisplay } from './_typeahead_input_display.jsx'
20
+ export { default as TypeaheadCustomOptions } from './_typeahead_custom_options.jsx'
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: 15.6.0.pre.alpha.play266013023
4
+ version: 15.6.0.pre.rc.0
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-12-11 00:00:00.000000000 Z
12
+ date: 2025-11-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -220,7 +220,6 @@ files:
220
220
  - app/pb_kits/playbook/pb_background/docs/_background_image.md
221
221
  - app/pb_kits/playbook/pb_background/docs/_background_light.html.erb
222
222
  - app/pb_kits/playbook/pb_background/docs/_background_light.jsx
223
- - app/pb_kits/playbook/pb_background/docs/_background_light.md
224
223
  - app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx
225
224
  - app/pb_kits/playbook/pb_background/docs/_background_overlay.md
226
225
  - app/pb_kits/playbook/pb_background/docs/_background_size.html.erb
@@ -787,9 +786,6 @@ files:
787
786
  - app/pb_kits/playbook/pb_detail/docs/_detail_styled.jsx
788
787
  - app/pb_kits/playbook/pb_detail/docs/example.yml
789
788
  - app/pb_kits/playbook/pb_detail/docs/index.js
790
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb
791
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx
792
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md
793
789
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb
794
790
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx
795
791
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.md
@@ -859,8 +855,6 @@ files:
859
855
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md
860
856
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.html.erb
861
857
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx
862
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx
863
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md
864
858
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md
865
859
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_react.md
866
860
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.html.erb
@@ -1530,8 +1524,6 @@ files:
1530
1524
  - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size.jsx
1531
1525
  - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size.md
1532
1526
  - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md
1533
- - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx
1534
- - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md
1535
1527
  - app/pb_kits/playbook/pb_multiple_users/docs/example.yml
1536
1528
  - app/pb_kits/playbook/pb_multiple_users/docs/index.js
1537
1529
  - app/pb_kits/playbook/pb_multiple_users_stacked/docs/_description.md
@@ -2064,9 +2056,6 @@ files:
2064
2056
  - app/pb_kits/playbook/pb_select/docs/_select_inline_compact.jsx
2065
2057
  - app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.html.erb
2066
2058
  - app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.jsx
2067
- - app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb
2068
- - app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx
2069
- - app/pb_kits/playbook/pb_select/docs/_select_input_options.md
2070
2059
  - app/pb_kits/playbook/pb_select/docs/_select_multiple.html.erb
2071
2060
  - app/pb_kits/playbook/pb_select/docs/_select_multiple.jsx
2072
2061
  - app/pb_kits/playbook/pb_select/docs/_select_multiple.md
@@ -2414,9 +2403,6 @@ files:
2414
2403
  - app/pb_kits/playbook/pb_timeline/docs/_description.md
2415
2404
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_default.html.erb
2416
2405
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_default.jsx
2417
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb
2418
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx
2419
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md
2420
2406
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.html.erb
2421
2407
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.jsx
2422
2408
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb
@@ -2588,9 +2574,6 @@ files:
2588
2574
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.md
2589
2575
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.html.erb
2590
2576
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.jsx
2591
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb
2592
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx
2593
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md
2594
2577
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb
2595
2578
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx
2596
2579
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.html.erb
@@ -1 +0,0 @@
1
- By default, the Background kit sets background color to 'light' as seen here.
@@ -1,24 +0,0 @@
1
- <%= pb_rails("flex", props:{wrap:true}) do %>
2
- <%= pb_rails("button", props: { text: "Open Simple Dialog", data: {"open-dialog": "dialog-simple"}, margin_right:"md" }) %>
3
- <%= pb_rails("button", props: { text: "Open Complex Dialog", data: {"open-dialog": "dialog-complex2"} }) %>
4
- <% end %>
5
-
6
- <%= pb_rails("dialog", props: {
7
- id:"dialog-simple",
8
- size: "sm",
9
- title: "Header Title is the Title Prop",
10
- text: "Hello Body Text, Nice to meet ya.",
11
- cancel_button: "Cancel Button",
12
- closeable: false,
13
- confirm_button: "Okay",
14
- confirm_button_id: "confirm-button-simple"
15
- }) %>
16
-
17
- <%= pb_rails("dialog", props: {
18
- id:"dialog-complex2",
19
- size: "sm"
20
- }) do %>
21
- <%= pb_rails("dialog/dialog_header", props: { id: "dialog-complex2", title:"Header Title inside Dialog Header", closeable: false } ) %>
22
- <%= pb_rails("dialog/dialog_body", props:{text: "Hello Body Text, Nice to meet ya."}) %>
23
- <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Cancel Button", confirm_button: "Okay", confirm_button_id:"confirm-complex2", id: "dialog-complex2"}) %>
24
- <% end %>
@@ -1,60 +0,0 @@
1
- import React, { useState } from 'react'
2
- import Button from '../../pb_button/_button'
3
- import Dialog from '../../pb_dialog/_dialog'
4
-
5
-
6
- const DialogCloseable = () => {
7
- // Simple example
8
- const [isOpenSimple, setIsOpenSimple] = useState(false)
9
- const closeSimple = () => setIsOpenSimple(false)
10
- const openSimple = () => setIsOpenSimple(true)
11
-
12
- // Complex example
13
- const [isOpenComplex, setIsOpenComplex] = useState(false)
14
- const closeComplex = () => setIsOpenComplex(false)
15
- const openComplex = () => setIsOpenComplex(true)
16
-
17
- return (
18
- <>
19
- <Button
20
- marginRight='md'
21
- onClick={openSimple}
22
- >
23
- {'Open Simple Dialog'}
24
- </Button>
25
- <Button onClick={openComplex}>{'Open Complex Dialog'}</Button>
26
-
27
- <Dialog
28
- cancelButton="Cancel Button"
29
- closeable={false}
30
- confirmButton="Okay"
31
- onCancel={closeSimple}
32
- onClose={closeSimple}
33
- onConfirm={closeSimple}
34
- opened={isOpenSimple}
35
- size="sm"
36
- text="Hello Body Text, Nice to meet ya."
37
- title="Header Title is the Title Prop"
38
- />
39
- <Dialog
40
- onClose={closeComplex}
41
- opened={isOpenComplex}
42
- size="sm"
43
- >
44
- <Dialog.Header closeable={false}>{'Header Title inside Dialog.Header'}</Dialog.Header>
45
- <Dialog.Body>{'Hello Body Text, Nice to meet ya.'}</Dialog.Body>
46
- <Dialog.Footer>
47
- <Button onClick={closeComplex}>{'Okay'}</Button>
48
- <Button
49
- onClick={closeComplex}
50
- variant="link"
51
- >
52
- {'Cancel Button'}
53
- </Button>
54
- </Dialog.Footer>
55
- </Dialog>
56
- </>
57
- )
58
- }
59
-
60
- export default DialogCloseable
@@ -1,3 +0,0 @@
1
- The `closeable` prop can be set to false to optionally render the Dialog header without the close “X” button. `closeable` is set to true by default.
2
-
3
- This prop can be used with the simple as well as the complex version of the Dialog as can be seen here.
@@ -1,180 +0,0 @@
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;
@@ -1,22 +0,0 @@
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)
@@ -1,42 +0,0 @@
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
@@ -1 +0,0 @@
1
- Use the `withTooltip` boolean prop to enable setting user-specific tooltip content via the `tooltip` property in the users array.
@@ -1,16 +0,0 @@
1
- <%= pb_rails("select", props: {
2
- label: "Favorite Food",
3
- name: "favorite_food",
4
- options: [
5
- { value: "pizza", value_text: "Pizza" },
6
- { value: "tacos", value_text: "Tacos" },
7
- { value: "sushi", value_text: "Sushi" }
8
- ],
9
- input_options: {
10
- 'aria-label': "Select your favorite food",
11
- class: "custom-select-class",
12
- data: { controller: "search", action: "change->search#filter" },
13
- id: "favorite-food-select"
14
- }
15
- }) %>
16
-
@@ -1,30 +0,0 @@
1
- import React from 'react'
2
-
3
- import Select from '../_select'
4
-
5
- const SelectInputOptions = (props) => {
6
- const options = [
7
- { value: 'pizza', text: 'Pizza' },
8
- { value: 'tacos', text: 'Tacos' },
9
- { value: 'sushi', text: 'Sushi' },
10
- ]
11
-
12
- return (
13
- <>
14
- <Select
15
- inputOptions={{
16
- 'aria-label': 'Select your favorite food',
17
- className: 'custom-select-class',
18
- id: 'favorite-food-select',
19
- }}
20
- label="Favorite Food"
21
- name="favorite_food"
22
- options={options}
23
- {...props}
24
- />
25
- </>
26
- )
27
- }
28
-
29
- export default SelectInputOptions
30
-
@@ -1 +0,0 @@
1
- Use the `input_options` / `inputOptions` prop to pass additional attributes directly to the underlying `<select>` element instead of the outer wrapper. This is useful for applying data attributes, custom IDs, or other HTML attributes that need to be on the select element itself.