playbook_ui_docs 15.6.0.pre.alpha.draggableask12907 → 15.6.0.pre.alpha.play261013050

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb +43 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +11 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +7 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx +54 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md +9 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx +80 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md +3 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
  12. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  13. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  14. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +0 -1
  15. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +0 -3
  16. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  17. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +16 -0
  18. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +30 -0
  19. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +1 -0
  20. data/app/pb_kits/playbook/pb_select/docs/example.yml +2 -0
  21. data/app/pb_kits/playbook/pb_select/docs/index.js +1 -0
  22. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx +134 -0
  23. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md +34 -0
  24. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb +101 -0
  25. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +33 -0
  26. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx +180 -0
  27. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.md +3 -0
  28. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.html.erb +122 -0
  29. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.md +3 -0
  30. data/app/pb_kits/playbook/pb_table/docs/example.yml +4 -0
  31. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  32. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +60 -0
  33. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +118 -0
  34. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +1 -0
  35. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
  36. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +2 -0
  37. data/app/pb_kits/playbook/pb_timeline/docs/index.js +1 -0
  38. metadata +22 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae0e5f4244d1274588cef2f7b34d4c552dbc1681f5e7d49c90bfd2f59194b237
4
- data.tar.gz: 0cf9eec97525fb134e69195ecaa4bbc5f481cb316cdd443c8a0718a894687097
3
+ metadata.gz: 1429a20e3269b6dfc72f937549b5dd567146dfa0ea624369ad1b06c87e761dc9
4
+ data.tar.gz: 78fd1522fb2d408c992a5d9bca3213379302059fc91a8adefa69b8dac62fd26e
5
5
  SHA512:
6
- metadata.gz: 4bd20de6f4d6d920e81409c11193b018f4fda6c62293616f45159ef2d649fdcc6af248b2e32c5252ad51b9566b199047517911edc6858af29e93c04daefc609e
7
- data.tar.gz: 33b277161e125f38749851a98193894900ac4ba9258a60c30163b2a84522f6426391c05ff2a405510074a8c15194a2303746c11c8595082233d79cb566e37434
6
+ metadata.gz: 846a6d3bf6536e911cd4b0d1f6b619b9e331396d333af15a9e2c9b987e9c5c526fbc8a976e46c8f2786bc92d606135655e171999774bcac6bd4c77985bf9dcd3
7
+ data.tar.gz: 44be50ab6f4c563eebba01fedb8f1d3fe4034d907d0981f6bcb90d975bed8750ba6a40834651cf947ccb39b5fe4c9f6ae31108fd054fe0c25023c49f633a258f
@@ -0,0 +1,43 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ column_styling: {
11
+ cell_background_color: ->(row) { row[:newEnrollments].to_i > 20 ? "success_secondary" : "warning_secondary" }
12
+ }
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ {
19
+ accessor: "attendanceRate",
20
+ label: "Attendance Rate",
21
+ },
22
+ {
23
+ accessor: "completedClasses",
24
+ label: "Completed Classes",
25
+ },
26
+ {
27
+ accessor: "classCompletionRate",
28
+ label: "Class Completion Rate",
29
+ column_styling: {
30
+ cell_background_color: "category_1",
31
+ font_color: "white"
32
+ }
33
+ },
34
+ {
35
+ accessor: "graduatedStudents",
36
+ label: "Graduated Students",
37
+ }
38
+ ] %>
39
+
40
+ <%= pb_rails("advanced_table", props: { id: "background-control", table_data: @table_data, column_definitions: column_definitions }) do %>
41
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "background-control", column_definitions: column_definitions }) %>
42
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "background-control", table_data: @table_data, column_definitions: column_definitions }) %>
43
+ <% end %>
@@ -0,0 +1 @@
1
+ `column_styling` can also be used to control the background color on individual cells in a given column as shown here.
@@ -8,16 +8,26 @@
8
8
  accessor: "newEnrollments",
9
9
  label: "New Enrollments",
10
10
  column_styling: {
11
- cell_background_color: ->(row) { row[:newEnrollments].to_i > 20 ? "success_secondary" : "warning_secondary" }
11
+ cell_background_color: "error_subtle",
12
+ header_background_color: "error_subtle"
12
13
  }
