flipper-ui 0.40.4 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/core/data-display/actions/actions.spec.d.ts +1 -1
  2. package/core/data-display/actions/actions.stories.d.ts +2 -1
  3. package/core/data-display/actions/index.d.ts +83 -3
  4. package/core/data-display/actions/index.js +46 -8
  5. package/core/data-display/actions/styles.d.ts +1 -1
  6. package/core/data-display/actions/styles.js +3 -3
  7. package/core/data-display/advertise/styles.d.ts +1 -1
  8. package/core/data-display/data-table/data-table.d.ts +5 -0
  9. package/core/data-display/data-table/data-table.js +18 -6
  10. package/core/data-display/data-table/data-table.stories.d.ts +110 -8
  11. package/core/data-display/data-table/rows.d.ts +7 -2
  12. package/core/data-display/data-table/rows.js +18 -6
  13. package/core/data-display/data-table/styles.d.ts +1 -1
  14. package/core/data-display/data-table/types.d.ts +2 -0
  15. package/core/data-display/list-item-dark/index.js +3 -4
  16. package/core/data-display/list-item-dark/styles.d.ts +1 -1
  17. package/core/data-display/table/index.js +34 -0
  18. package/core/data-display/table/styles.d.ts +42 -0
  19. package/core/data-display/table/styles.js +68 -0
  20. package/core/data-display/table/table-pagination.js +1 -1
  21. package/core/data-display/table-interactive/TableInteractive.d.ts +4 -0
  22. package/core/data-display/table-interactive/TableInteractive.js +18 -3
  23. package/core/data-display/table-interactive/TableInteractiveHead.d.ts +1 -1
  24. package/core/data-display/table-interactive/TableInteractiveHead.js +1 -1
  25. package/core/data-display/table-interactive/TableInteractiveHeader.js +1 -0
  26. package/core/data-display/table-interactive/index.d.ts +2 -0
  27. package/core/data-display/table-interactive/index.js +8 -1
  28. package/core/data-display/table-interactive/styles.js +1 -1
  29. package/core/data-display/table-interactive/table-interactive.stories.d.ts +2 -0
  30. package/core/data-display/table-interactive/utils.d.ts +1 -1
  31. package/core/data-display/table-interactive/utils.js +2 -1
  32. package/core/data-display/typography/index.d.ts +2 -1
  33. package/core/data-display/typography/index.js +18 -2
  34. package/core/data-display/view-mode/styles.d.ts +1 -1
  35. package/core/feedback/dialog-v2/dialog.js +6 -5
  36. package/core/feedback/nothing-found/index.d.ts +8 -1
  37. package/core/feedback/nothing-found/index.js +11 -2
  38. package/core/feedback/nothing-found/nothing-found.spec.d.ts +1 -1
  39. package/core/feedback/progress/index.d.ts +42 -2
  40. package/core/feedback/progress/index.js +79 -20
  41. package/core/feedback/progress/progress.spec.d.ts +1 -1
  42. package/core/feedback/progress/progress.stories.d.ts +4 -2
  43. package/core/feedback/progress/styles.d.ts +18 -0
  44. package/core/feedback/progress/styles.js +14 -0
  45. package/core/feedback/snackbar/index.js +1 -1
  46. package/core/inputs/checkbox/checkbox.spec.d.ts +1 -1
  47. package/core/inputs/checkbox/index.js +3 -1
  48. package/core/inputs/icon-button/icon-button.spec.d.ts +1 -1
  49. package/core/inputs/icon-button/index.d.ts +7 -0
  50. package/core/inputs/icon-button/index.js +11 -1
  51. package/core/inputs/select/index.js +2 -1
  52. package/core/inputs/text-field/index.d.ts +2 -2
  53. package/core/inputs/text-field/index.js +14 -4
  54. package/core/inputs/text-field/styles.js +1 -1
  55. package/core/inputs/text-field/text-field.spec.d.ts +1 -1
  56. package/core/navigation/menu/index.js +1 -1
  57. package/core/navigation/stepper/index.d.ts +38 -2
  58. package/core/navigation/stepper/index.js +36 -9
  59. package/core/navigation/stepper/stepper.stories.d.ts +2 -0
  60. package/core/surfaces/card/index.d.ts +13 -6
  61. package/core/surfaces/card/index.js +19 -12
  62. package/core/surfaces/card/styles.d.ts +3 -2
  63. package/core/surfaces/card/styles.js +2 -3
  64. package/core/surfaces/expansion-panel/index.d.ts +1 -0
  65. package/core/surfaces/expansion-panel/index.js +5 -3
  66. package/core/surfaces/step-card/index.d.ts +19 -9
  67. package/core/surfaces/step-card/index.js +2 -0
  68. package/core/surfaces/step-card/step-card-details.js +1 -0
  69. package/core/surfaces/step-card/step-card-panel.d.ts +1 -0
  70. package/core/surfaces/step-card/step-card-panel.js +2 -1
  71. package/core/surfaces/step-card/step-card.spec.d.ts +1 -1
  72. package/package.json +1 -1
  73. package/theme/index.d.ts +1 -0
  74. package/theme/index.js +1 -0
  75. package/theme/theme.d.ts +43 -0
  76. package/theme/theme.js +11 -1
  77. package/theme/typography.d.ts +96 -0
  78. package/theme/typography.js +59 -0
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
12
  var _react = _interopRequireDefault(require("react"));
