playbook_ui 13.16.0.pre.alpha.play1141iconkitusinglibrary2107 → 13.16.0.pre.alpha.powercentrainplaybookpt22125

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.jsx +52 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.md +1 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +7 -2
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx +59 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.md +18 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.jsx +60 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +3 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx +1 -6
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md +5 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx +63 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +3 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.jsx +57 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +3 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.jsx +61 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +3 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +55 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.md +1 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +10 -4
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +7 -0
  23. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/_loading.scss +4 -3
  24. data/app/pb_kits/playbook/pb_button/_button.scss +3 -3
  25. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +3 -2
  26. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -1
  27. data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +1 -1
  28. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -1
  29. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -1
  30. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +1 -1
  31. data/app/pb_kits/playbook/pb_icon/_icon.tsx +16 -29
  32. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +11 -5
  33. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +18 -44
  34. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +8 -4
  35. data/app/pb_kits/playbook/pb_icon/icon.html.erb +4 -6
  36. data/app/pb_kits/playbook/pb_icon/icon.rb +10 -24
  37. data/app/pb_kits/playbook/tokens/_typography.scss +10 -10
  38. data/dist/playbook-rails.js +2 -2
  39. data/dist/reset.css +1 -1
  40. data/lib/playbook/version.rb +1 -1
  41. metadata +17 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ab92a6e7833bb13346faa8d4613262a0a17553b543ef16c5a3e478eafa5a379
4
- data.tar.gz: 2b640baba6c150cd666c6806ac34afe831db87237bc4f0d8a667b61dc4ee7d2f
3
+ metadata.gz: 23d0612e30988562c51f3645ab1b8e17457040f5429fd42349efdac4ba34721d
4
+ data.tar.gz: a8b761742544cf542cf3982ed1ddd78df0121f2e9a630fcf3b0c1993b9b088c7
5
5
  SHA512:
6
- metadata.gz: 383e926ed412e91ae0491352e9d139f34a21fb0e5a7c500a1f0317dfe8d4356da15948dd23bc9831abea457721513950e38c34c41bdf3ac12d9d15e816091d70
7
- data.tar.gz: bbb281680a024010df4456aa017485497603402c58cf4f31fb90f970eb6a0554e65cd8abd320e1fb3ef37a043e2a95af6dbc7aa5cf35792e764be19779889337
6
+ metadata.gz: 6f91ed683d6637134e8b5738aada3c9a6d75a2642155d94ea0d3c3e1df3046b2a450f5550aea700e5eeb8b3397f623b083d9d190391d34e6ea34a23ed915e563
7
+ data.tar.gz: fccc217fe8e00235f3dc800d02b0b605b7d1c80896cc7cfde49a52a24b33a636bba300f921122e347fad0f24b1a5ba31e05ac2e203c60eff27b06da3be0aaac1
@@ -72,7 +72,6 @@ const cellId = `${loading ?
72
72
  <Flex
73
73
  alignItems="center"
74
74
  justify={header.index === 0 && enableSorting ? "between" : header.index === 0 && !enableSorting ? "start" : "end"}
75
- paddingLeft={loading ? "sm" : "none"}
76
75
  >
77
76
  {header.index === 0 &&
78
77
  !loading &&
@@ -114,7 +113,7 @@ const cellId = `${loading ?
114
113
  header.column.getCanSort() &&
115
114
  enableSorting &&
116
115
  (loading ? (
117
- <div className="loading-toggle-icon header-sort-icon" />
116
+ <div className="loading-toggle-icon" />
118
117
  ) : (
119
118
  <SortIconButton header={header}
120
119
  sortIcon={sortIcon}
@@ -162,6 +162,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
162
162
  getExpandedRowModel: getExpandedRowModel(),
163
163
  getSortedRowModel: getSortedRowModel(),
164
164
  enableSortingRemoval: false,
165
+ sortDescFirst: true,
165
166
  ...expandAndSortState(),
166
167
  ...tableOptions,
167
168
  });
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+ import { AdvancedTable } from "../../";
3
+ import { MOCK_DATA } from "./_mock_data";
4
+
5
+ const AdvancedTableCollapsibleTrail = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ];
37
+
38
+ return (
39
+ <div>
40
+ <AdvancedTable
41
+ columnDefinitions={columnDefinitions}
42
+ tableData={MOCK_DATA}
43
+ {...props}
44
+ >
45
+ <AdvancedTable.Header />
46
+ <AdvancedTable.Body collapsibleTrail={false} />
47
+ </AdvancedTable>
48
+ </div>
49
+ );
50
+ };
51
+
52
+ export default AdvancedTableCollapsibleTrail;
@@ -0,0 +1 @@
1
+ `collapsibleTrail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of rows when subRows are toggled open.
@@ -1,7 +1,12 @@
1
- The AdvancedTable kit takes the table data and automatically renders expandable subrows for nested items to any depth needed. In it's simplest form, the kit has two required props:
1
+ The AdvancedTable kit accepts tree data and automatically renders expansion controls for nested subrows, to any depth, based on the data it is given. In it's simplest form, __the kit has two required props__:
2
2
 
3
- `tableData` is the data that the kit needs to consume to render the table. This data will take the structure of an array of objects where each object will be rendered as a row with the key/value pairs being the column values. If an object within that data has children, the kit will automatically create subRows with icon buttons on the parent rows to toggle the subRows open or closed. The toggleExpansionAll button in the first column header can also be used to toggle expansion for the top level parent rows. For a visual of the data structure needed for `tableData`, see [here](https://github.com/powerhome/playbook/blob/PBNTR-177-New-Advanced-Table-Kit/playbook/app/pb_kits/playbook/pb_advanced_table/README.md).
3
+ ### tableData
4
4
 
5
+ `tableData` accepts an array of objects as the table data. Each object is a table row, and each key:value pair within an object is a column value within that row. Nested children within a data object are automatically rendered as subrows under their parent row. Each parent row is prepended with expansion controls for toggling its nested child rows. The `toggleExpansionAll` button in the first column header can also be used to toggle expansion of all parent rows within the table.
6
+
7
+ For a visual of the data structure needed for `tableData`, see [here](https://github.com/powerhome/playbook/tree/master/playbook/app/pb_kits/playbook/pb_advanced_table#readme).
8
+
9
+ ### columnDefinitions
5
10
 
6
11
  `columnDefinitions` maps to the columns prop on the Tanstack table. Column definitions are the single most important part of building a table as they are responsible for building the underlying data model that is used for all sorting, expansion, etc. `ColumnDefinitions` in the AdvancedTable kit is a array of objects as seen in the code snippet below. Each object within the array has two REQUIRED items:
7
12
 
@@ -0,0 +1,59 @@
1
+ import React, { useState } from "react";
2
+ import { AdvancedTable } from "../../";
3
+ import { MOCK_DATA } from "./_mock_data";
4
+
5
+ const AdvancedTableExpandedControl = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ];
37
+
38
+ //State for manually effecting what is expanded
39
+ const [expanded, setExpanded] = useState({'0': true, '0.0': true, '0.0.1': true})
40
+
41
+ //Passing expanded state to AdvancedTable as prop
42
+ const expandedControl = {
43
+ value: expanded,
44
+ onChange: setExpanded,
45
+ }
46
+
47
+ return (
48
+ <div>
49
+ <AdvancedTable
50
+ columnDefinitions={columnDefinitions}
51
+ expandedControl={expandedControl}
52
+ tableData={MOCK_DATA}
53
+ {...props}
54
+ />
55
+ </div>
56
+ );
57
+ };
58
+
59
+ export default AdvancedTableExpandedControl;
@@ -0,0 +1,18 @@
1
+ `expandedControl` is an optional prop that can be used to gain greater control over the expansion state of the Advanced Table. Tanstack handles expansion itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the expansion state so it persists on page reload, set an initial expansion state, etc.
2
+
3
+ In this example we are showing that if initial expansion state is set, it will render the table expanded according to that state.
4
+
5
+ The expanded state must be an object with key/value pairs where the key is the row id and the value is a boolean, true or false. Tanstack by default assigns row ids based on index and depth of the row as can be seen in this example. For more information on row ids, see [here](https://tanstack.com/table/v8/docs/api/core/row#id).
6
+
7
+ ### Single Row Expansion
8
+
9
+ By default, the click event on the row level toggleExpansion icon simply toggles the immediate sub rows open or closed. If you want to attach further logic to that button, the optional `onRowToggleClick` prop can be used. This click event provides one argument that can be hooked into: the current `row` object. Any additional functionality provided through this onClick will be applied in addition to the default.
10
+
11
+ ### Multi-Row Expansion
12
+
13
+ Similar to the row level click event, the default of the click event on the toggleExpansion buttons that render in the first column header (and the subRow Header rows if prop enabled) toggles all top level rows open and closed. If you want to attach further logic to that button, the optional `onToggleExpansionClick` prop can be used. This click event provides one argument that can be hooked into: the current `row` object. Any additional functionality provided through this onClick will be applied in addition to the default.
14
+
15
+ ### ToggleExpansionIcon
16
+
17
+ `ToggleExpansionIcon` is another optional prop that can be used to customize the icon for the toggleExpansion button. This prop takes a string value with the default set to `arrows-from-line`. All strings must be valid FA icons.
18
+
@@ -0,0 +1,60 @@
1
+ import React, { useState } from "react";
2
+ import { AdvancedTable } from "../../";
3
+ import { Button } from "../../"
4
+ import { MOCK_DATA } from "./_mock_data";
5
+
6
+ const AdvancedTableLoading = (props) => {
7
+
8
+ const [isloading, setIsLoading] = useState(true)
9
+
10
+ const columnDefinitions = [
11
+ {
12
+ accessor: "year",
13
+ label: "Year",
14
+ cellAccessors: ["quarter", "month", "day"],
15
+ },
16
+ {
17
+ accessor: "newEnrollments",
18
+ label: "New Enrollments",
19
+ },
20
+ {
21
+ accessor: "scheduledMeetings",
22
+ label: "Scheduled Meetings",
23
+ },
24
+ {
25
+ accessor: "attendanceRate",
26
+ label: "Attendance Rate",
27
+ },
28
+ {
29
+ accessor: "completedClasses",
30
+ label: "Completed Classes",
31
+ },
32
+ {
33
+ accessor: "classCompletionRate",
34
+ label: "Class Completion Rate",
35
+ },
36
+ {
37
+ accessor: "graduatedStudents",
38
+ label: "Graduated Students",
39
+ },
40
+ ];
41
+
42
+ return (
43
+ <div>
44
+ <Button marginBottom="md"
45
+ onClick={()=> setIsLoading(!isloading)}
46
+ text="Toggle Loading State"
47
+ variant="secondary"
48
+ {...props}
49
+ />
50
+ <AdvancedTable
51
+ columnDefinitions={columnDefinitions}
52
+ loading={isloading}
53
+ tableData={MOCK_DATA}
54
+ {...props}
55
+ />
56
+ </div>
57
+ );
58
+ };
59
+
60
+ export default AdvancedTableLoading;
@@ -0,0 +1,3 @@
1
+ the optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
2
+
3
+ By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
@@ -35,20 +35,15 @@ const AdvancedTableSort = (props) => {
35
35
  },
36
36
  ];
37
37
 
38
- //Render the subRow header rows
39
- const subRowHeaders = ["Quarter", "Month", "Day"]
40
-
41
-
42
38
  return (
43
39
  <div>
44
40
  <AdvancedTable
45
41
  columnDefinitions={columnDefinitions}
46
- enableToggleExpansion="all"
47
42
  tableData={MOCK_DATA}
48
43
  {...props}
49
44
  >
50
45
  <AdvancedTable.Header enableSorting />
51
- <AdvancedTable.Body subRowHeaders={subRowHeaders} />
46
+ <AdvancedTable.Body />
52
47
  </AdvancedTable>
53
48
  </div>
54
49
  );
@@ -0,0 +1,5 @@
1
+ the `enableSorting` prop is a boolean prop set to false by default. If true, the table will add sort logic linked to the sort button in the header. Clicking the sort button will toggle sort between ascending and descending. Currently this sort functionality is only available on the first column.
2
+
3
+ ### sortIcon
4
+
5
+ An optional prop, `sortIcon` allows you to customize your icon sets by passing it an array of any comma-separated pair of icon values. The first icon value will replace the kit's default icon when sort direction is desc, and the second value will replace the default icon when sort direction is asc. `sortIcon` also allows you to pass it a single icon as a string, in which case the icon will not toggle with the sort state. Default for this prop is `["arrow-up-short-wide", "arrow-down-short-wide"]`. All strings must be valid FA icons.
@@ -0,0 +1,63 @@
1
+ import React, { useState } from "react";
2
+ import { AdvancedTable } from "../..";
3
+ import { MOCK_DATA } from "./_mock_data";
4
+
5
+ const AdvancedTableSortControl = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ];
37
+
38
+ //State for sort direction
39
+ const [isSortDesc, setIsSortDesc] = useState({desc: false})
40
+
41
+ // //Passing sort state to AdvancedTable as prop
42
+ const sortControl = {
43
+ value: isSortDesc,
44
+ onChange: setIsSortDesc,
45
+ }
46
+
47
+
48
+ return (
49
+ <div>
50
+ <AdvancedTable
51
+ columnDefinitions={columnDefinitions}
52
+ sortControl={sortControl}
53
+ tableData={MOCK_DATA}
54
+ {...props}
55
+ >
56
+ <AdvancedTable.Header enableSorting />
57
+ <AdvancedTable.Body />
58
+ </AdvancedTable>
59
+ </div>
60
+ );
61
+ };
62
+
63
+ export default AdvancedTableSortControl;
@@ -0,0 +1,3 @@
1
+ `sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
2
+
3
+ The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort directino is `desc: true`.
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import { AdvancedTable } from "../..";
3
+ import { MOCK_DATA } from "./_mock_data";
4
+
5
+ const AdvancedTableSubrowHeaders = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ];
37
+
38
+ //Render the subRow header rows
39
+ const subRowHeaders = ["Quarter", "Month", "Day"]
40
+
41
+
42
+ return (
43
+ <div>
44
+ <AdvancedTable
45
+ columnDefinitions={columnDefinitions}
46
+ enableToggleExpansion="all"
47
+ tableData={MOCK_DATA}
48
+ {...props}
49
+ >
50
+ <AdvancedTable.Header />
51
+ <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
52
+ </AdvancedTable>
53
+ </div>
54
+ );
55
+ };
56
+
57
+ export default AdvancedTableSubrowHeaders;
@@ -0,0 +1,3 @@
1
+ `subRowHeaders` is an optional prop that if present will add header rows at each level of the nested data. The prop takes an array of strings, each string being the text for each header row. The array of strings must be in the order in which they need to be rendered in the UI according to depth.
2
+
3
+ `enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be 'all' or 'header". If set to 'all', the toggle exapansion button will appear in the table header as well as in the subRow headers. If set to 'header' button will only appear in header and NOT in subRow headers. This is set to 'headeer' by default.
@@ -0,0 +1,61 @@
1
+ import React from "react";
2
+ import { AdvancedTable } from "../../";
3
+ import { MOCK_DATA } from "./_mock_data";
4
+
5
+ const AdvancedTableTableOptions = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ];
37
+
38
+ const tableOptions = {
39
+ initialState: {
40
+ sorting: [
41
+ {
42
+ id: "year",
43
+ desc: true,
44
+ },
45
+ ],
46
+ },
47
+ }
48
+
49
+ return (
50
+ <div>
51
+ <AdvancedTable
52
+ columnDefinitions={columnDefinitions}
53
+ tableData={MOCK_DATA}
54
+ tableOptions={tableOptions}
55
+ {...props}
56
+ />
57
+ </div>
58
+ );
59
+ };
60
+
61
+ export default AdvancedTableTableOptions;
@@ -0,0 +1,3 @@
1
+ The Tanstack table consumes the useReactTable hook to create the table. This hook takes an object that can contain any of the functions that the Tanstack table provides. The advancedTable's optional `tableOptions` can be used to pass tanstack options to the kit.
2
+
3
+ In the above example, we are using the initialState option provided by tanstack that takes sort as one of it's values. Setting it to true for the first column is reversing the sort order on first render of the table. For a complete list of possible options and hoe to use them, see [here](https://tanstack.com/table/v8/docs/api/core/table#usereacttable--createsolidtable--usevuetable--createsveltetable)
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import { AdvancedTable } from "../../";
3
+ import { MOCK_DATA } from "./_mock_data";
4
+
5
+ const AdvancedTableTableProps = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ];
37
+
38
+ const tableProps = {
39
+ container: false,
40
+ sticky: true
41
+ }
42
+
43
+ return (
44
+ <div>
45
+ <AdvancedTable
46
+ columnDefinitions={columnDefinitions}
47
+ tableData={MOCK_DATA}
48
+ tableProps={tableProps}
49
+ {...props}
50
+ />
51
+ </div>
52
+ );
53
+ };
54
+
55
+ export default AdvancedTableTableProps;
@@ -0,0 +1 @@
1
+ This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `tableProps` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table/react).
@@ -1,6 +1,12 @@
1
1
  examples:
2
2
  react:
3
- - advanced_table_default: Default
4
- # - advanced_table_sort: enableSorting
5
-
6
-
3
+ - advanced_table_default: Default (Required Props)
4
+ - advanced_table_loading: Loading State
5
+ - advanced_table_sort: enable Sorting
6
+ - advanced_table_sort_control: Sort Control
7
+ - advanced_table_expanded_control: Expanded Control
8
+ - advanced_table_subrow_headers: SubRow Headers
9
+ - advanced_table_collapsible_trail: Collapsible Trail
10
+ - advanced_table_table_options: Table Options
11
+ - advanced_table_table_props: Table Props
12
+
@@ -1,2 +1,9 @@
1
1
  export { default as AdvancedTableDefault } from './_advanced_table_default.jsx'
2
2
  export { default as AdvancedTableSort } from './_advanced_table_sort.jsx'
3
+ export { default as AdvancedTableSortControl } from './_advanced_table_sort_control.jsx'
4
+ export { default as AdvancedTableLoading } from './_advanced_table_loading.jsx'
5
+ export { default as AdvancedTableExpandedControl } from './_advanced_table_expanded_control.jsx'
6
+ export { default as AdvancedTableSubrowHeaders } from './_advanced_table_subrow_headers.jsx'
7
+ export { default as AdvancedTableCollapsibleTrail } from './_advanced_table_collapsible_trail.jsx'
8
+ export { default as AdvancedTableTableOptions } from './_advanced_table_table_options.jsx'
9
+ export { default as AdvancedTableTableProps } from './_advanced_table_table_props.jsx'
@@ -55,11 +55,12 @@
55
55
  }
56
56
 
57
57
  .loading-toggle-icon {
58
- width: $space_sm - 1;
59
- height: $space_sm - 1;
58
+ width: $space_sm - 3;
59
+ height: $space_sm - 4;
60
+ margin-right: $space_xxs;
60
61
  margin-bottom: $space_xxs + 2;
61
62
  &::after {
62
- height: $space_sm - 1;
63
+ height: $space_sm - 4;
63
64
  border-radius: $border_radius_rounded;
64
65
  }
65
66
  }
@@ -6,9 +6,9 @@
6
6
  @import "../tokens/typography";
7
7
 
8
8
  $pb_button_sizes: (
9
- "sm": 0.75rem,
10
- "md": 0.875rem,
11
- "lg": 1.125rem,
9
+ "sm": $font_smaller,
10
+ "md": $font_small,
11
+ "lg": ($font_large - 2px),
12
12
  );
13
13
 
14
14
  [class*=pb_button_kit]{
@@ -9,7 +9,7 @@
9
9
 
10
10
  $pb_button_size: 40px;
11
11
  $pb_button_v_padding: 7px;
12
- $pb_button_h_padding: 34px;
12
+ $pb_button_h_padding: 28px;
13
13
  $pb_button_hover_darken: 4%;
14
14
  $pb_button_border_width: 0px;
15
15
 
@@ -27,12 +27,13 @@ $pb_button_border_width: 0px;
27
27
  text-rendering: optimizeLegibility;
28
28
  font-size: $font_small;
29
29
  font-weight: $bold;
30
+ letter-spacing: $lspace_loose;
30
31
  text-align: center;
31
32
  vertical-align: middle;
32
33
  text-transform: none;
33
34
  border-width: $pb_button_border_width;
34
35
  border-style: solid;
35
- border-radius: $border_rad_light;
36
+ border-radius: $border_rad_heavy;
36
37
  min-height: $pb_button_size;
37
38
  line-height: 1.5;
38
39
  padding: $pb_button_v_padding $pb_button_h_padding;
@@ -24,7 +24,7 @@ $pb_dark_caption_colors: (
24
24
  color: $text_lt_light;
25
25
  text-transform: uppercase;
26
26
  font-size: $font_size;
27
- letter-spacing: $lspace_looser;
27
+ letter-spacing: $lspace_loosest;
28
28
  }
29
29
 
30
30
  @mixin caption_color($color: $text_lt_light) {
@@ -53,7 +53,7 @@ const adjustAxisStyle = (axis) => {
53
53
  /* Change axis label styles */
54
54
  axis.labels.style.fontFamily = typography.font_family_base
55
55
  axis.labels.style.color = colors.charcoal
56
- axis.labels.style.fontWeight = typography.light
56
+ axis.labels.style.fontWeight = typography.regular
57
57
  axis.labels.style.fontSize = typography.font_small
58
58
  }
59
59
 
@@ -27,7 +27,7 @@ const highchartsDarkTheme: ThemeProps = {
27
27
  style: {
28
28
  color: colors.text_dk_default,
29
29
  fontFamily: typography.font_family_base,
30
- fontWeight: typography.regular,
30
+ fontWeight: typography.bold,
31
31
  fontSize: typography.heading_3,
32
32
  },
33
33
  },