@pingux/astro 2.0.0-rc.0 → 2.0.1-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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,62 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.0.0](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.44.1...@pingux/astro@2.0.0) (2023-03-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * [UIP-5746] "Update enduser theme in astro for v2 changes" ([e4e71f7](https://gitlab.corp.pingidentity.com/ux/pingux/commit/e4e71f742978d14f6a16ef00bedfc847e18a234c))
12
+ * [UIP-5748] Update theme overrides for v2 theme changes ([f734f35](https://gitlab.corp.pingidentity.com/ux/pingux/commit/f734f35a0ec99a0ae67c9447c7f032bfbdb77311))
13
+ * [UIP-5781] Styling regression fix ([1475102](https://gitlab.corp.pingidentity.com/ux/pingux/commit/14751028b397880893b428eda0016d9b128407db))
14
+ * [UIP-5827] Input components refactor prop spreading ([b667ca1](https://gitlab.corp.pingidentity.com/ux/pingux/commit/b667ca13176dba506056fbd12254ac1797f1b0fc))
15
+ * [UIP-5997 Astro Modal Fix IconButton Focus Styling ([2af0ebc](https://gitlab.corp.pingidentity.com/ux/pingux/commit/2af0ebc9276341fb3e8205dc39a449d8a74971ff))
16
+ * [UIP-6015] Astro accordion recipe updates ([44d1133](https://gitlab.corp.pingidentity.com/ux/pingux/commit/44d11332237f55e42d5fef03a54b60a4318a5df1))
17
+ * [UIP-6016] Astro badge story updates ([2b68dbc](https://gitlab.corp.pingidentity.com/ux/pingux/commit/2b68dbcca5a7e3707087f17f65ace8b2e5829452))
18
+ * [UIP-6029] Update OverlayPanel to ListView ([209bdcd](https://gitlab.corp.pingidentity.com/ux/pingux/commit/209bdcdc2b04361e76a6f96386518a159ee367bf))
19
+ * [UIP-6097] Missing Focus Indicators: HelpHint/CollapsiblePanel/CopyText ([05b724a](https://gitlab.corp.pingidentity.com/ux/pingux/commit/05b724aa5e2eed543b10a6f5397c3770277792fb))
20
+ * [UIP-6102] Badge story: fix IconButton variant ([de15e14](https://gitlab.corp.pingidentity.com/ux/pingux/commit/de15e146969c1ba76261bc6c43571f068cde0384))
21
+ * [UIP-6103] ListViewItem: fix border bottom color ([95ca43f](https://gitlab.corp.pingidentity.com/ux/pingux/commit/95ca43f01580df8d8d3ecb6dbe583652c7380eb6)), closes [#e4e6e9](https://gitlab.corp.pingidentity.com/ux/pingux/issues/e4e6e9) [#caced3](https://gitlab.corp.pingidentity.com/ux/pingux/issues/caced3)
22
+ * [UIP-6105] ScrollableListView: fix search field focus ([e89f8a7](https://gitlab.corp.pingidentity.com/ux/pingux/commit/e89f8a7cb304f1a834cc204ce712586b9777d5c5))
23
+ * [UIP-6107] Combobox: fix width ([b9382ec](https://gitlab.corp.pingidentity.com/ux/pingux/commit/b9382ec643048443efb8ccabefcd6f2020eca8af))
24
+ * [UIP-6109] Extra spacing in bracket between content ([888085a](https://gitlab.corp.pingidentity.com/ux/pingux/commit/888085a53fca7d224e69ec1ee4fd4efa1215060c))
25
+ * [UIP-6112] Fix Card Styling ([4fe3c45](https://gitlab.corp.pingidentity.com/ux/pingux/commit/4fe3c45e69048945323c226512c1efbe97eda1c1))
26
+ * [UIP-6115] Multivalues Delete Focus Indicator ([c282968](https://gitlab.corp.pingidentity.com/ux/pingux/commit/c282968e0c50f752439ece4f6d92e4815a8ab92b))
27
+ * [UIP-6116] MultivaluesField close button for icon slots variant ([51fb36e](https://gitlab.corp.pingidentity.com/ux/pingux/commit/51fb36ec6ddb7ffce77d5ee0e11ab25ff3637e58))
28
+ * [UIP-6159] Button & IconButton: add usePress hook to handle context ([9b8f3d1](https://gitlab.corp.pingidentity.com/ux/pingux/commit/9b8f3d1926aee7719641d36712a3eabf21347758))
29
+ * [UIP-6193] MultiValuesField: trim custom value ([7a9c159](https://gitlab.corp.pingidentity.com/ux/pingux/commit/7a9c159659a19fe2b5780cc800af52746551d4d5))
30
+ * [UIP-6197] uiLibraryOverride fix ThemeProvider ([6d942db](https://gitlab.corp.pingidentity.com/ux/pingux/commit/6d942dbd620da9a4c97d09c8dc099812085074f9))
31
+ * [UIP-6199] TooltipTrigger incorrect placement with SwitchField ([5ce835b](https://gitlab.corp.pingidentity.com/ux/pingux/commit/5ce835bce13578467f8eedae6170c15f58f7a92e))
32
+ * [UIP-6218] NavBar: fix primary items variants ([0e16f2e](https://gitlab.corp.pingidentity.com/ux/pingux/commit/0e16f2e8e33acfedf51e35f15e7e5d1a7604377e))
33
+ * [UIP-6220] Down grade @emotion/react and @emotion/styled to 11.1.1 ([508a398](https://gitlab.corp.pingidentity.com/ux/pingux/commit/508a398aca2b2ffcf4742f5086ea2ff293c5c485))
34
+
35
+
36
+ * ci!: [UIP-6036]: publish astro alpha only ([84e2093](https://gitlab.corp.pingidentity.com/ux/pingux/commit/84e2093bf4c84c45127e5619d252db09142ed0ac))
37
+
38
+
39
+ ### Features
40
+
41
+ * [UIP-5938] Update astro nano theme to support v2 ([e317303](https://gitlab.corp.pingidentity.com/ux/pingux/commit/e317303585ade483073f8ece9cff036f10dfa2f0))
42
+ * [UIP-5983] setup chromatic only stories ([aed7966](https://gitlab.corp.pingidentity.com/ux/pingux/commit/aed79668ca9db752d648f19dd4787a12a9875746))
43
+
44
+
45
+ ### BREAKING CHANGES
46
+
47
+ * This change includes Astro v2 changes which will be documented in a migration guide coming soon.
48
+
49
+ ## Describe your changes
50
+ Use `npm publish` to publish only astro to Artifactory by adding the registry in `package.json`, as scene at the bottom of [this doc](https://docs.npmjs.com/cli/v8/using-npm/registry)
51
+ ## Checklist before requesting a review
52
+ - [:white_check_mark: ] I have performed a self-review of my code
53
+ - [n/a] I have added tests for any new or fixed functionality to prevent regressions
54
+ - [:white_check_mark: ] I have added clarifying code comments to blocks which other devs may have questions on
55
+
56
+ Closes UIP-6036
57
+
58
+
59
+
60
+
61
+
6
62
  ## [1.44.1](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.44.0...@pingux/astro@1.44.1) (2023-03-22)
7
63
 
8
64
  **Note:** Version bump only for package @pingux/astro
@@ -32,8 +32,7 @@ var TooltipWrapper = function TooltipWrapper(_ref) {
32
32
  others = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
33
33
  return (0, _react2.jsx)(_index.TooltipTrigger, (0, _extends2["default"])({
34
34
  key: tooltip,
35
- direction: "top",
36
- isNotFlippable: true
35
+ direction: "top"
37
36
  }, others), children, (0, _react2.jsx)(_index.Tooltip, null, tooltip));
38
37
  };
39
38
  TooltipWrapper.propTypes = {
@@ -15,6 +15,11 @@ var _react2 = require("@emotion/react");
15
15
  var _default = {
16
16
  title: 'Components/CopyText',
17
17
  component: _index.CopyText,
18
+ decorators: [function (Story) {
19
+ return (0, _react2.jsx)(_index.Box, {
20
+ pt: "10px"
21
+ }, (0, _react2.jsx)(Story, null));
22
+ }],
18
23
  parameters: {
19
24
  docs: {
20
25
  page: function page() {
@@ -18,6 +18,7 @@ exports["default"] = void 0;
18
18
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
19
19
  var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
20
20
  var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
21
+ var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
21
22
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
22
23
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
23
24
  var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
@@ -202,7 +203,10 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
202
203
  }, [isOpen]);
203
204
  var addNewBadgeFromInput = function addNewBadgeFromInput(inputValue) {
204
205
  var _context3, _context4;
205
- var key = inputValue;
206
+ var key = (0, _trim["default"])(inputValue).call(inputValue);
207
+ if (key === '') {
208
+ return;
209
+ }
206
210
  if (state.selectionManager.isSelected(key)) {
207
211
  return;
208
212
  }
@@ -582,4 +582,28 @@ test('form does not submit when adding custom value', function () {
582
582
  expect(input).toHaveValue('');
583
583
  _userEvent["default"].type(input, '{enter}');
584
584
  expect(onFormSubmit).not.toHaveBeenCalled();
585
+ });
586
+ test('in non-restrictive mode the value should be trimmed', function () {
587
+ getComponent({
588
+ mode: 'non-restrictive'
589
+ });
590
+ var input = _testWrapper.screen.getByRole('combobox');
591
+ expect(input).toHaveValue('');
592
+ var value = 'test ';
593
+ var trimmedValue = 'test';
594
+ _userEvent["default"].type(input, value);
595
+ _userEvent["default"].type(input, '{enter}');
596
+ var badge = _testWrapper.screen.queryByText(value, {
597
+ normalizer: (0, _testWrapper.getDefaultNormalizer)({
598
+ trim: false
599
+ })
600
+ });
601
+ var trimmedBadge = _testWrapper.screen.queryByText(trimmedValue, {
602
+ normalizer: (0, _testWrapper.getDefaultNormalizer)({
603
+ trim: false
604
+ })
605
+ });
606
+ expect(badge).not.toBeInTheDocument();
607
+ expect(trimmedBadge).toBeInTheDocument();
608
+ expect(input).toHaveValue('');
585
609
  });
@@ -112,7 +112,7 @@ var NavBarPrimaryItemHeader = function NavBarPrimaryItemHeader(_ref) {
112
112
  },
113
113
  "aria-hidden": "true"
114
114
  }), (0, _react2.jsx)(_index.Text, {
115
- variant: "navBarHeaderText"
115
+ variant: "variants.navBar.headerText"
116
116
  }, heading), (0, _react2.jsx)(_index.Box, {
117
117
  isRow: true,
118
118
  alignItems: "center",
@@ -142,7 +142,7 @@ var SectionItem = function SectionItem(_ref2) {
142
142
  var PrimaryItem = function PrimaryItem(_ref3) {
143
143
  var item = _ref3.item;
144
144
  return (0, _react2.jsx)(_.Link, {
145
- variant: "buttons.navBarSectionButton",
145
+ variant: "variants.navBar.sectionButton",
146
146
  href: item.href,
147
147
  target: "_blank"
148
148
  }, (0, _react2.jsx)(_NavBarItemHeader["default"], {
@@ -130,10 +130,14 @@ var Required = function Required() {
130
130
  };
131
131
  exports.Required = Required;
132
132
  var WithTooltip = function WithTooltip() {
133
+ var tooltipTrigger = (0, _react.useRef)();
133
134
  return (0, _react2.jsx)(_index.TooltipTrigger, {
134
135
  crossOffset: 15,
135
- offset: 20
136
- }, (0, _react2.jsx)(_interactions.Pressable, null, (0, _react2.jsx)(_index.SwitchField, {
136
+ offset: 20,
137
+ targetRef: tooltipTrigger
138
+ }, (0, _react2.jsx)(_interactions.Pressable, {
139
+ ref: tooltipTrigger
140
+ }, (0, _react2.jsx)(_index.SwitchField, {
137
141
  "aria-label": "my-label",
138
142
  value: "my-switch"
139
143
  })), (0, _react2.jsx)(_index.Tooltip, null, "Tooltip Content"));
@@ -67,7 +67,13 @@ var buttons = {
67
67
  border: 'none'
68
68
  }
69
69
  })
70
- })
70
+ }),
71
+ filter: {
72
+ '&:not(.disabled):hover': {
73
+ borderColor: 'accent.40',
74
+ color: 'accent.40'
75
+ }
76
+ }
71
77
  };
72
78
  var forms = {
73
79
  input: {
@@ -19,8 +19,7 @@ var TooltipWrapper = function TooltipWrapper(_ref) {
19
19
  others = _objectWithoutProperties(_ref, _excluded);
20
20
  return ___EmotionJSX(TooltipTrigger, _extends({
21
21
  key: tooltip,
22
- direction: "top",
23
- isNotFlippable: true
22
+ direction: "top"
24
23
  }, others), children, ___EmotionJSX(Tooltip, null, tooltip));
25
24
  };
26
25
  TooltipWrapper.propTypes = {
@@ -1,12 +1,17 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
3
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
4
- import { CopyText, Link, Text } from '../../index';
4
+ import { Box, CopyText, Link, Text } from '../../index';
5
5
  import CopyTextReadme from './CopyText.mdx';
6
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
7
7
  export default {
8
8
  title: 'Components/CopyText',
9
9
  component: CopyText,
10
+ decorators: [function (Story) {
11
+ return ___EmotionJSX(Box, {
12
+ pt: "10px"
13
+ }, ___EmotionJSX(Story, null));
14
+ }],
10
15
  parameters: {
11
16
  docs: {
12
17
  page: function page() {
@@ -15,6 +15,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
15
15
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
16
16
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
17
17
  import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
18
+ import _trimInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/trim";
18
19
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
19
20
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
20
21
  import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
@@ -191,7 +192,10 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
191
192
  }, [isOpen]);
192
193
  var addNewBadgeFromInput = function addNewBadgeFromInput(inputValue) {
193
194
  var _context3, _context4;
194
- var key = inputValue;
195
+ var key = _trimInstanceProperty(inputValue).call(inputValue);
196
+ if (key === '') {
197
+ return;
198
+ }
195
199
  if (state.selectionManager.isSelected(key)) {
196
200
  return;
197
201
  }
@@ -16,7 +16,7 @@ import userEvent from '@testing-library/user-event';
16
16
  import { axe } from 'jest-axe';
17
17
  import { Item, MultivaluesField, OverlayProvider } from '../../index';
18
18
  import statuses from '../../utils/devUtils/constants/statuses';
19
- import { render, screen, within } from '../../utils/testUtils/testWrapper';
19
+ import { getDefaultNormalizer, render, screen, within } from '../../utils/testUtils/testWrapper';
20
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
21
21
  var items = [{
22
22
  id: 1,
@@ -579,4 +579,28 @@ test('form does not submit when adding custom value', function () {
579
579
  expect(input).toHaveValue('');
580
580
  userEvent.type(input, '{enter}');
581
581
  expect(onFormSubmit).not.toHaveBeenCalled();
582
+ });
583
+ test('in non-restrictive mode the value should be trimmed', function () {
584
+ getComponent({
585
+ mode: 'non-restrictive'
586
+ });
587
+ var input = screen.getByRole('combobox');
588
+ expect(input).toHaveValue('');
589
+ var value = 'test ';
590
+ var trimmedValue = 'test';
591
+ userEvent.type(input, value);
592
+ userEvent.type(input, '{enter}');
593
+ var badge = screen.queryByText(value, {
594
+ normalizer: getDefaultNormalizer({
595
+ trim: false
596
+ })
597
+ });
598
+ var trimmedBadge = screen.queryByText(trimmedValue, {
599
+ normalizer: getDefaultNormalizer({
600
+ trim: false
601
+ })
602
+ });
603
+ expect(badge).not.toBeInTheDocument();
604
+ expect(trimmedBadge).toBeInTheDocument();
605
+ expect(input).toHaveValue('');
582
606
  });
@@ -99,7 +99,7 @@ var NavBarPrimaryItemHeader = function NavBarPrimaryItemHeader(_ref) {
99
99
  },
100
100
  "aria-hidden": "true"
101
101
  }), ___EmotionJSX(Text, {
102
- variant: "navBarHeaderText"
102
+ variant: "variants.navBar.headerText"
103
103
  }, heading), ___EmotionJSX(Box, {
104
104
  isRow: true,
105
105
  alignItems: "center",
@@ -129,7 +129,7 @@ var SectionItem = function SectionItem(_ref2) {
129
129
  var PrimaryItem = function PrimaryItem(_ref3) {
130
130
  var item = _ref3.item;
131
131
  return ___EmotionJSX(Link, {
132
- variant: "buttons.navBarSectionButton",
132
+ variant: "variants.navBar.sectionButton",
133
133
  href: item.href,
134
134
  target: "_blank"
135
135
  }, ___EmotionJSX(NavBarItemHeader, {
@@ -10,7 +10,7 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
10
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
11
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
13
- import React, { useState } from 'react';
13
+ import React, { useRef, useState } from 'react';
14
14
  import { Pressable } from '@react-aria/interactions';
15
15
  import { SwitchField, Tooltip, TooltipTrigger } from '../../index';
16
16
  import statuses from '../../utils/devUtils/constants/statuses';
@@ -112,10 +112,14 @@ export var Required = function Required() {
112
112
  });
113
113
  };
114
114
  export var WithTooltip = function WithTooltip() {
115
+ var tooltipTrigger = useRef();
115
116
  return ___EmotionJSX(TooltipTrigger, {
116
117
  crossOffset: 15,
117
- offset: 20
118
- }, ___EmotionJSX(Pressable, null, ___EmotionJSX(SwitchField, {
118
+ offset: 20,
119
+ targetRef: tooltipTrigger
120
+ }, ___EmotionJSX(Pressable, {
121
+ ref: tooltipTrigger
122
+ }, ___EmotionJSX(SwitchField, {
119
123
  "aria-label": "my-label",
120
124
  value: "my-switch"
121
125
  })), ___EmotionJSX(Tooltip, null, "Tooltip Content"));
@@ -60,7 +60,13 @@ var buttons = {
60
60
  border: 'none'
61
61
  }
62
62
  })
63
- })
63
+ }),
64
+ filter: {
65
+ '&:not(.disabled):hover': {
66
+ borderColor: 'accent.40',
67
+ color: 'accent.40'
68
+ }
69
+ }
64
70
  };
65
71
  var forms = {
66
72
  input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.0.0-rc.0",
3
+ "version": "2.0.1-alpha.0",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",