@pingux/astro 1.42.2-alpha.1 → 1.42.2-alpha.3

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.
@@ -20,8 +20,6 @@ require("prismjs/components/prism-powershell");
20
20
 
21
21
  var _CodeView = _interopRequireDefault(require("./CodeView"));
22
22
 
23
- var _ = require("../..");
24
-
25
23
  var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
26
24
 
27
25
  var _CodeView2 = _interopRequireDefault(require("./CodeView.mdx"));
@@ -69,21 +67,13 @@ var _default = {
69
67
  exports["default"] = _default;
70
68
 
71
69
  var Default = function Default(args) {
72
- return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_.Text, {
73
- sx: {
74
- fontWeight: 2
75
- }
76
- }, "JSON"), (0, _react2.jsx)(_CodeView["default"], args));
70
+ return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_CodeView["default"], args));
77
71
  };
78
72
 
79
73
  exports.Default = Default;
80
74
 
81
75
  var WithLineNumbers = function WithLineNumbers() {
82
- return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_.Text, {
83
- sx: {
84
- fontWeight: 2
85
- }
86
- }, "JSON"), (0, _react2.jsx)(_CodeView["default"], {
76
+ return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_CodeView["default"], {
87
77
  hasLineNumbers: true
88
78
  }, code));
89
79
  };
@@ -173,6 +173,7 @@ var ColorField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
173
173
  hasNoArrow: true,
174
174
  isDismissable: true,
175
175
  isNonModal: true,
176
+ isNotClosedOnBlur: true,
176
177
  isOpen: popoverState.isOpen,
177
178
  onClose: popoverState.close,
178
179
  ref: overlayRef
@@ -68,4 +68,24 @@ test('will call onChange with arguments if provided', function () {
68
68
  _userEvent["default"].type(hexInput, testColor2);
69
69
 
70
70
  expect(testOnChange).toHaveBeenCalled();
71
+ });
72
+ test('clicking within the popover does not close it', function () {
73
+ var testOnChange = jest.fn();
74
+ getComponent({
75
+ onChange: testOnChange,
76
+ value: testColor1
77
+ });
78
+
79
+ var button = _testWrapper.screen.getByRole('button');
80
+
81
+ _userEvent["default"].click(button); // should be open now
82
+
83
+
84
+ var hexLabelElement = _testWrapper.screen.queryByText(hexLabel);
85
+
86
+ expect(hexLabelElement).toBeInTheDocument(); // click the popover container, which has caused closing in regressions
87
+
88
+ _userEvent["default"].click(_testWrapper.screen.queryByRole('presentation'));
89
+
90
+ expect(_testWrapper.screen.queryByRole('presentation')).toBeInTheDocument();
71
91
  });
@@ -43,7 +43,7 @@ var CopyButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
43
43
  variant: "buttons.copy"
44
44
  }, (0, _lodash.omit)(props, 'iconProps')), (0, _react2.jsx)(_Icon["default"], (0, _extends2["default"])({
45
45
  icon: _ContentCopyIcon["default"],
46
- size: 15,
46
+ size: "xs",
47
47
  color: "text.secondary"
48
48
  }, props === null || props === void 0 ? void 0 : props.iconProps)));
49
49
  });
@@ -115,7 +115,7 @@ var SVGIcons = function SVGIcons() {
115
115
  return (0, _react2.jsx)(_index.Icon, {
116
116
  icon: SVGComponent,
117
117
  color: "active",
118
- size: 40
118
+ size: "sm"
119
119
  });
120
120
  };
121
121
 
@@ -3,7 +3,6 @@ import React from 'react';
3
3
  import Prism from 'prismjs';
4
4
  import 'prismjs/components/prism-powershell';
5
5
  import CodeView from './CodeView';
6
- import { Text } from '../..';
7
6
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
8
7
  import CodeViewReadme from './CodeView.mdx';
9
8
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -46,18 +45,10 @@ export default {
46
45
  }
47
46
  };
48
47
  export var Default = function Default(args) {
49
- return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Text, {
50
- sx: {
51
- fontWeight: 2
52
- }
53
- }, "JSON"), ___EmotionJSX(CodeView, args));
48
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(CodeView, args));
54
49
  };
55
50
  export var WithLineNumbers = function WithLineNumbers() {
56
- return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Text, {
57
- sx: {
58
- fontWeight: 2
59
- }
60
- }, "JSON"), ___EmotionJSX(CodeView, {
51
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(CodeView, {
61
52
  hasLineNumbers: true
62
53
  }, code));
63
54
  };
@@ -127,6 +127,7 @@ var ColorField = /*#__PURE__*/forwardRef(function (props, ref) {
127
127
  hasNoArrow: true,
128
128
  isDismissable: true,
129
129
  isNonModal: true,
130
+ isNotClosedOnBlur: true,
130
131
  isOpen: popoverState.isOpen,
131
132
  onClose: popoverState.close,
132
133
  ref: overlayRef
@@ -47,4 +47,19 @@ test('will call onChange with arguments if provided', function () {
47
47
  userEvent.clear(hexInput);
48
48
  userEvent.type(hexInput, testColor2);
49
49
  expect(testOnChange).toHaveBeenCalled();
50
+ });
51
+ test('clicking within the popover does not close it', function () {
52
+ var testOnChange = jest.fn();
53
+ getComponent({
54
+ onChange: testOnChange,
55
+ value: testColor1
56
+ });
57
+ var button = screen.getByRole('button');
58
+ userEvent.click(button); // should be open now
59
+
60
+ var hexLabelElement = screen.queryByText(hexLabel);
61
+ expect(hexLabelElement).toBeInTheDocument(); // click the popover container, which has caused closing in regressions
62
+
63
+ userEvent.click(screen.queryByRole('presentation'));
64
+ expect(screen.queryByRole('presentation')).toBeInTheDocument();
50
65
  });
@@ -13,7 +13,7 @@ var CopyButton = /*#__PURE__*/forwardRef(function (props, ref) {
13
13
  variant: "buttons.copy"
14
14
  }, omit(props, 'iconProps')), ___EmotionJSX(Icon, _extends({
15
15
  icon: ContentCopy,
16
- size: 15,
16
+ size: "xs",
17
17
  color: "text.secondary"
18
18
  }, props === null || props === void 0 ? void 0 : props.iconProps)));
19
19
  });
@@ -81,7 +81,7 @@ export var SVGIcons = function SVGIcons() {
81
81
  return ___EmotionJSX(Icon, {
82
82
  icon: SVGComponent,
83
83
  color: "active",
84
- size: 40
84
+ size: "sm"
85
85
  });
86
86
  };
87
87
  var rowHeadings = ['SVG Size', 'Code Example', 'Icon Example'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.42.2-alpha.1",
3
+ "version": "1.42.2-alpha.3",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",