playbook_ui 14.24.0.pre.alpha.PLAY23139411 → 14.24.0.pre.alpha.play23479502

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +34 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +43 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +64 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +1 -1
  9. data/app/pb_kits/playbook/pb_date/_date.tsx +5 -3
  10. data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
  11. data/app/pb_kits/playbook/pb_date/date.rb +2 -0
  12. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
  13. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
  14. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
  15. data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
  16. data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +2 -2
  18. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.html.erb +22 -0
  19. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.jsx +43 -0
  20. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.md +1 -0
  21. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  22. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  23. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +2 -1
  24. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
  25. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +6 -0
  26. data/app/pb_kits/playbook/pb_pagination/_pagination.test.jsx +212 -0
  27. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +8 -1
  28. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +112 -0
  29. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +3 -0
  30. data/app/pb_kits/playbook/pb_pagination/docs/example.yml +1 -0
  31. data/app/pb_kits/playbook/pb_pagination/docs/index.js +1 -0
  32. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +49 -1
  33. data/dist/chunks/{_weekday_stacked-B89kArHY.js → _weekday_stacked-irgZUVGj.js} +2 -2
  34. data/dist/chunks/vendor.js +1 -1
  35. data/dist/menu.yml +1 -1
  36. data/dist/playbook-doc.js +1 -1
  37. data/dist/playbook.css +1 -1
  38. data/lib/playbook/version.rb +1 -1
  39. metadata +14 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3d762bec279ed08c6f2c32e62d81d19ff9309898bd898b64b5ebbafa042746c
4
- data.tar.gz: 9e9e7d6f94777f1770757559c95bb1e12ac8b4016cc48d84236278a9d8ab15dd
3
+ metadata.gz: f4ccc02520ca6f12c398e5c4417dcfeb08b24b1b68bed3ca430137584fd25bf8
4
+ data.tar.gz: d916bb54b939ce9cbec50449fe9bf90791ae6ac0e330337f54c8fc8f5375c5cb
5
5
  SHA512:
6
- metadata.gz: 50d7e0dd26c65b9bbf45ecb7132b46deb8507e5d06d6c9e3c8ee0d3f49f26844184f69fdef2ee7baccda44f490c13cc2a4232d8d2f73c0ec35dea88f10149aed
7
- data.tar.gz: 4709d36e634964f8a1a9b9fb1b7d8fe0893951a5b5fc2d2b83d55fcbe2e966a7a95e03be098891c6e7811704f9db4c54d1eb903e891d4cf0b1f8d71348ddef14
6
+ metadata.gz: d3c9a37eb5044d3a60ac5d4843fec307a2c183ac800d9fdb940a93503a00cd1dd21f5c28df556096909eae5e7f6369df0f78ea108a0ca37761a595390ead7c0e
7
+ data.tar.gz: '0845b9c473a82d7322b6ee1d1d9a17e1a4221453ef23a105d66b01d6de4682fdfd6abe77ba38877ae66cdfa3dae70a2b4bfa9602d1808ba11df4aece44607714'
@@ -971,6 +971,40 @@
971
971
  }
972
972
  }
973
973
  }
974
+
975
+ // Firefox-specific fix for last-header-cell and last-cell vertical borders
976
+ @-moz-document url-prefix() {
977
+ .pb_advanced_table_header {
978
+ .last-header-cell {
979
+ border-right: none !important;
980
+ box-shadow: 1px 0 0 0 $border_light !important;
981
+ }
982
+ }
983
+
984
+ .pb_advanced_table_body {
985
+ .last-cell {
986
+ border-right: none !important;
987
+ box-shadow: 1px 0 0 0 $border_light !important;
988
+ }
989
+ }
990
+
991
+ // Dark mode Firefox fixes
992
+ &.dark {
993
+ .pb_advanced_table_header {
994
+ .last-header-cell {
995
+ border-right: none !important;
996
+ box-shadow: 1px 0 0 0 $border_dark !important;
997
+ }
998
+ }
999
+
1000
+ .pb_advanced_table_body {
1001
+ .last-cell {
1002
+ border-right: none !important;
1003
+ box-shadow: 1px 0 0 0 $border_dark !important;
1004
+ }
1005
+ }
1006
+ }
1007
+ }
974
1008
  }
975
1009
 
976
1010
  // Outside of the pb_advanced_table class for popover
