@pingux/astro 2.129.0 → 2.130.0-alpha.2
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.
- package/lib/cjs/components/Button/Button.stories.d.ts +1 -0
- package/lib/cjs/components/Button/Button.stories.js +8 -2
- package/lib/cjs/components/Button/Buttons.styles.d.ts +48 -0
- package/lib/cjs/components/Button/Buttons.styles.js +9 -1
- package/lib/cjs/components/Callout/Callout.js +14 -16
- package/lib/cjs/components/Callout/Callout.stories.d.ts +9 -0
- package/lib/cjs/components/Callout/Callout.stories.js +24 -1
- package/lib/cjs/components/Callout/Callout.styles.d.ts +14 -22
- package/lib/cjs/components/Callout/Callout.styles.js +19 -23
- package/lib/cjs/components/Callout/stories/CalloutNextGenComponent.d.ts +2 -0
- package/lib/cjs/components/Callout/stories/CalloutNextGenComponent.js +33 -0
- package/lib/cjs/components/Callout/stories/NextGenCallout.chromatic.stories.d.ts +6 -0
- package/lib/cjs/components/Callout/stories/NextGenCallout.chromatic.stories.js +22 -0
- package/lib/cjs/components/Callout/stories/NextGenDarkCallout.chomatic.stories.d.ts +6 -0
- package/lib/cjs/components/Callout/stories/NextGenDarkCallout.chomatic.stories.js +22 -0
- package/lib/cjs/components/Card/Card.styles.d.ts +11 -0
- package/lib/cjs/components/Card/Card.styles.js +6 -1
- package/lib/cjs/components/CodeEditor/CodeEditor.chromatic.stories.d.ts +12 -0
- package/lib/cjs/components/CodeEditor/CodeEditor.chromatic.stories.js +125 -0
- package/lib/cjs/components/CodeEditor/CodeEditor.js +17 -5
- package/lib/cjs/components/CodeEditor/CodeEditor.stories.d.ts +3 -0
- package/lib/cjs/components/CodeEditor/CodeEditor.stories.js +3 -0
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.mdx +1 -1
- package/lib/cjs/components/Table/Table.stories.js +4 -5
- package/lib/cjs/components/Table/Table.styles.d.ts +5 -3
- package/lib/cjs/components/Table/Table.styles.js +8 -6
- package/lib/cjs/components/TableBase/TableBase.d.ts +9 -0
- package/lib/cjs/components/TableBase/TableBase.js +238 -0
- package/lib/cjs/components/TableBase/TableBase.mdx +30 -0
- package/lib/cjs/components/TableBase/TableBase.stories.d.ts +6 -0
- package/lib/cjs/components/TableBase/TableBase.stories.js +111 -0
- package/lib/cjs/components/TableBase/TableBase.styles.d.ts +76 -0
- package/lib/cjs/components/TableBase/TableBase.styles.js +80 -0
- package/lib/cjs/components/TableBase/TableBase.test.d.ts +1 -0
- package/lib/cjs/components/TableBase/TableBase.test.js +122 -0
- package/lib/cjs/components/TableBase/index.d.ts +1 -0
- package/lib/cjs/components/TableBase/index.js +14 -0
- package/lib/cjs/components/TableBase/stories/NextGenDarkTableBase.chromatic.stories.d.ts +6 -0
- package/lib/cjs/components/TableBase/stories/NextGenDarkTableBase.chromatic.stories.js +22 -0
- package/lib/cjs/components/TableBase/stories/NextGenTableBase.chromatic.stories.d.ts +6 -0
- package/lib/cjs/components/TableBase/stories/NextGenTableBase.chromatic.stories.js +22 -0
- package/lib/cjs/components/TableBase/stories/NextGenTableBase.d.ts +3 -0
- package/lib/cjs/components/TableBase/stories/NextGenTableBase.js +67 -0
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +3 -41
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.js +74 -20
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/callout.d.ts +27 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/callout.js +35 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +48 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +24 -0
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +4 -4
- package/lib/cjs/styles/themes/astro/customProperties/tShirtSizes.d.ts +4 -4
- package/lib/cjs/styles/themes/astro/customProperties/tShirtSizes.js +4 -4
- package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/colors/colors.js +2 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +3 -2
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +179 -1
- package/lib/cjs/styles/themes/next-gen/variants/callout.d.ts +34 -0
- package/lib/cjs/styles/themes/next-gen/variants/callout.js +45 -0
- package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +14 -1
- package/lib/cjs/styles/themes/next-gen/variants/cards.js +7 -2
- package/lib/cjs/styles/themes/next-gen/variants/table.d.ts +45 -0
- package/lib/cjs/styles/themes/next-gen/variants/table.js +65 -0
- package/lib/cjs/styles/themes/next-gen/variants/tableBase.d.ts +86 -0
- package/lib/cjs/styles/themes/next-gen/variants/tableBase.js +99 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +164 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +7 -1
- package/lib/cjs/styles/variants/variants.js +5 -2
- package/lib/cjs/types/callout.d.ts +2 -0
- package/lib/cjs/types/cell.d.ts +12 -0
- package/lib/cjs/types/cell.js +6 -0
- package/lib/cjs/types/codeEditor.d.ts +2 -0
- package/lib/cjs/types/tableBase.d.ts +45 -0
- package/lib/cjs/types/tableBase.js +6 -0
- package/lib/cjs/utils/devUtils/constants/items.d.ts +10 -0
- package/lib/cjs/utils/devUtils/constants/items.js +87 -0
- package/lib/components/Button/Button.stories.js +5 -0
- package/lib/components/Button/Buttons.styles.js +9 -1
- package/lib/components/Callout/Callout.js +14 -16
- package/lib/components/Callout/Callout.stories.js +22 -0
- package/lib/components/Callout/Callout.styles.js +19 -24
- package/lib/components/Callout/stories/CalloutNextGenComponent.js +24 -0
- package/lib/components/Callout/stories/NextGenCallout.chromatic.stories.js +12 -0
- package/lib/components/Callout/stories/NextGenDarkCallout.chomatic.stories.js +12 -0
- package/lib/components/Card/Card.styles.js +6 -1
- package/lib/components/CodeEditor/CodeEditor.chromatic.stories.js +113 -0
- package/lib/components/CodeEditor/CodeEditor.js +17 -3
- package/lib/components/CodeEditor/CodeEditor.stories.js +3 -0
- package/lib/components/RockerButtonGroup/RockerButtonGroup.mdx +1 -1
- package/lib/components/Table/Table.stories.js +5 -6
- package/lib/components/Table/Table.styles.js +8 -6
- package/lib/components/TableBase/TableBase.js +221 -0
- package/lib/components/TableBase/TableBase.mdx +30 -0
- package/lib/components/TableBase/TableBase.stories.js +100 -0
- package/lib/components/TableBase/TableBase.styles.js +72 -0
- package/lib/components/TableBase/TableBase.test.js +119 -0
- package/lib/components/TableBase/index.js +1 -0
- package/lib/components/TableBase/stories/NextGenDarkTableBase.chromatic.stories.js +12 -0
- package/lib/components/TableBase/stories/NextGenTableBase.chromatic.stories.js +12 -0
- package/lib/components/TableBase/stories/NextGenTableBase.js +58 -0
- package/lib/index.js +3 -2
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/callout.js +27 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +24 -0
- package/lib/styles/themes/astro/customProperties/tShirtSizes.js +4 -4
- package/lib/styles/themes/next-gen/colors/colors.js +2 -1
- package/lib/styles/themes/next-gen/convertedComponentList.js +3 -2
- package/lib/styles/themes/next-gen/variants/callout.js +36 -0
- package/lib/styles/themes/next-gen/variants/cards.js +7 -2
- package/lib/styles/themes/next-gen/variants/table.js +57 -0
- package/lib/styles/themes/next-gen/variants/tableBase.js +91 -0
- package/lib/styles/themes/next-gen/variants/variants.js +7 -1
- package/lib/styles/variants/variants.js +5 -2
- package/lib/types/cell.js +1 -0
- package/lib/types/tableBase.js +1 -0
- package/lib/utils/devUtils/constants/items.js +79 -0
- package/package.json +1 -1
@@ -0,0 +1,80 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
4
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
5
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
7
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
8
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
9
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
10
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
11
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
12
|
+
_Object$defineProperty(exports, "__esModule", {
|
13
|
+
value: true
|
14
|
+
});
|
15
|
+
exports["default"] = void 0;
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
17
|
+
var _Text = require("../Text/Text.styles");
|
18
|
+
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; }
|
19
|
+
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; }
|
20
|
+
var defaultFocus = {
|
21
|
+
outline: '1px',
|
22
|
+
outlineStyle: 'solid',
|
23
|
+
outlineColor: 'focus',
|
24
|
+
outlineOffset: '-1px'
|
25
|
+
};
|
26
|
+
var container = {
|
27
|
+
width: '100%',
|
28
|
+
borderSpacing: '0',
|
29
|
+
borderCollapse: 'collapse'
|
30
|
+
};
|
31
|
+
var caption = {
|
32
|
+
fontFamily: 'standard',
|
33
|
+
fontSize: 'lg',
|
34
|
+
fontWeight: '2',
|
35
|
+
p: 'sm',
|
36
|
+
textAlign: 'left'
|
37
|
+
};
|
38
|
+
var thead = {};
|
39
|
+
var head = _objectSpread(_objectSpread({}, _Text.text.label), {}, {
|
40
|
+
fontWeight: 500,
|
41
|
+
textAlign: 'left',
|
42
|
+
p: 'sm',
|
43
|
+
cursor: 'default',
|
44
|
+
'&.is-focused': _objectSpread({}, defaultFocus)
|
45
|
+
});
|
46
|
+
var tbody = {
|
47
|
+
borderTop: '1px solid',
|
48
|
+
borderTopColor: 'neutral.40',
|
49
|
+
borderBottom: '1px solid',
|
50
|
+
borderBottomColor: 'neutral.80'
|
51
|
+
};
|
52
|
+
var row = {
|
53
|
+
'&:nth-of-type(odd) ': {
|
54
|
+
bg: 'neutral.95'
|
55
|
+
},
|
56
|
+
'&.is-focused': _objectSpread({}, defaultFocus),
|
57
|
+
'&.is-hovered': {
|
58
|
+
// This is the hover state for the row
|
59
|
+
},
|
60
|
+
'&.is-selected': {
|
61
|
+
// This is the selected state for the row
|
62
|
+
}
|
63
|
+
};
|
64
|
+
var data = _objectSpread(_objectSpread({}, _Text.text.tableData), {}, {
|
65
|
+
p: 'sm',
|
66
|
+
'&.no-wrap': {
|
67
|
+
whiteSpace: 'nowrap'
|
68
|
+
},
|
69
|
+
'&.is-focused': _objectSpread({}, defaultFocus)
|
70
|
+
});
|
71
|
+
var _default = {
|
72
|
+
thead: thead,
|
73
|
+
tbody: tbody,
|
74
|
+
caption: caption,
|
75
|
+
container: container,
|
76
|
+
data: data,
|
77
|
+
head: head,
|
78
|
+
row: row
|
79
|
+
};
|
80
|
+
exports["default"] = _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,122 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
5
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
7
|
+
var _react2 = require("@testing-library/react");
|
8
|
+
var _index = require("../../index");
|
9
|
+
var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
|
10
|
+
var _TableBase = _interopRequireDefault(require("./TableBase"));
|
11
|
+
var _react3 = require("@emotion/react");
|
12
|
+
var testId = 'test-table';
|
13
|
+
var defaultProps = {
|
14
|
+
'aria-label': 'table',
|
15
|
+
'data-testid': testId,
|
16
|
+
caption: 'Populations of Countries'
|
17
|
+
};
|
18
|
+
var headers = [{
|
19
|
+
key: 'country',
|
20
|
+
name: 'Country'
|
21
|
+
}, {
|
22
|
+
key: 'population',
|
23
|
+
name: 'Population'
|
24
|
+
}, {
|
25
|
+
key: 'continent',
|
26
|
+
name: 'Continent'
|
27
|
+
}];
|
28
|
+
var objects = [{
|
29
|
+
key: '1',
|
30
|
+
country: 'USA',
|
31
|
+
population: '320,000,000',
|
32
|
+
continent: 'South America',
|
33
|
+
cellProps: {
|
34
|
+
noWrap: true
|
35
|
+
}
|
36
|
+
}, {
|
37
|
+
key: '2',
|
38
|
+
country: 'Canada',
|
39
|
+
population: '37,000,000',
|
40
|
+
continent: 'North America'
|
41
|
+
}, {
|
42
|
+
key: '3',
|
43
|
+
country: 'China',
|
44
|
+
population: '1,398,000,000',
|
45
|
+
continent: 'Asia'
|
46
|
+
}, {
|
47
|
+
key: '4',
|
48
|
+
country: 'France',
|
49
|
+
population: '67,000,000',
|
50
|
+
continent: 'Europe'
|
51
|
+
}];
|
52
|
+
var getComponent = function getComponent() {
|
53
|
+
return (0, _react2.render)((0, _react3.jsx)(_TableBase["default"], defaultProps, (0, _react3.jsx)(_index.THead, {
|
54
|
+
columns: headers
|
55
|
+
}, function (head) {
|
56
|
+
return (0, _react3.jsx)(_index.Column, {
|
57
|
+
key: head.key
|
58
|
+
}, head.name);
|
59
|
+
}), (0, _react3.jsx)(_index.TBody, {
|
60
|
+
items: objects
|
61
|
+
}, function (row) {
|
62
|
+
return (0, _react3.jsx)(_index.Row, {
|
63
|
+
key: row.key
|
64
|
+
}, function (columnKey) {
|
65
|
+
return (0, _react3.jsx)(_index.Cell, row.cellProps || {}, row[columnKey]);
|
66
|
+
});
|
67
|
+
})));
|
68
|
+
};
|
69
|
+
|
70
|
+
// Needs to be added to each components test file
|
71
|
+
(0, _universalComponentTest.universalComponentTests)({
|
72
|
+
renderComponent: function renderComponent(props) {
|
73
|
+
return (0, _react3.jsx)(_TableBase["default"], (0, _extends2["default"])({}, defaultProps, props), (0, _react3.jsx)(_index.THead, {
|
74
|
+
columns: headers
|
75
|
+
}, function (head) {
|
76
|
+
return (0, _react3.jsx)(_index.Column, {
|
77
|
+
key: head.key
|
78
|
+
}, head.name);
|
79
|
+
}), (0, _react3.jsx)(_index.TBody, {
|
80
|
+
items: objects
|
81
|
+
}, function (row) {
|
82
|
+
return (0, _react3.jsx)(_index.Row, {
|
83
|
+
key: row.key
|
84
|
+
}, function (columnKey) {
|
85
|
+
return (0, _react3.jsx)(_index.Cell, null, row[columnKey]);
|
86
|
+
});
|
87
|
+
}));
|
88
|
+
}
|
89
|
+
});
|
90
|
+
test('default table', function () {
|
91
|
+
getComponent();
|
92
|
+
var table = _react2.screen.getByTestId(testId);
|
93
|
+
expect(table).toBeInTheDocument();
|
94
|
+
});
|
95
|
+
test('renders caption', function () {
|
96
|
+
getComponent();
|
97
|
+
var caption = _react2.screen.getByText(defaultProps.caption);
|
98
|
+
expect(caption).toBeInTheDocument();
|
99
|
+
});
|
100
|
+
test('renders table headers', function () {
|
101
|
+
getComponent();
|
102
|
+
var headerCells = _react2.screen.getAllByRole('columnheader');
|
103
|
+
expect(headerCells).toHaveLength(headers.length);
|
104
|
+
(0, _forEach["default"])(headers).call(headers, function (header) {
|
105
|
+
expect(_react2.screen.getByText(header.name)).toBeInTheDocument();
|
106
|
+
});
|
107
|
+
});
|
108
|
+
test('renders table rows', function () {
|
109
|
+
getComponent();
|
110
|
+
var rows = _react2.screen.getAllByRole('row');
|
111
|
+
expect(rows).toHaveLength(objects.length + 1);
|
112
|
+
(0, _forEach["default"])(objects).call(objects, function (object) {
|
113
|
+
expect(_react2.screen.getByText(object.country)).toBeInTheDocument();
|
114
|
+
expect(_react2.screen.getByText(object.population)).toBeInTheDocument();
|
115
|
+
expect(_react2.screen.getByText(object.continent)).toBeInTheDocument();
|
116
|
+
});
|
117
|
+
});
|
118
|
+
test('renders cell with noWrap prop', function () {
|
119
|
+
getComponent();
|
120
|
+
var cell = _react2.screen.getByText('South America');
|
121
|
+
expect(cell).toHaveClass('no-wrap');
|
122
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './TableBase';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
_Object$defineProperty(exports, "default", {
|
9
|
+
enumerable: true,
|
10
|
+
get: function get() {
|
11
|
+
return _TableBase["default"];
|
12
|
+
}
|
13
|
+
});
|
14
|
+
var _TableBase = _interopRequireDefault(require("./TableBase"));
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = exports.Default = void 0;
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
10
|
+
var _ = require("../../..");
|
11
|
+
var _NextGenTableBase = _interopRequireDefault(require("./NextGenTableBase"));
|
12
|
+
var _react2 = require("@emotion/react");
|
13
|
+
var _default = {
|
14
|
+
title: 'Chromatic Only Onyx Dark TableBase'
|
15
|
+
};
|
16
|
+
exports["default"] = _default;
|
17
|
+
var Default = function Default() {
|
18
|
+
return (0, _react2.jsx)(_.AstroProvider, {
|
19
|
+
themeOverrides: [_.NextGenDarkTheme]
|
20
|
+
}, (0, _react2.jsx)(_NextGenTableBase["default"], null));
|
21
|
+
};
|
22
|
+
exports.Default = Default;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = exports.Default = void 0;
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
10
|
+
var _ = require("../../..");
|
11
|
+
var _NextGenTableBase = _interopRequireDefault(require("./NextGenTableBase"));
|
12
|
+
var _react2 = require("@emotion/react");
|
13
|
+
var _default = {
|
14
|
+
title: 'Chromatic Only Onyx TableBase'
|
15
|
+
};
|
16
|
+
exports["default"] = _default;
|
17
|
+
var Default = function Default() {
|
18
|
+
return (0, _react2.jsx)(_.AstroProvider, {
|
19
|
+
themeOverrides: [_.NextGenTheme]
|
20
|
+
}, (0, _react2.jsx)(_NextGenTableBase["default"], null));
|
21
|
+
};
|
22
|
+
exports.Default = Default;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = void 0;
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
10
|
+
var _ = require("../../..");
|
11
|
+
var _react2 = require("@emotion/react");
|
12
|
+
var NextGenTableBase = function NextGenTableBase() {
|
13
|
+
var headers = [{
|
14
|
+
key: 'type',
|
15
|
+
name: 'Type'
|
16
|
+
}, {
|
17
|
+
key: 'date',
|
18
|
+
name: 'Date'
|
19
|
+
}, {
|
20
|
+
key: 'additional_grant',
|
21
|
+
name: 'Additional Grant'
|
22
|
+
}, {
|
23
|
+
key: 'total_grant',
|
24
|
+
name: 'Total Grant'
|
25
|
+
}];
|
26
|
+
var objects = [{
|
27
|
+
id: 1,
|
28
|
+
type: 'Lorem ipsum',
|
29
|
+
date: '2020-06-12',
|
30
|
+
additional_grant: '+25,000',
|
31
|
+
total_grant: '25,000'
|
32
|
+
}, {
|
33
|
+
id: 2,
|
34
|
+
type: 'Lorem ipsum',
|
35
|
+
date: '2020-10-01',
|
36
|
+
additional_grant: '+25,000',
|
37
|
+
total_grant: '50,000'
|
38
|
+
}, {
|
39
|
+
id: 3,
|
40
|
+
type: 'Lorem ipsum',
|
41
|
+
date: '2021-01-01',
|
42
|
+
additional_grant: '+25,000',
|
43
|
+
total_grant: '75,000'
|
44
|
+
}];
|
45
|
+
return (0, _react2.jsx)(_.Card, {
|
46
|
+
variant: "cards.tableWrapper"
|
47
|
+
}, (0, _react2.jsx)(_.TableBase, {
|
48
|
+
caption: "Lorem ipsum",
|
49
|
+
"aria-label": "table"
|
50
|
+
}, (0, _react2.jsx)(_.THead, {
|
51
|
+
columns: headers
|
52
|
+
}, function (column) {
|
53
|
+
return (0, _react2.jsx)(_.Column, {
|
54
|
+
key: column.key
|
55
|
+
}, column.name);
|
56
|
+
}), (0, _react2.jsx)(_.TBody, {
|
57
|
+
items: objects
|
58
|
+
}, function (item) {
|
59
|
+
return (0, _react2.jsx)(_.Row, {
|
60
|
+
key: item.id
|
61
|
+
}, function (columnKey) {
|
62
|
+
return (0, _react2.jsx)(_.Cell, null, item[columnKey]);
|
63
|
+
});
|
64
|
+
})));
|
65
|
+
};
|
66
|
+
var _default = NextGenTableBase;
|
67
|
+
exports["default"] = _default;
|
@@ -6,9 +6,6 @@ export declare const baseState: {
|
|
6
6
|
isCustom: boolean;
|
7
7
|
};
|
8
8
|
declare const useGetTheme: () => {
|
9
|
-
styles: {
|
10
|
-
navButtonEstHeight: number;
|
11
|
-
};
|
12
9
|
icons: {
|
13
10
|
[x: number]: import("@pingux/mdi-react").MdiReactIconComponentType;
|
14
11
|
MenuDown: import("@pingux/mdi-react").MdiReactIconComponentType;
|
@@ -16,49 +13,14 @@ declare const useGetTheme: () => {
|
|
16
13
|
pingLogoHorizontalSmall: import("react").JSX.Element;
|
17
14
|
listViewMenu: import("@pingux/mdi-react").MdiReactIconComponentType;
|
18
15
|
};
|
16
|
+
styles: {
|
17
|
+
navButtonEstHeight: number;
|
18
|
+
};
|
19
19
|
tShirtSizes: {
|
20
20
|
xxs: string;
|
21
|
-
'icon-100': string;
|
22
21
|
xs: string;
|
23
|
-
'icon-200': string;
|
24
22
|
sm: string;
|
25
|
-
'icon-300': string;
|
26
23
|
md: string;
|
27
|
-
'icon-400': string;
|
28
|
-
'icon-500': string;
|
29
|
-
'icon-600': string;
|
30
|
-
'icon-700': string;
|
31
|
-
'icon-800': string;
|
32
|
-
'icon-900': string;
|
33
|
-
};
|
34
|
-
iconWrapperSizes: {
|
35
|
-
sm: number;
|
36
|
-
md: number;
|
37
|
-
lg: number;
|
38
|
-
};
|
39
|
-
themeState: {
|
40
|
-
isOnyx: boolean;
|
41
|
-
isAstro: boolean;
|
42
|
-
isOnyxDark: boolean;
|
43
|
-
isCustom: boolean;
|
44
|
-
};
|
45
|
-
name: string;
|
46
|
-
} | {
|
47
|
-
icons: {
|
48
|
-
[x: number]: import("@pingux/mdi-react").MdiReactIconComponentType;
|
49
|
-
MenuDown: import("@pingux/mdi-react").MdiReactIconComponentType;
|
50
|
-
MenuUp: import("@pingux/mdi-react").MdiReactIconComponentType;
|
51
|
-
pingLogoHorizontalSmall: import("react").JSX.Element;
|
52
|
-
listViewMenu: import("@pingux/mdi-react").MdiReactIconComponentType;
|
53
|
-
};
|
54
|
-
styles: {
|
55
|
-
navButtonEstHeight: number;
|
56
|
-
};
|
57
|
-
tShirtSizes: {
|
58
|
-
xxs: number;
|
59
|
-
xs: number;
|
60
|
-
sm: number;
|
61
|
-
md: number;
|
62
24
|
};
|
63
25
|
iconWrapperSizes: {
|
64
26
|
sm: number;
|
package/lib/cjs/index.d.ts
CHANGED
@@ -184,6 +184,8 @@ export { default as Tab } from './components/Tab';
|
|
184
184
|
export * from './components/Tab';
|
185
185
|
export { default as Table } from './components/Table';
|
186
186
|
export * from './components/Table';
|
187
|
+
export * from './components/TableBase';
|
188
|
+
export { default as TableBase } from './components/TableBase';
|
187
189
|
export { default as TableBody } from './components/TableBody';
|
188
190
|
export * from './components/TableBody';
|
189
191
|
export { default as TableCaption } from './components/TableCaption';
|
@@ -218,5 +220,4 @@ export { default as NextGenTheme } from './styles/themes/next-gen';
|
|
218
220
|
export { default as OnyxTheme } from './styles/themes/next-gen';
|
219
221
|
export * from './types';
|
220
222
|
export { OverlayProvider, useOverlayPosition, useOverlayTrigger } from 'react-aria';
|
221
|
-
export { Item, Section, useOverlayTriggerState, useTreeData } from 'react-stately';
|
222
|
-
export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow, } from 'react-stately';
|
223
|
+
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';
|