playbook_ui_docs 15.6.0 → 15.7.0.pre.alpha.play263313229

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb +43 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +11 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +7 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx +54 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md +9 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx +80 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md +3 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
  12. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  13. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  14. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +0 -1
  15. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +0 -3
  16. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.html.erb +33 -0
  17. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.jsx +46 -0
  18. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_rails.md +2 -0
  19. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_react.md +2 -0
  20. data/app/pb_kits/playbook/pb_contact/docs/example.yml +2 -0
  21. data/app/pb_kits/playbook/pb_contact/docs/index.js +1 -0
  22. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +23 -14
  23. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +1 -1
  24. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb +24 -0
  25. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx +60 -0
  26. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md +3 -0
  27. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.html.erb +71 -0
  28. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.jsx +57 -0
  29. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_rails.md +1 -0
  30. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_react.md +1 -0
  31. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +4 -0
  32. data/app/pb_kits/playbook/pb_dialog/docs/index.js +3 -1
  33. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  34. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +7 -5
  35. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.html.erb +19 -0
  36. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.html.erb +12 -0
  37. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.md +26 -0
  38. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.html.erb +19 -0
  39. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.md +1 -0
  40. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.html.erb +30 -0
  41. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.md +3 -0
  42. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.html.erb +29 -0
  43. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.md +13 -0
  44. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +3 -1
  45. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +5 -0
  46. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -1
  47. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -1
  48. data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +14 -0
  49. data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.md +3 -0
  50. data/app/pb_kits/playbook/pb_form/docs/example.yml +1 -0
  51. data/app/pb_kits/playbook/pb_radio/docs/_radio_error.md +1 -1
  52. data/app/pb_kits/playbook/pb_select/docs/_select_error.md +1 -1
  53. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +16 -0
  54. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +30 -0
  55. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +1 -0
  56. data/app/pb_kits/playbook/pb_select/docs/example.yml +2 -0
  57. data/app/pb_kits/playbook/pb_select/docs/index.js +1 -0
  58. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx +134 -0
  59. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md +34 -0
  60. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb +101 -0
  61. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +33 -0
  62. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx +180 -0
  63. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.md +3 -0
  64. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.html.erb +122 -0
  65. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.md +3 -0
  66. data/app/pb_kits/playbook/pb_table/docs/example.yml +4 -0
  67. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  68. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md +1 -1
  69. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_required_indicator.html.erb +6 -0
  70. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_required_indicator.jsx +25 -0
  71. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_required_indicator.md +3 -0
  72. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +3 -0
  73. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  74. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md +1 -1
  75. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_24_hour.html.erb +2 -0
  76. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_24_hour.jsx +16 -0
  77. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_24_hour.md +1 -0
  78. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default.html.erb +1 -0
  79. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default.jsx +13 -0
  80. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default.md +1 -0
  81. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default_time.html.erb +4 -0
  82. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default_time.jsx +29 -0
  83. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default_time.md +1 -0
  84. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_disabled.html.erb +13 -0
  85. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_disabled.jsx +23 -0
  86. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_error.html.erb +5 -0
  87. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_error.jsx +15 -0
  88. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_input_options.html.erb +14 -0
  89. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_label.html.erb +2 -0
  90. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_label.jsx +15 -0
  91. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_min_max_time.html.erb +42 -0
  92. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_min_max_time.jsx +52 -0
  93. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_min_max_time.md +1 -0
  94. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.jsx +45 -0
  95. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.md +1 -0
  96. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.html.erb +3 -0
  97. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.jsx +21 -0
  98. data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.md +1 -0
  99. data/app/pb_kits/playbook/pb_time_picker/docs/example.yml +24 -0
  100. data/app/pb_kits/playbook/pb_time_picker/docs/index.js +9 -0
  101. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +60 -0
  102. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +118 -0
  103. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +1 -0
  104. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
  105. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +2 -0
  106. data/app/pb_kits/playbook/pb_timeline/docs/index.js +1 -0
  107. metadata +73 -2
