@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
@@ -0,0 +1,30 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="Components/Table/Table" />
4
+
5
+ # Table
6
+
7
+ Data tables display information in a grid-like format of rows and columns.
8
+ They organize information in a way that’s easy to scan so that users can look for patterns and develop insights from data.
9
+
10
+ Column header names describe the type of content displayed in each column.
11
+ Each row contains data related to a single entity.
12
+
13
+ Tables should:
14
+ - Have consistently aligned content.
15
+ - Use multiple heading rows for higher-level grouping of the columns.
16
+ - Use column dividers sparingly.
17
+
18
+ Tables shouldn’t use different indicators to represent empty fields.
19
+
20
+ This basic component is rendered as an HTML `<table>`, which accepts the `<TableBody>` component and the `<TableHead>` as children.
21
+
22
+ ### Required Components
23
+
24
+ This component requires these additional components:
25
+
26
+ - TableCaption
27
+ - TableHead
28
+ - TableRow
29
+ - TableCell
30
+ - TableBody
@@ -0,0 +1,100 @@
1
+ import React from 'react';
2
+ import DocsLayout from '../../../.storybook/storybookDocsLayout';
3
+ import { Badge, Card, Cell, Column, Row, TableBase, TBody, THead } from '../..';
4
+ import { items } from '../../utils/devUtils/constants/items';
5
+ import TableReadme from './TableBase.mdx';
6
+ import { jsx as ___EmotionJSX } from "@emotion/react";
7
+ export default {
8
+ title: 'Experimental/Table',
9
+ component: TableBase,
10
+ parameters: {
11
+ docs: {
12
+ page: function page() {
13
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(TableReadme, null), ___EmotionJSX(DocsLayout, null));
14
+ }
15
+ }
16
+ }
17
+ };
18
+ var headers = [{
19
+ key: 'type',
20
+ name: 'Type'
21
+ }, {
22
+ key: 'date',
23
+ name: 'Date'
24
+ }, {
25
+ key: 'additional_grant',
26
+ name: 'Additional Grant'
27
+ }, {
28
+ key: 'total_grant',
29
+ name: 'Total Grant'
30
+ }];
31
+ var objects = [{
32
+ id: 1,
33
+ type: 'Lorem ipsum',
34
+ date: '2020-06-12',
35
+ additional_grant: '+25,000',
36
+ total_grant: '25,000'
37
+ }, {
38
+ id: 2,
39
+ type: 'Lorem ipsum',
40
+ date: '2020-10-01',
41
+ additional_grant: '+25,000',
42
+ total_grant: '50,000'
43
+ }, {
44
+ id: 3,
45
+ type: 'Lorem ipsum',
46
+ date: '2021-01-01',
47
+ additional_grant: '+25,000',
48
+ total_grant: '75,000'
49
+ }];
50
+ export var Default = function Default() {
51
+ return ___EmotionJSX(Card, {
52
+ variant: "cards.tableWrapper"
53
+ }, ___EmotionJSX(TableBase, {
54
+ caption: "Lorem ipsum",
55
+ "aria-label": "table"
56
+ }, ___EmotionJSX(THead, {
57
+ columns: headers
58
+ }, function (column) {
59
+ return ___EmotionJSX(Column, {
60
+ key: column.key
61
+ }, column.name);
62
+ }), ___EmotionJSX(TBody, {
63
+ items: objects
64
+ }, function (item) {
65
+ return ___EmotionJSX(Row, {
66
+ key: item.id
67
+ }, function (columnKey) {
68
+ return ___EmotionJSX(Cell, null, item[columnKey]);
69
+ });
70
+ })));
71
+ };
72
+ export var Customization = function Customization() {
73
+ var statusVariant = {
74
+ 'Pending': 'warningStatusBadge',
75
+ 'Failed': 'criticalStatusBadge',
76
+ 'Rejected': 'criticalStatusBadge',
77
+ 'Active': 'healthyStatusBadge',
78
+ 'Inactive': 'secondaryStatusBadge'
79
+ };
80
+ return ___EmotionJSX(Card, {
81
+ variant: "cards.tableWrapper"
82
+ }, ___EmotionJSX(TableBase, {
83
+ "aria-label": "table"
84
+ }, ___EmotionJSX(THead, null, ___EmotionJSX(Column, {
85
+ width: 70
86
+ }, "#"), ___EmotionJSX(Column, null, "Name"), ___EmotionJSX(Column, null, "Email"), ___EmotionJSX(Column, null, "Status"), ___EmotionJSX(Column, null, "Bio")), ___EmotionJSX(TBody, {
87
+ items: items
88
+ }, function (item) {
89
+ return ___EmotionJSX(Row, {
90
+ key: item.email
91
+ }, ___EmotionJSX(Cell, null, item.id), ___EmotionJSX(Cell, {
92
+ noWrap: true
93
+ }, item.firstName, ' ', item.lastName), ___EmotionJSX(Cell, {
94
+ noWrap: true
95
+ }, item.email), ___EmotionJSX(Cell, null, ___EmotionJSX(Badge, {
96
+ variant: statusVariant[item.status],
97
+ label: item.status
98
+ })), ___EmotionJSX(Cell, null, "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo quidem accusantium architecto tempore facere!"));
99
+ })));
100
+ };
@@ -0,0 +1,72 @@
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 _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
+ 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; }
11
+ 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) { _defineProperty(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; }
12
+ import { text } from '../Text/Text.styles';
13
+ var defaultFocus = {
14
+ outline: '1px',
15
+ outlineStyle: 'solid',
16
+ outlineColor: 'focus',
17
+ outlineOffset: '-1px'
18
+ };
19
+ var container = {
20
+ width: '100%',
21
+ borderSpacing: '0',
22
+ borderCollapse: 'collapse'
23
+ };
24
+ var caption = {
25
+ fontFamily: 'standard',
26
+ fontSize: 'lg',
27
+ fontWeight: '2',
28
+ p: 'sm',
29
+ textAlign: 'left'
30
+ };
31
+ var thead = {};
32
+ var head = _objectSpread(_objectSpread({}, text.label), {}, {
33
+ fontWeight: 500,
34
+ textAlign: 'left',
35
+ p: 'sm',
36
+ cursor: 'default',
37
+ '&.is-focused': _objectSpread({}, defaultFocus)
38
+ });
39
+ var tbody = {
40
+ borderTop: '1px solid',
41
+ borderTopColor: 'neutral.40',
42
+ borderBottom: '1px solid',
43
+ borderBottomColor: 'neutral.80'
44
+ };
45
+ var row = {
46
+ '&:nth-of-type(odd) ': {
47
+ bg: 'neutral.95'
48
+ },
49
+ '&.is-focused': _objectSpread({}, defaultFocus),
50
+ '&.is-hovered': {
51
+ // This is the hover state for the row
52
+ },
53
+ '&.is-selected': {
54
+ // This is the selected state for the row
55
+ }
56
+ };
57
+ var data = _objectSpread(_objectSpread({}, text.tableData), {}, {
58
+ p: 'sm',
59
+ '&.no-wrap': {
60
+ whiteSpace: 'nowrap'
61
+ },
62
+ '&.is-focused': _objectSpread({}, defaultFocus)
63
+ });
64
+ export default {
65
+ thead: thead,
66
+ tbody: tbody,
67
+ caption: caption,
68
+ container: container,
69
+ data: data,
70
+ head: head,
71
+ row: row
72
+ };
@@ -0,0 +1,119 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
3
+ import React from 'react';
4
+ import { render, screen } from '@testing-library/react';
5
+ import { Cell, Column, Row, TBody, THead } from '../../index';
6
+ import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
7
+ import TableBase from './TableBase';
8
+ import { jsx as ___EmotionJSX } from "@emotion/react";
9
+ var testId = 'test-table';
10
+ var defaultProps = {
11
+ 'aria-label': 'table',
12
+ 'data-testid': testId,
13
+ caption: 'Populations of Countries'
14
+ };
15
+ var headers = [{
16
+ key: 'country',
17
+ name: 'Country'
18
+ }, {
19
+ key: 'population',
20
+ name: 'Population'
21
+ }, {
22
+ key: 'continent',
23
+ name: 'Continent'
24
+ }];
25
+ var objects = [{
26
+ key: '1',
27
+ country: 'USA',
28
+ population: '320,000,000',
29
+ continent: 'South America',
30
+ cellProps: {
31
+ noWrap: true
32
+ }
33
+ }, {
34
+ key: '2',
35
+ country: 'Canada',
36
+ population: '37,000,000',
37
+ continent: 'North America'
38
+ }, {
39
+ key: '3',
40
+ country: 'China',
41
+ population: '1,398,000,000',
42
+ continent: 'Asia'
43
+ }, {
44
+ key: '4',
45
+ country: 'France',
46
+ population: '67,000,000',
47
+ continent: 'Europe'
48
+ }];
49
+ var getComponent = function getComponent() {
50
+ return render(___EmotionJSX(TableBase, defaultProps, ___EmotionJSX(THead, {
51
+ columns: headers
52
+ }, function (head) {
53
+ return ___EmotionJSX(Column, {
54
+ key: head.key
55
+ }, head.name);
56
+ }), ___EmotionJSX(TBody, {
57
+ items: objects
58
+ }, function (row) {
59
+ return ___EmotionJSX(Row, {
60
+ key: row.key
61
+ }, function (columnKey) {
62
+ return ___EmotionJSX(Cell, row.cellProps || {}, row[columnKey]);
63
+ });
64
+ })));
65
+ };
66
+
67
+ // Needs to be added to each components test file
68
+ universalComponentTests({
69
+ renderComponent: function renderComponent(props) {
70
+ return ___EmotionJSX(TableBase, _extends({}, defaultProps, props), ___EmotionJSX(THead, {
71
+ columns: headers
72
+ }, function (head) {
73
+ return ___EmotionJSX(Column, {
74
+ key: head.key
75
+ }, head.name);
76
+ }), ___EmotionJSX(TBody, {
77
+ items: objects
78
+ }, function (row) {
79
+ return ___EmotionJSX(Row, {
80
+ key: row.key
81
+ }, function (columnKey) {
82
+ return ___EmotionJSX(Cell, null, row[columnKey]);
83
+ });
84
+ }));
85
+ }
86
+ });
87
+ test('default table', function () {
88
+ getComponent();
89
+ var table = screen.getByTestId(testId);
90
+ expect(table).toBeInTheDocument();
91
+ });
92
+ test('renders caption', function () {
93
+ getComponent();
94
+ var caption = screen.getByText(defaultProps.caption);
95
+ expect(caption).toBeInTheDocument();
96
+ });
97
+ test('renders table headers', function () {
98
+ getComponent();
99
+ var headerCells = screen.getAllByRole('columnheader');
100
+ expect(headerCells).toHaveLength(headers.length);
101
+ _forEachInstanceProperty(headers).call(headers, function (header) {
102
+ expect(screen.getByText(header.name)).toBeInTheDocument();
103
+ });
104
+ });
105
+ test('renders table rows', function () {
106
+ getComponent();
107
+ var rows = screen.getAllByRole('row');
108
+ expect(rows).toHaveLength(objects.length + 1);
109
+ _forEachInstanceProperty(objects).call(objects, function (object) {
110
+ expect(screen.getByText(object.country)).toBeInTheDocument();
111
+ expect(screen.getByText(object.population)).toBeInTheDocument();
112
+ expect(screen.getByText(object.continent)).toBeInTheDocument();
113
+ });
114
+ });
115
+ test('renders cell with noWrap prop', function () {
116
+ getComponent();
117
+ var cell = screen.getByText('South America');
118
+ expect(cell).toHaveClass('no-wrap');
119
+ });
@@ -0,0 +1 @@
1
+ export { default } from './TableBase';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { AstroProvider, NextGenDarkTheme } from '../../..';
3
+ import NextGenTableBase from './NextGenTableBase';
4
+ import { jsx as ___EmotionJSX } from "@emotion/react";
5
+ export default {
6
+ title: 'Chromatic Only Onyx Dark TableBase'
7
+ };
8
+ export var Default = function Default() {
9
+ return ___EmotionJSX(AstroProvider, {
10
+ themeOverrides: [NextGenDarkTheme]
11
+ }, ___EmotionJSX(NextGenTableBase, null));
12
+ };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { AstroProvider, NextGenTheme } from '../../..';
3
+ import NextGenTableBase from './NextGenTableBase';
4
+ import { jsx as ___EmotionJSX } from "@emotion/react";
5
+ export default {
6
+ title: 'Chromatic Only Onyx TableBase'
7
+ };
8
+ export var Default = function Default() {
9
+ return ___EmotionJSX(AstroProvider, {
10
+ themeOverrides: [NextGenTheme]
11
+ }, ___EmotionJSX(NextGenTableBase, null));
12
+ };
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import { Card, Cell, Column, Row, TableBase, TBody, THead } from '../../..';
3
+ import { jsx as ___EmotionJSX } from "@emotion/react";
4
+ var NextGenTableBase = function NextGenTableBase() {
5
+ var headers = [{
6
+ key: 'type',
7
+ name: 'Type'
8
+ }, {
9
+ key: 'date',
10
+ name: 'Date'
11
+ }, {
12
+ key: 'additional_grant',
13
+ name: 'Additional Grant'
14
+ }, {
15
+ key: 'total_grant',
16
+ name: 'Total Grant'
17
+ }];
18
+ var objects = [{
19
+ id: 1,
20
+ type: 'Lorem ipsum',
21
+ date: '2020-06-12',
22
+ additional_grant: '+25,000',
23
+ total_grant: '25,000'
24
+ }, {
25
+ id: 2,
26
+ type: 'Lorem ipsum',
27
+ date: '2020-10-01',
28
+ additional_grant: '+25,000',
29
+ total_grant: '50,000'
30
+ }, {
31
+ id: 3,
32
+ type: 'Lorem ipsum',
33
+ date: '2021-01-01',
34
+ additional_grant: '+25,000',
35
+ total_grant: '75,000'
36
+ }];
37
+ return ___EmotionJSX(Card, {
38
+ variant: "cards.tableWrapper"
39
+ }, ___EmotionJSX(TableBase, {
40
+ caption: "Lorem ipsum",
41
+ "aria-label": "table"
42
+ }, ___EmotionJSX(THead, {
43
+ columns: headers
44
+ }, function (column) {
45
+ return ___EmotionJSX(Column, {
46
+ key: column.key
47
+ }, column.name);
48
+ }), ___EmotionJSX(TBody, {
49
+ items: objects
50
+ }, function (item) {
51
+ return ___EmotionJSX(Row, {
52
+ key: item.id
53
+ }, function (columnKey) {
54
+ return ___EmotionJSX(Cell, null, item[columnKey]);
55
+ });
56
+ })));
57
+ };
58
+ export default NextGenTableBase;
package/lib/index.js CHANGED
@@ -188,6 +188,8 @@ export { default as Tab } from './components/Tab';
188
188
  export * from './components/Tab';
189
189
  export { default as Table } from './components/Table';
190
190
  export * from './components/Table';
191
+ export * from './components/TableBase';
192
+ export { default as TableBase } from './components/TableBase';
191
193
  export { default as TableBody } from './components/TableBody';
192
194
  export * from './components/TableBody';
193
195
  export { default as TableCaption } from './components/TableCaption';
@@ -222,5 +224,4 @@ export { default as NextGenTheme } from './styles/themes/next-gen';
222
224
  export { default as OnyxTheme } from './styles/themes/next-gen';
223
225
  export * from './types';
224
226
  export { OverlayProvider, useOverlayPosition, useOverlayTrigger } from 'react-aria';
225
- export { Item, Section, useOverlayTriggerState, useTreeData } from 'react-stately';
226
- export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow } from 'react-stately';
227
+ export { Cell, Column, TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow, Item, Row, Section, TableBody as TBody, TableHeader as THead, useOverlayTriggerState, useTreeData } from 'react-stately';
@@ -116,5 +116,27 @@ export default {
116
116
  boxShadow: '0 0 0 3px inset #1a73e8'
117
117
  }