12
13
  var _Table = _interopRequireDefault(require("@mui/material/Table"));
@@ -15,6 +16,38 @@ var _excluded = ["style", "margin", "padding", "spacing", "children"];
15
16
  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; }
16
17
  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) { (0, _defineProperty2["default"])(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; }
17
18
  var gray = _theme.theme.colors.gray;
19
+
20
+ // doubled ampersand so it also wins over TableCellInteractive's own `&&`
21
+ var SMALL_SIZE_SX = {
22
+ '&& thead th, && tbody th, && tbody td': {
23
+ fontSize: '13px',
24
+ padding: '6px 12px'
25
+ },
26
+ // the pagination cell keeps its own padding of 0, so the footer shrinks
27
+ // through the toolbar instead. 8px here plus the 4px below leave the last
28
+ // icon 12px from the edge, the same inset the small cells use
29
+ '&& tfoot .MuiTablePagination-toolbar': {
30
+ minHeight: '40px',
31
+ paddingRight: '8px'
32
+ },
33
+ // the labels are `p` elements, and their default `1em` margin is what
34
+ // holds the toolbar above the 40px asked for above
35
+ '&& tfoot .MuiTablePagination-selectLabel, && tfoot .MuiTablePagination-displayedRows': {
36
+ margin: 0,
37
+ fontSize: '13px'
38
+ },
39
+ '&& tfoot .MuiTablePagination-input': {
40
+ fontSize: '13px',
41
+ marginRight: '16px'
42
+ },
43
+ // the select arrow and the four page icons in one rule
44
+ '&& tfoot .MuiSvgIcon-root': {
45
+ fontSize: '18px'
46
+ },
47
+ '&& tfoot .MuiIconButton-root': {
48
+ padding: '4px'
49
+ }
50
+ };
18
51
  var Table = function Table(_ref) {
19
52
  var style = _ref.style,
20
53
  margin = _ref.margin,
@@ -24,6 +57,7 @@ var Table = function Table(_ref) {
24
57
  otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
25
58
  return /*#__PURE__*/_react["default"].createElement(_Table["default"], (0, _extends2["default"])({}, otherProps, {
26
59
  padding: spacing,
60
+ sx: [otherProps.size === 'small' && SMALL_SIZE_SX].concat((0, _toConsumableArray2["default"])(Array.isArray(otherProps.sx) ? otherProps.sx : [otherProps.sx])),
27
61
  style: _objectSpread({
28
62
  border: "1px solid ".concat(gray[300]),
29
63
  padding: padding,
@@ -0,0 +1,42 @@
1
+ import type { CSSProperties } from 'react';
2
+ export type Truncate = boolean | number | string;
3
+ export declare const SCROLLBAR: {
4
+ readonly scrollbarWidth: "thin";
5
+ readonly scrollbarColor: `${string} transparent`;
6
+ readonly '&::-webkit-scrollbar': {
7
+ readonly width: "4px";
8
+ readonly height: "4px";
9
+ };
10
+ readonly '&::-webkit-scrollbar-track': {
11
+ readonly background: "transparent";
12
+ };
13
+ readonly '&::-webkit-scrollbar-thumb': {
14
+ readonly borderRadius: "2px";
15
+ readonly backgroundColor: string;
16
+ };
17
+ readonly '&::-webkit-scrollbar-thumb:hover': {
18
+ readonly backgroundColor: string;
19
+ };
20
+ };
21
+ export declare const tableFrame: (framed?: boolean, borderRadius?: number | string) => {
22
+ borderRadius: string;
23
+ boxShadow?: undefined;
24
+ border?: undefined;
25
+ '& table'?: undefined;
26
+ '& tbody:last-child tr:last-of-type td'?: undefined;
27
+ '& tfoot td'?: undefined;
28
+ } | {
29
+ boxShadow: string;
30
+ border: string;
31
+ borderRadius: string;
32
+ '& table': {
33
+ border: string;
34
+ };
35
+ '& tbody:last-child tr:last-of-type td': {
36
+ borderBottom: string;
37
+ };
38
+ '& tfoot td': {
39
+ borderBottom: string;
40
+ };
41
+ } | undefined;
42
+ export declare const truncateStyle: (truncate?: Truncate) => CSSProperties | undefined;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.truncateStyle = exports.tableFrame = exports.SCROLLBAR = void 0;
7
+ var _styles = require("@mui/material/styles");
8
+ var _theme = require("../../../theme");
9
+ var gray = _theme.theme.colors.gray;
10
+ var DEFAULT_RADIUS = 12;
11
+ var DEFAULT_MAX_WIDTH = 150;
12
+ // sx reads a bare number as a theme multiple, so pin the unit
13
+ var toPx = function toPx(value) {
14
+ return typeof value === 'number' ? "".concat(value, "px") : value;
15
+ };
16
+ var SCROLLBAR = exports.SCROLLBAR = {
17
+ scrollbarWidth: 'thin',
18
+ scrollbarColor: "".concat((0, _styles.alpha)(gray[900], 0.2), " transparent"),
19
+ '&::-webkit-scrollbar': {
20
+ width: '4px',
21
+ height: '4px'
22
+ },
23
+ '&::-webkit-scrollbar-track': {
24
+ background: 'transparent'
25
+ },
26
+ '&::-webkit-scrollbar-thumb': {
27
+ borderRadius: '2px',
28
+ backgroundColor: (0, _styles.alpha)(gray[900], 0.2)
29
+ },
30
+ '&::-webkit-scrollbar-thumb:hover': {
31
+ backgroundColor: (0, _styles.alpha)(gray[900], 0.35)
32
+ }
33
+ };
34
+ var tableFrame = exports.tableFrame = function tableFrame(framed, borderRadius) {
35
+ if (!framed) {
36
+ return borderRadius === undefined ? undefined : {
37
+ borderRadius: toPx(borderRadius)
38
+ };
39
+ }
40
+ return {
41
+ boxShadow: 'none',
42
+ border: "1px solid ".concat(gray[300]),
43
+ borderRadius: toPx(borderRadius !== null && borderRadius !== void 0 ? borderRadius : DEFAULT_RADIUS),
44
+ '& table': {
45
+ border: 'none !important'
46
+ },
47
+ // a footer below the body means the frame no longer closes the last
48
+ // row, so it only drops that border while the body really is last
49
+ '& tbody:last-child tr:last-of-type td': {
50
+ borderBottom: 'none'
51
+ },
52
+ // the frame draws the bottom edge, so the footer must not draw one too
53
+ '& tfoot td': {
54
+ borderBottom: 'none'
55
+ }
56
+ };
57
+ };
58
+ var truncateStyle = exports.truncateStyle = function truncateStyle(truncate) {
59
+ if (!truncate) {
60
+ return undefined;
61
+ }
62
+ return {
63
+ maxWidth: toPx(truncate === true ? DEFAULT_MAX_WIDTH : truncate),
64
+ overflow: 'hidden',
65
+ textOverflow: 'ellipsis',
66
+ whiteSpace: 'nowrap'
67
+ };
68
+ };
@@ -42,7 +42,7 @@ var TablePagination = function TablePagination(_ref) {
42
42
  padding: padding
43
43
  }, style),
44
44
  sx: {
45
- borderBottom: "1px solid ".concat(gray[200], " !important;")
45
+ borderBottom: "1px solid ".concat(gray[200])
46
46
  },
47
47
  onPageChange: onPageChange,
48
48
  onRowsPerPageChange: onRowsPerPageChange
@@ -12,6 +12,10 @@ export interface ITableInteractive extends Omit<TableProps, 'children'> {
12
12
  total?: number;
13
13
  fixed?: boolean;
14
14
  active?: string;
15
+ maxHeight?: number | string;
16
+ cellPadding?: number | string;
17
+ framed?: boolean;
18
+ borderRadius?: number | string;
15
19
  headers: {
16
20
  name: string;
17
21
  label: string;
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
11
11
  var _table = _interopRequireDefault(require("../table"));
12
+ var _styles = require("../table/styles");
12
13
  var _tableBody = _interopRequireDefault(require("../table/table-body"));
13
14
  var _tableFooter = _interopRequireDefault(require("../table/table-footer"));
14
15
  var _tablePagination = _interopRequireDefault(require("../table/table-pagination"));
@@ -21,6 +22,15 @@ var _theme = require("../../../theme");
21
22
  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; }
22
23
  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) { (0, _defineProperty2["default"])(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; }
23
24
  var gray = _theme.theme.colors.gray;
25
+
26
+ // body cells are rendered by the consumer, so they default to MUI's padding;
27
+ // match TableCellInteractive's head instead, or the columns sit 8px apart.
28
+ // scoped to tbody so the pagination cell in tfoot keeps its own height
29
+ var BODY_CELL_SX = {
30
+ '&& tbody td': {
31
+ padding: '16px 8px'
32
+ }
33
+ };
24
34
  var Direction = exports.Direction = /*#__PURE__*/function (Direction) {
25
35
  Direction["ASCENDENT"] = "asc";
26
36
  Direction["DESCENDENT"] = "desc";
@@ -42,9 +52,11 @@ var TableInteractive = exports.TableInteractive = function TableInteractive(prop
42
52
  headerActions: props.headerActions,
43
53
  handleOpen: props.handleOpen
44
54
  }), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
45
- sx: {
55
+ sx: _objectSpread(_objectSpread(_objectSpread({
46
56
  overflow: 'auto'
47
- }
57
+ }, _styles.SCROLLBAR), props.maxHeight ? {
58
+ maxHeight: props.maxHeight
59
+ } : undefined), (0, _styles.tableFrame)(props.framed, props.borderRadius))
48
60
  }, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
49
61
  sx: {
50
62
  width: '100%',
@@ -55,16 +67,19 @@ var TableInteractive = exports.TableInteractive = function TableInteractive(prop
55
67
  name: props.name,
56
68
  id: 'list-' + props.name,
57
69
  className: props.className,
70
+ size: props.size,
71
+ stickyHeader: props.stickyHeader,
58
72
  style: {
59
73
  border: props.isInteractive ? 'none !important' : "1px solid ".concat(gray[300])
60
74
  },
61
- sx: _objectSpread({}, props.sx)
75
+ sx: _objectSpread(_objectSpread({}, props.size !== 'small' && BODY_CELL_SX), props.sx)
62
76
  }, /*#__PURE__*/_react["default"].createElement(_TableInteractiveHead.TableInteractiveHead, {
63
77
  fixed: props.fixed,
64
78
  active: props.active,
65
79
  headers: props.headers,
66
80
  children: props.children,
67
81
  direction: props.direction,
82
+ cellPadding: props.cellPadding,
68
83
  isCollapsible: props.isCollapsible,
69
84
  visibleColumns: props.visibleColumns || [],
70
85
  onSort: props.onSort
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type ITableInteractive } from './TableInteractive';
3
- export type ITableInteractiveHead = Pick<ITableInteractive, 'fixed' | 'headers' | 'visibleColumns' | 'onSort' | 'active' | 'direction' | 'children' | 'isCollapsible'>;
3
+ export type ITableInteractiveHead = Pick<ITableInteractive, 'fixed' | 'headers' | 'cellPadding' | 'visibleColumns' | 'onSort' | 'active' | 'direction' | 'children' | 'isCollapsible'>;
4
4
  export declare const TableInteractiveHead: (props: ITableInteractiveHead) => React.JSX.Element;
@@ -21,7 +21,7 @@ var TableInteractiveHead = exports.TableInteractiveHead = function TableInteract
21
21
  direction: props.direction,
22
22
  onSort: props.onSort && handleSort
23
23
  }, /*#__PURE__*/_react["default"].createElement(_tableRow["default"], null, props.headers.map(function (header) {
24
- return (0, _utils.generateHeader)(header, visibleColumns, header.sortable, props.fixed);
24
+ return (0, _utils.generateHeader)(header, visibleColumns, header.sortable, props.fixed, props.cellPadding);
25
25
  }), (props.children || props.isCollapsible) && /*#__PURE__*/_react["default"].createElement(_tableCell["default"], {
26
26
  sortable: false,
27
27
  sx: {
@@ -12,6 +12,7 @@ var _styles = require("./styles");
12
12
  var TableInteractiveHeader = exports.TableInteractiveHeader = function TableInteractiveHeader(props) {
13
13
  return /*#__PURE__*/_react["default"].createElement(_styles.TableHeaderContent, null, /*#__PURE__*/_react["default"].createElement("div", null, props.headerActions), /*#__PURE__*/_react["default"].createElement(_iconButton["default"], {
14
14
  padding: "4px 6px",
15
+ "aria-label": "Prefer\xEAncias",
15
16
  onClick: props.handleOpen
16
17
  }, /*#__PURE__*/_react["default"].createElement(_mui.IconSettings, {
17
18
  color: "primary"
@@ -1,3 +1,5 @@
1
1
  export { TableInteractive } from './TableInteractive';
2
2
  export { getDefaultColumns, getInitialColumns, setVisibleColumns, generateHeader, getVisibleColumns, getOrderedVisibleColumns } from './utils';
3
3
  export type { ITableInteractive } from './TableInteractive';
4
+ export { truncateStyle } from '../table/styles';
5
+ export type { Truncate } from '../table/styles';
@@ -45,5 +45,12 @@ Object.defineProperty(exports, "setVisibleColumns", {
45
45
  return _utils.setVisibleColumns;
46
46
  }
47
47
  });
48
+ Object.defineProperty(exports, "truncateStyle", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _styles.truncateStyle;
52
+ }
53
+ });
48
54
  var _TableInteractive = require("./TableInteractive");
49
- var _utils = require("./utils");
55
+ var _utils = require("./utils");
56
+ var _styles = require("../table/styles");
@@ -12,7 +12,7 @@ var _theme = require("../../../theme");
12
12
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
13
13
  var gray = _theme.theme.colors.gray;
14
14
  var ContentWrapper = exports.ContentWrapper = _styled["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 2px solid ", ";\n"])), gray[300]);
15
- var TableHeaderContent = exports.TableHeaderContent = _styled["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: flex-end;\n gap: 4px;\n margin: 0 0 8px 0;\n\n & > div {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n }\n"])));
15
+ var TableHeaderContent = exports.TableHeaderContent = _styled["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: flex-end;\n gap: 4px;\n margin: 0 0 8px 0;\n\n & > div {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 6px;\n }\n"])));
16
16
  var ActionsWrapper = exports.ActionsWrapper = _styled["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n"])));
17
17
  var TableCellInteractive = exports.TableCellInteractive = (0, _styled["default"])(_tableCell["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n && {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 60px;\n max-width: ", ";\n padding: 16px 8px;\n }\n"])), function (props) {
18
18
  return props.fixed ? props.width : 'none';
@@ -4,3 +4,5 @@ declare const meta: Meta<typeof TableInteractive>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof TableInteractive>;
6
6
  export declare const interactiveTable: Story;
7
+ export declare const framed: Story;
8
+ export declare const stickyHeader: Story;
@@ -11,7 +11,7 @@ export declare const getInitialColumns: (columns: {
11
11
  show: boolean;
12
12
  }[], key: string) => string[];
13
13
  export declare const setVisibleColumns: (columns: string[], key: string) => void;
14
- export declare const generateHeader: (header: ITableInteractive["headers"][number], visibleColumns?: string[] | undefined, sortable?: boolean, fixed?: boolean) => React.JSX.Element | null;
14
+ export declare const generateHeader: (header: ITableInteractive["headers"][number], visibleColumns?: string[] | undefined, sortable?: boolean, fixed?: boolean, cellPadding?: number | string) => React.JSX.Element | null;
15
15
  export declare const getVisibleColumns: (headers: {
16
16
  name: string;
17
17
  label: string;
@@ -36,12 +36,13 @@ var setVisibleColumns = exports.setVisibleColumns = function setVisibleColumns(c
36
36
  parsed[key] = columns;
37
37
  localStorage.setItem(STORAGE_KEY, JSON.stringify(parsed));
38
38
  };
39
- var generateHeader = exports.generateHeader = function generateHeader(header, visibleColumns, sortable, fixed) {
39
+ var generateHeader = exports.generateHeader = function generateHeader(header, visibleColumns, sortable, fixed, cellPadding) {
40
40
  if (!(visibleColumns !== null && visibleColumns !== void 0 && visibleColumns.includes(header.name))) return null;
41
41
  return /*#__PURE__*/_react["default"].createElement(_styles.TableCellInteractive, {
42
42
  name: header.name,
43
43
  sortable: sortable,
44
44
  width: header.width,
45
+ padding: cellPadding,
45
46
  key: header.name + '-header',
46
47
  fixed: fixed ? 'fixed' : undefined
47
48
  }, header.label);
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { DefaultProps } from '../../types';
3
3
  import type { TypographyProps } from '@mui/material/Typography';
4
- declare const Typography: ({ children, margin, padding, style, variant, ...otherProps }: TypographyProps & DefaultProps) => React.JSX.Element;
4
+ export type ITypographyProps = TypographyProps & DefaultProps;
5
+ declare const Typography: ({ children, margin, padding, style, sx, variant, ...otherProps }: ITypographyProps) => React.JSX.Element;
5
6
  export default Typography;
@@ -7,23 +7,39 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
12
  var _react = _interopRequireDefault(require("react"));
13
+ var _styles = require("@mui/material/styles");
12
14
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
- var _excluded = ["children", "margin", "padding", "style", "variant"];
15
+ var _typography = require("../../../theme/typography");
16
+ var _excluded = ["children", "margin", "padding", "style", "sx", "variant"];
14
17
  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; }
15
18
  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) { (0, _defineProperty2["default"])(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; }
19
+ var isTokenVariant = function isTokenVariant(variant) {
20
+ return variant in _typography.typographyVariants;
21
+ };
16
22
  var Typography = function Typography(_ref) {
17
23
  var children = _ref.children,
18
24
  margin = _ref.margin,
19
25
  padding = _ref.padding,
20
26
  _ref$style = _ref.style,
21
27
  style = _ref$style === void 0 ? {} : _ref$style,
28
+ sx = _ref.sx,
22
29
  _ref$variant = _ref.variant,
23
30
  variant = _ref$variant === void 0 ? 'body2' : _ref$variant,
24
31
  otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
25
- return /*#__PURE__*/_react["default"].createElement(_Typography["default"], (0, _extends2["default"])({}, otherProps, {
32
+ var _useTheme = (0, _styles.useTheme)(),
33
+ typography = _useTheme.typography;
34
+
35
+ // NG tokens come from the theme; keep them working when the app renders
36
+ // outside `ThemeProviderFlipper` or replaces the theme options
37
+ var fallback = isTokenVariant(variant) && !(variant in typography) ? _typography.typographyVariants[variant] : undefined;
38
+ return /*#__PURE__*/_react["default"].createElement(_Typography["default"], (0, _extends2["default"])({}, fallback ? {
39
+ variantMapping: _typography.variantMapping
40
+ } : {}, otherProps, {
26
41
  variant: variant,
42
+ sx: fallback ? [fallback].concat((0, _toConsumableArray2["default"])(Array.isArray(sx) ? sx : [sx])) : sx,
27
43
  style: _objectSpread({
28
44
  margin: margin,
29
45
  padding: padding
@@ -1,6 +1,6 @@
1
1
  export declare const ButtonFilterGroup: import("@emotion/styled").StyledComponent<import("@mui/material/ButtonGroup").ButtonGroupOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
2
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
3
- }, "color" | "disabled" | "size" | "children" | "style" | "className" | "classes" | "disableRipple" | "sx" | "disableFocusRipple" | "orientation" | "variant" | "disableElevation" | "fullWidth"> & {
3
+ }, "children" | "color" | "className" | "style" | "classes" | "sx" | "variant" | "disabled" | "disableRipple" | "disableElevation" | "disableFocusRipple" | "fullWidth" | "size" | "orientation"> & {
4
4
  theme?: import("@emotion/react").Theme;
5
5
  }, {}, {}>;
6
6
  export declare const WrapperEnd: import("@emotion/styled").StyledComponent<{
@@ -15,16 +15,17 @@ var _excluded = ["open", "title", "titleAction", "text", "primaryButtonColor", "
15
15
  var _theme$colors = _theme.theme.colors,
16
16
  action = _theme$colors.action,
17
17
  primary = _theme$colors.primary;
18
+ // The dialog keeps its own palette: here `secondary` is the cancel color,
19
+ // not the NG green
18
20
  var themeDialog = {
21
+ typography: _theme.muiThemeOptions.typography,
22
+ components: _theme.muiThemeOptions.components,
19
23
  palette: {
20
24
  primary: {
21
25
  main: primary.main
22
26
  },
23
27
  secondary: {
24
28
  main: action.cancel
25
- },
26
- typography: {
27
- useNextVariants: true
28
29
  }
29
30
  }
30
31
  };
@@ -64,14 +65,14 @@ var DialogV2 = function DialogV2(props) {
64
65
  PaperProps: PaperProps,
65
66
  actions: !omitActionButtons && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, haveSecondaryButton && /*#__PURE__*/_react["default"].createElement(_button["default"], {
66
67
  name: secondaryButtonName || 'secondary-button',
67
- margin: "12px 6px",
68
+ margin: "8px 4px 12px 4px",
68
69
  onClick: secondaryButtonAction
69
70
  }, secondaryButtonText), /*#__PURE__*/_react["default"].createElement(_button["default"], {
70
71
  name: primaryButtonName || 'primary-button',
71
72
  color: primaryButtonColor,
72
73
  style: primaryButtonStyle,
73
74
  variant: "contained",
74
- margin: "12px 6px",
75
+ margin: "8px 12px 12px 4px",
75
76
  onClick: primaryButtonAction
76
77
  }, primaryButtonText)),
77
78
  onClose: onClose
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { ReactNode } from 'react';
3
- export interface IProps {
3
+ import type { ITypographyProps } from '@/core/data-display/typography';
4
+ /**
5
+ * Every `Typography` prop is accepted and merged over the message defaults —
6
+ * `variant='h5'`, `align='center'`, `color='textSecondary'`. `variant` also
7
+ * sets the heading level, so `{ component: 'h2' }` keeps the `h5` type scale
8
+ * on an `<h2>` tag.
9
+ */
10
+ export interface IProps extends Partial<ITypographyProps> {
4
11
  searchText?: string;
5
12
  customText?: ReactNode;
6
13
  buttonLabel?: string;
@@ -10,7 +10,14 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _typography = _interopRequireDefault(require("../../data-display/typography"));
12
12
  var _excluded = ["buttonLabel", "readonly"],
13
- _excluded2 = ["customText", "searchText", "show"];
13
+ _excluded2 = ["customText", "searchText", "show", "variant"];
14
+ /**
15
+ * Every `Typography` prop is accepted and merged over the message defaults —
16
+ * `variant='h5'`, `align='center'`, `color='textSecondary'`. `variant` also
17
+ * sets the heading level, so `{ component: 'h2' }` keeps the `h5` type scale
18
+ * on an `<h2>` tag.
19
+ */
20
+
14
21
  var NothingFound = function NothingFound(props) {
15
22
  var buttonLabel = props.buttonLabel,
16
23
  readonly = props.readonly,
@@ -22,10 +29,12 @@ var NothingFound = function NothingFound(props) {
22
29
  _rest$searchText = rest.searchText,
23
30
  searchText = _rest$searchText === void 0 ? '' : _rest$searchText,
24
31
  show = rest.show,
32
+ _rest$variant = rest.variant,
33
+ variant = _rest$variant === void 0 ? 'h5' : _rest$variant,
25
34
  otherProps = (0, _objectWithoutProperties2["default"])(rest, _excluded2);
26
35
  return show ? /*#__PURE__*/_react["default"].createElement(_typography["default"], (0, _extends2["default"])({
27
36
  flex: 1,
28
- variant: "h5",
37
+ variant: variant,
29
38
  align: "center",
30
39
  color: "textSecondary",
31
40
  padding: "48px 0"
@@ -1 +1 @@
1
- export {};
1
+ import '@testing-library/jest-dom';
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
+ import type { ReactNode } from 'react';
2
3
  import type { DefaultProps } from '../../types';
4
+ import type { SxProps, Theme } from '@mui/material/styles';
3
5
  export interface ILinear {
4
6
  color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'inherit';
5
7
  variant?: 'buffer' | 'determinate' | 'indeterminate' | 'query';
@@ -7,20 +9,58 @@ export interface ILinear {
7
9
  primaryColor?: string;
8
10
  barPrimaryColor?: string;
9
11
  barSecondaryColor?: string;
12
+ /**
13
+ * Height of the linear bar. The fill follows it on its own, so the
14
+ * inner bars need no styling of their own. Default: `4`.
15
+ */
16
+ thickness?: number | string;
17
+ /**
18
+ * Corner radius of the linear bar, as CSS — `'3px'`, `'50%'`. The fill
19
+ * is clipped by it on its own, since the bar hides its own overflow.
20
+ * Default: square corners.
21
+ */
22
+ borderRadius?: string;
10
23
  }
11
24
  export interface ICircular {
12
25
  size?: string | number;
13
- variant?: 'determinate' | 'indeterminate';
26
+ /**
27
+ * `buffer` and `query` are implemented by the linear bar alone. They are
28
+ * declared here only so the intersection with `ILinear` does not collapse
29
+ * to the smaller set, which made them unusable on either mode.
30
+ */
31
+ variant?: 'buffer' | 'determinate' | 'indeterminate' | 'query';
14
32
  color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'inherit';
15
33
  }
16
34
  export interface ProgressProps extends DefaultProps {
17
35
  value?: number;
18
36
  linear?: boolean;
37
+ /**
38
+ * Inline content rendered next to the progress — beside the linear bar,
39
+ * and inside the ring of a circular one, which falls back to beside it
40
+ * below 40px. It also names the progressbar, so no `ariaLabel` is needed
41
+ * alongside it. Block elements are unsupported: it lands inside a
42
+ * `Typography`.
43
+ */
44
+ label?: ReactNode;
45
+ /**
46
+ * Accessible name, required whenever there is no `label` — a progressbar
47
+ * with no name announces a bare percentage. Overrides `label` as the name.
48
+ */
49
+ ariaLabel?: string;
50
+ /**
51
+ * Where a circular `label` goes. Default: `'inside'` from 40px up and
52
+ * `'beside'` below it — informing it skips that measurement, which
53
+ * cannot read a `size` in `rem` or `em`. The linear bar ignores it and
54
+ * always renders the label beside itself.
55
+ */
56
+ labelPosition?: 'inside' | 'beside';
57
+ /** Merged over the styles the color props generate, never replacing them. */
58
+ sx?: SxProps<Theme>;
19
59
  }
20
60
  export interface IColors {
21
61
  primaryColor?: string;
22
62
  barPrimaryColor?: string;
23
63
  barSecondaryColor?: string;
24
64
  }
25
- declare const Progress: ({ linear, style, margin, padding, valueBuffer, primaryColor, barPrimaryColor, barSecondaryColor, ...otherProps }: ProgressProps & ICircular & ILinear) => React.JSX.Element;
65
+ declare const Progress: ({ sx, label, linear, ariaLabel, thickness, borderRadius, labelPosition, style, margin, padding, valueBuffer, primaryColor, barPrimaryColor, barSecondaryColor, ...otherProps }: ProgressProps & ICircular & ILinear) => React.JSX.Element;
26
66
  export default Progress;