@pingux/astro 1.16.0 → 1.17.0-alpha.1

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.
Files changed (42) hide show
  1. package/lib/cjs/components/ArrayField/ArrayField.js +5 -1
  2. package/lib/cjs/components/ArrayField/ArrayField.stories.js +1 -0
  3. package/lib/cjs/components/Button/Button.js +5 -0
  4. package/lib/cjs/components/ComboBoxField/ComboBoxField.js +40 -7
  5. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +58 -2
  6. package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +123 -25
  7. package/lib/cjs/components/Image/Image.js +14 -3
  8. package/lib/cjs/components/Image/Image.stories.js +17 -8
  9. package/lib/cjs/components/Image/Image.test.js +9 -0
  10. package/lib/cjs/components/Link/Link.js +5 -0
  11. package/lib/cjs/components/ListView/ListView.js +6 -0
  12. package/lib/cjs/components/Messages/Messages.js +4 -0
  13. package/lib/cjs/components/Modal/Modal.js +5 -0
  14. package/lib/cjs/components/NavBar/NavBar.stories.js +1 -1
  15. package/lib/cjs/components/OverlayPanel/OverlayPanel.js +3 -0
  16. package/lib/cjs/components/RequirementsList/RequirementsList.js +4 -0
  17. package/lib/cjs/components/ScrollBox/ScrollBox.js +5 -2
  18. package/lib/cjs/components/Stepper/Stepper.js +6 -0
  19. package/lib/cjs/components/Tab/Tab.js +4 -0
  20. package/lib/cjs/components/Tabs/Tabs.js +4 -0
  21. package/lib/components/ArrayField/ArrayField.js +6 -1
  22. package/lib/components/ArrayField/ArrayField.stories.js +1 -0
  23. package/lib/components/Button/Button.js +6 -0
  24. package/lib/components/ComboBoxField/ComboBoxField.js +40 -8
  25. package/lib/components/ComboBoxField/ComboBoxField.stories.js +51 -0
  26. package/lib/components/ComboBoxField/ComboBoxField.test.js +106 -25
  27. package/lib/components/Image/Image.js +15 -4
  28. package/lib/components/Image/Image.stories.js +17 -8
  29. package/lib/components/Image/Image.test.js +9 -0
  30. package/lib/components/Link/Link.js +6 -0
  31. package/lib/components/ListView/ListView.js +6 -0
  32. package/lib/components/Messages/Messages.js +5 -0
  33. package/lib/components/Modal/Modal.js +6 -0
  34. package/lib/components/NavBar/NavBar.stories.js +1 -1
  35. package/lib/components/OverlayPanel/OverlayPanel.js +4 -0
  36. package/lib/components/RequirementsList/RequirementsList.js +5 -0
  37. package/lib/components/ScrollBox/ScrollBox.js +6 -2
  38. package/lib/components/Stepper/Stepper.js +6 -0
  39. package/lib/components/Tab/Tab.js +5 -0
  40. package/lib/components/Tabs/Tabs.js +4 -0
  41. package/package.json +1 -1
  42. package/NOTICE.html +0 -4292
@@ -35,12 +35,15 @@ export default {
35
35
  export var Default = function Default(_ref) {
36
36
  var args = _extends({}, _ref);
37
37
 
38
- return ___EmotionJSX(Image, args);
38
+ return ___EmotionJSX(Image, _extends({}, args, {
39
+ alt: "Ping identity square logo"
40
+ }));
39
41
  };
40
42
  export var Avatar = function Avatar() {
41
43
  return ___EmotionJSX(Image, {
42
44
  src: pingImg,
43
- variant: "images.avatar"
45
+ variant: "images.avatar",
46
+ alt: "Ping identity round avatar"
44
47
  });
45
48
  };
46
49
  export var CustomSizeAndRadius = function CustomSizeAndRadius() {
@@ -51,13 +54,15 @@ export var CustomSizeAndRadius = function CustomSizeAndRadius() {
51
54
  height: '70px',
52
55
  borderRadius: 8,
53
56
  bg: 'neutral.90'
54
- }
57
+ },
58
+ alt: "Terry Crews in a red suite"
55
59
  });
56
60
  };
57
61
  export var Disabled = function Disabled() {
58
62
  return ___EmotionJSX(Image, {
59
63
  src: pingImg,
60
- isDisabled: true
64
+ isDisabled: true,
65
+ alt: "Ping identity square logo"
61
66
  });
62
67
  };
63
68
  export var FallbackImage = function FallbackImage() {
@@ -67,7 +72,8 @@ export var FallbackImage = function FallbackImage() {
67
72
  sx: {
68
73
  width: '150px',
69
74
  height: '150px'
70
- }
75
+ },
76
+ alt: "Random image"
71
77
  });
