orcs-design-system 3.2.4 → 3.2.6

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 (96) hide show
  1. package/es/GlobalStyles.js +1 -31
  2. package/es/SystemThemeProvider.js +11 -5
  3. package/es/assets/Colour/Colour.stories.js +211 -0
  4. package/es/assets/Colour/index.js +3 -3
  5. package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
  6. package/es/components/ActionsMenu/index.js +144 -229
  7. package/es/components/Avatar/Avatar.stories.js +212 -196
  8. package/es/components/Avatar/index.js +280 -307
  9. package/es/components/Badge/Badge.stories.js +71 -46
  10. package/es/components/Badge/index.js +71 -74
  11. package/es/components/Box/Box.stories.js +51 -35
  12. package/es/components/Box/index.js +33 -34
  13. package/es/components/Button/Button.stories.js +161 -145
  14. package/es/components/Button/ButtonLink.stories.js +152 -139
  15. package/es/components/Button/index.js +79 -99
  16. package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
  17. package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
  18. package/es/components/ButtonGroup/index.js +103 -99
  19. package/es/components/Card/Card.stories.js +94 -62
  20. package/es/components/Card/index.js +50 -71
  21. package/es/components/Checkbox/Checkbox.stories.js +37 -43
  22. package/es/components/Checkbox/index.js +61 -76
  23. package/es/components/DatePicker/DatePicker.stories.js +86 -118
  24. package/es/components/DatePicker/index.js +71 -187
  25. package/es/components/Divider/Divider.stories.js +39 -42
  26. package/es/components/Divider/index.js +21 -27
  27. package/es/components/Expandable/Expandable.stories.js +46 -36
  28. package/es/components/Expandable/index.js +55 -82
  29. package/es/components/Flex/Flex.stories.js +19 -5
  30. package/es/components/Flex/FlexItem.stories.js +10 -9
  31. package/es/components/Flex/index.js +34 -27
  32. package/es/components/Grid/Grid.stories.js +129 -55
  33. package/es/components/Grid/index.js +25 -24
  34. package/es/components/Header/Header.stories.js +101 -92
  35. package/es/components/Header/index.js +433 -436
  36. package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
  37. package/es/components/HeaderSimple/index.js +73 -68
  38. package/es/components/Icon/Icon.stories.js +58 -57
  39. package/es/components/Icon/index.js +48 -46
  40. package/es/components/Loading/Loading.stories.js +32 -39
  41. package/es/components/Loading/index.js +44 -51
  42. package/es/components/Modal/Modal.stories.js +172 -153
  43. package/es/components/Modal/index.js +126 -134
  44. package/es/components/Notification/Notification.stories.js +59 -58
  45. package/es/components/Notification/index.js +123 -133
  46. package/es/components/Popover/Popover.stories.js +134 -102
  47. package/es/components/Popover/index.js +65 -111
  48. package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
  49. package/es/components/ProgressBar/index.js +29 -34
  50. package/es/components/RadioButton/RadioButton.stories.js +32 -37
  51. package/es/components/RadioButton/index.js +170 -184
  52. package/es/components/Range/Range.stories.js +19 -19
  53. package/es/components/Range/index.js +35 -45
  54. package/es/components/Select/Select.stories.js +107 -128
  55. package/es/components/Select/index.js +324 -336
  56. package/es/components/SideNav/NavItem.js +112 -122
  57. package/es/components/SideNav/SideNav.stories.js +84 -57
  58. package/es/components/SideNav/index.js +161 -185
  59. package/es/components/Sidebar/Sidebar.stories.js +50 -33
  60. package/es/components/Sidebar/index.js +152 -155
  61. package/es/components/Spacer/Spacer.stories.js +35 -32
  62. package/es/components/Spacer/index.js +20 -20
  63. package/es/components/StatusDot/StatusDot.stories.js +103 -90
  64. package/es/components/StatusDot/index.js +36 -38
  65. package/es/components/StyledLink/StyledLink.stories.js +68 -69
  66. package/es/components/StyledLink/index.js +47 -48
  67. package/es/components/Table/Table.stories.js +118 -112
  68. package/es/components/Table/getExpandColumnConfig.js +67 -62
  69. package/es/components/Table/index.js +24 -27
  70. package/es/components/Table/muiStyleOverrides.js +10 -8
  71. package/es/components/Tabs/Tab.stories.js +55 -38
  72. package/es/components/Tabs/TabsContainer.stories.js +30 -22
  73. package/es/components/Tabs/index.js +95 -92
  74. package/es/components/Tag/Tag.stories.js +250 -220
  75. package/es/components/Tag/index.js +118 -190
  76. package/es/components/TextArea/TextArea.stories.js +76 -89
  77. package/es/components/TextArea/index.js +117 -115
  78. package/es/components/TextInput/TextInput.stories.js +41 -61
  79. package/es/components/TextInput/index.js +127 -171
  80. package/es/components/Toggle/Toggle.stories.js +63 -62
  81. package/es/components/Toggle/index.js +43 -77
  82. package/es/components/TreeNav/TreeNav.stories.js +7 -8
  83. package/es/components/TreeNav/index.js +72 -69
  84. package/es/components/Typography/Typography.stories.js +174 -0
  85. package/es/components/Typography/index.js +252 -308
  86. package/es/components.test.js +1 -1
  87. package/es/hooks/isVisible.js +6 -10
  88. package/es/hooks/keepInView.js +27 -32
  89. package/es/hooks/keypress.js +14 -14
  90. package/es/hooks/useInputFocus.js +5 -5
  91. package/es/hooks/usePrevious.js +3 -3
  92. package/es/systemThemeCollapsed.js +53 -53
  93. package/es/systemtheme.js +53 -53
  94. package/es/utils/selectUtil.js +1 -1
  95. package/es/utils/selectUtil.test.js +6 -6
  96. package/package.json +29 -38