@@ -0,0 +1,43 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ label: "Enrollment Data",
9
+ columns: [
10
+ {
11
+ accessor: "newEnrollments",
12
+ label: "New Enrollments",
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ ],
19
+ },
20
+ {
21
+ label: "Performance Data",
22
+ columns: [
23
+ {
24
+ accessor: "attendanceRate",
25
+ label: "Attendance Rate",
26
+ },
27
+ {
28
+ accessor: "completedClasses",
29
+ label: "Completed Classes",
30
+ },
31
+ {
32
+ accessor: "classCompletionRate",
33
+ label: "Class Completion Rate",
34
+ },
35
+ {
36
+ accessor: "graduatedStudents",
37
+ label: "Graduated Students",
38
+ },
39
+ ],
40
+ },
41
+ ] %>
42
+
43
+ <%= pb_rails("advanced_table", props: { id: "table_multi_headers_vertical_borders", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true } }) %>
@@ -0,0 +1,64 @@
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 AdvancedTableColumnHeadersVerticalBorder = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ label: "Enrollment Data",
14
+ columns: [
15
+ {
16
+ accessor: "newEnrollments",
17
+ label: "New Enrollments",
18
+ },
19
+ {
20
+ accessor: "scheduledMeetings",
21
+ label: "Scheduled Meetings",
22
+ },
23
+ ],
24
+ },
25
+ {
26
+ label: "Performance Data",
27
+ columns: [
28
+ {
29
+ accessor: "attendanceRate",
30
+ label: "Attendance Rate",
31
+ },
32
+ {
33
+ accessor: "completedClasses",
34
+ label: "Completed Classes",
35
+ },
36
+ {
37
+ accessor: "classCompletionRate",
38
+ label: "Class Completion Rate",
39
+ },
40
+ {
41
+ accessor: "graduatedStudents",
42
+ label: "Graduated Students",
43
+ },
44
+ ],
45
+ },
46
+ ];
47
+
48
+ const tableProps = {
49
+ verticalBorder: true
50
+ }
51
+
52
+ return (
53
+ <>
54
+ <AdvancedTable
55
+ columnDefinitions={columnDefinitions}
56
+ tableData={MOCK_DATA}
57
+ tableProps={tableProps}
58
+ {...props}
59
+ />
60
+ </>
61
+ )
62
+ }
63
+
64
+ export default AdvancedTableColumnHeadersVerticalBorder
@@ -13,6 +13,7 @@ examples:
13
13
  - advanced_table_with_custom_header_rails: Custom Header Cell
14
14
  - advanced_table_column_headers: Multi-Header Columns
15
15
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
16
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
16
17
  - advanced_table_no_subrows: Table with No Subrows or Expansion
17
18
  - advanced_table_selectable_rows_rails: Selectable Rows
18
19
  - advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
@@ -53,6 +54,7 @@ examples:
53
54
  - advanced_table_column_headers: Multi-Header Columns
54
55
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
55
56
  - advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
57
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
56
58
  - advanced_table_no_subrows: Table with No Subrows or Expansion
57
59
  - advanced_table_pinned_rows: Pinned Rows
58
60
  - advanced_table_selectable_rows: Selectable Rows
@@ -21,6 +21,7 @@ export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_
21
21
  export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
22
22
  export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
23
23
  export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
24
+ export { default as AdvancedTableColumnHeadersVerticalBorder } from './_advanced_table_column_headers_vertical_border.jsx'
24
25
  export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
25
26
  export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
26
27
  export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
@@ -43,7 +43,7 @@ module Playbook
43
43
  end
44
44
 
45
45
  def td_classname(column, index)
46
- classes = %w[id-cell chrome-styles]
46
+ classes = %w[id-cell]
47
47
  classes << "last-cell" if column[:is_last_in_group]
48
48
  classes << "pinned-left" if index.zero? && is_pinned_left && responsive == "scroll"
49
49
  classes.join(" ")
@@ -29,7 +29,7 @@ module Playbook
29
29
  end
30
30
 
31
31
  def td_classname(index)
32
- classes = %w[id-cell chrome-styles]
32
+ classes = %w[id-cell]
33
33
  classes << "pinned-left" if index.zero? && responsive == "scroll"
34
34
  classes.join(" ")
35
35
  end