@@ -0,0 +1,57 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import Body from '../../pb_body/_body'
4
+ import Button from '../../pb_button/_button'
5
+ import Dialog from '../../pb_dialog/_dialog'
6
+ import Typeahead from '../../pb_typeahead/_typeahead'
7
+
8
+ const DialogOverflowVisible = () => {
9
+ const [isOpen, setIsOpen] = useState(false)
10
+ const close = () => setIsOpen(false)
11
+ const open = () => setIsOpen(true)
12
+
13
+ const typeaheadOptions = [
14
+ { label: "United States", value: "unitedStates", id: "us" },
15
+ { label: "United Kingdom", value: "unitedKingdom", id: "gb" },
16
+ { label: "Canada", value: "canada", id: "ca" },
17
+ { label: "Australia", value: "australia", id: "au" },
18
+ { label: "Germany", value: "germany", id: "de" },
19
+ { label: "France", value: "france", id: "fr" },
20
+ { label: "Japan", value: "japan", id: "jp" },
21
+ { label: "Brazil", value: "brazil", id: "br" },
22
+ ]
23
+
24
+ return (
25
+ <>
26
+ <Button onClick={open}>{'Open Dialog with Overflow Visible'}</Button>
27
+ <Dialog
28
+ onClose={close}
29
+ opened={isOpen}
30
+ overflow="visible"
31
+ size="md"
32
+ >
33
+ <Dialog.Header>
34
+ <Body>{'Select Location'}</Body>
35
+ </Dialog.Header>
36
+ <Dialog.Body>
37
+ <Typeahead
38
+ options={typeaheadOptions}
39
+ placeholder="Select a location..."
40
+ />
41
+ </Dialog.Body>
42
+ <Dialog.Footer>
43
+ <Button onClick={close}>{'Save'}</Button>
44
+ <Button
45
+ onClick={close}
46
+ variant="link"
47
+ >
48
+ {'Cancel'}
49
+ </Button>
50
+ </Dialog.Footer>
51
+ </Dialog>
52
+ </>
53
+ )
54
+ }
55
+
56
+ export default DialogOverflowVisible
57
+
@@ -0,0 +1 @@
1
+ Use the `overflow: "visible"` global prop to allow Typeahead dropdown menus to appear outside the dialog boundaries. By default, dialogs clip content that extends beyond their edges, but this prop enables pop-up elements to render above the dialog overlay.
@@ -0,0 +1 @@
1
+ Use the `overflow="visible"` global prop to allow Date Picker and Typeahead dropdown menus to appear outside the dialog boundaries. By default, dialogs clip content that extends beyond their edges, but this prop enables pop-up elements to render above the dialog overlay.
@@ -12,6 +12,8 @@ examples:
12
12
  - dialog_full_height_placement: Full Height Placement
13
13
  - dialog_loading: Loading
14
14
  - dialog_turbo_frames: Within Turbo Frames
15
+ - dialog_overflow_visible: Overflow Visible
16
+ - dialog_closeable: Close Button in Header
15
17
 
16
18
 
17
19
  react:
@@ -25,6 +27,8 @@ examples:
25
27
  - dialog_full_height: Full Height
26
28
  - dialog_full_height_placement: Full Height Placement
27
29
  - dialog_loading: Loading
30
+ - dialog_overflow_visible: Overflow Visible
31
+ - dialog_closeable: Close Button in Header
28
32
 
29
33
  swift:
30
34
  - dialog_default_swift: Simple
@@ -8,4 +8,6 @@ export { default as DialogStatus } from './_dialog_status.jsx'
8
8
  export { default as DialogStackedAlert } from './_dialog_stacked_alert.jsx'
9
9
  export { default as DialogFullHeight } from './_dialog_full_height.jsx'
10
10
  export { default as DialogFullHeightPlacement } from './_dialog_full_height_placement.jsx'
11
- export { default as DialogLoading } from './_dialog_loading.jsx'
11
+ export { default as DialogLoading } from './_dialog_loading.jsx'
12
+ export { default as DialogOverflowVisible } from './_dialog_overflow_visible.jsx'
13
+ export { default as DialogCloseable } from './_dialog_closeable.jsx'
@@ -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.
@@ -20,12 +20,14 @@
20
20
 
