@pingux/astro 2.129.0-alpha.1 → 2.129.0-alpha.3

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 (72) hide show
  1. package/lib/cjs/components/Card/Card.styles.d.ts +11 -0
  2. package/lib/cjs/components/Card/Card.styles.js +6 -1
  3. package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.mdx +1 -1
  4. package/lib/cjs/components/Table/Table.stories.js +4 -5
  5. package/lib/cjs/components/Table/Table.styles.d.ts +5 -3
  6. package/lib/cjs/components/Table/Table.styles.js +8 -6
  7. package/lib/cjs/components/TableBase/TableBase.d.ts +9 -0
  8. package/lib/cjs/components/TableBase/TableBase.js +238 -0
  9. package/lib/cjs/components/TableBase/TableBase.mdx +30 -0
  10. package/lib/cjs/components/TableBase/TableBase.stories.d.ts +6 -0
  11. package/lib/cjs/components/TableBase/TableBase.stories.js +111 -0
  12. package/lib/cjs/components/TableBase/TableBase.styles.d.ts +76 -0
  13. package/lib/cjs/components/TableBase/TableBase.styles.js +80 -0
  14. package/lib/cjs/components/TableBase/TableBase.test.d.ts +1 -0
  15. package/lib/cjs/components/TableBase/TableBase.test.js +122 -0
  16. package/lib/cjs/components/TableBase/index.d.ts +1 -0
  17. package/lib/cjs/components/TableBase/index.js +14 -0
  18. package/lib/cjs/components/TableBase/stories/NextGenDarkTableBase.chromatic.stories.d.ts +6 -0
  19. package/lib/cjs/components/TableBase/stories/NextGenDarkTableBase.chromatic.stories.js +22 -0
  20. package/lib/cjs/components/TableBase/stories/NextGenTableBase.chromatic.stories.d.ts +6 -0
  21. package/lib/cjs/components/TableBase/stories/NextGenTableBase.chromatic.stories.js +22 -0
  22. package/lib/cjs/components/TableBase/stories/NextGenTableBase.d.ts +3 -0
  23. package/lib/cjs/components/TableBase/stories/NextGenTableBase.js +67 -0
  24. package/lib/cjs/index.d.ts +3 -2
  25. package/lib/cjs/index.js +74 -20
  26. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +22 -0
  27. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +22 -0
  28. package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +1 -0
  29. package/lib/cjs/styles/themes/next-gen/colors/colors.js +2 -1
  30. package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
  31. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +146 -1
  32. package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +14 -1
  33. package/lib/cjs/styles/themes/next-gen/variants/cards.js +7 -2
  34. package/lib/cjs/styles/themes/next-gen/variants/table.d.ts +45 -0
  35. package/lib/cjs/styles/themes/next-gen/variants/table.js +65 -0
  36. package/lib/cjs/styles/themes/next-gen/variants/tableBase.d.ts +86 -0
  37. package/lib/cjs/styles/themes/next-gen/variants/tableBase.js +99 -0
  38. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +131 -0
  39. package/lib/cjs/styles/themes/next-gen/variants/variants.js +5 -1
  40. package/lib/cjs/styles/variants/variants.js +5 -2
  41. package/lib/cjs/types/cell.d.ts +12 -0
  42. package/lib/cjs/types/cell.js +6 -0
  43. package/lib/cjs/types/tableBase.d.ts +45 -0
  44. package/lib/cjs/types/tableBase.js +6 -0
  45. package/lib/cjs/utils/devUtils/constants/items.d.ts +10 -0
  46. package/lib/cjs/utils/devUtils/constants/items.js +87 -0
  47. package/lib/components/Card/Card.styles.js +6 -1
  48. package/lib/components/RockerButtonGroup/RockerButtonGroup.mdx +1 -1
  49. package/lib/components/Table/Table.stories.js +5 -6
  50. package/lib/components/Table/Table.styles.js +8 -6
  51. package/lib/components/TableBase/TableBase.js +221 -0
  52. package/lib/components/TableBase/TableBase.mdx +30 -0
  53. package/lib/components/TableBase/TableBase.stories.js +100 -0
  54. package/lib/components/TableBase/TableBase.styles.js +72 -0
  55. package/lib/components/TableBase/TableBase.test.js +119 -0
  56. package/lib/components/TableBase/index.js +1 -0
  57. package/lib/components/TableBase/stories/NextGenDarkTableBase.chromatic.stories.js +12 -0
  58. package/lib/components/TableBase/stories/NextGenTableBase.chromatic.stories.js +12 -0
  59. package/lib/components/TableBase/stories/NextGenTableBase.js +58 -0
  60. package/lib/index.js +3 -2
  61. package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +22 -0
  62. package/lib/styles/themes/next-gen/colors/colors.js +2 -1
  63. package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
  64. package/lib/styles/themes/next-gen/variants/cards.js +7 -2
  65. package/lib/styles/themes/next-gen/variants/table.js +57 -0
  66. package/lib/styles/themes/next-gen/variants/tableBase.js +91 -0
  67. package/lib/styles/themes/next-gen/variants/variants.js +5 -1
  68. package/lib/styles/variants/variants.js +5 -2
  69. package/lib/types/cell.js +1 -0
  70. package/lib/types/tableBase.js +1 -0
  71. package/lib/utils/devUtils/constants/items.js +79 -0
  72. package/package.json +1 -1