72
78
  };
73
79
  export var WithSkeletonLoadSuccess = function WithSkeletonLoadSuccess(_ref2) {
@@ -78,7 +84,8 @@ export var WithSkeletonLoadSuccess = function WithSkeletonLoadSuccess(_ref2) {
78
84
  sx: {
79
85
  width: '150px',
80
86
  height: '150px'
81
- }
87
+ },
88
+ alt: "Random image"
82
89
  });
83
90
  };
84
91
  WithSkeletonLoadSuccess.args = {
@@ -90,7 +97,8 @@ export var WithSkeletonLoadTimeout = function WithSkeletonLoadTimeout() {
90
97
  sx: {
91
98
  width: '150px',
92
99
  height: '150px'
93
- }
100
+ },
101
+ alt: "Random image"
94
102
  });
95
103
  };
96
104
  export var UpdatingImageSrc = function UpdatingImageSrc() {
@@ -116,6 +124,7 @@ export var UpdatingImageSrc = function UpdatingImageSrc() {
116
124
  width: '200px',
117
125
  height: '200px',
118
126
  mt: '25px'
119
- }
127
+ },
128
+ alt: image === pingImg ? 'Ping identity square logo' : 'Terry Crews in a red suite'
120
129
  }));
121
130
  };
@@ -76,6 +76,15 @@ test('image shows disabled status', function () {
76
76
  var img = screen.getByRole('img');
77
77
  expect(img).toHaveClass('is-disabled');
78
78
  });