21
21
  %>
22
22
 
23
- <%= pb_rails("dropdown", props: {options: options}) %>
23
+ <%= pb_rails("dropdown", props: {id: "country-dropdown", options: options}) %>
24
24
 
25
25
  <script>
26
26
  document.addEventListener("pb:dropdown:selected", (e) => {
27
- const option = e.detail;
28
- const dropdown = e.target;
29
- console.log("Selected option:", option);
30
- })
27
+ if (e.target.id === "country-dropdown") {
28
+ const option = e.detail;
29
+ const dropdown = e.target;
30
+ console.log("Selected option:", option);
31
+ }
32
+ });
31
33
  </script>
@@ -0,0 +1,19 @@
1
+
2
+ <%= pb_rails("dropdown", props: {
3
+ id: "date-range-with-default",
4
+ label: "Date Range",
5
+ variant: "quickpick",
6
+ default_value: "This Year"
7
+ }) %>
8
+
9
+ <script>
10
+ document.addEventListener("DOMContentLoaded", () => {
11
+ const dropdown = document.getElementById("date-range-with-default");
12
+ if (dropdown) {
13
+ dropdown.addEventListener("pb:dropdown:selected", (e) => {
14
+ const option = e.detail;
15
+ console.log("Selected option:", option);
16
+ });
17
+ }
18
+ });
19
+ </script>
@@ -0,0 +1,12 @@
1
+ <%= pb_rails("dropdown", props: {id: "date-range-quickpick-1", label: "Date Range", variant: "quickpick"}) %>
2
+
3
+
4
+ <script>
5
+ const dropdown = document.getElementById("date-range-quickpick-1");
6
+ if (dropdown) {
7
+ dropdown.addEventListener("pb:dropdown:selected", (e) => {
8
+ const option = e.detail;
9
+ console.log("Selected option:", option);
10
+ });
11
+ }
12
+ </script>
@@ -0,0 +1,26 @@
1
+ The `quickpick` variant provides predefined date based options when `variant:"quickpick"` is used.
2
+
3
+ Open the Dropdown above to see the default options.
4
+
5
+ The quickpick variant automatically generates hidden inputs for `start_date` and `end_date` which are populated when a date range is selected. These inputs are ready for form submission.
6
+
7
+ You can customize the input names and IDs using the following props:
8
+ - `start_date_name` - The name attribute for the start date input (default: `"start_date_name"`)
9
+ - `start_date_id` - The ID attribute for the start date input (default: `"start_date_id"`)
10
+ - `end_date_name` - The name attribute for the end date input (default: `"end_date_name"`)
11
+ - `end_date_id` - The ID attribute for the end date input (default: `"end_date_id"`)
12
+
13
+ Example with custom names:
14
+ ```ruby
15
+ pb_rails("dropdown", props: {
16
+ variant: "quickpick",
17
+ start_date_name: "filter[start_date]",
18
+ start_date_id: "filter_start_date",
19
+ end_date_name: "filter[end_date]",
20
+ end_date_id: "filter_end_date"
21
+ })
22
+ ```
23
+
24
+ The Dropdown kit also comes with a custom event called "pb:dropdown:selected" which updates dynamically with the selection as it changes. See code snippet to see this in action.
25
+
26
+ In addition, a data attribute called data-option-selected with the selection is also rendered on the parent dropdown div.
@@ -0,0 +1,19 @@
1
+
2
+ <%= pb_rails("dropdown", props: {
3
+ id: "date-range-quickpick-end-today",
4
+ label: "Date Range",
5
+ variant: "quickpick",
6
+ range_ends_today: true
7
+ }) %>
8
+
9
+ <script>
10
+ document.addEventListener("DOMContentLoaded", () => {
11
+ const dropdown = document.getElementById("date-range-quickpick-end-today");
12
+ if (dropdown) {
13
+ dropdown.addEventListener("pb:dropdown:selected", (e) => {
14
+ const option = e.detail;
15
+ console.log("Selected option:", option);
16
+ });
17
+ }
18
+ });
19
+ </script>
@@ -0,0 +1 @@
1
+ The optional `range_ends_today` prop can be used with the `quickpick` variant to set end date on all ranges that start with 'this' to today's date. For instance, by default 'This Year' will set end day to 12/31/(current year), but if `range_ends_today` prop is used, end date on that range will be today's date.
@@ -0,0 +1,30 @@
1
+ <%= pb_rails("dropdown", props: {
2
+ id: "dropdown-quickpick-with-date-pickers-default",
3
+ label: "Date Range",
4
+ name: "date_range",
5
+ margin_bottom: "sm",
6
+ variant: "quickpick",
7
+ default_value: "This Month",
8
+ controls_start_id: "start-date-picker-default",
9
+ controls_end_id: "end-date-picker-default",
10
+ start_date_id: "quickpick_start_date_default",
11
+ start_date_name: "start_date",
12
+ end_date_id: "quickpick_end_date_default",
13
+ end_date_name: "end_date"
14
+ }) %>
15
+
16
+ <%= pb_rails("date_picker", props: {
17
+ picker_id: "start-date-picker-default",
18
+ label: "Start Date",
19
+ name: "start_date_picker",
20
+ placeholder: "Select Start Date",
21
+ sync_start_with: "dropdown-quickpick-with-date-pickers-default"
22
+ }) %>
23
+
24
+ <%= pb_rails("date_picker", props: {
25
+ picker_id: "end-date-picker-default",
26
+ label: "End Date",
27
+ name: "end_date_picker",
28
+ placeholder: "Select End Date",
29
+ sync_end_with: "dropdown-quickpick-with-date-pickers-default"
30
+ }) %>
@@ -0,0 +1,3 @@
1
+ This example demonstrates the 3-input pattern with a default value. The dropdown is initialized with "This Month" selected, and both DatePickers are automatically populated with the corresponding start and end dates.
2
+
3
+ The default value can be set using the `default_value` prop with any of the quickpick option labels.
@@ -0,0 +1,29 @@
1
+ <%= pb_rails("dropdown", props: {
2
+ id: "dropdown-quickpick-with-date-pickers",
3
+ label: "Date Range",
4
+ name: "date_range",
5
+ margin_bottom: "sm",
6
+ variant: "quickpick",
7
+ controls_start_id: "start-date-picker",
8
+ controls_end_id: "end-date-picker",
9
+ start_date_id: "quickpick_start_date",
10
+ start_date_name: "start_date",
11
+ end_date_id: "quickpick_end_date",
12
+ end_date_name: "end_date"
13
+ }) %>
14
+
15
+ <%= pb_rails("date_picker", props: {
16
+ picker_id: "start-date-picker",
17
+ label: "Start Date",
18
+ name: "start_date_picker",
19
+ placeholder: "Select Start Date",
20
+ sync_start_with: "dropdown-quickpick-with-date-pickers"
21
+ }) %>
22
+
23
+ <%= pb_rails("date_picker", props: {
24
+ picker_id: "end-date-picker",
25
+ label: "End Date",
26
+ name: "end_date_picker",
27
+ placeholder: "Select End Date",
28
+ sync_end_with: "dropdown-quickpick-with-date-pickers"
29
+ }) %>
@@ -0,0 +1,13 @@
1
+ The quickpick variant can be synced with two DatePickers for a 3-input pattern. When a quickpick option is selected from the dropdown, both DatePickers are automatically populated. When either DatePicker is manually changed, the dropdown is cleared.
2
+
3
+ #### Props for 3-Input Pattern:
4
+
5
+ - `controls_start_id` - ID of the start DatePicker to sync with
6
+ - `controls_end_id` - ID of the end DatePicker to sync with
7
+
8
+ #### DatePicker Props:
9
+
10
+ - `sync_start_with` - ID of the dropdown to clear when start date changes
11
+ - `sync_end_with` - ID of the dropdown to clear when end date changes
12
+
13
+ This pattern allows users to quickly select common date ranges or manually pick specific dates.
@@ -47,7 +47,7 @@
47
47
  %>
