playbook_ui 15.0.0.pre.alpha.removewebpacker10589 → 15.0.0.pre.alpha.renovatenpmtrixvulnerability10692

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/RegularTableView.tsx +12 -11
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +7 -7
  4. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +7 -2
  5. data/app/pb_kits/playbook/pb_contact/_contact.tsx +5 -0
  6. data/app/pb_kits/playbook/pb_contact/contact.rb +4 -0
  7. data/app/pb_kits/playbook/pb_contact/contact.test.js +21 -1
  8. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +16 -1
  9. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +15 -0
  10. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.md +5 -0
  11. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +6 -0
  12. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +6 -0
  13. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +3 -3
  14. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +3 -3
  15. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +3 -3
  16. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +3 -3
  17. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +3 -3
  18. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +2 -2
  19. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +13 -5
  20. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +23 -0
  21. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +45 -7
  22. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +4 -1
  23. data/app/pb_kits/playbook/pb_section_separator/section_separator.test.js +165 -0
  24. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +24 -8
  25. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +0 -10
  26. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +0 -9
  27. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +1 -0
  28. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +3 -17
  29. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +0 -15
  30. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +1 -0
  31. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +0 -2
  32. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +0 -2
  33. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +5 -0
  34. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +12 -0
  35. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +25 -0
  36. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +1 -0
  37. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +4 -0
  38. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +17 -0
  39. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +1 -0
  40. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +18 -0
  41. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +44 -0
  42. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +1 -0
  43. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +0 -14
  44. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +0 -14
  45. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +1 -0
  46. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +0 -4
  47. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +0 -4
  48. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +0 -1
  49. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +5 -0
  50. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +16 -0
  51. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +30 -0
  52. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +1 -0
  53. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +16 -0
  54. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +30 -0
  55. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +1 -0
  56. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +26 -0
  57. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +41 -0
  58. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +1 -0
  59. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +18 -6
  60. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +6 -0
  61. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +29 -7
  62. data/app/pb_kits/playbook/pb_timestamp/timestamp.test.js +69 -4
  63. data/dist/chunks/{_line_graph-DeH7NK-i.js → _line_graph-CUfJ7E4h.js} +1 -1
  64. data/dist/chunks/{_typeahead-CCGp0OQe.js → _typeahead-DCp1lVJx.js} +1 -1
  65. data/dist/chunks/{_weekday_stacked-BHLwECdV.js → _weekday_stacked-qrsOsOR9.js} +3 -3
  66. data/dist/chunks/{lib-QZuu1ltS.js → lib-BTs5acfO.js} +1 -1
  67. data/dist/chunks/{pb_form_validation-CleM960_.js → pb_form_validation-CKkaQFX3.js} +1 -1
  68. data/dist/chunks/vendor.js +1 -1
  69. data/dist/playbook-doc.js +2 -2
  70. data/dist/playbook-rails-react-bindings.js +1 -1
  71. data/dist/playbook-rails.js +1 -1
  72. data/dist/playbook.css +1 -1
  73. data/lib/playbook/engine.rb +1 -0
  74. data/lib/playbook/kit_base.rb +2 -23
  75. data/lib/playbook/version.rb +1 -1
  76. metadata +51 -14
  77. data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +0 -1
  78. data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f1d58c0974115b7178c36d9cda95c0eacbfadd7b855f74d97d272acc9c62e1b
4
- data.tar.gz: f602e748ae8b93fc70a7a4ee7a26876c7dcca1b8c68d65687d2c7e1d254c9238
3
+ metadata.gz: c7bcc95238d82ff358bd617556b2a6f27f206b5419829471edb16e9a7f63a74c
4
+ data.tar.gz: 7019681b875c0194c0537cb502566fdc6b73447737b01b9e550d15a4d5de78e3
5
5
  SHA512:
6
- metadata.gz: fb8ac648144f2747012cd782f136b169e1e2c041cb7cd80e51727811968233ec5121542cccc8daf4ad1781d662e16138dd8d689867fd2b2bafce700a7c7b1d15
7
- data.tar.gz: 60ac54b5f6e52494d90565b6eaa63e2d322b84d776eba943445aa19d5e65e9bae06eddb32acf292ecb03b6d5c200d7cab0d2e351c18904497be2d0ca0db5f014
6
+ metadata.gz: fc723753e312a3abfb108ff828cbfff30cd7e23a05b0720f5f3d459e5a55d5fe24474c90ecc1bdffd458af9b793692ae9cf57dfc9d9d817ac5bba536286f93f7
7
+ data.tar.gz: 920585c68c8f47c7e2c949c107b27b06353a4acf0fe4511c7e0d61616f09e97085dfc5810dbb3299e9f0c4232bf90c6989ce8a3922c3727702c4f577f0c070e1
@@ -5,6 +5,7 @@ import { flexRender, Row, Cell } from "@tanstack/react-table"
5
5
  import { GenericObject } from "../../types"
6
6
  import { isChrome } from "../Utilities/BrowserCheck"
7
7
  import { findColumnDefByAccessor } from "../Utilities/ColumnStylingHelper"
8
+ import { getRowColorClass, shouldShowLoadingIndicator } from "../Utilities/RowUtils"
8
9
 
9
10
  import LoadingInline from "../../pb_loading_inline/_loading_inline"
10
11
  import Checkbox from "../../pb_checkbox/_checkbox"
