playbook_ui_docs 16.3.0 → 16.4.0.pre.alpha.displaybreakpoints15091

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.jsx +50 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.md +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_parent_only.jsx +175 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_parent_only.md +5 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
  8. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx +6 -3
  10. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.html.erb +3 -3
  11. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +6 -3
  12. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.html.erb +3 -3
  13. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +6 -3
  14. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.html.erb +16 -0
  15. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.md +1 -0
  16. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_event_type.html.erb +224 -0
  17. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_event_type.md +7 -0
  18. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
  19. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin.html.erb +46 -0
  20. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin.jsx +42 -0
  21. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin_rails.md +1 -0
  22. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin_react.md +1 -0
  23. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  24. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +2 -1
  25. data/app/pb_kits/playbook/pb_popover/docs/_popover_placement.jsx +81 -0
  26. data/app/pb_kits/playbook/pb_popover/docs/_popover_placement_react.md +1 -0
  27. data/app/pb_kits/playbook/pb_popover/docs/_popover_position.html.erb +128 -0
  28. data/app/pb_kits/playbook/pb_popover/docs/_popover_position_rails.md +1 -0
  29. data/app/pb_kits/playbook/pb_popover/docs/example.yml +2 -0
  30. data/app/pb_kits/playbook/pb_popover/docs/index.js +2 -1
  31. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +56 -0
  32. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.md +1 -0
  33. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +13 -21
  34. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -10
  35. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.jsx +152 -0
  36. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.md +17 -0
  37. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.html.erb +121 -0
  38. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.md +17 -0
  39. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  40. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
  41. metadata +23 -24
  42. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb +0 -5
  43. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx +0 -15
  44. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +0 -1
  45. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +0 -3
  46. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.jsx +0 -17
  47. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb +0 -6
  48. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx +0 -16
  49. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +0 -28
  50. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +0 -1
  51. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +0 -35
  52. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.jsx +0 -45
  53. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb +0 -10
  54. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +0 -22
  55. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.md +0 -3
  56. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +0 -1
  57. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.jsx +0 -13
  58. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +0 -1
  59. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.jsx +0 -15
  60. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.html.erb +0 -115
  61. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.jsx +0 -42
  62. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.html.erb +0 -4
  63. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.jsx +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c30a1eb8819bc6eed0fb4ac8ed734d16c3998584733bc0688ea9bd737b3de932
4
- data.tar.gz: 9b4e571da9f7698c37254f5124664a9d4d0638526f66856a42dbe2a1437864d3
3
+ metadata.gz: 4d76349497c9aed9fbdb3db641ffc35173b5b359a82e3002169c22dac3bd7bd5
4
+ data.tar.gz: 93ac2b9d7fb72999554b19883582e24168ec8e00ebc57cc6a4a01aefeb81b1e0
5
5
  SHA512:
6
- metadata.gz: a654f7d5a8939fe9c334afba17c2ed0709598b9615508d0c4bb6035560d5a9cb10ee215d15f6ba6e16a47ef1e407c6ff331e37adfde700d86a896c43219182c3
7
- data.tar.gz: 88a2f58003dbf098870ad2cc694e249a5f7fefed1b359a1be4d4d6949440554316b7564d26c469c290a5848b249ed4ee5be1cad292bd59e05f7573a8e1ef9bf4
6
+ metadata.gz: 5f7a324c2d795c8f7950252bc26fda991c90b20a71620f53646fcae7dea1e12c3f2e3fe777f51dae18f6b82cb74a9ef5483a4fd355847b51305353d96a8698a2
7
+ data.tar.gz: ac4f91556a586902d24d8a647dee141c1501dea08671ac8791ec2decb7b5942bf2949f8220f774dd38d46854c6cce8c9ca511cdb8e5d8d31426a69fe1e32ba16
@@ -0,0 +1,50 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
4
+
5
+ const AdvancedTableCascadeCollapse = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ return (
39
+ <div>
40
+ <AdvancedTable
41
+ cascadeCollapse
42
+ columnDefinitions={columnDefinitions}
43
+ tableData={MOCK_DATA}
44
+ {...props}
45
+ />
46
+ </div>
47
+ )
48
+ }
49
+
50
+ export default AdvancedTableCascadeCollapse
@@ -0,0 +1 @@
1
+ `cascadeCollapse` is an optional prop that is set to 'false' by default. If set to 'true', collapsing any parent row itself or by using the toggle exapansion buttons in any header or subheader row also collapses all descendants and clears their expansion state. Re-expanding then shows only direct children until the user expands deeper levels again.
@@ -0,0 +1,175 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
4
+
5
+ import Caption from "../../pb_caption/_caption"
6
+
7
+ const sharedColumnDefinitions = [
8
+ {
9
+ accessor: "year",
10
+ label: "Year",
11
+ cellAccessors: ["quarter", "month", "day"],
12
+ },
13
+ {
14
+ accessor: "newEnrollments",
15
+ label: "New Enrollments",
16
+ },
17
+ {
18
+ accessor: "scheduledMeetings",
19
+ label: "Scheduled Meetings",
20
+ },
21
+ {
22
+ accessor: "attendanceRate",
23
+ label: "Attendance Rate",
24
+ },
25
+ {
26
+ accessor: "completedClasses",
27
+ label: "Completed Classes",
28
+ },
29
+ {
30
+ accessor: "classCompletionRate",
31
+ label: "Class Completion Rate",
32
+ },
33
+ {
34
+ accessor: "graduatedStudents",
35
+ label: "Graduated Students",
36
+ },
37
+ ]
38
+
39
+ const sortByColumnDefinitions = [
40
+ {
41
+ accessor: "year",
42
+ label: "Year",
43
+ cellAccessors: ["quarter", "month", "day"],
44
+ },
45
+ {
46
+ accessor: "newEnrollments",
47
+ label: "New Enrollments",
48
+ enableSort: true,
49
+ },
50
+ {
51
+ accessor: "scheduledMeetings",
52
+ label: "Scheduled Meetings",
53
+ },
54
+ {
55
+ accessor: "attendanceRate",
56
+ label: "Attendance Rate",
57
+ enableSort: true,
58
+ },
59
+ {
60
+ accessor: "completedClasses",
61
+ label: "Completed Classes",
62
+ },
63
+ {
64
+ accessor: "classCompletionRate",
65
+ label: "Class Completion Rate",
66
+ },
67
+ {
68
+ accessor: "graduatedStudents",
69
+ label: "Graduated Students",
70
+ },
71
+ ]
72
+
73
+ const sortByColumnMultiDefinitions = [
74
+ {
75
+ accessor: "year",
76
+ label: "Year",
77
+ cellAccessors: ["quarter", "month", "day"],
78
+ },
79
+ {
80
+ label: "Enrollment Data",
81
+ columns: [
82
+ {
83
+ label: "Enrollment Stats",
84
+ columns: [
85
+ {
86
+ accessor: "newEnrollments",
87
+ label: "New Enrollments",
88
+ enableSort: true,
89
+ },
90
+ {
91
+ accessor: "scheduledMeetings",
92
+ label: "Scheduled Meetings",
93
+ },
94
+ ],
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ label: "Performance Data",
100
+ columns: [
101
+ {
102
+ label: "Completion Metrics",
103
+ columns: [
104
+ {
105
+ accessor: "completedClasses",
106
+ label: "Completed Classes",
107
+ enableSort: true,
108
+ },
109
+ {
110
+ accessor: "classCompletionRate",
111
+ label: "Class Completion Rate",
112
+ },
113
+ ],
114
+ },
115
+ {
116
+ label: "Attendance",
117
+ columns: [
118
+ {
119
+ accessor: "attendanceRate",
120
+ label: "Attendance Rate",
121
+ },
122
+ {
123
+ accessor: "scheduledMeetings",
124
+ label: "Scheduled Meetings",
125
+ },
126
+ ],
127
+ },
128
+ ],
129
+ },
130
+ ]
131
+
132
+ const AdvancedTableSortParentOnly = (props) => {
133
+ return (
134
+ <div>
135
+ <Caption text="Enable Sorting (first column) + sortParentOnly" />
136
+ <AdvancedTable
137
+ columnDefinitions={sharedColumnDefinitions}
138
+ sortParentOnly
139
+ tableData={MOCK_DATA}
140
+ {...props}
141
+ >
142
+ <AdvancedTable.Header enableSorting />
143
+ <AdvancedTable.Body />
144
+ </AdvancedTable>
145
+ <Caption marginTop="md"
146
+ text="Sort by column + sortParentOnly"
147
+ />
148
+ <AdvancedTable
149
+ columnDefinitions={sortByColumnDefinitions}
150
+ enableSortingRemoval
151
+ sortParentOnly
152
+ tableData={MOCK_DATA}
153
+ {...props}
154
+ >
155
+ <AdvancedTable.Header />
156
+ <AdvancedTable.Body />
157
+ </AdvancedTable>
158
+ <Caption marginTop="md"
159
+ text="Sort by column (multi-column) + sortParentOnly"
160
+ />
161
+ <AdvancedTable
162
+ columnDefinitions={sortByColumnMultiDefinitions}
163
+ enableSortingRemoval
164
+ sortParentOnly
165
+ tableData={MOCK_DATA}
166
+ {...props}
167
+ >
168
+ <AdvancedTable.Header enableSorting />
169
+ <AdvancedTable.Body />
170
+ </AdvancedTable>
171
+ </div>
172
+ )
173
+ }
174
+
175
+ export default AdvancedTableSortParentOnly
@@ -0,0 +1,5 @@
1
+ The `sortParentOnly` prop is a boolean set to `false` by default. When set to `true`, only parent (depth-0) rows are re-ordered when sorting; children and grandchildren stay grouped under their parent and keep their original order.
2
+
3
+ `sortParentOnly` works with every sorting mode: `enableSorting` on the header, per-column `enableSort: true`, and sortable leaf columns in the multi-header variant. Sort indicators behave as usual.
4
+
5
+ When omitted or `false`, sorting applies to all levels.
@@ -39,9 +39,11 @@ examples:
39
39
  - advanced_table_sort_per_column: Enable Sort By Column
40
40
  - advanced_table_sort_per_column_for_multi_column: Enable Sort By Column (Multi-Column)
41
41
  - advanced_table_custom_sort: Custom Sort
42
+ - advanced_table_sort_parent_only: Sort Parent Only
42
43
  - advanced_table_expanded_control: Expanded Control
43
44
  - advanced_table_expand_by_depth: Expand by Depth
44
45
  - advanced_table_subrow_headers: SubRow Headers
46
+ - advanced_table_cascade_collapse: Cascade Collapse
45
47
  - advanced_table_collapsible_trail: Collapsible Trail
46
48
  - advanced_table_table_options: Table Options
47
49
  - advanced_table_table_props: Table Props
@@ -48,4 +48,6 @@ export { default as AdvancedTablePaddingControl } from './_advanced_table_paddin
48
48
  export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
49
49
  export { default as AdvancedTableColumnStylingBackground } from './_advanced_table_column_styling_background.jsx'
50
50
  export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
51
- export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
51
+ export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
52
+ export { default as AdvancedTableCascadeCollapse } from './_advanced_table_cascade_collapse.jsx'
53
+ export { default as AdvancedTableSortParentOnly } from './_advanced_table_sort_parent_only.jsx'
@@ -28,7 +28,7 @@
28
28
  <% end %>
29
29
  <%= pb_rails("dialog/dialog_body") do %>
30
30
  <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
31
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
31
+ <%= pb_rails("textarea", props: {id: "default"}) %>
32
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" }) %>
33
33
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
34
34
  <%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
@@ -4,7 +4,7 @@ import Body from '../../pb_body/_body'
4
4
  import Button from '../../pb_button/_button'
5
5
  import Caption from '../../pb_caption/_caption'
6
6
  import Dialog from '../../pb_dialog/_dialog'
7
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
7
+ import Textarea from '../../pb_textarea/_textarea'
8
8
  import Typeahead from '../../pb_typeahead/_typeahead'
9
9
 
10
10
  const DialogCompound = () => {
@@ -25,8 +25,11 @@ const DialogCompound = () => {
25
25
  <Body>{'What do you need us to take care of?'}</Body>
26
26
  </Dialog.Header>
27
27
  <Dialog.Body>
28
- <Caption marginBottom="xs">{'Description'}</Caption>
29
- <RichTextEditor />
28
+ <Textarea
29
+ id="default-example-1"
30
+ label="Description"
31
+ rows={4}
32
+ />
30
33
  <br />
31
34
  <Caption>
32
35
  {
@@ -12,7 +12,7 @@
12
12
  <% end %>
13
13
  <%= pb_rails("dialog/dialog_body") do %>
14
14
  <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
15
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
15
+ <%= pb_rails("textarea", props: {id: "default-7"}) %>
16
16
  <%= 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" }) %>
17
17
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
18
18
 
@@ -31,7 +31,7 @@
31
31
  <% end %>
32
32
  <%= pb_rails("dialog/dialog_body") do %>
33
33
  <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
34
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
34
+ <%= pb_rails("textarea", props: {id: "default-8"}) %>
35
35
  <%= 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" }) %>
36
36
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
37
37
 
@@ -49,7 +49,7 @@
49
49
  <% end %>
50
50
  <%= pb_rails("dialog/dialog_body") do %>
51
51
  <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
52
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
52
+ <%= pb_rails("textarea", props: {id: "default-9"}) %>
53
53
  <%= 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" }) %>
54
54
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
55
55
 
@@ -5,7 +5,7 @@ import Button from '../../pb_button/_button'
5
5
  import Dialog from '../../pb_dialog/_dialog'
6
6
  import Flex from '../../pb_flex/_flex'
7
7
  import Caption from '../../pb_caption/_caption'
8
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
8
+ import Textarea from '../../pb_textarea/_textarea'
9
9
  import Typeahead from '../../pb_typeahead/_typeahead'
10
10
 
11
11
  const useDialog = (visible = false) => {
@@ -77,8 +77,11 @@ const DialogFullHeight = () => {
77
77
  <Body>{title}</Body>
78
78
  </Dialog.Header>
79
79
  <Dialog.Body>
80
- <Caption marginBottom="xs">{"Description"}</Caption>
81
- <RichTextEditor />
80
+ <Textarea
81
+ id="default-example-1"
82
+ label="Description"
83
+ rows={4}
84
+ />
82
85
  <br />
83
86
  <Caption>
84
87
  {
@@ -13,7 +13,7 @@
13
13
  <% end %>
14
14
  <%= pb_rails("dialog/dialog_body") do %>
15
15
  <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
16
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
16
+ <%= pb_rails("textarea", props: {id: "default-2"}) %>
17
17
  <%= 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" }) %>
18
18
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
19
19
  <% end %>
@@ -32,7 +32,7 @@
32
32
  <% end %>
33
33
  <%= pb_rails("dialog/dialog_body") do %>
34
34
  <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
35
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
35
+ <%= pb_rails("textarea", props: {id: "default-3"}) %>
36
36
  <%= 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" }) %>
37
37
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
38
38
  <% end %>
@@ -50,7 +50,7 @@
50
50
  <% end %>
51
51
  <%= pb_rails("dialog/dialog_body") do %>
52
52
  <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
53
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
53
+ <%= pb_rails("textarea", props: {id: "default-4"}) %>
54
54
  <%= 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" }) %>
55
55
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
56
56
  <% end %>
@@ -5,7 +5,7 @@ import Button from '../../pb_button/_button'
5
5
  import Dialog from '../../pb_dialog/_dialog'
6
6
  import Flex from '../../pb_flex/_flex'
7
7
  import Caption from '../../pb_caption/_caption'
8
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
8
+ import Textarea from "../../pb_textarea/_textarea";
9
9
  import Typeahead from '../../pb_typeahead/_typeahead'
10
10
 
11
11
  const useDialog = (visible = false) => {
@@ -76,8 +76,11 @@ const DialogFullHeightPlacement = () => {
76
76
  <Body>{title}</Body>
77
77
  </Dialog.Header>
78
78
  <Dialog.Body>
79
- <Caption marginBottom="xs">{"Description"}</Caption>
80
- <RichTextEditor />
79
+ <Textarea
80
+ id={`default-example-2-${index}`}
81
+ label="Description"
82
+ rows={4}
83
+ />
81
84
  <br />
82
85
  <Caption>
83
86
  {
@@ -0,0 +1,16 @@
1
+ <%
2
+ options = [
3
+ { label: "United States", value: "unitedStates", id: "us" },
4
+ { label: "Canada", value: "canada", id: "ca" },
5
+ { label: "Pakistan", value: "pakistan", id: "pk" },
6
+ ]
7
+ %>
8
+
9
+ <%= pb_rails("caption", props: { margin_bottom: "xs", text: "Any" }) %>
10
+ <%= pb_rails("dropdown", props: { options: options, close_on_click: "any", margin_bottom: "md" }) %>
11
+
12
+ <%= pb_rails("caption", props: { margin_bottom: "xs", text: "Outside" }) %>
13
+ <%= pb_rails("dropdown", props: { options: options, close_on_click: "outside", margin_bottom: "md" }) %>
14
+
15
+ <%= pb_rails("caption", props: { margin_bottom: "xs", text: "Inside" }) %>
16
+ <%= pb_rails("dropdown", props: { options: options, close_on_click: "inside" }) %>
@@ -0,0 +1 @@
1
+ The `close_on_click` prop allows you to control when the Dropdown closes in response to click interactions. The value `any` reflects the default behavior, where the dropdown will close after any click. Set it to `outside` to ensure interactive elements as dropdown options are able to be interacted with or modified. Set it to `inside` for a dropdown that only closes when the input or dropdown menu is clicked.
@@ -0,0 +1,224 @@
1
+ <%
2
+ default_options = [
3
+ { label: 'United States', value: 'unitedStates', id: 'us' },
4
+ { label: 'Canada', value: 'canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'pakistan', id: 'pk' },
6
+ { label: 'India', value: 'India', id: 'in' },
7
+ { label: 'Mexico', value: 'Mexico', id: 'mx' },
8
+ ]
9
+
10
+ multi_options = [
11
+ { label: 'United States', value: 'unitedStates', id: 'us' },
12
+ { label: 'Canada', value: 'canada', id: 'ca' },
13
+ { label: 'Pakistan', value: 'pakistan', id: 'pk' },
14
+ { label: 'India', value: 'india', id: 'in' },
15
+ { label: 'United Kingdom', value: 'unitedKingdom', id: 'uk' },
16
+ ]
17
+
18
+ autocomplete_options = [
19
+ { label: "United States", value: "unitedStates", areaCode: "+1", icon: "🇺🇸", id: "us" },
20
+ { label: "United Kingdom", value: "unitedKingdom", areaCode: "+44", icon: "🇬🇧", id: "gb" },
21
+ { label: "Pakistan", value: "pakistan", areaCode: "+92", icon: "🇵🇰", id: "pk" },
22
+ ]
23
+
24
+ custom_display_options = [
25
+ { label: "Strong Bad", value: "strongBad", id: "strong-bad", status: "Offline" },
26
+ { label: "Strong Mad", value: "strongMad", id: "strong-mad", status: "Online" },
27
+ { label: "Strong Sad", value: "strongSad", id: "strong-sad", status: "Away" },
28
+ ]
29
+
30
+ custom_display_content = capture do
31
+ pb_rails("flex", props: { align: "center" }) do
32
+ concat(pb_rails("avatar", props: { name: "", size: "xs", id: "cet-dropdown-avatar" }))
33
+ concat(pb_rails("body", props: { text: "", size: "xs", margin_x: "xs", id: "cet-dropdown-avatar-name" }))
34
+ concat(pb_rails("badge", props: { text: "", id: "cet-dropdown-avatar-status" }))
35
+ end
36
+ end
37
+ %>
38
+
39
+ <!-- Example 1: Default dropdown -->
40
+ <%= pb_rails("dropdown", props: {
41
+ custom_event_type: "form:submitted,pb:dropdown:clearRequest",
42
+ id: "dropdown-default-cet",
43
+ label: "Default dropdown",
44
+ margin_bottom: "sm",
45
+ options: default_options,
46
+ }) %>
47
+ <%= pb_rails("flex", props: { wrap: true, gap: "sm", align: "center", margin_bottom: "md" }) do %>
48
+ <%= pb_rails("button", props: { id: "clear-default-cet", text: "Clear", variant: "primary" }) %>
49
+ <%= pb_rails("button", props: { id: "select-default-cet", text: "Select Canada", variant: "secondary" }) %>
50
+ <%= pb_rails("button", props: { id: "simulate-default-cet", text: "Simulate form submit", variant: "secondary" }) %>
51
+ <% end %>
52
+
53
+ <script>
54
+ (function() {
55
+ var id = "dropdown-default-cet";
56
+ document.getElementById("clear-default-cet").addEventListener("click", function() {
57
+ document.dispatchEvent(new CustomEvent("pb:dropdown:clearRequest", { detail: { dropdownId: id } }));
58
+ });
59
+ document.getElementById("select-default-cet").addEventListener("click", function() {
60
+ document.dispatchEvent(new CustomEvent("pb:dropdown:select", { detail: { dropdownId: id, optionId: "ca" } }));
61
+ });
62
+ document.getElementById("simulate-default-cet").addEventListener("click", function() {
63
+ document.dispatchEvent(new CustomEvent("form:submitted", { detail: { dropdownId: id } }));
64
+ });
65
+ })();
66
+ </script>
67
+
68
+ <!-- Example 2: Multi select -->
69
+ <%= pb_rails("dropdown", props: {
70
+ custom_event_type: "form:submitted,pb:dropdown:clearRequest",
71
+ id: "dropdown-multi-cet",
72
+ label: "Multi select dropdown",
73
+ margin_bottom: "sm",
74
+ multi_select: true,
75
+ options: multi_options,
76
+ }) %>
77
+ <%= pb_rails("flex", props: { wrap: true, gap: "sm", align: "center", margin_bottom: "md" }) do %>
78
+ <%= pb_rails("button", props: { id: "clear-multi-cet", text: "Clear", variant: "primary" }) %>
79
+ <%= pb_rails("button", props: { id: "select-multi-cet", text: "Select US + UK", variant: "secondary" }) %>
80
+ <%= pb_rails("button", props: { id: "simulate-multi-cet", text: "Simulate form submit", variant: "secondary" }) %>
81
+ <% end %>
82
+
83
+ <script>
84
+ (function() {
85
+ var id = "dropdown-multi-cet";
86
+ document.getElementById("clear-multi-cet").addEventListener("click", function() {
87
+ document.dispatchEvent(new CustomEvent("pb:dropdown:clearRequest", { detail: { dropdownId: id } }));
88
+ });
89
+ document.getElementById("select-multi-cet").addEventListener("click", function() {
90
+ document.dispatchEvent(new CustomEvent("pb:dropdown:select", { detail: { dropdownId: id, optionIds: ["us", "uk"] } }));
91
+ });
92
+ document.getElementById("simulate-multi-cet").addEventListener("click", function() {
93
+ document.dispatchEvent(new CustomEvent("form:submitted", { detail: { dropdownId: id } }));
94
+ });
95
+ })();
96
+ </script>
97
+
98
+ <!-- Example 3: Autocomplete -->
99
+ <%= pb_rails("dropdown", props: {
100
+ autocomplete: true,
101
+ custom_event_type: "form:submitted,pb:dropdown:clearRequest",
102
+ id: "dropdown-autocomplete-cet",
103
+ label: "Autocomplete dropdown",
104
+ margin_bottom: "sm",
105
+ options: autocomplete_options,
106
+ }) %>
107
+ <%= pb_rails("flex", props: { wrap: true, gap: "sm", align: "center", margin_bottom: "md" }) do %>
108
+ <%= pb_rails("button", props: { id: "clear-autocomplete-cet", text: "Clear", variant: "primary" }) %>
109
+ <%= pb_rails("button", props: { id: "select-autocomplete-cet", text: "Select Pakistan", variant: "secondary" }) %>
110
+ <%= pb_rails("button", props: { id: "simulate-autocomplete-cet", text: "Simulate form submit", variant: "secondary" }) %>
111
+ <% end %>
112
+
113
+ <script>
114
+ (function() {
115
+ var id = "dropdown-autocomplete-cet";
116
+ document.getElementById("clear-autocomplete-cet").addEventListener("click", function() {
117
+ document.dispatchEvent(new CustomEvent("pb:dropdown:clearRequest", { detail: { dropdownId: id } }));
118
+ });
119
+ document.getElementById("select-autocomplete-cet").addEventListener("click", function() {
120
+ document.dispatchEvent(new CustomEvent("pb:dropdown:select", { detail: { dropdownId: id, optionId: "pk" } }));
121
+ });
122
+ document.getElementById("simulate-autocomplete-cet").addEventListener("click", function() {
123
+ document.dispatchEvent(new CustomEvent("form:submitted", { detail: { dropdownId: id } }));
124
+ });
125
+ })();
126
+ </script>
127
+
128
+ <!-- Example 4: Quick pick (Date Range) -->
129
+ <%= pb_rails("dropdown", props: {
130
+ custom_event_type: "form:submitted,pb:dropdown:clearRequest",
131
+ id: "dropdown-quickpick-cet",
132
+ label: "Quickpick dropdown",
133
+ margin_bottom: "sm",
134
+ variant: "quickpick",
135
+ }) %>
136
+ <%= pb_rails("flex", props: { wrap: true, gap: "sm", align: "center", margin_bottom: "md" }) do %>
137
+ <%= pb_rails("button", props: { id: "clear-quickpick-cet", text: "Clear", variant: "primary" }) %>
138
+ <%= pb_rails("button", props: { id: "select-quickpick-cet", text: "Select This Week", variant: "secondary" }) %>
139
+ <%= pb_rails("button", props: { id: "simulate-quickpick-cet", text: "Simulate form submit", variant: "secondary" }) %>
140
+ <% end %>
141
+
142
+ <script>
143
+ (function() {
144
+ var id = "dropdown-quickpick-cet";
145
+ document.getElementById("clear-quickpick-cet").addEventListener("click", function() {
146
+ document.dispatchEvent(new CustomEvent("pb:dropdown:clearRequest", { detail: { dropdownId: id } }));
147
+ });
148
+ document.getElementById("select-quickpick-cet").addEventListener("click", function() {
149
+ document.dispatchEvent(new CustomEvent("pb:dropdown:select", { detail: { dropdownId: id, optionId: "quickpick-this-week" } }));
150
+ });
151
+ document.getElementById("simulate-quickpick-cet").addEventListener("click", function() {
152
+ document.dispatchEvent(new CustomEvent("form:submitted", { detail: { dropdownId: id } }));
153
+ });
154
+ })();
155
+ </script>
156
+
157
+ <!-- Example 5: Custom display -->
158
+ <%= pb_rails("dropdown", props: {
159
+ custom_event_type: "form:submitted,pb:dropdown:clearRequest",
160
+ id: "dropdown-custom-display-cet",
161
+ label: "Custom display (Subcomponent) dropdown",
162
+ margin_bottom: "sm",
163
+ options: custom_display_options,
164
+ }) do %>
165
+ <%= pb_rails("dropdown/dropdown_trigger", props: { placeholder: "Select a User", custom_display: custom_display_content }) %>
166
+ <%= pb_rails("dropdown/dropdown_container") do %>
167
+ <% custom_display_options.each do |option| %>
168
+ <%= pb_rails("dropdown/dropdown_option", props: { option: option }) do %>
169
+ <%= pb_rails("flex", props: { align: "center", justify: "between" }) do %>
170
+ <%= pb_rails("flex/flex_item") do %>
171
+ <%= pb_rails("user", props: { name: option[:label], align: "left", avatar: true, orientation: "horizontal" }) %>
172
+ <% end %>
173
+ <%= pb_rails("flex/flex_item") do %>
174
+ <%= pb_rails("badge", props: { rounded: true, dark: true, text: option[:status], variant: option[:status] == "Offline" ? "neutral" : option[:status] == "Online" ? "success" : "warning" }) %>
175
+ <% end %>
176
+ <% end %>
177
+ <% end %>
178
+ <% end %>
179
+ <% end %>
180
+ <% end %>
181
+ <%= pb_rails("flex", props: { wrap: true, gap: "sm", align: "center", margin_bottom: "md" }) do %>
182
+ <%= pb_rails("button", props: { id: "clear-custom-display-cet", text: "Clear", variant: "primary" }) %>
183
+ <%= pb_rails("button", props: { id: "select-custom-display-cet", text: "Select Strong Sad", variant: "secondary" }) %>
184
+ <%= pb_rails("button", props: { id: "simulate-custom-display-cet", text: "Simulate form submit", variant: "secondary" }) %>
185
+ <% end %>
186
+
187
+ <script>
188
+ (function() {
189
+ var id = "dropdown-custom-display-cet";
190
+ document.getElementById("clear-custom-display-cet").addEventListener("click", function() {
191
+ document.dispatchEvent(new CustomEvent("pb:dropdown:clearRequest", { detail: { dropdownId: id } }));
192
+ });
193
+ document.getElementById("select-custom-display-cet").addEventListener("click", function() {
194
+ document.dispatchEvent(new CustomEvent("pb:dropdown:select", { detail: { dropdownId: id, optionId: "strong-sad" } }));
195
+ });
196
+ document.getElementById("simulate-custom-display-cet").addEventListener("click", function() {
197
+ document.dispatchEvent(new CustomEvent("form:submitted", { detail: { dropdownId: id } }));
198
+ });
199
+
200
+ document.addEventListener("pb:dropdown:selected", function(e) {
201
+ if (e.target && e.target.id === id && e.detail) {
202
+ var display = e.target.querySelector("[data-dropdown-trigger-custom-display]");
203
+ if (!display) return;
204
+ var nameEl = display.querySelector("#cet-dropdown-avatar-name");
205
+ if (nameEl) nameEl.textContent = e.detail.label;
206
+ var avatarEl = display.querySelector("#cet-dropdown-avatar");
207
+ if (avatarEl) {
208
+ var wrapper = avatarEl.querySelector(".avatar_wrapper");
209
+ if (wrapper) {
210
+ var initials = (e.detail.label[0] + (e.detail.label.split(" ").pop() || "")[0]).toUpperCase();
211
+ wrapper.dataset.name = e.detail.label;
212
+ wrapper.setAttribute("data-initials", initials);
213
+ }
214
+ }
215
+ var badgeEl = display.querySelector("#cet-dropdown-avatar-status");
216
+ if (badgeEl && e.detail.status) {
217
+ var variant = e.detail.status === "Online" ? "success" : e.detail.status === "Offline" ? "neutral" : "warning";
218
+ badgeEl.querySelector("span").textContent = e.detail.status;
219
+ badgeEl.className = "pb_badge_kit_" + variant;
220
+ }
221
+ }
222
+ });
223
+ })();
224
+ </script>