@pingux/astro 1.31.0-alpha.4 → 1.31.0-alpha.5

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.
@@ -26,6 +26,10 @@ var _TableCell = _interopRequireDefault(require("../TableCell"));
26
26
 
27
27
  var _TableHead = _interopRequireDefault(require("../TableHead"));
28
28
 
29
+ var _TableCaption = _interopRequireDefault(require("../TableCaption"));
30
+
31
+ var _index = require("../../index");
32
+
29
33
  var _react2 = require("@emotion/react");
30
34
 
31
35
  var _default = {
@@ -33,6 +37,7 @@ var _default = {
33
37
  component: _Table["default"]
34
38
  };
35
39
  exports["default"] = _default;
40
+ var caption = 'Populations of Countries';
36
41
  var headers = ['Country', 'Population', 'Continent'];
37
42
  var objects = [{
38
43
  country: 'USA',
@@ -53,33 +58,10 @@ var objects = [{
53
58
  }];
54
59
 
55
60
  var Default = function Default() {
56
- // const headers = [
57
- // 'Country', 'Population', 'Continent',
58
- // ];
59
- //
60
- // const objects = [
61
- // {
62
- // country: 'USA',
63
- // population: '320,000,000',
64
- // continent: 'North America',
65
- // },
66
- // {
67
- // country: 'Canada',
68
- // population: '37,000,000',
69
- // continent: 'North America',
70
- // },
71
- // {
72
- // country: 'China',
73
- // population: '1,398,000,000',
74
- // continent: 'Asia',
75
- // },
76
- // {
77
- // country: 'France',
78
- // population: '67,000,000',
79
- // continent: 'Europe',
80
- // },
81
- // ];
82
- return (0, _react2.jsx)(_Table["default"], null, (0, _react2.jsx)(_TableHead["default"], null, (0, _react2.jsx)(_TableRow["default"], {
61
+ return (0, _react2.jsx)(_Table["default"], null, (0, _react2.jsx)(_TableCaption["default"], null, (0, _react2.jsx)(_index.Text, {
62
+ fontWeight: 3,
63
+ fontSize: "lg"
64
+ }, caption)), (0, _react2.jsx)(_TableHead["default"], null, (0, _react2.jsx)(_TableRow["default"], {
83
65
  key: "head"
84
66
  }, (0, _map["default"])(headers).call(headers, function (head) {
85
67
  return (0, _react2.jsx)(_TableCell["default"], {
@@ -20,6 +20,10 @@ var _TableCell = _interopRequireDefault(require("../TableCell"));
20
20
 
21
21
  var _TableHead = _interopRequireDefault(require("../TableHead"));
22
22
 
23
+ var _TableCaption = _interopRequireDefault(require("../TableCaption"));
24
+
25
+ var _index = require("../../index");
26
+
23
27
  var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
24
28
 
25
29
  var _react3 = require("@emotion/react");
@@ -28,6 +32,7 @@ var testId = 'test-table';
28
32
  var defaultProps = {
29
33
  'data-testid': testId
30
34
  };
35
+ var caption = 'Populations of Countries';
31
36
  var headers = ['Country', 'Population', 'Continent'];
32
37
  var objects = [{
33
38
  country: 'USA',
@@ -48,7 +53,10 @@ var objects = [{
48
53
  }];
49
54
 
50
55
  var getComponent = function getComponent() {
51
- return (0, _react2.render)((0, _react3.jsx)(_Table["default"], defaultProps, (0, _react3.jsx)(_TableHead["default"], null, (0, _react3.jsx)(_TableRow["default"], {
56
+ return (0, _react2.render)((0, _react3.jsx)(_Table["default"], defaultProps, (0, _react3.jsx)(_TableCaption["default"], null, (0, _react3.jsx)(_index.Text, {
57
+ fontWeight: 3,
58
+ fontSize: "lg"
59
+ }, caption)), (0, _react3.jsx)(_TableHead["default"], null, (0, _react3.jsx)(_TableRow["default"], {
52
60
  key: "head"
53
61
  }, (0, _map["default"])(headers).call(headers, function (head) {
54
62
  return (0, _react3.jsx)(_TableCell["default"], {
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+
5
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
+
7
+ _Object$defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+
11
+ exports["default"] = void 0;
12
+
13
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
14
+
15
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
16
+
17
+ var _react = _interopRequireDefault(require("react"));
18
+
19
+ var _Box = _interopRequireDefault(require("../Box"));
20
+
21
+ var _react2 = require("@emotion/react");
22
+
23
+ var _excluded = ["children"];
24
+
25
+ /**
26
+ * Basic TableCaption component.
27
+ *
28
+ * Renders HTML `<caption>`
29
+ *
30
+ * Needs to be a child of the `<Table>` component. Accepts text as children.
31
+ *
32
+ */
33
+ var TableCaption = function TableCaption(props) {
34
+ var children = props.children,
35
+ others = (0, _objectWithoutProperties2["default"])(props, _excluded);
36
+ return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
37
+ variant: "table.tableCaption",
38
+ as: "caption"
39
+ }, others), children);
40
+ };
41
+
42
+ var _default = TableCaption;
43
+ exports["default"] = _default;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+
5
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
+
7
+ _Object$defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+
11
+ _Object$defineProperty(exports, "default", {
12
+ enumerable: true,
13
+ get: function get() {
14
+ return _TableCaption["default"];
15
+ }
16
+ });
17
+
18
+ var _TableCaption = _interopRequireDefault(require("./TableCaption"));
@@ -57,6 +57,11 @@ var tableRow = {
57
57
  width: '100%',
58
58
  flexDirection: 'row !important'
59
59
  };
60
+ var tableCaption = {
61
+ textAlign: 'left',
62
+ marginBottom: 'xs',
63
+ lineHeight: '21px'
64
+ };
60
65
  var table = {
61
66
  width: '100%'
62
67
  };
@@ -65,6 +70,7 @@ var _default = {
65
70
  tableData: tableData,
66
71
  tableBody: tableBody,
67
72
  tableRow: tableRow,
73
+ tableCaption: tableCaption,
68
74
  table: table
69
75
  };
70
76
  exports["default"] = _default;
@@ -6,11 +6,14 @@ import TableBody from '../TableBody';
6
6
  import TableRow from '../TableRow';
7
7
  import TableCell from '../TableCell';
8
8
  import TableHead from '../TableHead';
9
+ import TableCaption from '../TableCaption';
10
+ import { Text } from '../../index';
9
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
12
  export default {
11
13
  title: 'Table',
12
14
  component: Table
13
15
  };
16
+ var caption = 'Populations of Countries';
14
17
  var headers = ['Country', 'Population', 'Continent'];
15
18
  var objects = [{
16
19
  country: 'USA',
@@ -30,33 +33,10 @@ var objects = [{
30
33
  continent: 'Europe'
31
34
  }];
32
35
  export var Default = function Default() {
33
- // const headers = [
34
- // 'Country', 'Population', 'Continent',
35
- // ];
36
- //
37
- // const objects = [
38
- // {
39
- // country: 'USA',
40
- // population: '320,000,000',
41
- // continent: 'North America',
42
- // },
43
- // {
44
- // country: 'Canada',
45
- // population: '37,000,000',
46
- // continent: 'North America',
47
- // },
48
- // {
49
- // country: 'China',
50
- // population: '1,398,000,000',
51
- // continent: 'Asia',
52
- // },
53
- // {
54
- // country: 'France',
55
- // population: '67,000,000',
56
- // continent: 'Europe',
57
- // },
58
- // ];
59
- return ___EmotionJSX(Table, null, ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
36
+ return ___EmotionJSX(Table, null, ___EmotionJSX(TableCaption, null, ___EmotionJSX(Text, {
37
+ fontWeight: 3,
38
+ fontSize: "lg"
39
+ }, caption)), ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
60
40
  key: "head"
61
41
  }, _mapInstanceProperty(headers).call(headers, function (head) {
62
42
  return ___EmotionJSX(TableCell, {
@@ -7,12 +7,15 @@ import TableBody from '../TableBody';
7
7
  import TableRow from '../TableRow';
8
8
  import TableCell from '../TableCell';
9
9
  import TableHead from '../TableHead';
10
+ import TableCaption from '../TableCaption';
11
+ import { Text } from '../../index';
10
12
  import axeTest from '../../utils/testUtils/testAxe';
11
13
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
14
  var testId = 'test-table';
13
15
  var defaultProps = {
14
16
  'data-testid': testId
15
17
  };
18
+ var caption = 'Populations of Countries';
16
19
  var headers = ['Country', 'Population', 'Continent'];
17
20
  var objects = [{
18
21
  country: 'USA',
@@ -33,7 +36,10 @@ var objects = [{
33
36
  }];
34
37
 
35
38
  var getComponent = function getComponent() {
36
- return render(___EmotionJSX(Table, defaultProps, ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
39
+ return render(___EmotionJSX(Table, defaultProps, ___EmotionJSX(TableCaption, null, ___EmotionJSX(Text, {
40
+ fontWeight: 3,
41
+ fontSize: "lg"
42
+ }, caption)), ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
37
43
  key: "head"
38
44
  }, _mapInstanceProperty(headers).call(headers, function (head) {
39
45
  return ___EmotionJSX(TableCell, {
@@ -0,0 +1,27 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["children"];
4
+ import React from 'react';
5
+ import Box from '../Box';
6
+ /**
7
+ * Basic TableCaption component.
8
+ *
9
+ * Renders HTML `<caption>`
10
+ *
11
+ * Needs to be a child of the `<Table>` component. Accepts text as children.
12
+ *
13
+ */
14
+
15
+ import { jsx as ___EmotionJSX } from "@emotion/react";
16
+
17
+ var TableCaption = function TableCaption(props) {
18
+ var children = props.children,
19
+ others = _objectWithoutProperties(props, _excluded);
20
+
21
+ return ___EmotionJSX(Box, _extends({
22
+ variant: "table.tableCaption",
23
+ as: "caption"
24
+ }, others), children);
25
+ };
26
+
27
+ export default TableCaption;
@@ -0,0 +1 @@
1
+ export { default } from './TableCaption';
@@ -39,6 +39,11 @@ var tableRow = {
39
39
  width: '100%',
40
40
  flexDirection: 'row !important'
41
41
  };
42
+ var tableCaption = {
43
+ textAlign: 'left',
44
+ marginBottom: 'xs',
45
+ lineHeight: '21px'
46
+ };
42
47
  var table = {
43
48
  width: '100%'
44
49
  };
@@ -47,5 +52,6 @@ export default {
47
52
  tableData: tableData,
48
53
  tableBody: tableBody,
49
54
  tableRow: tableRow,
55
+ tableCaption: tableCaption,
50
56
  table: table
51
57
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.31.0-alpha.4",
3
+ "version": "1.31.0-alpha.5",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",