@@ -60,7 +61,7 @@ const TableCellRenderer = ({
60
61
  const cellAlignment = colDef?.columnStyling?.cellAlignment ?? "right"
61
62
  const paddingValue = colDef?.columnStyling?.cellPadding ?? customRowStyle?.cellPadding
62
63
  const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
63
-
64
+
64
65
  return (
65
66
  <td
66
67
  align={cellAlignment}
@@ -132,6 +133,7 @@ export const RegularTableView = ({
132
133
 
133
134
  const columnPinning = table.getState().columnPinning || { left: [] };
134
135
  const columnDefinitions = table.options.meta?.columnDefinitions || [];
136
+
135
137
  // Row pinning
136
138
  function PinnedRow({ row }: { row: Row<any> }) {
137
139
  const customRowStyle = rowStyling?.length > 0 && rowStyling?.find((s: GenericObject) => s?.rowId === row.id);
@@ -144,7 +146,7 @@ export const RegularTableView = ({
144
146
  backgroundColor: customRowStyle?.backgroundColor ? customRowStyle?.backgroundColor : 'white',
145
147
  color: customRowStyle?.fontColor,
146
148
  position: 'sticky',
147
- top:
149
+ top:
148
150
  row.getIsPinned() === 'top'
149
151
  ? `${row.getPinnedIndex() * rowHeight + headerHeight}px`
150
152
  : undefined,
@@ -169,21 +171,20 @@ export const RegularTableView = ({
169
171
  return (
170
172
  <>
171
173
  {pinnedRows && table.getTopRows().map((row: Row<GenericObject>) => (
172
- <PinnedRow key={row.id}
173
- row={row}
174
+ <PinnedRow key={row.id}
175
+ row={row}
174
176
  />
175
177
  ))}
176
178
  {totalRows.map((row: Row<GenericObject>, rowIndex: number) => {
177
- const isExpandable = row.getIsExpanded();
178
179
  const isFirstChildofSubrow = row.depth > 0 && row.index === 0;
179
- const rowHasNoChildren = row.original?.children && !row.original.children.length ? true : false;
180
180
  const numberOfColumns = table.getAllFlatColumns().length;
181
- const isDataLoading = isExpandable && (inlineRowLoading && rowHasNoChildren) && (row.depth < columnDefinitions[0]?.cellAccessors?.length);
182
- const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren));
183
- const rowColor = row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white";
184
181
  const isFirstRegularRow = rowIndex === 0 && !row.getIsPinned();
185
182
  const customRowStyle = rowStyling?.length > 0 && rowStyling?.find((s: GenericObject) => s?.rowId === row.id);
186
183
 
184
+ // Use functions from RowUtils for consistent cell coloring
185
+ const rowColor = getRowColorClass(row, inlineRowLoading || false);
186
+ const isDataLoading = shouldShowLoadingIndicator(row, inlineRowLoading || false, columnDefinitions[0]?.cellAccessors?.length || 0);
187
+
187
188
  return (
188
189
  <React.Fragment key={`${row.index}-${row.id}-${row.depth}-row`}>
189
190
  {isFirstChildofSubrow && subRowHeaders && (
@@ -228,7 +229,7 @@ export const RegularTableView = ({
228
229
 
229
230
  {/* Display LoadingInline if Row Data is querying and there are no children already */}
230
231
  {isDataLoading && (
231
- <tr key={`${row.id}-row`}>
232
+ <tr key={`${row.id}-loading-row`}>
232
233
  <td colSpan={numberOfColumns}
233
234
  style={{ paddingLeft: `${row.depth === 0 ? 0.5 : (row.depth * 2)}em` }}
234
235
  >
@@ -243,4 +244,4 @@ export const RegularTableView = ({
243
244
  );
244
245
  }
245
246
 
246
- export default RegularTableView;
247
+ export default RegularTableView;
@@ -7,6 +7,7 @@ import { GenericObject } from "../../types"
7
7
 
8
8
  import { isChrome } from "../Utilities/BrowserCheck"
9
9
  import { getVirtualizedRowStyle } from "../Utilities/TableContainerStyles"
10
+ import { getRowColorClass } from "../Utilities/RowUtils"
10
11
 
11
12
  import LoadingInline from "../../pb_loading_inline/_loading_inline"
12
13
  import Checkbox from "../../pb_checkbox/_checkbox"
@@ -45,10 +46,10 @@ export const VirtualizedTableView = ({
45
46
 
46
47
  const columnPinning = table.getState().columnPinning || { left: [] };
47
48
  const sortingState = JSON.stringify(table.getState().sorting || []);
48
-
49
+
49
50
  // Store column widths extracted from header
50
51
  const [columnWidths, setColumnWidths] = useState<{[key: string]: string}>({});
51
-
52
+
52
53
  // Function to get header cell widths
53
54
  const getHeaderCellWidths = () => {
54
55
  const widths: {[key: string]: string} = {};
@@ -136,7 +137,7 @@ export const VirtualizedTableView = ({
136
137
  </tr>
137
138
  );
138
139
  }
139
-
140
+
140
141
  // Establish # of Parent Rows (so that Footer count does not include every single row)
141
142
  const topLevelRowCount = table.getRowModel().flatRows.filter((row: Row<GenericObject>) => row.depth === 0).length;
142
143
 
@@ -172,10 +173,9 @@ export const VirtualizedTableView = ({
172
173
 
173
174
  if (item.type === 'row') {
174
175
  const row = item.row;
175
- const isExpandable = row.getIsExpanded();
176
- const rowHasNoChildren = row.original?.children && !row.original.children.length;
177
- const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren));
178
- const rowColor = row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white";
176
+
177
+ // Use the utility function to get consistent row color
178
+ const rowColor = getRowColorClass(row, inlineRowLoading || false);
179
179
 
180
180
  return (
181
181
  <tr
@@ -10,9 +10,14 @@ export const getRowColorClass = (
10
10
  ): string => {
11
11
  const isExpandable = row.getIsExpanded();
12
12
  const rowHasNoChildren = row.original?.children && !row.original.children.length ? true : false;
13
- const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren));
14
13
 
15
- return row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white";
14
+ // Check if row can expand or is currently expanded
15
+ const shouldShowExpandedBackground = isExpandable && (
16
+ (!inlineRowLoading && row.getCanExpand()) ||
17
+ (inlineRowLoading && (rowHasNoChildren || row.getCanExpand()))
18
+ );
19
+
20
+ return row.getIsSelected() ? "bg-row-selection" : shouldShowExpandedBackground ? "bg-silver" : "bg-white";
16
21
  }
17
22
 
18
23
  /**
@@ -17,6 +17,7 @@ const contactTypeMap: { [key: string]: string } = {
17
17
  'work': 'phone-office',
18
18
  'work-cell': 'phone-laptop',
19
19
  'wrong-phone': 'phone-slash',
20
+ 'international': 'globe',
20
21
  }
21
22
 
22
23
  const envelopeIcon = getAllIcons()["envelope"].icon as unknown as { [key: string]: SVGElement }
@@ -24,6 +25,10 @@ const envelopeIcon = getAllIcons()["envelope"].icon as unknown as { [key: string
24
25
  const formatContact = (contactString: string, contactType: string) => {
25
26
  if (contactType === 'email') return contactString
26
27
 
28
+ // International phone numbers are unformatted
29
+ if (contactType === 'international') return contactString
30
+
31
+ // Format US numbers
27
32
  const cleaned = contactString.replace(/\D/g, '')
28
33
  const phoneNumber = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
29
34
 
@@ -29,6 +29,8 @@ module Playbook
29
29
  "phone-slash"
30
30
  when "extension"
31
31
  "phone-plus"
32
+ when "international"
33
+ "globe"
32
34
  else # "unknown" || "other"
33
35
  "phone"
34
36
  end
@@ -39,6 +41,8 @@ module Playbook
39
41
  contact_value
40
42
  elsif contact_type == "extension" && contact_value.match(/^\d{4}$/)
41
43
  contact_value
44
+ elsif contact_type == "international"
45
+ contact_value
42
46
  else
43
47
  number_to_phone(formatted_value, area_code: true)
44
48
  end
@@ -66,6 +66,12 @@ test('returns correct icon', () => {
66
66
  contactValue="1234"
67
67
  data={{ testid: 'test-extension' }}
68
68
  />
69
+ <Contact
70
+ contactDetail="International"
71
+ contactType="international"
72
+ contactValue="+44 20 7946 0958"
73
+ data={{ testid: 'test-international' }}
74
+ />
69
75
  <Contact
70
76
  contactDetail=""
71
77
  contactType=""
@@ -83,10 +89,11 @@ test('returns correct icon', () => {
83
89
  expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_custom_icon')).toBeInTheDocument()
84
90
  expect(screen.getByTestId('test-wrong-type').querySelector('.pb_custom_icon')).toBeInTheDocument()
85
91
  expect(screen.getByTestId('test-extension').querySelector('.pb_custom_icon')).toBeInTheDocument()
92
+ expect(screen.getByTestId('test-international').querySelector('.pb_custom_icon')).toBeInTheDocument()
86
93
  expect(screen.getByTestId('test-empty').querySelector('.pb_custom_icon')).toBeInTheDocument()
87
94
  })
88
95
 
89
- test("not compliant values return null in phone related contact types", () => {
96
+ test("not compliant values return null in US phone related contact types", () => {
90
97
  const notCompliantValues = [
91
98
  "349-185-998223",
92
99
  "349-1858",
@@ -129,3 +136,16 @@ test("not compliant values return null in phone related contact types", () => {
129
136
  )
130
137
  })
131
138
  })
139
+
140
+ test('international contact type preserves original format', () => {
141
+ render(
142
+ <Contact
143
+ contactType="international"
144
+ contactValue="+44 20 7946 0958"
145
+ data={{ testid: 'test-international-format' }}
146
+ />
147
+ )
148
+
149
+ const kit = screen.getByTestId('test-international-format')
150
+ expect(kit).toHaveTextContent('+44 20 7946 0958')
151
+ })
@@ -13,7 +13,7 @@
13
13
  }) %>
14
14
 
15
15
  <%= pb_rails("contact", props: {
16
- contact_type: "wrong number",
16
+ contact_type: "work",
17
17
  contact_value: "3245627482",
18
18
  }) %>
19
19
 
@@ -21,3 +21,18 @@
21
21
  contact_type: "work-cell",
22
22
  contact_value: "349-185-9988",
23
23
  }) %>
24
+
25
+ <%= pb_rails("contact", props: {
26
+ contact_type: "wrong-phone",
27
+ contact_value: "2124396666",
28
+ }) %>
29
+
30
+ <%= pb_rails("contact", props: {
31
+ contact_type: "extension",
32
+ contact_value: "1233",
33
+ }) %>
34
+
35
+ <%= pb_rails("contact", props: {
36
+ contact_type: "international",
37
+ contact_value: "+44 7700 900461",
38
+ }) %>
@@ -28,6 +28,21 @@ const ContactDefault = (props) => {
28
28
  contactValue="3245627482"
29
29
  {...props}
30
30
  />
31
+ <Contact
32
+ contactType="wrong-phone"
33
+ contactValue="2124396666"
34
+ {...props}
35
+ />
36
+ <Contact
37
+ contactType='extension'
38
+ contactValue="1234"
39
+ {...props}
40
+ />
41
+ <Contact
42
+ contactType="international"
43
+ contactValue="+44 7700 900461"
44
+ {...props}
45
+ />
31
46
  </div>
32
47
  )
33
48
  }
@@ -0,0 +1,5 @@
1
+ The Contact kit automatically formats US phone numbers when the `contactType` / `contact_type` is one of: `home` (default), `work`, `cell`, `work-cell`, `wrong-phone`.
2
+
3
+ - Use `email` to display emails.
4
+ - Use `international` to display International phone numbers exactly as provided (no formatting applied).
5
+ - Use `extension` to display four digit phone extensions.
@@ -26,3 +26,9 @@
26
26
  contact_value: "1233",
27
27
  contact_detail: "Ext",
28
28
  }) %>
29
+
30
+ <%= pb_rails("contact", props: {
31
+ contact_type: "international",
32
+ contact_value: "+44 7700 900461",
33
+ contact_detail: "International",
34
+ }) %>
@@ -33,6 +33,12 @@ const ContactDefault = (props) => {
33
33
  contactValue="1234"
34
34
  {...props}
35
35
  />
36
+ <Contact
37
+ contactDetail="International"
38
+ contactType="international"
39
+ contactValue="+44 7700 900461"
40
+ {...props}
41
+ />
36
42
  </div>
37
43
  )
38
44
  }
@@ -4,8 +4,8 @@
4
4
 
5
5
  <%= pb_rails("caption", props: { size: 'xs', text: "hello", id: "caption_breached" }) %>
6
6
 
7
- <script>
8
- window.addEventListener("load", () => {
7
+ <%= javascript_tag do %>
8
+ window.addEventListener("DOMContentLoaded", () => {
9
9
 
10
10
  // variables for the kits you are targeting
11
11
  const passphrase = document.querySelector(".passphrase_breached").querySelector("input")
@@ -142,4 +142,4 @@
142
142
  });
143
143
 
144
144
  })
145
- </script>
145
+ <% end %>
@@ -10,8 +10,8 @@
10
10
  <%= pb_rails("caption", props: { size: 'xs', text: "hello", id: "caption_common" }) %>
11
11
 
12
12
 
13
- <script>
14
- window.addEventListener("load", () => {
13
+ <%= javascript_tag do %>
14
+ window.addEventListener("DOMContentLoaded", () => {
15
15
 
16
16
  const commonText = document.querySelector("#body_common")
17
17
 
@@ -133,4 +133,4 @@
133
133
  });
134
134
 
135
135
  })
136
- </script>
136
+ <% end %>
@@ -4,8 +4,8 @@
4
4
 
5
5
  <div id="match"> </div>
6
6
 
7
- <script>
8
- window.addEventListener("load", () => {
7
+ <%= javascript_tag do %>
8
+ window.addEventListener("DOMContentLoaded", () => {
9
9
 
10
10
  const useState = (defaultValue) => {
11
11
  let value = defaultValue;
@@ -48,4 +48,4 @@
48
48
 
49
49
  }
50
50
  })
51
- </script>
51
+ <% end %>
@@ -32,8 +32,8 @@
32
32
 
33
33
 
34
34
 
35
- <script>
36
- window.addEventListener("load", () => {
35
+ <%= javascript_tag do %>
36
+ window.addEventListener("DOMContentLoaded", () => {
37
37
 
38
38
 
39
39
  // variables for the passphrase kits you are targeting
@@ -320,4 +320,4 @@
320
320
 
321
321
 
322
322
  })
323
- </script>
323
+ <% end %>
@@ -7,8 +7,8 @@
7
7
  <%= pb_rails("text_input", props: { label: "Passphrase Strength", value: "0", disabled: true, id: "calc_strength_change" }) %>
8
8
 
9
9
 
10
- <script>
11
- window.addEventListener("load", () => {
10
+ <%= javascript_tag do %>
11
+ window.addEventListener("DOMContentLoaded", () => {
12
12
 
13
13
  // variables for the kits you are targeting
14
14
  const passphrase = document.querySelector(".passphrase_change").querySelector("input")
@@ -120,4 +120,4 @@
120
120
  });
121
121
 
122
122
  })
123
- </script>
123
+ <% end %>
@@ -13,8 +13,8 @@
13
13
  <script>
14
14
  document.addEventListener('DOMContentLoaded', () => {
15
15
  function handleButtonClick() {
16
- const editorContainer = [...document.querySelectorAll('[data-pb-react-props]')]
17
- .find(element => element.getAttribute('data-pb-react-props')?.includes('"id":"content-preview-editor"'))
16
+ const editorContainer = [...document.querySelectorAll('[data-react-props]')]
17
+ .find(element => element.getAttribute('data-react-props')?.includes('"id":"content-preview-editor"'))
18
18
 
19
19
  const editorElement = editorContainer?.querySelector('trix-editor')
20
20
  const inputId = editorElement?.getAttribute('input')
@@ -53,10 +53,13 @@ $section_colors_dark: (
53
53
  .pb_section_separator_vertical {
54
54
  margin-left: $space_xs;
55
55
  margin-right: $space_xs;
56
+ flex-direction: column;
56
57
  &::before {
57
- display: none;
58
+ flex: 1;
59
+ @include section_separator_vertical(false);
58
60
  }
59
61
  &::after {
62
+ flex: 1;
60
63
  @include section_separator_vertical(false);
61
64
  }
62
65
  }
@@ -87,7 +90,7 @@ $section_colors_dark: (
87
90
  background: none;
88
91
  }
89
92
  &.pb_section_separator_vertical {
90
- &::after {
93
+ &::before, &::after {
91
94
  border: 1px dashed $color_value;
92
95
  background: none;
93
96
  }
@@ -106,7 +109,7 @@ $section_colors_dark: (
106
109
  }
107
110
 
108
111
  &.pb_section_separator_vertical {
109
- &::after {
112
+ &::before, &::after {
110
113
  @include section_separator_vertical(true);
111
114
  }
112
115
  }
@@ -115,6 +118,11 @@ $section_colors_dark: (
115
118
  &::before, &::after {
116
119
  @include section_separator_dashed(true);
117
120
  }
121
+ &.pb_section_separator_vertical {
122
+ &::before, &::after {
123
+ @include section_separator_dashed(true);
124
+ }
125
+ }
118
126
  }
119
127
  }
120
128
 
@@ -126,7 +134,7 @@ $section_colors_dark: (
126
134
  }
127
135
 
128
136
  &.pb_section_separator_vertical {
129
- &::after {
137
+ &::before, &::after {
130
138
  @include section_separator_vertical(false);
131
139
  background: $color_value;
132
140
  }
@@ -138,7 +146,7 @@ $section_colors_dark: (
138
146
  background: none;
139
147
  }
140
148
  &.pb_section_separator_vertical {
141
- &::after {
149
+ &::before, &::after {
142
150
  border: 1px dashed $color_value;
143
151
  background: none;
144
152
  }
@@ -11,4 +11,27 @@
11
11
  padding_right: "xs"
12
12
  }) %>
13
13
  <% end %>
14
+ <% end %>
15
+
16
+ <%= pb_rails("flex", props: { classname: "flex-container", margin_top: "lg", vertical: "stretch" }) do %>
17
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
19
+ <% end %>
20
+ <%= pb_rails("section_separator", props: { orientation: "vertical" }) do %>
21
+ <%= pb_rails("card", props: {
22
+ border_radius: "rounded",
23
+ justify_content: "center",
24
+ padding: "none"
25
+ }) do %>
26
+ <%= pb_rails("caption", props: {
27
+ text: "TODAY",
28
+ size: "xs",
29
+ padding_left: "xs",
30
+ padding_right: "xs"
31
+ }) %>
32
+ <% end %>
33
+ <% end %>
34
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
35
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
36
+ <% end %>
14
37
  <% end %>
@@ -2,8 +2,25 @@ import React from 'react'
2
2
  import Card from '../../pb_card/_card'
3
3
  import Caption from '../../pb_caption/_caption'
4
4
  import SectionSeparator from '../../pb_section_separator/_section_separator'
5
+ import Flex from '../../pb_flex/_flex'
6
+ import FlexItem from '../../pb_flex/_flex_item'
5
7
 
6
- const children = (
8
+ const childrenHorizontal = (
9
+ <Card
10
+ borderRadius="rounded"
11
+ justifyContent="center"
12
+ padding="none"
13
+ >
14
+ <Caption
15
+ paddingLeft="xs"
16
+ paddingRight="xs"
17
+ size="xs"
18
+ text="TODAY"
19
+ />
20
+ </Card>
21
+ )
22
+
23
+ const childrenVertical = (
7
24
  <Card
8
25
  borderRadius="rounded"
9
26
  justifyContent="center"
@@ -20,12 +37,33 @@ const children = (
20
37
 
21
38
  const SectionSeparatorChildren = (props) => {
22
39
  return (
23
- <SectionSeparator
24
- {...props}
25
- lineStyle='dashed'
26
- >
27
- {children}
28
- </SectionSeparator>
40
+ <>
41
+ <SectionSeparator
42
+ {...props}
43
+ lineStyle='dashed'
44
+ >
45
+ {childrenHorizontal}
46
+ </SectionSeparator>
47
+ <Flex
48
+ inline="flex-container"
49
+ marginTop="lg"
50
+ vertical="stretch"
51
+ >
52
+ <FlexItem>
53
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'}
54
+ </FlexItem>
55
+ <SectionSeparator
56
+ orientation="vertical"
57
+ {...props}
58
+ >
59
+ {childrenVertical}
60
+ </SectionSeparator>
61
+ <FlexItem>
62
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'}
63
+ </FlexItem>
64
+ </Flex>
65
+ </>
66
+
29
67
  )
30
68
  }
31
69
 
@@ -7,7 +7,10 @@
7
7
  <% end %>
8
8
  <% end %>
9
9
  <% if object.orientation === 'vertical' %>
10
- <%= pb_rails("flex", props: { orientation: "column"}) do %>
10
+ <% if content %>
11
+ <%= content %>
12
+ <% elsif object.text %>
13
+ <span><%= pb_rails("caption", props: { text: object.text }) %></span>
11
14
  <% end %>
12
15
  <%end%>
13
16
  <% end %>