playbook_ui 16.3.0.pre.alpha.play274314785 → 16.3.0.pre.alpha.play283714716

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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +4 -17
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +9 -21
  5. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +1 -25
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -5
  7. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -74
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
  10. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +6 -1
  11. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx +3 -6
  13. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.html.erb +18 -9
  14. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx +24 -5
  15. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.html.erb +3 -3
  16. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +3 -6
  17. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.html.erb +3 -3
  18. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +3 -6
  19. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +134 -35
  20. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb +5 -0
  21. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx +15 -0
  22. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -0
  23. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +0 -56
  24. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +3 -0
  25. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.jsx +17 -0
  26. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb +6 -0
  27. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx +16 -0
  28. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +28 -0
  29. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +1 -0
  30. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +35 -0
  31. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.jsx +45 -0
  32. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb +10 -0
  33. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +22 -0
  34. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.md +3 -0
  35. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -0
  36. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.jsx +13 -0
  37. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -0
  38. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.jsx +15 -0
  39. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.html.erb +115 -0
  40. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.jsx +42 -0
  41. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.html.erb +4 -0
  42. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.jsx +14 -0
  43. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +21 -13
  44. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +10 -0
  45. data/app/pb_kits/playbook/pb_rich_text_editor/inlineFocus.ts +4 -5
  46. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +5 -0
  47. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +63 -0
  48. data/app/pb_kits/playbook/pb_table/_table.tsx +21 -24
  49. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
  50. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
  51. data/app/pb_kits/playbook/pb_table/table.html.erb +11 -12
  52. data/app/pb_kits/playbook/pb_table/table.rb +0 -4
  53. data/app/pb_kits/playbook/pb_table/table.test.js +0 -33
  54. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -105
  55. data/dist/chunks/{_pb_line_graph-BI5wY8Wj.js → _pb_line_graph-BGY7jEks.js} +1 -1
  56. data/dist/chunks/_typeahead-QhswHQnq.js +1 -0
  57. data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
  58. data/dist/chunks/{globalProps-Bn1WUHLp.js → globalProps-CK2YuA9O.js} +1 -1
  59. data/dist/chunks/{lib-qwWYiGtH.js → lib-DspaUdlc.js} +1 -1
  60. data/dist/chunks/vendor.js +4 -4
  61. data/dist/menu.yml +1 -1
  62. data/dist/playbook-rails-react-bindings.js +1 -1
  63. data/dist/playbook-rails.js +1 -1
  64. data/dist/playbook.css +1 -1
  65. data/lib/playbook/pb_forms_helper.rb +0 -3
  66. data/lib/playbook/version.rb +1 -1
  67. metadata +31 -16
  68. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.jsx +0 -50
  69. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.md +0 -1
  70. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_editor.tsx +0 -51
  71. data/app/pb_kits/playbook/pb_rich_text_editor/_trix_editor.tsx +0 -206
  72. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.md +0 -1
  73. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.jsx +0 -152
  74. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.md +0 -17
  75. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.html.erb +0 -121
  76. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.md +0 -17
  77. data/dist/chunks/_typeahead-BBTOlWn7.js +0 -1
  78. data/dist/chunks/componentRegistry-DRSp5D_e.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 401ad87164675d7ba82055bc775edb0d00fb5919b33572f92eb6a33e5189e1ec
4
- data.tar.gz: 4618f042a89e4c2b2bff1ad36a24b86f86c3c5caa8a3652753f150588f1493d4
3
+ metadata.gz: 8268fd29b4cb73ceb2b1795a9edbb7d0775c8eb2fac019ea89c04fd2e2866653
4
+ data.tar.gz: eeaa290965d1ee98aa32555672688a89f98f3fa4b410542cd260c8f5dc7c1042
5
5
  SHA512:
6
- metadata.gz: b9505991c35886449f39d2d9d8d9b1f5d4410ca1fa7f5552454a5255eb96a2c49da2d0a79abcb0fb67aab38baa8e4bedfebcc2a07a418013018e3363f67e0f46
7
- data.tar.gz: f9016211d8ec4dde9944d3b00b984e7d5f0f5150b85f5cdbebd22b11a573031f190f46f3cfb0c55fd0d89ac91a881af0317a3a199a1a0fa0805167a1ae7903c3
6
+ metadata.gz: 8b5074ed6659ec809ada0af5455c4a93fa2ddb889e314eb9f5f94eb2a8a6989d5c046ebadf5f60527f0be5a78178243cbcefa3e76251de23c06413d1df1c4bea
7
+ data.tar.gz: 6f1716a0201cbf67b4a87d123f32efa30bef8116709f7dad382c12affe58734301cc2756c3a833e8162c7150869344e9c80a84c51cc942f4959f5f4036eaf31e
@@ -11,7 +11,6 @@ import Icon from "../../pb_icon/_icon"
11
11
  import Checkbox from "../../pb_checkbox/_checkbox"
12
12
 
13
13
  import AdvancedTableContext from "../Context/AdvancedTableContext"
14
- import { getDescendantRowIds } from "../Utilities/ExpansionControlHelpers"
15
14
 