@@ -1328,5 +1328,136 @@ declare const _default: {
1328
1328
  color: string;
1329
1329
  };
1330
1330
  };
1331
+ table: {
1332
+ container: {
1333
+ overflow: string;
1334
+ };
1335
+ caption: {
1336
+ px: string;
1337
+ color: string;
1338
+ borderBottom: string;
1339
+ borderBottomColor: string;
1340
+ };
1341
+ head: {
1342
+ px: string;
1343
+ py: string;
1344
+ fontSize: string;
1345
+ fontWeight: string;
1346
+ color: string;
1347
+ lineHeight: string;
1348
+ };
1349
+ body: {
1350
+ borderTopColor: string;
1351
+ borderBottom: string;
1352
+ backgroundColor: string;
1353
+ borderBottomLeftRadius: string;
1354
+ borderBottomRightRadius: string;
1355
+ '&& > tr:not(:last-child)': {
1356
+ borderBottom: string;
1357
+ borderBottomColor: string;
1358
+ };
1359
+ '&& > tr:nth-of-type(odd) ': {
1360
+ backgroundColor: string;
1361
+ };
1362
+ '&& > tr:last-child': {
1363
+ borderBottomLeftRadius: string;
1364
+ borderBottomRightRadius: string;
1365
+ };
1366
+ };
1367
+ data: {
1368
+ py: string;
1369
+ fontWeight: string;
1370
+ px: string;
1371
+ fontSize: string;
1372
+ color: string;
1373
+ lineHeight: string;
1374
+ };
1375
+ };
1376
+ tableBase: {
1377
+ caption: {
1378
+ backgroundColor: string;
1379
+ px: string;
1380
+ color: string;
1381
+ borderBottom: string;
1382
+ borderBottomColor: string;
1383
+ borderTopLeftRadius: string;
1384
+ borderTopRightRadius: string;
1385
+ };
1386
+ row: {
1387
+ borderBottom: string;
1388
+ borderBottomColor: string;
1389
+ '&.is-focused': {
1390
+ outlineOffset: string;
1391
+ outline: string;
1392
+ outlineColor: string;
1393
+ };
1394
+ '&.is-hovered': {
1395
+ bg: string;
1396
+ };
1397
+ '&:nth-of-type(odd)': {
1398
+ bg: string;
1399
+ '&.is-hovered': {
1400
+ bg: string;
1401
+ };
1402
+ };
1403
+ };
1404
+ thead: {
1405
+ backgroundColor: string;
1406
+ '&:not(.has-caption)': {
1407
+ '& > tr:first-child': {
1408
+ borderTopLeftRadius: string;
1409
+ borderTopRightRadius: string;
1410
+ '& > th:first-of-type': {
1411
+ borderTopLeftRadius: string;
1412
+ };
1413
+ '& > th:last-of-type': {
1414
+ borderTopRightRadius: string;
1415
+ };
1416
+ };
1417
+ };
1418
+ };
1419
+ head: {
1420
+ px: string;
1421
+ py: string;
1422
+ fontSize: string;
1423
+ fontWeight: string;
1424
+ color: string;
1425
+ lineHeight: string;
1426
+ '&.is-focused': {
1427
+ outlineOffset: string;
1428
+ outline: string;
1429
+ outlineColor: string;
1430
+ };
1431
+ };
1432
+ tbody: {
1433
+ borderTopColor: string;
1434
+ borderBottom: string;
1435
+ backgroundColor: string;
1436
+ '& > tr:last-child': {
1437
+ borderBottom: string;
1438
+ borderBottomLeftRadius: string;
1439
+ borderBottomRightRadius: string;
1440
+ '& > td:first-of-type': {
1441
+ borderBottomLeftRadius: string;
1442
+ };
1443
+ '& > td:last-of-type': {
1444
+ borderBottomRightRadius: string;
1445
+ };
1446
+ };
1447
+ };
1448
+ data: {
1449
+ py: string;
1450
+ fontWeight: string;
1451
+ px: string;
1452
+ fontSize: string;
1453
+ color: string;
1454
+ lineHeight: string;
1455
+ '&.is-focused': {
1456
+ outlineOffset: string;
1457
+ outline: string;
1458
+ outlineColor: string;
1459
+ };
1460
+ };
1461
+ };
1331
1462
  };