@@ -3,44 +3,47 @@ import Table from ".";
3
3
  import Card from "../Card/index";
4
4
  import Box from "../Box";
5
5
  import Badge from "../Badge";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
6
7
  export default {
7
8
  title: "Components/Table",
8
9
  component: Table
9
10
  };
10
- export var Default = function Default() {
11
- var columns = useMemo(function () {
12
- return [{
13
- accessorKey: "name",
14
- header: "Name",
15
- enableHiding: false
16
- }, {
17
- accessorFn: function accessorFn(originalRow) {
18
- return parseInt(originalRow.age);
19
- },
20
- id: "age",
21
- header: "Age",
22
- Header: /*#__PURE__*/React.createElement("i", null, "Age"),
23
- Cell: function Cell(_ref) {
24
- var cell = _ref.cell;
25
- return /*#__PURE__*/React.createElement("i", null, cell.getValue().toLocaleString());
26
- }
27
- }];
28
- }, []);
29
- var data = useMemo(function () {
30
- return [{
31
- name: "John",
32
- age: 30
33
- }, {
34
- name: "Sara",
35
- age: 25
36
- }];
37
- }, []);
38
- return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Table, {
39
- columns: columns,
40
- data: data
41
- }));
11
+ export const Default = () => {
12
+ const columns = useMemo(() => [{
13
+ accessorKey: "name",
14
+ header: "Name",
15
+ enableHiding: false
16
+ }, {
17
+ accessorFn: originalRow => parseInt(originalRow.age),
18
+ id: "age",
19
+ header: "Age",
20
+ Header: /*#__PURE__*/_jsx("i", {
21
+ children: "Age"
22
+ }),
23
+ Cell: _ref => {
24
+ let {
25
+ cell
26
+ } = _ref;
27
+ return /*#__PURE__*/_jsx("i", {
28
+ children: cell.getValue().toLocaleString()
29
+ });
30
+ }
31
+ }], []);
32
+ const data = useMemo(() => [{
33
+ name: "John",
34
+ age: 30
35
+ }, {
36
+ name: "Sara",
37
+ age: 25
38
+ }], []);
39
+ return /*#__PURE__*/_jsx(Card, {
40
+ children: /*#__PURE__*/_jsx(Table, {
41
+ columns: columns,
42
+ data: data
43
+ })
44
+ });
42
45
  };
