@pingux/astro 2.1.2 → 2.2.0-alpha.0

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.
@@ -3,11 +3,11 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
3
3
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
4
4
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
5
5
  import React from 'react';
6
- import AccountGroupIcon from 'mdi-react/AccountGroupIcon';
7
- import AccountIcon from 'mdi-react/AccountIcon';
8
- import LockIcon from 'mdi-react/LockIcon';
9
- import SearchIcon from 'mdi-react/SearchIcon';
10
- import TagIcon from 'mdi-react/TagIcon';
6
+ import AccountGroupIcon from '@pingux/mdi-react/AccountGroupIcon';
7
+ import AccountIcon from '@pingux/mdi-react/AccountIcon';
8
+ import LockIcon from '@pingux/mdi-react/LockIcon';
9
+ import SearchIcon from '@pingux/mdi-react/SearchIcon';
10
+ import TagIcon from '@pingux/mdi-react/TagIcon';
11
11
  import { v4 as uuid } from 'uuid';
12
12
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
13
13
  import { Box, Icon, Table, TableBody, TableCell, TableHead, TableRow, Text } from '../../index';
@@ -57,7 +57,12 @@ export default {
57
57
  }
58
58
  };
59
59
  export var Default = function Default(args) {
60
- return ___EmotionJSX(Icon, args);
60
+ return ___EmotionJSX(Icon, _extends({}, args, {
61
+ title: {
62
+ id: 'search-icon-title',
63
+ name: 'Search Icon'
64
+ }
65
+ }));
61
66
  };
62
67
  export var SVGIcons = function SVGIcons() {
63
68
  // SVGR can used to convert .svg files to components instead of doing this manually
@@ -102,7 +107,11 @@ export var Sizes = function Sizes() {
102
107
  fontFamily: "monospace"
103
108
  }, '<Icon icon={SearchIcon}/> size="xs"/>')), ___EmotionJSX(TableCell, null, ___EmotionJSX(Icon, {
104
109
  icon: SearchIcon,
105
- size: "xs"
110
+ size: "xs",
111
+ title: {
112
+ id: 'search-icon-title',
113
+ name: 'Search Icon'
114
+ }
106
115
  }))), ___EmotionJSX(TableRow, {
107
116
  height: "45px",
108
117
  bg: "transparent !important"
@@ -110,7 +119,11 @@ export var Sizes = function Sizes() {
110
119
  fontFamily: "monospace"
111
120
  }, '<Icon icon={SearchIcon}/> size="sm"/>')), ___EmotionJSX(TableCell, null, ___EmotionJSX(Icon, {
112
121
  icon: SearchIcon,
113
- size: "sm"
122
+ size: "sm",
123
+ title: {
124
+ id: 'search-icon-title',
125
+ name: 'Search Icon'
126
+ }
114
127
  }))), ___EmotionJSX(TableRow, {
115
128
  height: "45px",
116
129
  bg: "transparent !important"
@@ -118,7 +131,11 @@ export var Sizes = function Sizes() {
118
131
  fontFamily: "monospace"
119
132
  }, '<Icon icon={SearchIcon}/> size="md"/>')), ___EmotionJSX(TableCell, null, ___EmotionJSX(Icon, {
120
133
  icon: SearchIcon,
121
- size: "md"
134
+ size: "md",
135
+ title: {
136
+ id: 'search-icon-title',
137
+ name: 'Search Icon'
138
+ }
122
139
  })))));
123
140
  };