48
48
 
49
49
 
50
- <%= pb_rails("dropdown", props: {options: options}) do %>
50
+ <%= pb_rails("dropdown", props: {id: "user-dropdown", options: options}) do %>
51
51
  <%= pb_rails("dropdown/dropdown_trigger", props: {placeholder: "Select a User", custom_display: custom_display}) %>
52
52
  <%= pb_rails("dropdown/dropdown_container") do %>
53
53
  <% options.each do |option| %>
@@ -71,6 +71,8 @@
71
71
 
72
72
  <script>
73
73
  document.addEventListener("pb:dropdown:selected", (e) => {
74
+ if (e.target.id !== "user-dropdown") return;
75
+
74
76
  const option = e.detail;
75
77
  const dropdown = e.target;
76
78
 
@@ -22,6 +22,11 @@ examples:
22
22
  - dropdown_multi_select_with_default: Multi Select Default Value
23
23
  - dropdown_blank_selection: Blank Selection
24
24
  - dropdown_separators_hidden: Separators Hidden
25
+ - dropdown_quickpick_rails: Quick Pick Variant
26
+ - dropdown_quickpick_range_end_rails: Quick Pick Variant (Range Ends Today)
27
+ - dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
28
+ - dropdown_quickpick_with_date_pickers_rails: Quick Pick with Date Pickers
29
+ - dropdown_quickpick_with_date_pickers_default_rails: Quick Pick with Date Pickers (Default Value)
25
30
 
26
31
  react:
27
32
  - dropdown_default: Default
@@ -116,7 +116,7 @@
116
116
  <%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true } %>
117
117
  <%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true } %>