43
- var types = {
46
+ const types = {
44
47
  strat_outcome: {
45
48
  variant: "primaryDark",
46
49
  label: "Strategic Outcome"
@@ -58,95 +61,98 @@ var types = {
58
61
  label: "Work Item"
59
62
  }
60
63
  };
61
- export var NestedTreeStructure = function NestedTreeStructure() {
62
- var columns = useMemo(function () {
63
- return [{
64
- accessorKey: "name",
65
- id: "name",
66
- header: "Strategy"
67
- }, {
68
- accessorKey: "workForce",
69
- id: "workForce",
70
- header: "Work force"
71
- }, {
72
- accessorKey: "type",
73
- id: "type",
74
- header: "Type",
75
- Cell: function Cell(_ref2) {
76
- var cell = _ref2.cell;
77
- var type = types[cell.getValue()];
78
- return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Badge, {
79
- variant: type === null || type === void 0 ? void 0 : type.variant
80
- }, type === null || type === void 0 ? void 0 : type.label));
81
- }
82
- }];
83
- }, []);
84
- var data = useMemo(function () {
85
- return [{
86
- name: "Never gonna give you up",
87
- workForce: 391,
88
- type: "strat_outcome",
64
+ export const NestedTreeStructure = () => {
65
+ const columns = useMemo(() => [{
66
+ accessorKey: "name",
67
+ id: "name",
68
+ header: "Strategy"
69
+ }, {
70
+ accessorKey: "workForce",
71
+ id: "workForce",
72
+ header: "Work force"
73
+ }, {
74
+ accessorKey: "type",
75
+ id: "type",
76
+ header: "Type",
77
+ Cell: _ref2 => {
78
+ let {
79
+ cell
80
+ } = _ref2;
81
+ const type = types[cell.getValue()];
82
+ return /*#__PURE__*/_jsx(Box, {
83
+ children: /*#__PURE__*/_jsx(Badge, {
84
+ variant: type === null || type === void 0 ? void 0 : type.variant,
85
+ children: type === null || type === void 0 ? void 0 : type.label
86
+ })
87
+ });
88
+ }
89
+ }], []);
90
+ const data = useMemo(() => [{
91
+ name: "Never gonna give you up",
92
+ workForce: 391,
93
+ type: "strat_outcome",
94
+ children: [{
95
+ name: "Never gonna let you down",
96
+ workForce: 25,
97
+ type: "okr",
89
98
  children: [{
90
- name: "Never gonna let you down",
91
- workForce: 25,
92
- type: "okr",
99
+ name: "TPP-441 Never gonna run around and desert you",
100
+ workForce: 30,
101
+ type: "epic",
93
102
  children: [{
94
- name: "TPP-441 Never gonna run around and desert you",
95
- workForce: 30,
96
- type: "epic",
97
- children: [{
98
- name: "TPP-684 Never gonna make you cry",
99
- workForce: 25,
100
- type: "work_item"
101
- }, {
102
- name: "TPP-685 Never gonna say goodbye",
103
- workForce: 25,
104
- type: "work_item"
105
- }, {
106
- name: "TPP-685 Never gonna tell a lie and hurt you",
107
- workForce: 25,
108
- type: "work_item"
109
- }]
103
+ name: "TPP-684 Never gonna make you cry",
104
+ workForce: 25,
105
+ type: "work_item"
106
+ }, {
107
+ name: "TPP-685 Never gonna say goodbye",
108
+ workForce: 25,
109
+ type: "work_item"
110
+ }, {
111
+ name: "TPP-685 Never gonna tell a lie and hurt you",
112
+ workForce: 25,
113
+ type: "work_item"
110
114
  }]
111
115
  }]
112
- }, {
113
- name: "Grow customer base by 5 mill",
114
- workForce: 391,
115
- type: "strat_outcome",
116
+ }]
117
+ }, {
118
+ name: "Grow customer base by 5 mill",
119
+ workForce: 391,
120
+ type: "strat_outcome",
121
+ children: [{
122
+ name: "Launch our revolutionary HPLSF module",
123
+ workForce: 25,
124
+ type: "okr",
116
125
  children: [{
117
- name: "Launch our revolutionary HPLSF module",
118
- workForce: 25,
119
- type: "okr",
126
+ name: "TPP-441 New space flight model test",
127
+ workForce: 30,
128
+ type: "epic",
120
129
  children: [{
121
- name: "TPP-441 New space flight model test",
122
- workForce: 30,
123
- type: "epic",
124
- children: [{
125
- name: "TPP-684 Infra benchmarking",
126
- workForce: 25,
127
- type: "work_item"
128
- }]
130
+ name: "TPP-684 Infra benchmarking",
131
+ workForce: 25,
132
+ type: "work_item"
129
133
  }]
130
134
  }]
131
- }];
132
- }, []);
133
- return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Table, {
134
- columns: columns,
135
- data: data,
136
- enableExpanding: true,
137
- enableExpandAll: true,
138
- muiTableBodyCellProps: function muiTableBodyCellProps(_ref3) {
139
- var row = _ref3.row;
140
- return {
141
- sx: function sx() {
142
- return {
135
+ }]
136
+ }], []);
137
+ return /*#__PURE__*/_jsx(Card, {
138
+ children: /*#__PURE__*/_jsx(Table, {
139
+ columns: columns,
140
+ data: data,
141
+ enableExpanding: true,
142
+ enableExpandAll: true,
143
+ muiTableBodyCellProps: _ref3 => {
144
+ let {
145
+ row
146
+ } = _ref3;
147
+ return {
148
+ sx: () => ({
143
149
  color: row.original.type === "work_item" ? "grey" : "",
144
150
  fontWeight: row.depth === 0 ? 600 : row.depth === 1 ? 500 : undefined
145
- };
146
- }
147
- };
148
- }
149
- }));
151
+ })
152
+ };
153
+ }
154
+ })
155
+ });
150
156
  };