79
+ test('image with alt text', function () {
80
+ getComponent({
81
+ alt: 'Test'
82
+ });
83
+ act(function () {
84
+ fallbackImageObj.onImageLoad();
85
+ });
86
+ expect(screen.getByAltText('Test')).toBeInTheDocument();
87
+ });
79
88
  test('image source is able to be changed', function () {
80
89
  var src2 = 'second-src';
81
90
 
@@ -9,6 +9,12 @@ import { useFocusRing } from '@react-aria/focus';
9
9
  import { useHover, usePress } from '@react-aria/interactions';
10
10
  import { mergeProps } from '@react-aria/utils';
11
11
  import { usePropWarning, useStatusClasses } from '../../hooks';
12
+ /**
13
+ * Link uses the [Link - Theme-UI](https://theme-ui.com/components/link) component and
14
+ * React Aria's [useLink](https://react-spectrum.adobe.com/react-aria/useLink.html) hook.
15
+ *
16
+ */
17
+
12
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
13
19
  var Link = /*#__PURE__*/forwardRef(function (props, ref) {
14
20
  var className = props.className,
@@ -58,6 +58,12 @@ export function useListLayout(state) {
58
58
  layout.disabledKeys = state.disabledKeys;
59
59
  return layout;
60
60
  }
61
+ /**
62
+ * ListViews are used to display a list of items. Users can select,
63
+ * view, or edit items in this list. This virtualized component supports
64
+ * asynchronous data in infinitely scrollable lists.
65
+ */
66
+
61
67
  var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
62
68
  var disabledKeys = props.disabledKeys,
63
69
  loadingState = props.loadingState,
@@ -10,6 +10,11 @@ import { useListState } from '@react-stately/list';
10
10
  import statuses from '../../utils/devUtils/constants/statuses';
11
11
  import Message from './Message';
12
12
  import Box from '../Box';
13
+ /**
14
+ *Messages are intended to display non-critical alerts that
15
+ attract the users’ attention, but do not interfere or temporarily block their work.
16
+ */
17
+
13
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
14
19
  var Messages = /*#__PURE__*/forwardRef(function (props, ref) {
15
20
  var _context;
@@ -26,6 +26,12 @@ import IconButton from '../IconButton';
26
26
  import Icon from '../Icon';
27
27
  import Text from '../Text';
28
28
  import { useStatusClasses, useDeprecationWarning } from '../../hooks';
29
+ /**
30
+ * Modals are overlays that interrupt a user’s workflow to convey an important message.
31
+ * The component must be wrapped in an OverlayProvider, and the first child should be a trigger,
32
+ * such as Button.
33
+ */
34
+
29
35
  import { jsx as ___EmotionJSX } from "@emotion/react";
30
36
  var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
31
37
  var className = props.className,
@@ -12,7 +12,7 @@ import { Separator, Box, Link, NavBar, NavBarSection, NavBarItemButton, NavBarIt
12
12
  import { jsx as ___EmotionJSX } from "@emotion/react";
13
13
  export default {
14
14
  title: 'NavBar',
15
- component: 'NavBar',
15
+ component: NavBar,
16
16
  subcomponents: {
17
17
  NavBarSection: NavBarSection,
18
18
  NavBarItemLink: NavBarItemLink,
@@ -9,6 +9,10 @@ import { FocusScope } from '@react-aria/focus';
9
9
  import Box from '../Box';
10
10
  import { useStatusClasses, useOverlayPanelState } from '../../hooks';
11
11
  import { panelSizes } from '../../utils/devUtils/constants/panelSizes';
12
+ /**
13
+ * In Astro, side panels are used to show details and present modal interactions.
14
+ */
15
+
12
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
13
17
  var OverlayPanel = /*#__PURE__*/forwardRef(function (props, ref) {
14
18
  var _props$sx;
@@ -11,6 +11,11 @@ import DefaultCircle from 'mdi-react/CheckboxBlankCircleOutlineIcon';
11
11
  import Box from '../Box';
12
12
  import Text from '../Text';
13
13
  import Icon from '../Icon';
14
+ /**
15
+ * List of requirements for a password, with indicators that can change to show when
16
+ * requirements are satisfied.
17
+ */
18
+
14
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
20
  var RequirementsList = /*#__PURE__*/forwardRef(function (props, ref) {
16
21
  var requirements = props.requirements,
@@ -20,6 +20,10 @@ import React, { forwardRef, useImperativeHandle, useLayoutEffect, useRef, useSta
20
20
  import PropTypes from 'prop-types';
21
21
  import Box from '../Box';
22
22
  import useStatusClasses from '../../hooks/useStatusClasses';
23
+ /**
24
+ * Scrollbox is a container that allows content to be scrolled
25
+ */
26
+
23
27
  import { jsx as ___EmotionJSX } from "@emotion/react";
24
28
  var ScrollBox = /*#__PURE__*/forwardRef(function (props, ref) {
25
29
  var maxHeight = props.maxHeight,
@@ -31,7 +35,7 @@ var ScrollBox = /*#__PURE__*/forwardRef(function (props, ref) {
31
35
 
32
36
  var _useState = useState(0),
33
37
  _useState2 = _slicedToArray(_useState, 2),
34
- scrollTopPostion = _useState2[0],
38
+ scrollTopPosition = _useState2[0],
35
39
  setScrollTopPosition = _useState2[1];
36
40
 
37
41
  var _useState3 = useState(false),
@@ -59,7 +63,7 @@ var ScrollBox = /*#__PURE__*/forwardRef(function (props, ref) {
59
63
  setIsTopShadowShowing(outerRef.current.firstChild.scrollTop !== 0);
60
64
  }
61
65
  }
62
- }, [scrollTopPostion]);
66
+ }, [scrollTopPosition]);
63
67
  /* istanbul ignore next */
64
68
 
65
69
  var onScroll = function onScroll() {
@@ -31,6 +31,12 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
31
31
  var ACTIVE = stepStatuses.ACTIVE,
32
32
  COMPLETED = stepStatuses.COMPLETED,
33
33
  INACTIVE = stepStatuses.INACTIVE;
34
+ /**
35
+ * The Stepper component acts as a wrapper for individual Step components.
36
+ * Stepper is used to display progress through a sequence of logical and numbered steps
37
+ * usually within a configuration wizard.
38
+ */
39
+
34
40
  var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
35
41
  var activeStep = props.activeStep,
36
42
  onStepChange = props.onStepChange,
@@ -13,6 +13,11 @@ import { useStatusClasses, usePropWarning } from '../../hooks';
13
13
  import ORIENTATION from '../../utils/devUtils/constants/orientation';
14
14
  import TabPicker from '../TabPicker';
15
15
  import { Box, Text, TooltipTrigger, Tooltip, Button } from '../..';
16
+ /**
17
+ * Tab control for dividing up closely-related content.
18
+ * Typically used as a child of the Tabs component.
19
+ */
20
+
16
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
17
22
  export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
18
23
  var className = props.className,
@@ -28,6 +28,10 @@ import ORIENTATION from '../../utils/devUtils/constants/orientation';
28
28
  import { usePropWarning } from '../../hooks';
29
29
  import { jsx as ___EmotionJSX } from "@emotion/react";
30
30
  export var TabsContext = /*#__PURE__*/React.createContext({});
31
+ /**
32
+ * Tabs are used to divide content, navigate to other views, and indicate work progress.
33
+ */
34
+
31
35
  var Tabs = /*#__PURE__*/forwardRef(function (props, ref) {
32
36
  var _context4, _context5;
33
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.16.0",
3
+ "version": "1.17.0-alpha.1",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "ux-development@pingidentity.com",
6
6
  "license": "Apache-2.0",