@@ -19,6 +19,7 @@ type PbDateProps = {
19
19
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
20
20
  id?: string;
21
21
  showDayOfWeek?: boolean;
22
+ showCurrentYear?: boolean;
22
23
  showIcon?: boolean;
23
24
  size?: "sm" | "md" | "lg";
24
25
  unstyled?: boolean;
@@ -35,6 +36,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
35
36
  htmlOptions = {},
36
37
  id,
37
38
  showDayOfWeek = false,
39
+ showCurrentYear = false,
38
40
  showIcon = false,
39
41
  size = "md",
40
42
  unstyled = false,
@@ -90,7 +92,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
90
92
  {month} {day}
91
93
  </span>
92
94
 
93
- {currentYear != year && <span>{`, ${year}`}</span>}
95
+ {(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
94
96
  </span>
95
97
  </>
96
98
  : size == "md" || size == "lg"
@@ -124,7 +126,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
124
126
  <span>
125
127
  {month} {day}
126
128
  </span>
127
- {currentYear != year && <span>{`, ${year}`}</span>}
129
+ {(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
128
130
  </Title>
129
131
  )
130
132
  : (
@@ -158,7 +160,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
158
160
  <Caption dark={dark}
159
161
  tag="span">
160
162
  {month} {day}
161
- {currentYear != year && <>{`, ${year}`}</>}
163
+ {(currentYear !== year || showCurrentYear) && <>{`, ${year}`}</>}
162
164
  </Caption>
163
165
  </>
164
166
  )}
@@ -13,8 +13,8 @@
13
13
  <% end %>
14
14
 
15
15
  <!-- month day, year -->
16
- <%# if not current year %>
17
- <% if object.year.to_s == DateTime.now.year.to_s %>
16
+ <%# if not current year or show_current_year is false %>
17
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
18
18
  <span><%= "#{object.month} #{object.day}" %></span>
19
19
  <%# if is current year %>
20
20
  <% else %>
@@ -44,8 +44,8 @@
44
44
 
45
45
  <!-- month day, year -->
46
46
 
47
- <%# if not current year %>
48
- <% if object.year.to_s == DateTime.now.year.to_s %>
47
+ <%# if not current year or show_current_year is false %>
48
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
49
49
  <%= pb_rails("title", props: { tag: "div", text: "#{object.month} #{object.day}", size: 4 }) %>
50
50
  <%# if is current year %>
51
51
  <% else %>
@@ -74,8 +74,8 @@
74
74
 
75
75
  <!-- month day, year -->
76
76
 
77
- <%# if not current year %>
78
- <% if object.year.to_s == DateTime.now.year.to_s %>
77
+ <%# if not current year or show_current_year is false %>
78
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
79
79
  <%= pb_rails("caption", props: { tag: "span", text: "#{object.month} #{object.day}" }) %>
80
80
  <%# if is current year %>
81
81
  <% else %>
@@ -11,6 +11,8 @@ module Playbook
11
11
  default: false
12
12
  prop :show_day_of_week, type: Playbook::Props::Boolean,
13
13
  default: false
14
+ prop :show_current_year, type: Playbook::Props::Boolean,
15
+ default: false
14
16
  prop :size, type: Playbook::Props::Enum,
15
17
  values: %w[lg md sm xs],
16
18
  default: "md"
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("date", props: {
2
+ date: Date.today,
3
+ show_current_year: true
4
+ }) %>
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+
3
+ import FormattedDate from '../../pb_date/_date'
4
+
5
+ const DateWithShowCurrentYear = (props) => {
6
+ return (
7
+ <>
8
+ <FormattedDate
9
+ showCurrentYear
10
+ value={new Date()}
11
+ {...props}
12
+ />
13
+ </>
14
+ )
15
+ }
16
+
17
+ export default DateWithShowCurrentYear
@@ -0,0 +1 @@
1
+ By default, the Date kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true as shown here.
@@ -5,12 +5,14 @@ examples:
5
5
  - date_variants: Variants
6
6
  - date_alignment: Alignment
7
7
  - date_timezone: Timezones
8
+ - date_with_show_current_year: Show Current Year
8
9
  - date_unstyled: Unstyled
9
10
 
10
11
  react:
11
12
  - date_default: Default
12
13
  - date_variants: Variants
13
14
  - date_alignment: Alignment
15
+ - date_with_show_current_year: Show Current Year
14
16
  - date_unstyled: Unstyled
15
17
 
16
18
  swift:
@@ -2,3 +2,4 @@ export { default as DateDefault } from './_date_default.jsx'
2
2
  export { default as DateVariants } from './_date_variants.jsx'
3
3
  export { default as DateAlignment } from './_date_alignment.jsx'
4
4
  export { default as DateUnstyled } from './_date_unstyled.jsx'
5
+ export { default as DateWithShowCurrentYear } from './_date_with_show_current_year.jsx'
@@ -52,7 +52,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
52
52
  } = props;
53
53
 
54
54
  const returnedIcon = icon || iconMap[status]
55
- const iconClass = icon ? "custom_icon" : ""
55
+ const iconClass = icon && icon !== "none" ? "custom_icon" : ""
56
56
 
57
57
  const css = classnames(
58
58
  `pb_fixed_confirmation_toast_kit_${status}`,
@@ -92,7 +92,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
92
92
  onClick={handleClick}
93
93
  {...htmlProps}
94
94
  >
95
- {returnedIcon && (
95
+ {returnedIcon && icon !== "none" && (
96
96
  <Icon
97
97
  className="pb_icon"
98
98
  fixedWidth
@@ -0,0 +1,22 @@
1
+ <%= pb_rails("fixed_confirmation_toast", props: {
2
+ text: "Error Message",
3
+ status: "error",
4
+ icon: "none",
5
+ closeable: true
6
+ })%>
7
+
8
+ <br><br>
9
+
10
+ <%= pb_rails("fixed_confirmation_toast", props: {
11
+ text: "Items Successfully Moved",
12
+ status: "success",
13
+ icon: "none"
14
+ })%>
15
+
16
+ <br><br>
17
+
18
+ <%= pb_rails("fixed_confirmation_toast", props: {
19
+ text: "Scan to Assign Selected Items",
20
+ status: "neutral",
21
+ icon: "none"
22
+ })%>
@@ -0,0 +1,43 @@
1
+ import React from 'react'
2
+
3
+ import FixedConfirmationToast from '../_fixed_confirmation_toast'
4
+
5
+ const FixedConfirmationToastNoIcon = (props) => {
6
+ return (
7
+ <div>
8
+ <div>
9
+ <FixedConfirmationToast
10
+ closeable
11
+ icon="none"
12
+ status="error"
13
+ text="Error Message"
14
+ {...props}
15
+ />
16
+ </div>
17
+
18
+ <br />
19
+
20
+ <div>
21
+ <FixedConfirmationToast
22
+ icon="none"
23
+ status="success"
24
+ text="Items Successfully Moved"
25
+ {...props}
26
+ />
27
+ </div>
28
+
29
+ <br />
30
+
31
+ <div>
32
+ <FixedConfirmationToast
33
+ icon="none"
34
+ status="neutral"
35
+ text="Scan to Assign Selected Items"
36
+ {...props}
37
+ />
38
+ </div>
39
+ </div>
40
+ )
41
+ }
42
+
43
+ export default FixedConfirmationToastNoIcon
@@ -0,0 +1 @@
1
+ Setting `icon` prop to "none" will render the fixed confirmation toast without the left side icon.
@@ -8,6 +8,7 @@ examples:
8
8
  - fixed_confirmation_toast_auto_close: Click to Show Auto Close
9
9
  - fixed_confirmation_toast_children: Children
10
10
  - fixed_confirmation_toast_custom_icon: Custom Icon
11
+ - fixed_confirmation_toast_no_icon: No Icon
11
12
 
12
13
  react:
13
14
  - fixed_confirmation_toast_default: Default
@@ -17,6 +18,7 @@ examples:
17
18
  - fixed_confirmation_toast_auto_close: Click to Show Auto Close
18
19
  - fixed_confirmation_toast_children: Children
19
20
  - fixed_confirmation_toast_custom_icon: Custom Icon
21
+ - fixed_confirmation_toast_no_icon: No Icon
20
22
 
21
23
  swift:
22
24
  - fixed_confirmation_toast_default_swift: Default
@@ -5,3 +5,4 @@ export { default as FixedConfirmationToastPositions } from './_fixed_confirmatio
5
5
  export { default as FixedConfirmationToastAutoClose } from './_fixed_confirmation_toast_auto_close.jsx'
6
6
  export { default as FixedConfirmationToastChildren } from './_fixed_confirmation_toast_children.jsx'
7
7
  export { default as FixedConfirmationToastCustomIcon } from './_fixed_confirmation_toast_custom_icon.jsx'
8
+ export { default as FixedConfirmationToastNoIcon } from './_fixed_confirmation_toast_no_icon.jsx'
@@ -1,6 +1,7 @@
1
1
  <%= pb_content_tag do %>
2
+ <% if object.icon_value && object.icon_value != "none" %>
2
3
  <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
3
-
4
+ <% end %>
4
5
  <% if content %>
5
6
  <%= content %>
6
7
  <% elsif object.show_text? %>
@@ -56,7 +56,7 @@ module Playbook
56
56
  end
57
57
 
58
58
  def icon_class
59
- icon.present? ? " custom_icon" : ""
59
+ icon.present? && icon != "none" ? " custom_icon" : ""
60
60
  end
61
61
 
62
62
  def classname
@@ -56,6 +56,12 @@ test('renders custom icon when provided', () => {
56
56
  expect(container.querySelector('.custom_icon')).toBeInTheDocument();
57
57
  });
58
58
 
59
+ test("renders no icon when icon prop is 'none'", () => {
60
+ const { container } = render(<FixedConfirmationToast icon="none" />);
61
+ expect(container.querySelector('.pb_icon')).not.toBeInTheDocument();
62
+ expect(container.querySelector('.custom_icon')).not.toBeInTheDocument();
63
+ });
64
+
59
65
  test('renders correctly with multiLine prop', () => {
60
66
  const { container } = render(<FixedConfirmationToast multiLine />);
61
67
  expect(container.querySelector('._multi_line')).toBeInTheDocument();