1332
1463
  export default _default;
@@ -31,6 +31,8 @@ var _prompt = _interopRequireDefault(require("./prompt"));
31
31
  var _response = _interopRequireDefault(require("./response"));
32
32
  var _suggestion = _interopRequireDefault(require("./suggestion"));
33
33
  var _suggestions = _interopRequireDefault(require("./suggestions"));
34
+ var _table = require("./table");
35
+ var _tableBase = require("./tableBase");
34
36
  var _tabs = require("./tabs");
35
37
  var _tooltip = _interopRequireDefault(require("./tooltip"));
36
38
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -389,6 +391,8 @@ var _default = {
389
391
  rockerButton: rockerButton,
390
392
  tooltip: _tooltip["default"],
391
393
  footer: _footer.footer,
392
- loader: loader
394
+ loader: loader,
395
+ table: _table.table,
396
+ tableBase: _tableBase.tableBase
393
397
  };
394
398
  exports["default"] = _default;
@@ -59,6 +59,7 @@ var _Skeleton = _interopRequireDefault(require("../../components/Skeleton/Skelet
59
59
  var _Slider = _interopRequireDefault(require("../../components/SliderField/Slider.styles"));
60
60
  var _Stepper = _interopRequireDefault(require("../../components/Stepper/Stepper.styles"));
61
61
  var _Table = _interopRequireDefault(require("../../components/Table/Table.styles"));
62
+ var _TableBase = _interopRequireDefault(require("../../components/TableBase/TableBase.styles"));
62
63
  var tab = _interopRequireWildcard(require("../../components/Tabs/Tabs.style"));
63
64
  var _TimeField = _interopRequireDefault(require("../../components/TimeField/TimeField.styles"));
64
65
  var _TimeZone = _interopRequireDefault(require("../../components/TimeZonePicker/TimeZone.styles"));
@@ -68,7 +69,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "functi
68
69
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
69
70
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
70
71
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
71
- var _default = _objectSpread({
72
+ var _default = _objectSpread(_objectSpread({
72
73
  accordion: _Accordion["default"],
73
74
  accordionGrid: _AccordionGrid["default"],
74
75
  box: _Box["default"],
@@ -116,5 +117,7 @@ var _default = _objectSpread({
116
117
  timeZone: _TimeZone["default"],
117
118
  tooltip: _Tooltip["default"],
118
119
  treeView: _TreeView["default"]
119
- }, tab);
120
+ }, tab), {}, {
121
+ tableBase: _TableBase["default"]
122
+ });
120
123
  exports["default"] = _default;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { StyleProps } from './shared';
3
+ declare module '@react-types/table' {
4
+ interface CellProps extends StyleProps {
5
+ /** Whether the cell should not wrap its contents. */
6
+ noWrap?: boolean;
7
+ /** The contents of the cell. */
8
+ children: React.ReactNode;
9
+ /** A string representation of the cell's contents, used for features like typeahead. */
10
+ textValue?: string;
11
+ }
12
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -0,0 +1,45 @@
1
+ import { Key, ReactNode } from 'react';
2
+ import type { TableState } from '@react-stately/table';
3
+ import type { GridNode } from '@react-types/grid';
4
+ import type { Node } from '@react-types/shared';
5
+ import { TestingAttributes } from './shared/test';
6
+ import { BoxProps } from './box';
7
+ import { DOMAttributes } from './shared';
8
+ export interface TableBaseProp extends BoxProps, TestingAttributes, DOMAttributes {
9
+ }
10
+ export interface TableBaseProps extends TableBaseProp {
11
+ 'aria-label'?: string;
12
+ selectedKeys?: Key[];
13
+ defaultSelectedKeys?: Key[];
14
+ selectionMode?: 'single' | 'none';
15
+ 'data-testid'?: string;
16
+ caption?: ReactNode | string;
17
+ tableBodyProps?: Record<string, unknown>;
18
+ }
19
+ export interface TableRowGroupProps extends TableBaseProp {
20
+ type: 'thead' | 'tbody' | 'tfoot';
21
+ children: ReactNode;
22
+ hasCaption?: boolean;
23
+ }
24
+ export interface TableHeaderRowProps extends TableBaseProp {
25
+ item: Node<object>;
26
+ state: TableState<object>;
27
+ children: ReactNode;
28
+ className?: string;
29
+ }
30
+ export interface TableColumnHeaderProps extends TableBaseProp {
31
+ column: GridNode<object>;
32
+ state: TableState<object>;
33
+ className?: string;
34
+ }
35
+ export interface TableRowProps extends TableBaseProp {
36
+ item: Node<object>;
37
+ state: TableState<object>;
38
+ children: ReactNode;
39
+ className?: string;
40
+ }
41
+ export interface TableCellProps extends TableBaseProp {
42
+ cell: GridNode<object>;
43
+ state: TableState<object>;
44
+ className?: string;
45
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -0,0 +1,10 @@
1
+ import { Key } from 'react';
2
+ interface Item {
3
+ id: Key;
4
+ email: string;
5
+ firstName: string;
6
+ lastName: string;
7
+ status: 'Pending' | 'Active' | 'Failed' | 'Rejected';
8
+ }
9
+ export declare const items: Item[];
10
+ export {};
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.items = void 0;
8
+ var items = [{
9
+ id: '1',
10
+ email: 'dburkitt5@columbia.edu',
11
+ firstName: 'Nicola',
12
+ lastName: 'Burkitt',
13
+ status: 'Failed'
14
+ }, {
15
+ id: '2',
16
+ email: 'idixie2@elegantthemes.com',
17
+ firstName: 'Cacilia',
18
+ lastName: 'Dixie',
19
+ status: 'Active'
20
+ }, {
21
+ id: '3',
22
+ email: 'dfowler0@rambler.ru',
23
+ firstName: 'Stavro',
24
+ lastName: 'Fowler',
25
+ status: 'Active'
26
+ }, {
27
+ id: '4',
28
+ email: 'jgolde8@jimdo.com',
29
+ firstName: 'Celisse',
30
+ lastName: 'Golde',
31
+ status: 'Active'
32
+ }, {
33
+ id: '5',
34
+ email: 'shearst9@answers.com',
35
+ firstName: 'Jeth',
36
+ lastName: 'Hearst',
37
+ status: 'Pending'
38
+ }, {
39
+ id: '6',
40
+ email: 'ajinaa@mapquest.com',
41
+ firstName: 'Kaycee',
42
+ lastName: 'Jina',
43
+ status: 'Active'
44
+ }, {
45
+ id: '7',
46
+ email: 'vmalster4@biblegateway.com',
47
+ firstName: 'Lorry',
48
+ lastName: 'Malster',
49
+ status: 'Pending'
50
+ }, {
51
+ id: '8',
52
+ email: 'yphipp6@yellowpages.com',
53
+ firstName: 'Stanley',
54
+ lastName: 'Phipp',
55
+ status: 'Active'
56
+ }, {
57
+ id: '9',
58
+ email: 'mskilbeck3@bbc.co.uk',
59
+ firstName: 'Gradey',
60
+ lastName: 'Skilbeck',
61
+ status: 'Pending'
62
+ }, {
63
+ id: '10',
64
+ email: 'dstebbing1@msu.edu',
65
+ firstName: 'Marnia',
66
+ lastName: 'Stebbing',
67
+ status: 'Rejected'
68
+ }, {
69
+ id: '11',
70
+ email: 'lsterley7@lulu.com',
71
+ firstName: 'Joshua',
72
+ lastName: 'Sterley',
73
+ status: 'Pending'
74
+ }, {
75
+ id: '12',
76
+ email: 'luttleyb@hugedomains.com',
77
+ firstName: 'Jarrod',
78
+ lastName: 'Uttley',
79
+ status: 'Active'
80
+ }, {
81
+ id: '13',
82
+ email: 'lidelc@yelp.com',
83
+ firstName: 'Andromache',
84
+ lastName: 'Idel',
85
+ status: 'Pending'
86
+ }];
87
+ exports.items = items;
@@ -85,6 +85,10 @@ var activeCard = _objectSpread(_objectSpread({}, interactive), {}, {
85
85
  }
86
86
  }
87
87
  });
88
+ var tableWrapper = _objectSpread(_objectSpread({}, container), {}, {
89
+ padding: 0,
90
+ boxShadow: 'none'
91
+ });
88
92
  export default {
89
93
  container: container,
90
94
  interactive: interactive,
@@ -92,5 +96,6 @@ export default {
92
96
  footer: footer,
93
97
  flat: flat,
94
98
  body: body,
95
- activeCard: activeCard
99
+ activeCard: activeCard,
100
+ tableWrapper: tableWrapper
96
101
  };
@@ -10,7 +10,7 @@ This component should:
10
10
  - Be used for a single-item selection.
11
11
  - Contain concise labels.
12
12
 
13
- It shouldn’t be used as a replacement for RadioButton.
13
+ It should not be used as a replacement for RadioButton.
14
14
 
15
15
  ### Required Components
16
16
 
@@ -2,7 +2,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
2
2
  import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
3
3
  import React from 'react';
4
4
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
5
- import { Table, TableBody, TableCaption, TableCell, TableHead, TableRow, Text } from '../../index';
5
+ import { Card, Table, TableBody, TableCaption, TableCell, TableHead, TableRow } from '../../index';
6
6
  import TableReadme from './Table.mdx';
7
7
  import { jsx as ___EmotionJSX } from "@emotion/react";
8
8
  export default {
@@ -46,10 +46,9 @@ var objects = [{
46
46
  total_grant: '75,000'
47
47
  }];
48
48
  export var Default = function Default(args) {
49
- return ___EmotionJSX(Table, args, ___EmotionJSX(TableCaption, null, ___EmotionJSX(Text, {
50
- fontWeight: 3,
51
- fontSize: "lg"
52
- }, caption)), ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
49
+ return ___EmotionJSX(Card, {
50
+ variant: "cards.tableWrapper"
51
+ }, ___EmotionJSX(Table, args, ___EmotionJSX(TableCaption, null, caption), ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
53
52
  key: "head"
54
53
  }, _mapInstanceProperty(headers).call(headers, function (head) {
55
54
  return ___EmotionJSX(TableCell, {
@@ -65,5 +64,5 @@ export var Default = function Default(args) {
65
64
  key: value
66
65
  }, value);
67
66
  }));
68
- })));
67
+ }))));
69
68
  };
