@pingux/astro 1.29.0 → 1.30.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.
@@ -0,0 +1,32 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import React from 'react';
3
+ import ArrowIcon from 'mdi-react/ArrowTopRightThickIcon';
4
+ import GroupIcon from 'mdi-react/AccountGroupIcon';
5
+ import IconBadge from '.';
6
+ import { Icon, Box } from '../../index';
7
+ import { jsx as ___EmotionJSX } from "@emotion/react";
8
+ export default {
9
+ title: 'IconBadge',
10
+ component: IconBadge,
11
+ parameters: {
12
+ docs: {
13
+ source: {
14
+ type: 'code'
15
+ }
16
+ }
17
+ }
18
+ };
19
+ export var Default = function Default(args) {
20
+ return ___EmotionJSX(Box, null, ___EmotionJSX(IconBadge, _extends({}, args, {
21
+ baseSize: 25,
22
+ circleSize: 15
23
+ }), ___EmotionJSX(Icon, {
24
+ icon: GroupIcon,
25
+ size: "25px",
26
+ color: "accent.40"
27
+ }), ___EmotionJSX(Icon, {
28
+ icon: ArrowIcon,
29
+ size: "13px",
30
+ color: "accent.40"
31
+ })));
32
+ };
@@ -0,0 +1,53 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import React from 'react';
3
+ import { render, screen } from '@testing-library/react';
4
+ import { IconBadge, Icon } from '../../index';
5
+ import axeTest from '../../utils/testUtils/testAxe';
6
+ import { jsx as ___EmotionJSX } from "@emotion/react";
7
+ var testId = 'test-icon';
8
+ var defaultProps = {
9
+ 'data-testid': testId
10
+ };
11
+
12
+ var ThisIcon = function ThisIcon(args) {
13
+ return ___EmotionJSX("svg", _extends({
14
+ fill: "none",
15
+ xmlns: "http://www.w3.org/2000/svg"
16
+ }, args), ___EmotionJSX("path", {
17
+ d: "M12.5 7.28125C14.1979 7.28125 15.6979 7.6875 16.9167 8.21875C18.0417 8.71875 18.75 9.84375 18.75 11.0625V12.75H6.25V11.0729C6.25 9.84375 6.95833 8.71875 8.08333 8.22917C9.30208 7.6875 10.8021 7.28125 12.5 7.28125ZM4.16667 7.54167C5.3125 7.54167 6.25 6.60417 6.25 5.45833C6.25 4.3125 5.3125 3.375 4.16667 3.375C3.02083 3.375 2.08333 4.3125 2.08333 5.45833C2.08333 6.60417 3.02083 7.54167 4.16667 7.54167ZM5.34375 8.6875C4.95833 8.625 4.57292 8.58333 4.16667 8.58333C3.13542 8.58333 2.15625 8.80208 1.27083 9.1875C0.5 9.52083 0 10.2708 0 11.1146V12.75H4.6875V11.0729C4.6875 10.2083 4.92708 9.39583 5.34375 8.6875ZM20.8333 7.54167C21.9792 7.54167 22.9167 6.60417 22.9167 5.45833C22.9167 4.3125 21.9792 3.375 20.8333 3.375C19.6875 3.375 18.75 4.3125 18.75 5.45833C18.75 6.60417 19.6875 7.54167 20.8333 7.54167ZM25 11.1146C25 10.2708 24.5 9.52083 23.7292 9.1875C22.8437 8.80208 21.8646 8.58333 20.8333 8.58333C20.4271 8.58333 20.0417 8.625 19.6563 8.6875C20.0729 9.39583 20.3125 10.2083 20.3125 11.0729V12.75H25V11.1146ZM12.5 0.25C14.2292 0.25 15.625 1.64583 15.625 3.375C15.625 5.10417 14.2292 6.5 12.5 6.5C10.7708 6.5 9.375 5.10417 9.375 3.375C9.375 1.64583 10.7708 0.25 12.5 0.25Z",
18
+ fill: "currentColor"
19
+ }));
20
+ };
21
+
22
+ var ThisSecondIcon = function ThisSecondIcon(args) {
23
+ return ___EmotionJSX("svg", _extends({
24
+ fill: "none",
25
+ xmlns: "http://www.w3.org/2000/svg"
26
+ }, args), ___EmotionJSX("path", {
27
+ d: "M1.71875 0.624999L7.96875 0.625L7.96875 6.875L6.09375 6.875L6.09375 3.89375L1.73125 8.125L0.46875 6.85625L4.75 2.5L1.71875 2.5L1.71875 0.624999Z",
28
+ fill: "currentColor"
29
+ }));
30
+ };
31
+
32
+ var getComponent = function getComponent() {
33
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
34
+ return render(___EmotionJSX(IconBadge, _extends({}, props, {
35
+ backgroundColor: "white"
36
+ }, defaultProps), ___EmotionJSX(Icon, {
37
+ icon: ThisIcon,
38
+ size: "25px",
39
+ color: "accent.40"
40
+ }), ___EmotionJSX(Icon, {
41
+ icon: ThisSecondIcon,
42
+ size: "9px",
43
+ color: "accent.40"
44
+ })));
45
+ }; // Need to be added to each test file to test accessibility using axe.
46
+
47
+
48
+ axeTest(getComponent);
49
+ test('default iconbadge render', function () {
50
+ getComponent();
51
+ var iconButton = screen.getByTestId(testId);
52
+ expect(iconButton).toBeInTheDocument();
53
+ });
@@ -0,0 +1 @@
1
+ export { default } from './IconBadge';
package/lib/index.js CHANGED
@@ -43,6 +43,8 @@ export { default as HelpHint } from './components/HelpHint';
43
43
  export * from './components/HelpHint';