13
14
  },
14
15
  {
15
16
  accessor: "scheduledMeetings",
16
17
  label: "Scheduled Meetings",
18
+ column_styling: {
19
+ cell_background_color: "info_subtle",
20
+ }
17
21
  },
18
22
  {
19
23
  accessor: "attendanceRate",
20
24
  label: "Attendance Rate",
25
+ column_styling: {
26
+ cell_background_color: "info",
27
+ header_background_color: "info",
28
+ header_font_color: "white",
29
+ font_color: "white"
30
+ }
21
31
  },
22
32
  {
23
33
  accessor: "completedClasses",
@@ -26,10 +36,6 @@
26
36
  {
27
37
  accessor: "classCompletionRate",
28
38
  label: "Class Completion Rate",
29
- column_styling: {
30
- cell_background_color: "category_1",
31
- font_color: "white"
32
- }
33
39
  },
34
40
  {
35
41
  accessor: "graduatedStudents",
@@ -1 +1,7 @@
1
- `column_styling` can also be used to control the background color on all cells in a given column via the use of the `cell_background_color` key/value pair. Use `cell_background_color` to achieve custom background colors for individual cells as seen here. Use `font_color` to achieve better contrast between cell content and background for darker backgrounds.
1
+ `column_styling` can also be used to control the background color on all cells in a given column. Use the following key/values pairs to achieve this:
2
+
3
+ 1) `cell_background_color`: use this to control the background color of all cells in the given column
4
+ 2) `font_color`: use this to control font color for all cells in the given column if needed, for example if using a darker background color
5
+ 3) `header_background_color`: use this to control the background color of the column header
6
+ 4) `header_font_color`: use this to control font color for the header in the given column if needed, for example if using a darker background color.
7
+
@@ -0,0 +1,54 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import colors from '../../tokens/exports/_colors.module.scss'
4
+ import MOCK_DATA from "./advanced_table_mock_data.json"
5
+
6
+
7
+ const AdvancedTableColumnStylingBackground = (props) => {
8
+ const columnDefinitions = [
9
+ {
10
+ accessor: "year",
11
+ label: "Year",
12
+ cellAccessors: ["quarter", "month", "day"],
13
+ },
14
+ {
15
+ accessor: "newEnrollments",
16
+ label: "New Enrollments",
17
+ columnStyling:{cellBackgroundColor: colors.error_subtle, headerBackgroundColor: colors.error_subtle},
18
+ },
19
+ {
20
+ accessor: "scheduledMeetings",
21
+ label: "Scheduled Meetings",
22
+ columnStyling:{cellBackgroundColor: colors.info_subtle},
23
+ },
24
+ {
25
+ accessor: "attendanceRate",
26
+ label: "Attendance Rate",
27
+ columnStyling:{cellBackgroundColor: colors.info, headerBackgroundColor: colors.info, fontColor: colors.white, headerFontColor: colors.white},
28
+ },
29
+ {
30
+ accessor: "completedClasses",
31
+ label: "Completed Classes",
32
+ },
33
+ {
34
+ accessor: "classCompletionRate",
35
+ label: "Class Completion Rate",
36
+ },
37
+ {
38
+ accessor: "graduatedStudents",
39
+ label: "Graduated Students",
40
+ },
41
+ ]
42
+
43
+ return (
44
+ <div>
45
+ <AdvancedTable
46
+ columnDefinitions={columnDefinitions}
47
+ tableData={MOCK_DATA}
48
+ {...props}
49
+ />
50
+ </div>
51
+ )
52
+ }
53
+
54
+ export default AdvancedTableColumnStylingBackground
@@ -0,0 +1,9 @@
1
+ The `columnStyling` prop can also be used to set background color for entire columns.As stated above, `columnStyling` is an object that has several optional key/value pairs, here are the options highlighted in this doc:
2
+
3
+ 1) `cellBackgroundColor`: use this to control the background color of all cells in the given column
4
+ 2) `headerBackgroundColor`: use this to control the background color of the column header
5
+ 3) `fontColor`: use this to control font color for all cells in the given column if needed, for example if using a darker background color.
6
+ 4) `headerFontColor`: use this to control font color for the header in the given column if needed, for example if using a darker background color.
7
+
8
+
9
+
@@ -0,0 +1,80 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import colors from '../../tokens/exports/_colors.module.scss'
4
+ import MOCK_DATA from "./advanced_table_mock_data.json"
5
+
6
+
7
+ const AdvancedTableColumnStylingBackgroundMulti = (props) => {
8
+ const columnDefinitions = [
9
+ {
10
+ accessor: "year",
11
+ label: "Year",
12
+ cellAccessors: ["quarter", "month", "day"],
13
+ },
14
+ {
15
+ label: "Enrollment Data",
16
+ columns: [
17
+ {
18
+ label: "Enrollment Stats",
19
+ columns: [
20
+ {
21
+ accessor: "newEnrollments",
22
+ label: "New Enrollments",
23
+ columnStyling:{cellBackgroundColor: colors.error_subtle, headerBackgroundColor: colors.error_subtle},
24
+ },
25
+ {
26
+ accessor: "scheduledMeetings",
27
+ label: "Scheduled Meetings",
28
+ },
29
+ ],
30
+ },
31
+ ],
32
+ },
33
+ {
34
+ label: "Performance Data",
35
+ columns: [
36
+ {
37
+ label: "Completion Metrics",
38
+ columns: [
39
+ {
40
+ accessor: "completedClasses",
41
+ label: "Completed Classes",
42
+ columnStyling:{cellBackgroundColor: colors.info, headerBackgroundColor: colors.info, fontColor: colors.white, headerFontColor: colors.white},
43
+ },
44
+ {
45
+ accessor: "classCompletionRate",
46
+ label: "Class Completion Rate",
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ label: "Attendance",
52
+ columns: [
53
+ {
54
+ accessor: "attendanceRate",
55
+ label: "Attendance Rate",
56
+ columnStyling:{cellBackgroundColor: colors.info_subtle},
57
+ },
58
+ {
59
+ accessor: "scheduledMeetings",
60
+ label: "Scheduled Meetings",
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ },
66
+ ];
67
+
68
+
69
+ return (
70
+ <div>
71
+ <AdvancedTable
72
+ columnDefinitions={columnDefinitions}
73
+ tableData={MOCK_DATA}
74
+ {...props}
75
+ />
76
+ </div>
77
+ )
78
+ }
79
+
80
+ export default AdvancedTableColumnStylingBackgroundMulti
@@ -0,0 +1,3 @@
1
+ The `columnStyling` prop can also be used to set background color for entire columns for the multi header variant as well.
2
+
3
+ It should be noted that `headerFontColor` and `headerBackgroundColor` in the multi header variant will only apply to the immediate header for the given column as shown here.
@@ -26,7 +26,8 @@ examples:
26
26
  - advanced_table_column_styling_rails: Column Styling
27
27
  - advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
28
28
  - advanced_table_padding_control_rails: Padding Control using Column Styling
29
- - advanced_table_background_control_rails: Background Control using Column Styling
29
+ - advanced_table_background_control_rails: Column Styling Background Color
30
+ - advanced_table_background_colors_rails: Column Styling Individual Cell Background Color
30
31
  - advanced_table_column_border_color_rails: Column Group Border Color
31
32
 
32
33
 
@@ -75,6 +76,8 @@ examples:
75
76
  - advanced_table_padding_control_per_row: Padding Control using Row Styling
76
77
  - advanced_table_column_styling: Column Styling
77
78
  - advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
79
+ - advanced_table_column_styling_background: Column Styling Background Color
80
+ - advanced_table_column_styling_background_multi: Column Styling Background Color with Multiple Headers
78
81
  - advanced_table_padding_control: Padding Control using Column Styling
79
82
  - advanced_table_column_border_color: Column Group Border Color
80
83
  - advanced_table_fullscreen: Fullscreen
@@ -45,4 +45,6 @@ export { default as AdvancedTableWithCustomHeaderMultiHeader } from './_advanced
45
45
  export { default as AdvancedTableSortPerColumn } from './_advanced_table_sort_per_column.jsx'
46
46
  export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced_table_sort_per_column_for_multi_column.jsx'
47
47
  export { default as AdvancedTablePaddingControl } from './_advanced_table_padding_control.jsx'
48
- export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
48
+ export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
49
+ export { default as AdvancedTableColumnStylingBackground } from './_advanced_table_column_styling_background.jsx'
50
+ export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
@@ -1 +1 @@
1
- Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/token/colors" target="_blank">here</a>.
1
+ Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a>.
@@ -1 +1 @@
1
- Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/token/colors" target="_blank">here</a>.
1
+ Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a>.
@@ -7,7 +7,6 @@ const CollapsibleIcons = (props) => {
7
7
  <>
8
8
  <Collapsible
9
9
  icon={['plus','minus']}
10
- iconColor='white'
11
10
  >
12
11
  <Collapsible.Main {...props}>
13
12
  <div>{'Main Section'}</div>
@@ -22,7 +22,6 @@ const CollapsibleState = (props) => {
22
22
  <Collapsible
23
23
  collapsed={isCollapsed}
24
24
  icon={["plus", "minus"]}
25
- iconColor='white'
26
25
  padding="none"
27
26
  >
28
27
  <Collapsible.Main padding="sm"
@@ -41,7 +40,6 @@ const CollapsibleState = (props) => {
41
40
  <Collapsible
42
41
  collapsed={isCollapsed}
43
42
  icon={["plus", "minus"]}
44
- iconColor='white'
45
43
  padding="none"
46
44
  >
47
45
  <Collapsible.Main padding="sm"
@@ -60,7 +58,6 @@ const CollapsibleState = (props) => {
60
58
  <Collapsible
61
59
  collapsed={isCollapsed}
62
60
  icon={["plus", "minus"]}
63
- iconColor='white'
64
61
  padding="none"
65
62
  >
66
63
  <Collapsible.Main padding="sm"
@@ -1 +1 @@
1
- You can customize the order of the colors you would like to use by using the `colors` prop. Only the data and status colors will work for Playbook charts. See the [design page](https://playbook.powerapp.cloud/token/colors) for reference.
1
+ You can customize the order of the colors you would like to use by using the `colors` prop. Only the data and status colors will work for Playbook charts. See the [design page](https://playbook.powerapp.cloud/tokens/colors) for reference.
@@ -0,0 +1,16 @@
1
+ <%= pb_rails("select", props: {
2
+ label: "Favorite Food",
3
+ name: "favorite_food",
4
+ options: [
5
+ { value: "pizza", value_text: "Pizza" },
6
+ { value: "tacos", value_text: "Tacos" },
7
+ { value: "sushi", value_text: "Sushi" }
8
+ ],
9
+ input_options: {
10
+ 'aria-label': "Select your favorite food",
11
+ class: "custom-select-class",
12
+ data: { controller: "search", action: "change->search#filter" },
13
+ id: "favorite-food-select"
14
+ }
15
+ }) %>
16
+
@@ -0,0 +1,30 @@
1
+ import React from 'react'
2
+
3
+ import Select from '../_select'
4
+
5
+ const SelectInputOptions = (props) => {
6
+ const options = [
7
+ { value: 'pizza', text: 'Pizza' },
8
+ { value: 'tacos', text: 'Tacos' },
9
+ { value: 'sushi', text: 'Sushi' },
10
+ ]
11
+
12
+ return (
13
+ <>
14
+ <Select
15
+ inputOptions={{
16
+ 'aria-label': 'Select your favorite food',
17
+ className: 'custom-select-class',
18
+ id: 'favorite-food-select',
19
+ }}
20
+ label="Favorite Food"
21
+ name="favorite_food"
22
+ options={options}
23
+ {...props}
24
+ />
25
+ </>
26
+ )
27
+ }
28
+
29
+ export default SelectInputOptions
30
+
@@ -0,0 +1 @@
1
+ Use the `input_options` / `inputOptions` prop to pass additional attributes directly to the underlying `<select>` element instead of the outer wrapper. This is useful for applying data attributes, custom IDs, or other HTML attributes that need to be on the select element itself.
@@ -15,6 +15,7 @@ examples:
15
15
  - select_inline_compact: Select Inline Compact
16
16
  - select_attributes: Select W/ Attributes
17
17
  - select_multiple: Select Multiple
18
+ - select_input_options: Input Options
18
19
 
19
20
 
20
21
 
@@ -33,6 +34,7 @@ examples:
33
34
  - select_inline_compact: Select Inline Compact
34
35
  - select_multiple: Select Multiple
35
36
  - select_react_hook: React Hook
37
+ - select_input_options: Input Options
36
38
 
37
39
  swift:
38
40
  - select_default_swift: Default
@@ -12,3 +12,4 @@ export { default as SelectInlineCompact } from './_select_inline_compact.jsx'
12
12
  export { default as SelectMultiple } from './_select_multiple.jsx'
13
13
  export { default as SelectReactHook } from './_select_react_hook.jsx'
14
14
  export { default as SelectCustomSelectSubheaders } from './_select_custom_select_subheaders.jsx'
15
+ export { default as SelectInputOptions } from './_select_input_options.jsx'
@@ -0,0 +1,134 @@
1
+ import React, { useState } from "react"
2
+ import { Button, Date as DateKit, DatePicker, Dropdown, Select, Table, TextInput, Typeahead, Flex } from "playbook-ui"
3
+
4
+ // Mock Data for Table
5
+ const users = [
6
+ { id: 1, name: "Jennifer", title: "Associate Scrum Master", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-01" },
7
+ { id: 2, name: "Nick", title: "UX Engineer II", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-02" },
8
+ { id: 3, name: "Nida", title: "Senior UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-03" },
9
+ { id: 4, name: "Justin", title: "Director of User Experience Engineering", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-04" },
10
+ { id: 5, name: "Edward", title: "UX Designer II", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-05" },
11
+ { id: 6, name: "Elisa", title: "UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-06" },
12
+ { id: 7, name: "Gary", title: "UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-07" },
13
+ { id: 8, name: "Barkley", title: "Nitro Quality Ninja", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-08" },
14
+ { id: 9, name: "Aaron", title: "Associate Nitro Quality Ninja", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-09" },
15
+ ]
16
+
17
+ const TableWithFilterVariant = () => {
18
+ const [territory, setTerritory] = useState("")
19
+
20
+ // --------Filter content example ------
21
+ const filterContent = ({ closePopover }) => (
22
+ <>
23
+ <TextInput
24
+ label="Territory ID"
25
+ onChange={event => setTerritory(event.target.value)}
26
+ value={territory}
27
+ />
28
+
29
+ <Typeahead
30
+ label="Title"
31
+ options={[
32
+ { key: "senior-ux-engineer", label: "Senior UX Engineer", value: "senior-ux-engineer" },
33
+ { key: "ux-engineer", label: "UX Engineer", value: "ux-engineer" },
34
+ { key: "ux-designer", label: "UX Designer", value: "ux-designer" }
35
+ ]}
36
+ />
37
+
38
+ <Select
39
+ blankSelection="All Departments"
40
+ label="Department"
41
+ options={[
42
+ { value: "Business Technology", label: "Business Technology", key: "business-technology" },
43
+ { value: "Customer Development", label: "Customer Development", key: "customer-development" },
44
+ { value: "Talent Acquisition", label: "Talent Acquisition", key: "talent-acquisition" }
45
+ ]}
46
+ />
47
+
48
+ <Dropdown
49
+ label="Branch"
50
+ options={[
51
+ { key: "Philadelphia", label: "Philadelphia", value: "philadelphia" },
52
+ { key: "New York", label: "New York", value: "new-york" },
53
+ { key: "Austin", label: "Austin", value: "austin" }
54
+ ]}
55
+ />
56
+
57
+ <DatePicker
58
+ label="Start Date"
59
+ paddingY="sm"
60
+ pickerId="startedOn"
61
+ />
62
+ <Flex spacing="between">
63
+ <Button
64
+ onClick={() => {
65
+ alert("No filtering functionality - just a pattern demo!")
66
+ closePopover()
67
+ }}
68
+ text="Filter"
69
+ />
70
+ <Button
71
+ text="Defaults"
72
+ variant="secondary"
73
+ />
74
+ </Flex>
75
+ </>
76
+ )
77
+ // -------End Filter content example ------
78
+
79
+ return (
80
+ <Table
81
+ filterContent={filterContent}
82
+ filterProps={{
83
+ results: 50,
84
+ sortOptions: {
85
+ territory_id: "Territory ID",
86
+ first_name: "Name",
87
+ started_on: "Start Date",
88
+ department_name: "Department",
89
+ title_name: "Title",
90
+ branch_branch_name: "Branch",
91
+ },
92
+ sortValue: [{ name: 'started_on', dir: 'asc' }],
93
+ }}
94
+ title="Table Title Here"
95
+ variant="withFilter"
96
+ >
97
+ <Table.Head>
98
+ <Table.Row>
99
+ <Table.Header>{'Territory ID'}</Table.Header>
100
+ <Table.Header>{'Name'}</Table.Header>
101
+ <Table.Header>{'Title'}</Table.Header>
102
+ <Table.Header>{'Department'}</Table.Header>
103
+ <Table.Header>{'Branch'}</Table.Header>
104
+ <Table.Header textAlign="right">{'Start Date'}</Table.Header>
105
+ </Table.Row>
106
+ </Table.Head>
107
+ <Table.Body>
108
+ {users.map((user) => (
109
+ <Table.Row key={user.id}>
110
+ <Table.Cell
111
+ marginX={{ xs: "sm" }}
112
+ numberSpacing="tabular"
113
+ >
114
+ {user.id}
115
+ </Table.Cell>
116
+ <Table.Cell marginX={{ xs: "sm" }}>{user.name}</Table.Cell>
117
+ <Table.Cell marginX={{ xs: "sm" }}>{user.title}</Table.Cell>
118
+ <Table.Cell marginX={{ xs: "sm" }}>{user.department}</Table.Cell>
119
+ <Table.Cell marginX={{ xs: "sm" }}>{user.branch}</Table.Cell>
120
+ <Table.Cell marginX={{ xs: "sm" }}>
121
+ <DateKit
122
+ alignment="right"
123
+ showCurrentYear
124
+ value={user.startDate}
125
+ />
126
+ </Table.Cell>
127
+ </Table.Row>
128
+ ))}
129
+ </Table.Body>
130
+ </Table>
131
+ )
132
+ }
133
+
134
+ export default TableWithFilterVariant
@@ -0,0 +1,34 @@
1
+ Set the `variant` prop to `withFilter` to render a Table with a filter. The variant automatically handles:
2
+
3
+ - Card wrapper with standard responsive margins
4
+ - Optional `title` prop to render title above the card
5
+ - Filter component rendering with Design defaults
6
+ - SectionSeparator between filter and table
7
+ - Flex layout for proper alignment
8
+
9
+ #### Required Props
10
+
11
+ - `variant="withFilter"`: Enables the filter variant
12
+ - `filterContent`: A function that receives `{ closePopover }` and returns the filter's body content (inputs, buttons, etc.). Use this to pass in all input kits, etc needed inside the Filter itself.
13
+ - `filterProps`: An object containing Filter-specific props like `results`, `sortOptions`, `sortValue`, etc.
14
+
15
+ #### Optional Props
16
+
17
+ - `title`: Displays a title above the card
18
+ - All standard Table props (`size`, `collapse`, etc.) can be used, but defaults are already set to match Design guidelines
19
+ - All standard Filter props can be used, but defaults are already set to match Design guidelines.
20
+
21
+ #### Default Filter Props
22
+
23
+ The Table kit automatically sets these Filter defaults (which you can override via `filterProps`):
24
+
25
+ - `background={false}`
26
+ - `maxHeight="50vh"`
27
+ - `minWidth="xs"`
28
+ - `popoverProps={{ width: "350px" }}`
29
+
30
+
31
+ **IMPORTANT NOTE**:
32
+ The purpose of this variant is to provide an easy way to set up a Table with a Filter with Design standards applied by default.
33
+
34
+ If you are looking for more customization than this embedded variant provides, you may be better served by using the individual kits as demonstrated in our Table Filter Card Building Block [here](https://playbook.powerapp.cloud/building_blocks/table_filter_card/react).