@@ -14,18 +14,18 @@ var head = _objectSpread(_objectSpread({}, text.label), {}, {
14
14
  fontWeight: 500,
15
15
  width: '100%',
16
16
  flexDirection: 'row !important',
17
- p: '10px'
17
+ p: 'sm'
18
18
  });
19
19
  var data = _objectSpread(_objectSpread({}, text.tableData), {}, {
20
20
  width: '100%',
21
- p: '10px'
21
+ p: 'sm'
22
22
  });
23
23
  var body = {
24
24
  borderTop: '1px solid',
25
25
  borderTopColor: 'neutral.40',
26
26
  borderBottom: '1px solid',
27
27
  borderBottomColor: 'neutral.80',
28
- '&& > tr:nth-of-type(odd) ': {
28
+ '& > tr:nth-of-type(odd)': {
29
29
  backgroundColor: 'neutral.95'
30
30
  }
31
31
  };
@@ -37,9 +37,11 @@ var container = {
37
37
  width: '100%'
38
38
  };
39
39
  var caption = {
40
- textAlign: 'left',
41
- marginBottom: 'xs',
42
- lineHeight: '21px'
40
+ fontFamily: 'standard',
41
+ fontSize: 'lg',
42
+ fontWeight: '2',
43
+ p: 'sm',
44
+ textAlign: 'left'
43
45
  };
44
46
  export default {
45
47
  body: body,
@@ -0,0 +1,221 @@
1
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
4
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
10
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
12
+ var _excluded = ["caption", "selectionMode", "selectedKeys", "defaultSelectedKeys", "tableBodyProps"],
13
+ _excluded2 = ["type", "children", "hasCaption", "className"];
14
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
15
+ import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
16
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+ import React, { forwardRef, useRef } from 'react';
19
+ import { useFocusRing } from '@react-aria/focus';
20
+ import { useHover, usePress } from '@react-aria/interactions';
21
+ import { useTable, useTableCell, useTableColumnHeader, useTableHeaderRow, useTableRow, useTableRowGroup } from '@react-aria/table';
22
+ import { mergeProps } from '@react-aria/utils';
23
+ import { useTableState } from '@react-stately/table';
24
+ import { Box } from '../..';
25
+ import { useLocalOrForwardRef, useStatusClasses } from '../../hooks';
26
+ import { jsx as ___EmotionJSX } from "@emotion/react";
27
+ var TableBase = /*#__PURE__*/forwardRef(function (props, ref) {
28
+ var _context, _context3;
29
+ var caption = props.caption,
30
+ selectionMode = props.selectionMode,
31
+ selectedKeys = props.selectedKeys,
32
+ _props$defaultSelecte = props.defaultSelectedKeys,
33
+ defaultSelectedKeys = _props$defaultSelecte === void 0 ? [] : _props$defaultSelecte,
34
+ tableBodyProps = props.tableBodyProps,
35
+ others = _objectWithoutProperties(props, _excluded);
36
+ var state = useTableState(_objectSpread(_objectSpread({}, props), {}, {
37
+ selectionMode: selectionMode,
38
+ selectedKeys: selectedKeys,
39
+ defaultSelectedKeys: selectedKeys ? undefined : defaultSelectedKeys
40
+ }));
41
+ var tableRef = useLocalOrForwardRef(ref);
42
+ var bodyRef = useRef(null);
43
+ var collection = state.collection;
44
+ var _useTable = useTable(_objectSpread(_objectSpread({}, props), {}, {
45
+ 'aria-describedby': props['aria-describedby'] || 'table-caption',
46
+ scrollRef: bodyRef
47
+ }), state, tableRef),
48
+ gridProps = _useTable.gridProps;
49
+ return ___EmotionJSX(Box, _extends({
50
+ as: "table",
51
+ display: "table",
52
+ variant: "tableBase.container",
53
+ ref: tableRef
54
+ }, gridProps, others), caption && ___EmotionJSX(Box, {
55
+ as: "caption",
56
+ display: "table-caption",
57
+ variant: "tableBase.caption",
58
+ textAlign: "left",
59
+ id: props['aria-describedby'] || 'table-caption'
60
+ }, caption), ___EmotionJSX(TableRowGroup, {
61
+ type: "thead",
62
+ hasCaption: !!caption
63
+ }, _mapInstanceProperty(_context = collection.headerRows).call(_context, function (headerRow) {
64
+ var _context2, _state$collection$get, _state$collection;
65
+ return ___EmotionJSX(TableHeaderRow, {
66
+ key: headerRow.key,
67
+ item: headerRow,
68
+ state: state
69
+ }, _mapInstanceProperty(_context2 = _Array$from(((_state$collection$get = (_state$collection = state.collection).getChildren) === null || _state$collection$get === void 0 ? void 0 : _state$collection$get.call(_state$collection, headerRow.key)) || [])).call(_context2, function (column) {
70
+ return ___EmotionJSX(TableColumnHeader, {
71
+ key: column.key,
72
+ column: column,
73
+ state: state
74
+ });
75
+ }));
76
+ })), ___EmotionJSX(TableRowGroup, _extends({
77
+ ref: bodyRef,
78
+ type: "tbody"
79
+ }, tableBodyProps), _mapInstanceProperty(_context3 = _Array$from(collection)).call(_context3, function (row) {
80
+ var _context4;
81
+ return ___EmotionJSX(TableRow, {
82
+ key: row.key,
83
+ item: row,
84
+ state: state
85
+ }, _mapInstanceProperty(_context4 = _Array$from(state.collection.getChildren(row.key))).call(_context4, function (cell) {
86
+ return ___EmotionJSX(TableCell, {
87
+ key: cell.key,
88
+ cell: cell,
89
+ state: state
90
+ });
91
+ }));
92
+ })));
93
+ });
94
+ export default TableBase;
95
+ export var TableRowGroup = /*#__PURE__*/forwardRef(function (props, ref) {
96
+ var type = props.type,
97
+ children = props.children,
98
+ hasCaption = props.hasCaption,
99
+ className = props.className,
100
+ others = _objectWithoutProperties(props, _excluded2);
101
+ var _useTableRowGroup = useTableRowGroup(),
102
+ rowGroupProps = _useTableRowGroup.rowGroupProps;
103
+ var _useStatusClasses = useStatusClasses(className, {
104
+ hasCaption: hasCaption
105
+ }),
106
+ classNames = _useStatusClasses.classNames;
107
+ return ___EmotionJSX(Box, _extends({
108
+ ref: ref
109
+ }, rowGroupProps, {
110
+ as: type,
111
+ className: classNames,
112
+ display: "table-row-group",
113
+ variant: "tableBase.".concat(type)
114
+ }, others), children);
115
+ });
116
+ export var TableHeaderRow = function TableHeaderRow(props) {
117
+ var item = props.item,
118
+ state = props.state,
119
+ children = props.children;
120
+ var ref = useRef(null);
121
+ var _useTableHeaderRow = useTableHeaderRow({
122
+ node: item
123
+ }, state, ref),
124
+ rowProps = _useTableHeaderRow.rowProps;
125
+ return ___EmotionJSX(Box, _extends({
126
+ as: "tr",
127
+ display: "table-row"
128
+ }, rowProps, {
129
+ ref: ref
130
+ }), children);
131
+ };
132
+ export var TableColumnHeader = function TableColumnHeader(props) {
133
+ var column = props.column,
134
+ state = props.state,
135
+ className = props.className;
136
+ var ref = useRef(null);
137
+ var _useTableColumnHeader = useTableColumnHeader({
138
+ node: column
139
+ }, state, ref),
140
+ columnHeaderProps = _useTableColumnHeader.columnHeaderProps;
141
+ var _useFocusRing = useFocusRing(),
142
+ isFocusVisible = _useFocusRing.isFocusVisible,
143
+ focusProps = _useFocusRing.focusProps;
144
+ var _useStatusClasses2 = useStatusClasses(className, {
145
+ isFocused: isFocusVisible
146
+ }),
147
+ classNames = _useStatusClasses2.classNames;
148
+ return ___EmotionJSX(Box, _extends({
149
+ as: "th",
150
+ display: "table-cell",
151
+ variant: "tableBase.head",
152
+ className: classNames
153
+ }, mergeProps(columnHeaderProps, focusProps), {
154
+ ref: ref
155
+ }, column.props), column.rendered);
156
+ };
157
+ export var TableRow = function TableRow(props) {
158
+ var item = props.item,
159
+ state = props.state,
160
+ children = props.children,
161
+ className = props.className;
162
+ var ref = useRef(null);
163
+ var _useTableRow = useTableRow({
164
+ node: item
165
+ }, state, ref),
166
+ rowProps = _useTableRow.rowProps;
167
+ var isSelected = state.selectionManager.isSelected(item.key);
168
+ var _useFocusRing2 = useFocusRing(),
169
+ isFocusVisible = _useFocusRing2.isFocusVisible,
170
+ focusProps = _useFocusRing2.focusProps;
171
+ var _useHover = useHover({}),
172
+ hoverProps = _useHover.hoverProps,
173
+ isHovered = _useHover.isHovered;
174
+ var _usePress = usePress({
175
+ ref: ref
176
+ }),
177
+ pressProps = _usePress.pressProps,
178
+ isPressed = _usePress.isPressed;
179
+ var _useStatusClasses3 = useStatusClasses(className, {
180
+ isSelected: isSelected,
181
+ isHovered: isHovered,
182
+ isPressed: isPressed,
183
+ isFocused: isFocusVisible
184
+ }),
185
+ classNames = _useStatusClasses3.classNames;
186
+ return ___EmotionJSX(Box, _extends({
187
+ display: "table-row",
188
+ as: "tr",
189
+ className: classNames,
190
+ variant: "tableBase.row"
191
+ }, mergeProps(rowProps, focusProps, hoverProps, pressProps), {
192
+ ref: ref
193
+ }), children);
194
+ };
195
+ export function TableCell(props) {
196
+ var _cell$props$noWrap;
197
+ var cell = props.cell,
198
+ state = props.state,
199
+ className = props.className;
200
+ var ref = useRef(null);
201
+ var _useTableCell = useTableCell({
202
+ node: cell
203
+ }, state, ref),
204
+ gridCellProps = _useTableCell.gridCellProps;
205
+ var _useFocusRing3 = useFocusRing(),
206
+ isFocusVisible = _useFocusRing3.isFocusVisible,
207
+ focusProps = _useFocusRing3.focusProps;
208
+ var _useStatusClasses4 = useStatusClasses(className, {
209
+ isFocused: isFocusVisible,
210
+ noWrap: (_cell$props$noWrap = cell.props.noWrap) !== null && _cell$props$noWrap !== void 0 ? _cell$props$noWrap : false
211
+ }),
212
+ classNames = _useStatusClasses4.classNames;
213
+ return ___EmotionJSX(Box, _extends({
214
+ as: "td",
215
+ display: "table-cell",
216
+ className: classNames
217
+ }, mergeProps(gridCellProps, focusProps), {
218
+ variant: "tableBase.data",
219
+ ref: ref
220
+ }, cell.props), cell.rendered);
221
+ }