151
157
  Default.__docgenInfo = {
152
158
  "description": "",
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import { Stack } from "@mui/material";
3
2
  import { MRT_ExpandAllButton } from "material-react-table";
4
3
  import React from "react";
@@ -6,84 +5,90 @@ import Box from "../Box";
6
5
  import { get } from "lodash";
7
6
  import styled from "styled-components";
8
7
  import { PropTypes } from "prop-types";
9
- var StyledHighlight = styled.span.withConfig({
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ const StyledHighlight = styled.span.withConfig({
10
10
  displayName: "getExpandColumnConfig__StyledHighlight",
11
11
  componentId: "sc-kekww4-0"
12
- })(["background-color:", ";border-radius:2px;padding:2px 1px;"], function (props) {
13
- return props.matchHighlightColor;
14
- });
15
- var getHiglightedSearchTerm = function getHiglightedSearchTerm(_ref) {
16
- var value = _ref.value,
17
- searchTerm = _ref.searchTerm,
18
- matchHighlightColor = _ref.matchHighlightColor;
19
- var regex = new RegExp("(".concat(searchTerm, ")"), "i");
20
- return value.split(regex).map(function (part, i) {
21
- return part.match(regex) ? /*#__PURE__*/React.createElement(StyledHighlight, {
22
- key: part + i,
23
- matchHighlightColor: matchHighlightColor
24
- }, part) : part;
25
- });
12
+ })(["background-color:", ";border-radius:2px;padding:2px 1px;"], props => props.matchHighlightColor);
13
+ const getHiglightedSearchTerm = _ref => {
14
+ let {
15
+ value,
16
+ searchTerm,
17
+ matchHighlightColor
18
+ } = _ref;
19
+ const regex = new RegExp("(".concat(searchTerm, ")"), "i");
20
+ return value.split(regex).map((part, i) => part.match(regex) ? /*#__PURE__*/_jsx(StyledHighlight, {
21
+ matchHighlightColor: matchHighlightColor,
22
+ children: part
23
+ }, part + i) : part);
26
24
  };
27
- var _GroupedCell = function GroupedCell(props) {
28
- var row = props.row,
29
- table = props.table,
30
- firstCol = props.firstCol;
31
- var _ref2 = (table === null || table === void 0 ? void 0 : table.options) || {},
32
- matchHighlightColor = _ref2.mrtTheme.matchHighlightColor,
33
- enableFilterMatchHighlighting = _ref2.enableFilterMatchHighlighting;
34
- var searchTerm = table.getState().globalFilter;
35
- var value = get(row.original, firstCol.accessorKey);
36
- var renderedCellValue = value;
25
+ const GroupedCell = props => {
26
+ const {
27
+ row,
28
+ table,
29
+ firstCol
30
+ } = props;
31
+ const {
32
+ mrtTheme: {
33
+ matchHighlightColor
34
+ },
35
+ enableFilterMatchHighlighting
36
+ } = (table === null || table === void 0 ? void 0 : table.options) || {};
37
+ const searchTerm = table.getState().globalFilter;
38
+ const value = get(row.original, firstCol.accessorKey);
39
+ let renderedCellValue = value;
37
40
  if (enableFilterMatchHighlighting && searchTerm) {
38
41
  renderedCellValue = getHiglightedSearchTerm({
39
- value: value,
40
- searchTerm: searchTerm,
41
- matchHighlightColor: matchHighlightColor
42
+ value,
43
+ searchTerm,
44
+ matchHighlightColor
42
45
  });
43
46
  }
44
47
  if (firstCol.Cell) {
45
- return /*#__PURE__*/React.createElement(firstCol.Cell, _extends({}, props, {
48
+ return /*#__PURE__*/_jsx(firstCol.Cell, {
49
+ ...props,
46
50
  renderedCellValue: renderedCellValue
47
- }));
51
+ });
48
52
  }
49
53
  return renderedCellValue;
50
54
  };
51
- _GroupedCell.propTypes = PropTypes.Obj;
52
- var HeaderCell = function HeaderCell(props) {
53
- var table = props.table,
54
- firstCol = props.firstCol,
55
- tableConfig = props.tableConfig;
56
- var headerMarkup = firstCol.header;
55
+ GroupedCell.propTypes = PropTypes.Obj;
56
+ const HeaderCell = props => {
57
+ const {
58
+ table,
59
+ firstCol,
60
+ tableConfig
61
+ } = props;
62
+ let headerMarkup = firstCol.header;
57
63
  if ( /*#__PURE__*/React.isValidElement(firstCol.Header)) {
58
64
  headerMarkup = firstCol.Header;
59
65
  }
60
66
  if (typeof firstCol.Header === "function") {
61
- headerMarkup = /*#__PURE__*/React.createElement(firstCol.Header, null);
67
+ headerMarkup = /*#__PURE__*/_jsx(firstCol.Header, {});
62
68
  }
63
- return /*#__PURE__*/React.createElement(Stack, {
69
+ return /*#__PURE__*/_jsxs(Stack, {
64
70
  direction: "row",
65
- alignItems: "center"
66
- }, tableConfig.enableExpandAll && /*#__PURE__*/React.createElement(MRT_ExpandAllButton, {
67
- table: table
68
- }), /*#__PURE__*/React.createElement(Box, null, headerMarkup));
71
+ alignItems: "center",
72
+ children: [tableConfig.enableExpandAll && /*#__PURE__*/_jsx(MRT_ExpandAllButton, {
73
+ table: table
74
+ }), /*#__PURE__*/_jsx(Box, {
75
+ children: headerMarkup
76
+ })]
77
+ });
69
78
  };
70
79
  HeaderCell.propTypes = PropTypes.Obj;
71
- export default (function (firstCol, tableConfig) {
72
- return {
73
- "mrt-row-expand": {
74
- Header: function Header(props) {
75
- return /*#__PURE__*/React.createElement(HeaderCell, _extends({}, props, {
76
- firstCol: firstCol,
77
- tableConfig: tableConfig
78
- }));
79
- },
80
- GroupedCell: function GroupedCell(props) {
81
- return /*#__PURE__*/React.createElement(_GroupedCell, _extends({}, props, {
82
- firstCol: firstCol
83
- }));
84
- },
85
- enableResizing: true,
86
- size: 200
87
- }
88
- };
89
- });
80
+ export default ((firstCol, tableConfig) => ({
81
+ "mrt-row-expand": {
82
+ Header: props => /*#__PURE__*/_jsx(HeaderCell, {
83
+ ...props,
84
+ firstCol: firstCol,
85
+ tableConfig: tableConfig
86
+ }),
87
+ GroupedCell: props => /*#__PURE__*/_jsx(GroupedCell, {
88
+ ...props,
89
+ firstCol: firstCol
90
+ }),
91
+ enableResizing: true,
92
+ size: 200
93
+ }
94
+ }));
@@ -1,47 +1,44 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["data", "columns"];
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
1
  import React, { useCallback, useMemo } from "react";
7
2
  import { useMaterialReactTable, MaterialReactTable } from "material-react-table";
8
3
  import { merge } from "lodash";
9
4
  import muiStyleOverrides from "./muiStyleOverrides";
10
5
  import getExpandColumnConfig from "./getExpandColumnConfig";
11
6
  import { PropTypes } from "prop-types";
12
- var Table = function Table(_ref) {
13
- var data = _ref.data,
14
- columns = _ref.columns,
15
- tableConfig = _objectWithoutProperties(_ref, _excluded);
16
- var otherConfig = {};
17
- var columnVisibility = {};
18
- var firstCol = useMemo(function () {
19
- return columns[0];
20
- }, [columns]);
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ const Table = _ref => {
9
+ let {
10
+ data,
11
+ columns,
12
+ ...tableConfig
13
+ } = _ref;
14
+ const otherConfig = {};
15
+ const columnVisibility = {};
16
+ const firstCol = useMemo(() => columns[0], [columns]);
21
17
  if (tableConfig.enableExpanding) {
22
18
  columnVisibility[firstCol.id] = false;
23
19
  columns[0].visibleInShowHideMenu = false;
24
20
  otherConfig.displayColumnDefOptions = getExpandColumnConfig(firstCol, tableConfig);
25
21
  }
26
- var table = useMaterialReactTable(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
27
- getSubRows: function getSubRows(row) {
28
- return row.children;
29
- }
30
- }, muiStyleOverrides), otherConfig), tableConfig), {}, {
31
- columns: columns,
32
- data: data,
22
+ const table = useMaterialReactTable({
23
+ getSubRows: row => row.children,
24
+ ...muiStyleOverrides,
25
+ ...otherConfig,
26
+ ...tableConfig,
27
+ columns,
28
+ data,
33
29
  initialState: merge({
34
30
  density: "compact",
35
- columnVisibility: columnVisibility
31
+ columnVisibility
36
32
  }, tableConfig.initialState || {})
37
- }));
38
- var customSetColumnVisibility = useCallback(function (columnVisibility) {
39
- return _objectSpread(_objectSpread({}, columnVisibility), {}, _defineProperty({}, firstCol.id, false));
40
- }, [firstCol]);
33
+ });
34
+ const customSetColumnVisibility = useCallback(columnVisibility => ({
35
+ ...columnVisibility,
36
+ [firstCol.id]: false
37
+ }), [firstCol]);
41
38
  if (tableConfig.enableExpanding) {
42
39
  table.setColumnVisibility = customSetColumnVisibility;
43
40
  }
44
- return /*#__PURE__*/React.createElement(MaterialReactTable, {
41
+ return /*#__PURE__*/_jsx(MaterialReactTable, {
45
42
  table: table
46
43
  });
47
44
  };
@@ -1,4 +1,4 @@
1
- var muiStyleOverrides = {
1
+ const muiStyleOverrides = {
2
2
  muiBottomToolbarProps: {
3
3
  sx: {
4
4
  boxShadow: "none"
@@ -27,27 +27,29 @@ var muiStyleOverrides = {
27
27
  }
28
28
  }
29
29
  },
30
- muiTableBodyRowProps: function muiTableBodyRowProps(_ref) {
31
- var row = _ref.row,
32
- table = _ref.table;
33
- var borderBottomStyle = "solid";
30
+ muiTableBodyRowProps: _ref => {
31
+ let {
32
+ row,
33
+ table
34
+ } = _ref;
35
+ let borderBottomStyle = "solid";
34
36
  if (row.getIsExpanded()) {
35
37
  borderBottomStyle = "dashed";
36
38
  }
37
39
  if (!row.originalSubRows && table.options.enableExpanding) {
38
40
  var _row$getParentRow;
39
- var subRows = (_row$getParentRow = row.getParentRow()) === null || _row$getParentRow === void 0 ? void 0 : _row$getParentRow.subRows;
41
+ const subRows = (_row$getParentRow = row.getParentRow()) === null || _row$getParentRow === void 0 ? void 0 : _row$getParentRow.subRows;
40
42
  if (!subRows) {
41
43
  borderBottomStyle = "none";
42
44
  } else {
43
- var lastSubRowOfParent = subRows[subRows.length - 1];
45
+ const lastSubRowOfParent = subRows[subRows.length - 1];
44
46
  borderBottomStyle = lastSubRowOfParent.id === row.id ? "solid" : "none";
45
47
  }
46
48
  }
47
49
  return {
48
50
  sx: {
49
51
  "&:not(.Mui-TableBodyCell-DetailPanel) .MuiTableCell-root": {
50
- borderBottomStyle: borderBottomStyle
52
+ borderBottomStyle
51
53
  }
52
54
  }
53
55
  };
@@ -2,58 +2,75 @@ import React from "react";
2
2
  import Box from "../Box";
3
3
  import { TabsContainer, Tab } from ".";
4
4
  import Popover from "../Popover";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  export default {
6
7
  title: "Components/Tabs/Tab",
7
- decorators: [function (storyFn) {
8
- return /*#__PURE__*/React.createElement(Box, {
9
- bg: "greyLightest",
10
- p: "xl"
11
- }, storyFn());
12
- }],
8
+ decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
9
+ bg: "greyLightest",
10
+ p: "xl",
11
+ children: storyFn()
12
+ })],
13
13
  component: Tab
14
14
  };
15
- export var activeTab = function activeTab() {
16
- return /*#__PURE__*/React.createElement(TabsContainer, null, /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement("a", {
17
- href: "#"
18
- }, "Details")), /*#__PURE__*/React.createElement(Tab, {
19
- active: true
20
- }, /*#__PURE__*/React.createElement("a", {
21
- href: "#"
22
- }, "Planning")));
23
- };
15
+ export const activeTab = () => /*#__PURE__*/_jsxs(TabsContainer, {
16
+ children: [/*#__PURE__*/_jsx(Tab, {
17
+ children: /*#__PURE__*/_jsx("a", {
18
+ href: "#",
19
+ children: "Details"
20
+ })
21
+ }), /*#__PURE__*/_jsx(Tab, {
22
+ active: true,
23
+ children: /*#__PURE__*/_jsx("a", {
24
+ href: "#",
25
+ children: "Planning"
26
+ })
27
+ })]
28
+ });
24
29
  activeTab.story = {
25
30
  name: "Active Tab"
26
31
  };
27
- export var withNotificationsTab = function withNotificationsTab() {
28
- return /*#__PURE__*/React.createElement(TabsContainer, null, /*#__PURE__*/React.createElement(Tab, {
29
- notification: "1"
30
- }, /*#__PURE__*/React.createElement("a", {
31
- href: "#"
32
- }, "Details")), /*#__PURE__*/React.createElement(Tab, {
33
- notification: "7"
34
- }, /*#__PURE__*/React.createElement("a", {
35
- href: "#"
36
- }, "Planning")));
37
- };
32
+ export const withNotificationsTab = () => /*#__PURE__*/_jsxs(TabsContainer, {
33
+ children: [/*#__PURE__*/_jsx(Tab, {
34
+ notification: "1",
35
+ children: /*#__PURE__*/_jsx("a", {
36
+ href: "#",
37
+ children: "Details"
38
+ })
39
+ }), /*#__PURE__*/_jsx(Tab, {
40
+ notification: "7",
41
+ children: /*#__PURE__*/_jsx("a", {
42
+ href: "#",
43
+ children: "Planning"
44
+ })
45
+ })]
46
+ });
38
47
  activeTab.story = {
39
48
  name: "With Notifications Tab"
40
49
  };
41
- export var withPopoverTab = function withPopoverTab() {
42
- return /*#__PURE__*/React.createElement(TabsContainer, null, /*#__PURE__*/React.createElement(Popover, {
50
+ export const withPopoverTab = () => /*#__PURE__*/_jsxs(TabsContainer, {
51
+ children: [/*#__PURE__*/_jsx(Popover, {
43
52
  direction: "right",
44
53
  text: "Example with tooltip explaining tab",
45
- width: "218px"
46
- }, /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement("a", {
47
- href: "#"
48
- }, "Details"))), /*#__PURE__*/React.createElement(Popover, {
54
+ width: "218px",
55
+ children: /*#__PURE__*/_jsx(Tab, {
56
+ children: /*#__PURE__*/_jsx("a", {
57
+ href: "#",
58
+ children: "Details"
59
+ })
60
+ })
61
+ }), /*#__PURE__*/_jsx(Popover, {
49
62
  direction: "top",
50
63
  text: "Example with tooltip explaining tab",
51
- width: "218px"
52
- }, /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement("a", {
53
- href: "#",
54
- tabIndex: "-1"
55
- }, "Additional information"))));
56
- };
64
+ width: "218px",
65
+ children: /*#__PURE__*/_jsx(Tab, {
66
+ children: /*#__PURE__*/_jsx("a", {
67
+ href: "#",
68
+ tabIndex: "-1",
69
+ children: "Additional information"
70
+ })
71
+ })
72
+ })]
73
+ });
57
74
  withPopoverTab.story = {
58
75
  name: "With Popover Tab"
59
76
  };