44
44
  export { default as Icon } from './components/Icon';
45
45
  export * from './components/Icon';
46
+ export { default as IconBadge } from './components/IconBadge';
47
+ export * from './components/IconBadge';
46
48
  export { default as IconButton } from './components/IconButton';
47
49
  export * from './components/IconButton';
48
50
  export { default as IconButtonToggle } from './components/IconButtonToggle';
@@ -12,16 +12,28 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
12
12
  export default {
13
13
  title: 'Recipes/Panel Header'
14
14
  };
15
+ var sx = {
16
+ wrapper: {
17
+ width: 'fit-content',
18
+ alignItems: 'center',
19
+ bg: 'accent.99',
20
+ py: 'sm',
21
+ pl: 'md'
22
+ },
23
+ title: {
24
+ fontSize: 'md',
25
+ lineHeight: '18px'
26
+ },
27
+ subtitle: {
28
+ fontSize: 'sm',
29
+ my: '1px',
30
+ lineHeight: '16px'
31
+ }
32
+ };
15
33
  export var Default = function Default() {
16
34
  return ___EmotionJSX(Box, {
17
- bg: "accent.99",
18
- py: "sm",
19
- pl: "md",
20
35
  isRow: true,
21
- alignItems: "center",
22
- sx: {
23
- width: 'fit-content'
24
- }
36
+ sx: sx.wrapper
25
37
  }, ___EmotionJSX(Icon, {
26
38
  icon: AccountIcon,
27
39
  size: 25,
@@ -30,17 +42,10 @@ export var Default = function Default() {
30
42
  ml: "sm",
31
43
  mr: "xx"
32
44
  }, ___EmotionJSX(Text, {
33
- sx: {
34
- fontSize: 'md',
35
- lineHeight: '18px'
36
- },
45
+ sx: sx.title,
37
46
  variant: "bodyStrong"
38
47
  }, "Fons Vernall"), ___EmotionJSX(Text, {
39
- sx: {
40
- fontSize: 'sm',
41
- my: '1px',
42
- lineHeight: '16px'
43
- },
48
+ sx: sx.subtitle,
44
49
  variant: "subtitle"
45
50
  }, "fvernall0@google.it")), ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(IconButton, {
46
51
  "aria-label": "Menu Button"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.29.0",
3
+ "version": "1.30.0-alpha.0",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",