@pingux/astro 1.31.0-alpha.3 → 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.
@@ -79,7 +79,8 @@ var Default = function Default(_ref) {
79
79
  // readers when an overlay is open.
80
80
  (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
81
81
  ref: triggerRef,
82
- onPress: state.open
82
+ onPress: state.open,
83
+ "aria-expanded": state.isOpen
83
84
  }, "Open Panel"), state.isOpen && (0, _react2.jsx)(_OverlayPanel["default"], (0, _extends2["default"])({
84
85
  isOpen: state.isOpen,
85
86
  state: state
@@ -88,7 +89,8 @@ var Default = function Default(_ref) {
88
89
  }), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
89
90
  onPress: function onPress() {
90
91
  onClose(state, triggerRef);
91
- }
92
+ },
93
+ "aria-expanded": state.isOpen
92
94
  }, "Close Panel"), (0, _react2.jsx)(_index.Text, {
93
95
  pt: "md"
94
96
  }, "Children render here."))))
@@ -158,7 +160,8 @@ var InnerPanel = function InnerPanel(_ref2) {
158
160
  p: '12px'
159
161
  }
160
162
  }, (0, _react2.jsx)(_index.Button, {
161
- onPress: closeOuterPanel
163
+ onPress: closeOuterPanel,
164
+ "aria-expanded": state.isOpen
162
165
  }, "Close Panel"), (0, _react2.jsx)(_index.Text, {
163
166
  pt: "md",
164
167
  mb: "24px"
@@ -180,13 +183,15 @@ var InnerPanel = function InnerPanel(_ref2) {
180
183
  onPress: toggleMessagesOpen
181
184
  }, "Toggle Messages"), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
182
185
  ref: innerTriggerRef,
183
- onPress: innerState.open
186
+ onPress: innerState.open,
187
+ "aria-expanded": innerState.isOpen
184
188
  }, "Open Inner Panel"), inner)));
185
189
  return (// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
186
190
  // readers when an overlay opens.
187
191
  (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
188
192
  ref: outerTriggerRef,
189
- onPress: state.open
193
+ onPress: state.open,
194
+ "aria-expanded": state.isOpen
190
195
  }, "Open Panel"), outer), messagesOpen && (0, _react2.jsx)(_index.Messages, {
191
196
  sx: {
192
197
  zIndex: 11
@@ -210,7 +215,8 @@ var CustomWidth = function CustomWidth() {
210
215
  // readers when an overlay opens.
211
216
  (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
212
217
  ref: triggerRef,
213
- onPress: state.open
218
+ onPress: state.open,
219
+ "aria-expanded": state.isOpen
214
220
  }, "Open Panel"), state.isOpen && (0, _react2.jsx)(_OverlayPanel["default"], {
215
221
  isOpen: state.isOpen,
216
222
  state: state,
@@ -221,7 +227,8 @@ var CustomWidth = function CustomWidth() {
221
227
  }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
222
228
  onPress: function onPress() {
223
229
  onClose(state, triggerRef);
224
- }
230
+ },
231
+ "aria-expanded": state.isOpen
225
232
  }, "Close Panel"), (0, _react2.jsx)(_index.Text, {
226
233
  pt: "md"
227
234
  }, "Children render here."))))
@@ -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;
@@ -46,7 +46,8 @@ export var Default = function Default(_ref) {
46
46
  // readers when an overlay is open.
47
47
  ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
48
48
  ref: triggerRef,
49
- onPress: state.open
49
+ onPress: state.open,
50
+ "aria-expanded": state.isOpen
50
51
  }, "Open Panel"), state.isOpen && ___EmotionJSX(OverlayPanel, _extends({
51
52
  isOpen: state.isOpen,
52
53
  state: state
@@ -55,7 +56,8 @@ export var Default = function Default(_ref) {
55
56
  }), ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
56
57
  onPress: function onPress() {
57
58
  onClose(state, triggerRef);
58
- }
59
+ },
60
+ "aria-expanded": state.isOpen
59
61
  }, "Close Panel"), ___EmotionJSX(Text, {
60
62
  pt: "md"
61
63
  }, "Children render here."))))
@@ -123,7 +125,8 @@ export var InnerPanel = function InnerPanel(_ref2) {
123
125
  p: '12px'
124
126
  }
125
127
  }, ___EmotionJSX(Button, {
126
- onPress: closeOuterPanel
128
+ onPress: closeOuterPanel,
129
+ "aria-expanded": state.isOpen
127
130
  }, "Close Panel"), ___EmotionJSX(Text, {
128
131
  pt: "md",
129
132
  mb: "24px"
@@ -145,14 +148,16 @@ export var InnerPanel = function InnerPanel(_ref2) {
145
148
  onPress: toggleMessagesOpen
146
149
  }, "Toggle Messages"), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
147
150
  ref: innerTriggerRef,
148
- onPress: innerState.open
151
+ onPress: innerState.open,
152
+ "aria-expanded": innerState.isOpen
149
153
  }, "Open Inner Panel"), inner)));
150
154
 
151
155
  return (// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
152
156
  // readers when an overlay opens.
153
157
  ___EmotionJSX(React.Fragment, null, ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
154
158
  ref: outerTriggerRef,
155
- onPress: state.open
159
+ onPress: state.open,
160
+ "aria-expanded": state.isOpen
156
161
  }, "Open Panel"), outer), messagesOpen && ___EmotionJSX(Messages, {
157
162
  sx: {
158
163
  zIndex: 11
@@ -173,7 +178,8 @@ export var CustomWidth = function CustomWidth() {
173
178
  // readers when an overlay opens.
174
179
  ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
175
180
  ref: triggerRef,
176
- onPress: state.open
181
+ onPress: state.open,
182
+ "aria-expanded": state.isOpen
177
183
  }, "Open Panel"), state.isOpen && ___EmotionJSX(OverlayPanel, {
178
184
  isOpen: state.isOpen,
179
185
  state: state,
@@ -184,7 +190,8 @@ export var CustomWidth = function CustomWidth() {
184
190
  }, ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
185
191
  onPress: function onPress() {
186
192
  onClose(state, triggerRef);
187
- }
193
+ },
194
+ "aria-expanded": state.isOpen
188
195
  }, "Close Panel"), ___EmotionJSX(Text, {
189
196
  pt: "md"
190
197
  }, "Children render here."))))
@@ -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.3",
3
+ "version": "1.31.0-alpha.5",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",