118
118
  <%= form.multi_level_select :example_multi_level_select, props: { id: "multi-level-select-form-default", tree_data: treeData, margin_bottom: "sm", label: "Example Multi Level Select field" } %>
119
-
119
+ <%= form.time_picker :example_time_picker, props: { label: true } %>
120
120
  <%= form.actions do |action| %>
121
121
  <%= action.submit %>
122
122
  <%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
@@ -117,7 +117,8 @@
117
117
  <%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
118
118
  <%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true, blank_selection: "Select a Time Zone...", required: true } %>
119
119
  <%= form.multi_level_select :example_multi_level_select, props: { id: "multi-level-select-form", tree_data: treeData, margin_bottom: "sm", required: true, label: "Example Multi Level Select field" } %>
120
-
120
+ <%= form.time_picker :example_time_picker_validation, props: { label: true, required: true, validation_message: "Please select a time." } %>
121
+
121
122
  <%= form.actions do |action| %>
122
123
  <%= action.submit %>
123
124
  <%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
@@ -0,0 +1,14 @@
1
+ <%= pb_form_with(scope: :example, url: "", method: :get, validate: true) do |form| %>
2
+ <%= form.text_field :example_text_field, props: { label: true, required: true, required_indicator: true } %>
3
+ <%= form.text_field :example_text_field_2, props: { label: "Text Field Custom Label", required: true, required_indicator: true } %>
4
+ <%= form.email_field :example_email_field, props: { label: true, required: true, required_indicator: true } %>
5
+ <%= form.number_field :example_number_field, props: { label: true, required: true, required_indicator: true } %>
6
+ <%= form.search_field :example_search_field, props: { label: true, required: true, required_indicator: true } %>
7
+ <%= form.password_field :example_password_field, props: { label: true, required: true, required_indicator: true } %>
8
+ <%= form.url_field :example_url_field, props: { label: true, required: true, required_indicator: true } %>
9
+
10
+ <%= form.actions do |action| %>
11
+ <%= action.submit %>
12
+ <%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
13
+ <% end %>
14
+ <% end %>
@@ -0,0 +1,3 @@
1
+ The `required_indicator` prop adds a red asterisk (*) to the input label, visually marking the field as required. This works with both `label: true` for auto-generated labels and `label: "Custom Text"` for custom labels.
2
+
3
+ While it's typically used alongside the `required` prop for HTML5 validation, you can use `required_indicator` independently if you're handling validation differently (e.g., client-side or backend validation).
@@ -4,3 +4,4 @@ examples:
4
4
  - form_form_with: Default