16
15
  interface CustomCellProps {
17
16
  getValue?: Getter<string>
@@ -32,25 +31,13 @@ export const CustomCell = ({
32
31
  selectableRows,
33
32
  customStyle = {},
34
33
  }: CustomCellProps & GlobalProps) => {
35
- const { setExpanded, expanded, expandedControl, inlineRowLoading, hasAnySubRows, cascadeCollapse } = useContext(AdvancedTableContext);
34
+ const { setExpanded, expanded, expandedControl, inlineRowLoading, hasAnySubRows } = useContext(AdvancedTableContext);
36
35
 
37
36
  const handleOnExpand = (row: Row<GenericObject>) => {
38
37
  onRowToggleClick && onRowToggleClick(row);
39
-
40
- const willBeExpanded = !row.getIsExpanded();
41
- if (willBeExpanded) {
42
- if (!expandedControl) {
43
- setExpanded({ ...expanded, [row.id]: true });
44
- }
45
- } else {
46
- if (cascadeCollapse) {
47
- const idsToRemove = new Set([row.id, ...getDescendantRowIds(row)]);
48
- const nextExpanded = { ...expanded };
49
- idsToRemove.forEach((id) => delete nextExpanded[id]);
50
- setExpanded(nextExpanded);
51
- } else if (!expandedControl) {
52
- setExpanded({ ...expanded, [row.id]: false });
53
- }
38
+
39
+ if (!expandedControl) {
40
+ setExpanded({ ...expanded, [row.id]: !row.getIsExpanded() });
54
41
  }
55
42
  };
56
43
 
@@ -63,7 +63,6 @@ export const TableHeaderCell = ({
63
63
  stickyLeftColumn,
64
64
  inlineRowLoading,
65
65
  isActionBarVisible,
66
- cascadeCollapse,
67
66
  } = useContext(AdvancedTableContext);
68
67
 
69
68
  type justifyTypes = "none" | "center" | "start" | "end" | "between" | "around" | "evenly"
@@ -183,8 +182,7 @@ const isToggleExpansionEnabled =
183
182
  table.getRowModel(),
184
183
  expanded,
185
184
  undefined,
186
- depth,
187
- cascadeCollapse
185
+ depth
188
186
  )
189
187
  setExpanded(updated)
190
188
  }
@@ -12,7 +12,6 @@ interface UseTableActionsProps {
12
12
  inlineRowLoading?: boolean;
13
13
  localPagination?: { pageIndex: number; pageSize: number };
14
14
  setLocalPagination?: (pagination: { pageIndex: number; pageSize: number }) => void;
15
- cascadeCollapse?: boolean;
16
15
  }
17
16
 
18
17
  export function useTableActions({
@@ -23,8 +22,7 @@ export function useTableActions({
23
22
  onRowSelectionChange,
24
23
  inlineRowLoading = false,
25
24
  localPagination,
26
- setLocalPagination,
27
- cascadeCollapse = false
25
+ setLocalPagination
28
26
  }: UseTableActionsProps) {
29
27
 
30
28
  // State to achieve 1 second delay before fetching more rows
@@ -34,25 +32,15 @@ export function useTableActions({
34
32
  // Handle expand/collapse
35
33
  const handleExpandOrCollapse = useCallback(async (row: Row<GenericObject>) => {
36
34
  if (onToggleExpansionClick) onToggleExpansionClick(row)
35
+ const updatedExpandedState = await updateExpandAndCollapseState(
36
+ table.getRowModel(),
37
+ expanded,
38
+ row?.parentId,
39
+ undefined
40
+ )
37
41
 
38
- const anyTopLevelExpanded = table.getRowModel().rows.some((r: Row<GenericObject>) => r.getIsExpanded())
39
- const isHeaderCollapseAll = row == null && anyTopLevelExpanded
40
-
41
- if (cascadeCollapse && isHeaderCollapseAll) {
42
- setExpanded({})
43
- return
44
- }
45
-
46
- const updatedExpandedState = await updateExpandAndCollapseState(
47
- table.getRowModel(),
48
- expanded,
49
- row?.parentId,
50
- undefined,
51
- cascadeCollapse
52
- )
53
-
54
- setExpanded(updatedExpandedState)
55
- }, [expanded, setExpanded, onToggleExpansionClick, table, cascadeCollapse]);
42
+ setExpanded(updatedExpandedState)
43
+ }, [expanded, setExpanded, onToggleExpansionClick, table]);
56
44
 
57
45
  // Handle pagination
58
46
  const onPageChange = useCallback((page: number) => {
@@ -11,21 +11,11 @@ const filterExpandableRows = (expandedState: Record<string, boolean>) => {
11
11
  return expandedState
12
12
  }
13
13
 
14
- export const getDescendantRowIds = (row: Row<GenericObject>): string[] => {
15
- const ids: string[] = []
16
- for (const sub of row.subRows || []) {
17
- ids.push(sub.id)
18
- ids.push(...getDescendantRowIds(sub))
19
- }
20
- return ids
21
- }
22
-
23
14
  export const updateExpandAndCollapseState = (
24
15
  tableRows: RowModel<GenericObject>,
25
16
  expanded: Record<string, boolean>,
26
17
  targetParent?: string,
27
18
  targetDepth?: number,
28
- cascadeCollapse?: boolean,
29
19
  ) => {
30
20
  const updateExpandedRows: Record<string, boolean> = {};
31
21
  const rows = targetDepth !== undefined ? tableRows.flatRows : tableRows.rows;
@@ -61,22 +51,8 @@ export const updateExpandAndCollapseState = (
61
51
  }
62
52
  }
63
53
 
64
- const updatedExpandedState = filterExpandableRows({
54
+ return filterExpandableRows({
65
55
  ...(expanded as ExpandedStateObject),
66
56
  ...updateExpandedRows,
67
57
  });
68
-
69
- if (cascadeCollapse && !isExpandAction) {
70
- const idsToRemove = new Set<string>();
71
- for (const row of rowsToToggle) {
72
- const shouldUpdate =
73
- targetDepth === undefined ? true : row.depth === targetDepth;
74
- if (shouldUpdate) {
75
- getDescendantRowIds(row).forEach((id) => idsToRemove.add(id));
76
- }
77
- }
78
- idsToRemove.forEach((id) => delete updatedExpandedState[id]);
79
- }
80
-
81
- return updatedExpandedState;
82
58
  };
@@ -31,7 +31,6 @@ type FullscreenControls = {
31
31
  type AdvancedTableProps = {
32
32
  aria?: { [key: string]: string }
33
33
  actions?: React.ReactNode[] | React.ReactNode
34
- cascadeCollapse?: boolean
35
34
  children?: React.ReactNode | React.ReactNode[]
36
35
  className?: string
37
36
  columnDefinitions: GenericObject[]
@@ -81,7 +80,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
81
80
  const {
82
81
  aria = {},
83
82
  actions,
84
- cascadeCollapse = false,
85
83
  children,
86
84
  className,
87
85
  columnDefinitions,
@@ -175,8 +173,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
175
173
  onRowSelectionChange,
176
174
  inlineRowLoading,
177
175
  localPagination,
178
- setLocalPagination,
179
- cascadeCollapse
176
+ setLocalPagination
180
177
  });
181
178
 
182
179
  // Set table row count for loading state
@@ -342,7 +339,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
342
339
  >
343
340
  {renderFullscreenHeader()}
344
341
  <AdvancedTableProvider
345
- cascadeCollapse={cascadeCollapse}
346
342
  columnDefinitions={columnDefinitions}
347
343
  columnGroupBorderColor={columnGroupBorderColor}
348
344
  columnVisibilityControl={columnVisibilityControl}
@@ -1015,77 +1015,4 @@ test("columnStyling.headerFontColor works as excpected", () => {
1015
1015
 
1016
1016
  const firstEnrollmentHeader = screen.getAllByText("New Enrollments")[0].closest("th");
1017
1017
  expect(firstEnrollmentHeader).toHaveStyle({ color: colors.white });
1018
- });
1019
-
1020
- test("cascadeCollapse=false (default) preserves existing behavior when parent is re-expanded", () => {
1021
- render(
1022
- <AdvancedTable
1023
- columnDefinitions={columnDefinitions}
1024
- data={{ testid: testId }}
1025
- tableData={MOCK_DATA}
1026
- />
1027
- )
1028
-
1029
- const kit = screen.getByTestId(testId)
1030
- const getParentExpandButton = () => kit.querySelector("tbody tr .gray-icon.expand-toggle-icon")
1031
- const parentButton = getParentExpandButton()
1032
- expect(parentButton).toBeInTheDocument()
1033
- parentButton.click()
1034
- let subRow = kit.querySelector(".pb-bg-row-white.depth-sub-row-1")
1035
- expect(subRow).toBeInTheDocument()
1036
- getParentExpandButton().click()
1037
- subRow = kit.querySelector(".pb-bg-row-white.depth-sub-row-1")
1038
- expect(subRow).not.toBeInTheDocument()
1039
- getParentExpandButton().click()
1040
- subRow = kit.querySelector(".pb-bg-row-white.depth-sub-row-1")
1041
- expect(subRow).toBeInTheDocument()
1042
- })
1043
-
1044
- test("cascadeCollapse=true collapses all descendants when parent is collapsed", () => {
1045
- render(
1046
- <AdvancedTable
1047
- cascadeCollapse
1048
- columnDefinitions={columnDefinitions}
1049
- data={{ testid: testId }}
1050
- tableData={MOCK_DATA}
1051
- />
1052
- )
1053
-
1054
- const kit = screen.getByTestId(testId)
1055
- const getParentExpandButton = () => kit.querySelector("tbody tr .gray-icon.expand-toggle-icon")
1056
- const parentButton = getParentExpandButton()
1057
- expect(parentButton).toBeInTheDocument()
1058
- parentButton.click()
1059
- expect(kit.querySelector(".depth-sub-row-1")).toBeInTheDocument()
1060
- getParentExpandButton().click()
1061
- expect(kit.querySelector(".depth-sub-row-1")).not.toBeInTheDocument()
1062
- getParentExpandButton().click()
1063
- expect(kit.querySelector(".depth-sub-row-1")).toBeInTheDocument()
1064
- })
1065
-
1066
- test("cascadeCollapse=true with header toggle all: collapse all then expand all shows only direct children", async () => {
1067
- render(
1068
- <AdvancedTable
1069
- cascadeCollapse
1070
- columnDefinitions={columnDefinitions}
1071
- data={{ testid: testId }}
1072
- tableData={MOCK_DATA}
1073
- />
1074
- )
1075
-
1076
- const kit = screen.getByTestId(testId)
1077
- const toggleAllButton = kit.querySelector(".gray-icon.toggle-all-icon")
1078
- expect(toggleAllButton).toBeInTheDocument()
1079
- toggleAllButton.click()
1080
- await waitFor(() => {
1081
- expect(kit.querySelector(".depth-sub-row-1")).toBeInTheDocument()
1082
- })
1083
- toggleAllButton.click()
1084
- await waitFor(() => {
1085
- expect(kit.querySelector(".depth-sub-row-1")).not.toBeInTheDocument()
1086
- })
1087
- toggleAllButton.click()
1088
- await waitFor(() => {
1089
- expect(kit.querySelector(".depth-sub-row-1")).toBeInTheDocument()
1090
- })
1091
- })
1018
+ });
@@ -42,7 +42,6 @@ examples:
42
42
  - advanced_table_expanded_control: Expanded Control
43
43
  - advanced_table_expand_by_depth: Expand by Depth
44
44
  - advanced_table_subrow_headers: SubRow Headers
45
- - advanced_table_cascade_collapse: Cascade Collapse
46
45
  - advanced_table_collapsible_trail: Collapsible Trail
47
46
  - advanced_table_table_options: Table Options
48
47
  - advanced_table_table_props: Table Props
@@ -48,5 +48,4 @@ 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'
52
- export { default as AdvancedTableCascadeCollapse } from './_advanced_table_cascade_collapse.jsx'
51
+ export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
@@ -57,7 +57,7 @@ $pb_button_border_width: 0px;
57
57
  }
58
58
 
59
59
  .loading-icon {
60
- position: absolute;
60
+ position: static;
61
61
  display: none;
62
62
  }
63
63
  .pb_button_content {
@@ -158,10 +158,15 @@ $pb_button_border_width: 0px;
158
158
  // Loading =====================
159
159
  @mixin pb_button_loading($loading: false) {
160
160
  @if $loading == true {
161
+ display: inline-grid;
162
+ place-items: center;
163
+
161
164
  .loading-icon {
165
+ grid-area: 1 / 1;
162
166
  display: block;
163
167
  }
164
168
  .pb_button_content {
169
+ grid-area: 1 / 1;
165
170
  visibility: hidden;
166
171
  }
167
172
  }
@@ -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("textarea", props: {id: "default"}) %>
31
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
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 Textarea from '../../pb_textarea/_textarea'
7
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
8
8
  import Typeahead from '../../pb_typeahead/_typeahead'
9
9
 
10
10
  const DialogCompound = () => {
@@ -25,11 +25,8 @@ const DialogCompound = () => {
25
25
  <Body>{'What do you need us to take care of?'}</Body>
26
26
  </Dialog.Header>
27
27
  <Dialog.Body>
28
- <Textarea
29
- id="default-example-1"
30
- label="Description"
31
- rows={4}
32
- />
28
+ <Caption marginBottom="xs">{'Description'}</Caption>
29
+ <RichTextEditor />
33
30
  <br />
34
31
  <Caption>
35
32
  {
@@ -1,11 +1,20 @@
1
1
  <%= pb_rails("button", props: { text: "Open Dialog", data: {"open-dialog": "dialog-1"} }) %>
2
2
 
3
- <%= pb_rails("dialog", props: {
4
- id:"dialog-1",
5
- size: "sm",
6
- title: "Header Title is the Title Prop",
7
- text: "Hello Body Text, Nice to meet ya.",
8
- cancel_button: "Cancel Button",
9
- confirm_button: "Okay",
10
- confirm_button_id: "confirm-button-1"
11
- }) %>
3
+ <%= pb_rails("dialog", props: {
4
+ id:"dialog-1",
5
+ size: "md",
6
+ title: "Header Title is the Title Prop"
7
+ }) do %>
8
+ <%= pb_rails("dialog/dialog_body") do %>
9
+ <%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, margin_right: "lg", text: "Button Primary" }) %>
10
+ <div style="height: 800px; background-color: lightgray;"></div>
11
+ <%= pb_rails("button", props: { loading: true, text: "Loading..." }) %>
12
+ <% end %>
13
+
14
+ <%= pb_rails("dialog/dialog_footer") do %>
15
+ <%= pb_rails("flex", props: { spacing: "between", padding_x: "md", padding_bottom: "md", padding: "sm" }) do %>
16
+ <%= pb_rails("button", props: { loading: true, text: "Send My Issue" }) %>
17
+ <%= pb_rails("button", props: { text: "Back", variant: "link", data: {"close-dialog": "dialog-1"} }) %>
18
+ <% end %>
19
+ <% end %>
20
+ <% end %>
@@ -12,16 +12,35 @@ const DialogDefault = () => {
12
12
  <>
13
13
  <Button onClick={open}>{'Open Dialog'}</Button>
14
14
  <Dialog
15
- cancelButton="Cancel Button"
16
- confirmButton="Okay"
17
15
  onCancel={close}
18
16
  onClose={close}
19
17
  onConfirm={close}
20
18
  opened={isOpen}
21
- size="sm"
22
- text="Hello Body Text, Nice to meet ya."
19
+ size="md"
23
20
  title="Header Title is the Title Prop"
24
- />
21
+ >
22
+ <Dialog.Body>
23
+ <Button
24
+ aria={{ label: 'Loading' }}
25
+ loading
26
+ text="Button Primary"
27
+ />
28
+ <div style={{height: '800px', backgroundColor: 'lightgray'}} />
29
+ <Button
30
+ loading
31
+ text="Loading..."
32
+ />
33
+ </Dialog.Body>
34
+ <Dialog.Footer>
35
+ <Button
36
+ loading
37
+ text="Send My Issue"
38
+ />
39
+ <Button variant="link">
40
+ {"Back"}
41
+ </Button>
42
+ </Dialog.Footer>
43
+ </Dialog>
25
44
  </>
26
45
  )
27
46
  }
@@ -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("textarea", props: {id: "default-7"}) %>
15
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
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("textarea", props: {id: "default-8"}) %>
34
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
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("textarea", props: {id: "default-9"}) %>
52
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
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 Textarea from '../../pb_textarea/_textarea'
8
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
9
9
  import Typeahead from '../../pb_typeahead/_typeahead'
10
10
 
11
11
  const useDialog = (visible = false) => {
@@ -77,11 +77,8 @@ const DialogFullHeight = () => {
77
77
  <Body>{title}</Body>
78
78
  </Dialog.Header>
79
79
  <Dialog.Body>
80
- <Textarea
81
- id="default-example-1"
82
- label="Description"
83
- rows={4}
84
- />
80
+ <Caption marginBottom="xs">{"Description"}</Caption>
81
+ <RichTextEditor />
85
82
  <br />
86
83
  <Caption>
87
84
  {
@@ -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("textarea", props: {id: "default-2"}) %>
16
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
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("textarea", props: {id: "default-3"}) %>
35
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
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("textarea", props: {id: "default-4"}) %>
53
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
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 Textarea from "../../pb_textarea/_textarea";
8
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
9
9
  import Typeahead from '../../pb_typeahead/_typeahead'
10
10
 
11
11
  const useDialog = (visible = false) => {
@@ -76,11 +76,8 @@ const DialogFullHeightPlacement = () => {
76
76
  <Body>{title}</Body>
77
77
  </Dialog.Header>
78
78
  <Dialog.Body>
79
- <Textarea
80
- id={`default-example-2-${index}`}
81
- label="Description"
82
- rows={4}
83
- />
79
+ <Caption marginBottom="xs">{"Description"}</Caption>
80
+ <RichTextEditor />
84
81
  <br />
85
82
  <Caption>
86
83
  {