118
118
  }
119
+ },
120
+ table: {
121
+ caption: {
122
+ color: 'text.secondary'
123
+ },
124
+ head: {
125
+ color: 'text.secondary'
126
+ },
127
+ data: {
128
+ color: 'text.secondary'
129
+ }
130
+ },
131
+ tableBase: {
132
+ caption: {
133
+ color: 'text.secondary'
134
+ },
135
+ head: {
136
+ color: 'text.secondary'
137
+ },
138
+ data: {
139
+ color: 'text.secondary'
140
+ }
119
141
  }
120
142
  };
@@ -99,7 +99,8 @@ var background = {
99
99
  base: 'white',
100
100
  secondary: nextGenColors['gray-100'],
101
101
  card: nextGenColors['blue-100'],
102
- suggestion: '#ecf0f5'
102
+ suggestion: '#ecf0f5',
103
+ hover: nextGenColors['gray-100']
103
104
  };
104
105
  var card = {
105
106
  blue: nextGenColors['blue-100'],
@@ -1,4 +1,4 @@
1
- var nextGenConvertedComponents = ['DataTable', 'Message', 'Button', 'Badge', 'IconButton', 'CheckboxField', 'Messages', 'PopoverMenu', 'TextField', 'PasswordField', 'SearchField', 'SelectField', 'Modal', 'RadioField', 'MultiValuesField', 'TextAreaField', 'RadioGroupField', 'RockerButtonGroup', 'Tabs', 'ProgressBar', 'NavBar', 'OverlayPanel', 'AstroProvider', 'ListView', 'NavigationHeader', 'Avatar', 'MultivaluesField', 'Text', 'Link', 'Card', 'IconWrapper', 'ComboBoxField', 'CodeView', 'Sticker Sheet', 'NextGen ListViewItem', 'Skeleton', 'TooltipTrigger', 'ListViewItem', 'Pagination'];
1
+ var nextGenConvertedComponents = ['DataTable', 'Message', 'Button', 'Badge', 'IconButton', 'CheckboxField', 'Messages', 'PopoverMenu', 'TextField', 'PasswordField', 'SearchField', 'SelectField', 'Modal', 'RadioField', 'MultiValuesField', 'TextAreaField', 'RadioGroupField', 'RockerButtonGroup', 'Tabs', 'ProgressBar', 'NavBar', 'OverlayPanel', 'AstroProvider', 'ListView', 'NavigationHeader', 'Avatar', 'MultivaluesField', 'Text', 'Link', 'Card', 'IconWrapper', 'ComboBoxField', 'CodeView', 'Sticker Sheet', 'NextGen ListViewItem', 'Skeleton', 'TooltipTrigger', 'ListViewItem', 'Pagination', 'Table', 'TableBase'];
2
2
  export var componentSpecificNextGenBlacklist = {
3
3
  AstroProvider: ['Default', 'With Custom Theme Override'],
4
4
  Badge: ['Status Badge Variants', 'Badge With Left Slot And Icon', 'Callout Badges', 'Removable'],
@@ -28,7 +28,8 @@ var interactive = {
28
28
  }
29
29
  };
30
30
  var container = _objectSpread(_objectSpread({}, flat), {}, {
31
- p: 'lg'
31
+ p: 'lg',
32
+ borderColor: 'border.base'
32
33
  });
33
34
  var dark = _objectSpread(_objectSpread({}, flat), {}, {
34
35
  border: 'none',
@@ -73,6 +74,9 @@ var suggestionRow = _objectSpread(_objectSpread({}, baseSuggestion), {}, {
73
74
  var suggestionColumn = _objectSpread(_objectSpread({}, baseSuggestion), {}, {
74
75
  display: 'flex'
75
76
  });
77
+ var tableWrapper = _objectSpread(_objectSpread({}, container), {}, {
78
+ overflowY: 'hidden'
79
+ });
76
80
  export default {
77
81
  interactive: interactive,
78
82
  dark: dark,
@@ -80,5 +84,6 @@ export default {
80
84
  activeCard: activeCard,
81
85
  container: container,
82
86
  suggestionColumn: suggestionColumn,
83
- suggestionRow: suggestionRow
87
+ suggestionRow: suggestionRow,
88
+ tableWrapper: tableWrapper
84
89
  };
@@ -0,0 +1,57 @@
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 _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
+ 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; }
11
+ 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) { _defineProperty(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; }
12
+ var container = {
13
+ overflow: 'hidden'
14
+ };
15
+ var caption = {
16
+ px: 'lg',
17
+ color: 'text.primary',
18
+ borderBottom: '1px solid',
19
+ borderBottomColor: 'border.base'
20
+ };
21
+ var head = {
22
+ px: 'lg',
23
+ py: 'sm',
24
+ fontSize: 'md',
25
+ fontWeight: '2',
26
+ color: 'text.primary',
27
+ lineHeight: 'body'
28
+ };
29
+ var body = {
30
+ borderTopColor: 'border.base',
31
+ borderBottom: 'unset',
32
+ backgroundColor: 'background.base',
33
+ borderBottomLeftRadius: '16px',
34
+ borderBottomRightRadius: '16px',
35
+ '&& > tr:not(:last-child)': {
36
+ borderBottom: '1px solid',
37
+ borderBottomColor: 'border.base'
38
+ },
39
+ '&& > tr:nth-of-type(odd) ': {
40
+ backgroundColor: 'background.base'
41
+ },
42
+ '&& > tr:last-child': {
43
+ borderBottomLeftRadius: '16px',
44
+ borderBottomRightRadius: '16px'
45
+ }
46
+ };
47
+ var data = _objectSpread(_objectSpread({}, head), {}, {
48
+ py: 'md',
49
+ fontWeight: '1'
50
+ });
51
+ export var table = {
52
+ container: container,
53
+ caption: caption,
54
+ head: head,
55
+ body: body,
56
+ data: data
57
+ };
@@ -0,0 +1,91 @@
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 _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
+ 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; }
11
+ 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) { _defineProperty(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; }
12
+ import { defaultFocus as baseFocus } from './button';
13
+ var borderRadius = '16px';
14
+ var defaultFocus = _objectSpread(_objectSpread({}, baseFocus), {}, {
15
+ outlineOffset: '-2px'
16
+ });
17
+ var caption = {
18
+ backgroundColor: 'background.base',
19
+ px: 'lg',
20
+ color: 'text.primary',
21
+ borderBottom: '1px solid',
22
+ borderBottomColor: 'border.base',
23
+ borderTopLeftRadius: borderRadius,
24
+ borderTopRightRadius: borderRadius
25
+ };
26
+ var row = {
27
+ borderBottom: '1px solid',
28
+ borderBottomColor: 'border.base',
29
+ '&.is-focused': _objectSpread({}, defaultFocus),
30
+ '&.is-hovered': {
31
+ bg: 'background.hover'
32
+ },
33
+ '&:nth-of-type(odd)': {
34
+ bg: 'background.base',
35
+ '&.is-hovered': {
36
+ bg: 'background.hover'
37
+ }
38
+ }
39
+ };
40
+ var thead = {
41
+ backgroundColor: 'background.base',
42
+ '&:not(.has-caption)': {
43
+ '& > tr:first-child': {
44
+ borderTopLeftRadius: borderRadius,
45
+ borderTopRightRadius: borderRadius,
46
+ '& > th:first-of-type': {
47
+ borderTopLeftRadius: borderRadius
48
+ },
49
+ '& > th:last-of-type': {
50
+ borderTopRightRadius: borderRadius
51
+ }
52
+ }
53
+ }
54
+ };
55
+ var head = {
56
+ px: 'lg',
57
+ py: 'sm',
58
+ fontSize: 'md',
59
+ fontWeight: '2',
60
+ color: 'text.primary',
61
+ lineHeight: 'body',
62
+ '&.is-focused': _objectSpread({}, defaultFocus)
63
+ };
64
+ var tbody = {
65
+ borderTopColor: 'border.base',
66
+ borderBottom: 'unset',
67
+ backgroundColor: 'background.base',
68
+ '& > tr:last-child': {
69
+ borderBottom: 'unset',
70
+ borderBottomLeftRadius: borderRadius,
71
+ borderBottomRightRadius: borderRadius,
72
+ '& > td:first-of-type': {
73
+ borderBottomLeftRadius: borderRadius
74
+ },
75
+ '& > td:last-of-type': {
76
+ borderBottomRightRadius: borderRadius
77
+ }
78
+ }
79
+ };
80
+ var data = _objectSpread(_objectSpread({}, head), {}, {
81
+ py: 'md',
82
+ fontWeight: '1'
83
+ });
84
+ export var tableBase = {
85
+ caption: caption,
86
+ row: row,
87
+ thead: thead,
88
+ head: head,
89
+ tbody: tbody,
90
+ data: data
91
+ };
@@ -26,6 +26,8 @@ import prompt from './prompt';
26
26
  import response from './response';
27
27
  import suggestion from './suggestion';
28
28
  import suggestions from './suggestions';
29
+ import { table } from './table';
30
+ import { tableBase } from './tableBase';
29
31
  import { menuTab, tab, tabs } from './tabs';
30
32
  import tooltip from './tooltip';
31
33
  var fieldHelperText = {
@@ -380,5 +382,7 @@ export default {
380
382
  rockerButton: rockerButton,
381
383
  tooltip: tooltip,
382
384
  footer: footer,
383
- loader: loader
385
+ loader: loader,
386
+ table: table,
387
+ tableBase: tableBase
384
388
  };