5
5
  - form_form_with_validate: Default + Validation
6
6
  - form_form_with_loading: Default + Loading
7
+ - form_with_required_indicator: With Optional Required Indicator
@@ -1 +1 @@
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
+ 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 +1 @@
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).
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).
@@ -0,0 +1,16 @@
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
+
@@ -0,0 +1,30 @@
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
+
@@ -0,0 +1 @@
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.
@@ -15,6 +15,7 @@ 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
18
19
 
19
20
 
20
21
 
@@ -33,6 +34,7 @@ examples:
33
34
  - select_inline_compact: Select Inline Compact
34
35
  - select_multiple: Select Multiple
35
36
  - select_react_hook: React Hook
37
+ - select_input_options: Input Options
36
38
 
37
39
  swift:
38
40
  - select_default_swift: Default
@@ -12,3 +12,4 @@ 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'
@@ -0,0 +1,134 @@
1
+ import React, { useState } from "react"
2
+ import { Button, Date as DateKit, DatePicker, Dropdown, Select, Table, TextInput, Typeahead, Flex } from "playbook-ui"
3
+
4
+ // Mock Data for Table
5
+ const users = [
6
+ { id: 1, name: "Jennifer", title: "Associate Scrum Master", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-01" },
7
+ { id: 2, name: "Nick", title: "UX Engineer II", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-02" },
8
+ { id: 3, name: "Nida", title: "Senior UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-03" },
9
+ { id: 4, name: "Justin", title: "Director of User Experience Engineering", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-04" },
10
+ { id: 5, name: "Edward", title: "UX Designer II", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-05" },
11
+ { id: 6, name: "Elisa", title: "UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-06" },
12
+ { id: 7, name: "Gary", title: "UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-07" },
13
+ { id: 8, name: "Barkley", title: "Nitro Quality Ninja", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-08" },
14
+ { id: 9, name: "Aaron", title: "Associate Nitro Quality Ninja", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-09" },
15
+ ]
16
+
17
+ const TableWithFilterVariant = () => {
18
+ const [territory, setTerritory] = useState("")
19
+
20
+ // --------Filter content example ------
21
+ const filterContent = ({ closePopover }) => (
22
+ <>
23
+ <TextInput
24
+ label="Territory ID"
25
+ onChange={event => setTerritory(event.target.value)}
26
+ value={territory}
27
+ />
28
+
29
+ <Typeahead
30
+ label="Title"
31
+ options={[
32
+ { key: "senior-ux-engineer", label: "Senior UX Engineer", value: "senior-ux-engineer" },
33
+ { key: "ux-engineer", label: "UX Engineer", value: "ux-engineer" },
34
+ { key: "ux-designer", label: "UX Designer", value: "ux-designer" }
35
+ ]}
36
+ />
37
+
38
+ <Select
39
+ blankSelection="All Departments"
40
+ label="Department"
41
+ options={[
42
+ { value: "Business Technology", label: "Business Technology", key: "business-technology" },
43
+ { value: "Customer Development", label: "Customer Development", key: "customer-development" },
44
+ { value: "Talent Acquisition", label: "Talent Acquisition", key: "talent-acquisition" }
45
+ ]}
46
+ />
47
+
48
+ <Dropdown
49
+ label="Branch"
50
+ options={[
51
+ { key: "Philadelphia", label: "Philadelphia", value: "philadelphia" },
52
+ { key: "New York", label: "New York", value: "new-york" },
53
+ { key: "Austin", label: "Austin", value: "austin" }
54
+ ]}
55
+ />
56
+
57
+ <DatePicker
58
+ label="Start Date"
59
+ paddingY="sm"
60
+ pickerId="startedOn"
61
+ />
62
+ <Flex spacing="between">
63
+ <Button
64
+ onClick={() => {
65
+ alert("No filtering functionality - just a pattern demo!")
66
+ closePopover()
67
+ }}
68
+ text="Filter"
69
+ />
70
+ <Button
71
+ text="Defaults"
72
+ variant="secondary"
73
+ />
74
+ </Flex>
75
+ </>
76
+ )
77
+ // -------End Filter content example ------
78
+
79
+ return (
80
+ <Table
81
+ filterContent={filterContent}
82
+ filterProps={{
83
+ results: 50,
84
+ sortOptions: {
85
+ territory_id: "Territory ID",
86
+ first_name: "Name",
87
+ started_on: "Start Date",
88
+ department_name: "Department",
89
+ title_name: "Title",
90
+ branch_branch_name: "Branch",
91
+ },
92
+ sortValue: [{ name: 'started_on', dir: 'asc' }],
93
+ }}
94
+ title="Table Title Here"
95
+ variant="withFilter"
96
+ >
97
+ <Table.Head>
98
+ <Table.Row>
99
+ <Table.Header>{'Territory ID'}</Table.Header>
100
+ <Table.Header>{'Name'}</Table.Header>
101
+ <Table.Header>{'Title'}</Table.Header>
102
+ <Table.Header>{'Department'}</Table.Header>
103
+ <Table.Header>{'Branch'}</Table.Header>
104
+ <Table.Header textAlign="right">{'Start Date'}</Table.Header>
105
+ </Table.Row>
106
+ </Table.Head>
107
+ <Table.Body>
108
+ {users.map((user) => (
109
+ <Table.Row key={user.id}>
110
+ <Table.Cell
111
+ marginX={{ xs: "sm" }}
112
+ numberSpacing="tabular"
113
+ >
114
+ {user.id}
115
+ </Table.Cell>
116
+ <Table.Cell marginX={{ xs: "sm" }}>{user.name}</Table.Cell>
117
+ <Table.Cell marginX={{ xs: "sm" }}>{user.title}</Table.Cell>
118
+ <Table.Cell marginX={{ xs: "sm" }}>{user.department}</Table.Cell>
119
+ <Table.Cell marginX={{ xs: "sm" }}>{user.branch}</Table.Cell>
120
+ <Table.Cell marginX={{ xs: "sm" }}>
121
+ <DateKit
122
+ alignment="right"
123
+ showCurrentYear
124
+ value={user.startDate}
125
+ />
126
+ </Table.Cell>
127
+ </Table.Row>
128
+ ))}
129
+ </Table.Body>
130
+ </Table>
131
+ )
132
+ }
133
+
134
+ export default TableWithFilterVariant
@@ -0,0 +1,34 @@
1
+ Set the `variant` prop to `withFilter` to render a Table with a filter. The variant automatically handles:
2
+
3
+ - Card wrapper with standard responsive margins
4
+ - Optional `title` prop to render title above the card
5
+ - Filter component rendering with Design defaults
6
+ - SectionSeparator between filter and table
7
+ - Flex layout for proper alignment
8
+
9
+ #### Required Props
10
+
11
+ - `variant="withFilter"`: Enables the filter variant
12
+ - `filterContent`: A function that receives `{ closePopover }` and returns the filter's body content (inputs, buttons, etc.). Use this to pass in all input kits, etc needed inside the Filter itself.
13
+ - `filterProps`: An object containing Filter-specific props like `results`, `sortOptions`, `sortValue`, etc.
14
+
15
+ #### Optional Props
16
+
17
+ - `title`: Displays a title above the card
18
+ - All standard Table props (`size`, `collapse`, etc.) can be used, but defaults are already set to match Design guidelines
19
+ - All standard Filter props can be used, but defaults are already set to match Design guidelines.
20
+
21
+ #### Default Filter Props
22
+
23
+ The Table kit automatically sets these Filter defaults (which you can override via `filterProps`):
24
+
25
+ - `background={false}`
26
+ - `maxHeight="50vh"`
27
+ - `minWidth="xs"`
28
+ - `popoverProps={{ width: "350px" }}`
29
+
30
+
31
+ **IMPORTANT NOTE**:
32
+ The purpose of this variant is to provide an easy way to set up a Table with a Filter with Design standards applied by default.
33
+
34
+ If you are looking for more customization than this embedded variant provides, you may be better served by using the individual kits as demonstrated in our Table Filter Card Building Block [here](https://playbook.powerapp.cloud/building_blocks/table_filter_card/react).