124
141
  export var CommonlyUsed = function CommonlyUsed() {
@@ -129,48 +146,68 @@ export var CommonlyUsed = function CommonlyUsed() {
129
146
  }, ___EmotionJSX(Icon, {
130
147
  icon: AccountIcon,
131
148
  color: "accent.40",
132
- size: "sm"
149
+ size: "sm",
150
+ title: {
151
+ id: 'account-icon-title',
152
+ name: 'Account Icon'
153
+ }
133
154
  }), ___EmotionJSX(Text, {
134
155
  fontFamily: "monospace"
135
- }, "import AccountIcon from 'mdi-react/AccountIcon'; ")), ___EmotionJSX(Box, {
156
+ }, "import AccountIcon from '@pingux/mdi-react/AccountIcon'; ")), ___EmotionJSX(Box, {
136
157
  isRow: true,
137
158
  gap: "md",
138
159
  mb: "xs"
139
160
  }, ___EmotionJSX(Icon, {
140
161
  icon: AccountGroupIcon,
141
162
  color: "accent.40",
142
- size: "sm"
163
+ size: "sm",
164
+ title: {
165
+ id: 'account-group-title',
166
+ name: 'Account Group Icon'
167
+ }
143
168
  }), ___EmotionJSX(Text, {
144
169
  fontFamily: "monospace"
145
- }, "import AccountGroupIcon from 'mdi-react/AccountGroupIcon'; ")), ___EmotionJSX(Box, {
170
+ }, "import AccountGroupIcon from '@pingux/mdi-react/AccountGroupIcon'; ")), ___EmotionJSX(Box, {
146
171
  isRow: true,
147
172
  gap: "md",
148
173
  mb: "xs"
149
174
  }, ___EmotionJSX(Icon, {
150
175
  icon: LockIcon,
151
176
  color: "accent.40",
152
- size: "sm"
177
+ size: "sm",
178
+ title: {
179
+ id: 'lock-icon-title',
180
+ name: 'Lock Icon'
181
+ }
153
182
  }), ___EmotionJSX(Text, {
154
183
  fontFamily: "monospace"
155
- }, "import LockIcon from 'mdi-react/LockIcon'; ")), ___EmotionJSX(Box, {
184
+ }, "import LockIcon from '@pingux/mdi-react/LockIcon'; ")), ___EmotionJSX(Box, {
156
185
  isRow: true,
157
186
  gap: "md",
158
187
  mb: "xs"
159
188
  }, ___EmotionJSX(Icon, {
160
189
  icon: SearchIcon,
161
190
  color: "accent.40",
162
- size: "sm"
191
+ size: "sm",
192
+ title: {
193
+ id: 'search-icon-title',
194
+ name: 'Search Icon'
195
+ }
163
196
  }), ___EmotionJSX(Text, {
164
197
  fontFamily: "monospace"
165
- }, "import SearchIcon from 'mdi-react/SearchIcon'; ")), ___EmotionJSX(Box, {
198
+ }, "import SearchIcon from '@pingux/mdi-react/SearchIcon'; ")), ___EmotionJSX(Box, {
166
199
  isRow: true,
167
200
  gap: "md",
168
201
  mb: "xs"
169
202
  }, ___EmotionJSX(Icon, {
170
203
  icon: TagIcon,
171
204
  color: "accent.40",
172
- size: "sm"
205
+ size: "sm",
206
+ title: {
207
+ id: 'tag-icon-title',
208
+ name: 'Tag Icon'
209
+ }
173
210
  }), ___EmotionJSX(Text, {
174
211
  fontFamily: "monospace"
175
- }, "import TagIcon from 'mdi-react/TagIcon'; ")));
212
+ }, "import TagIcon from '@pingux/mdi-react/TagIcon'; ")));
176
213
  };
@@ -1,14 +1,18 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
+ import Earth from '@pingux/mdi-react/EarthIcon';
3
4
  import { render, screen } from '@testing-library/react';
4
- import Earth from 'mdi-react/EarthIcon';
5
5
  import axeTest from '../../utils/testUtils/testAxe';
6
6
  import Icon from '.';
7
7
  import { jsx as ___EmotionJSX } from "@emotion/react";
8
8
  var testId = 'test-icon';
9
9
  var defaultProps = {
10
10
  'data-testid': testId,
11
- icon: Earth
11
+ icon: Earth,
12
+ title: {
13
+ id: 'title-id',
14
+ name: 'Earth Icon'
15
+ }
12
16
  };
13
17
  var getComponent = function getComponent() {
14
18
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -43,4 +47,13 @@ test('icon renders correct medium tshirt size', function () {
43
47
  });
44
48
  var mdIcon = screen.getByTestId(testId);
45
49
  expect(mdIcon).toHaveStyleRule('width', '25px');
50
+ });
51
+ test('icon renders with associated title', function () {
52
+ getComponent();
53
+ var icon = screen.getByTestId(testId);
54
+ var title = screen.getByText('Earth Icon');
55
+ expect(icon).toBeInstanceOf(SVGSVGElement);
56
+ expect(icon).toBeInTheDocument();
57
+ expect(icon).toHaveAttribute('aria-labelledby', 'title-id');
58
+ expect(title).toBeInTheDocument();
46
59
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.1.2",
3
+ "version": "2.2.0-alpha.0",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,6 +40,7 @@
40
40
  "@emotion/styled": "^11.1.1",
41
41
  "@faker-js/faker": "~7.5.0",
42
42
  "@mdx-js/react": "^1.6.22",
43
+ "@pingux/mdi-react": "^1.0.0",
43
44
  "@react-aria/accordion": "~3.0.0-alpha.11",
44
45
  "@react-aria/breadcrumbs": "^3.1.4",
45
46
  "@react-aria/button": "^3.2.1",