@pingux/astro 1.33.0-alpha.2 → 1.33.0-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.
@@ -101,9 +101,12 @@ var AccordionGridItem = function AccordionGridItem(props) {
101
101
  delete rowProps.onPointerDown;
102
102
  delete rowProps.onClick;
103
103
  return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
104
- as: "div"
104
+ as: "div",
105
+ role: "row",
106
+ tabindex: "0"
105
107
  }, (0, _utils.mergeProps)(rowProps, others), {
106
108
  "aria-selected": isSelected,
109
+ "aria-expanded": isSelected,
107
110
  className: classNames,
108
111
  variant: "accordion.accordionGridItem",
109
112
  ref: rowRef
@@ -22,6 +22,8 @@ var _ = _interopRequireDefault(require("."));
22
22
 
23
23
  var _index = require("../../index");
24
24
 
25
+ var _images = require("../../utils/devUtils/constants/images");
26
+
25
27
  var _colors = require("../../styles/colors.js");
26
28
 
27
29
  var _htmlElements = require("../../utils/devUtils/constants/htmlElements");
@@ -93,29 +95,28 @@ var Disabled = function Disabled(_ref4) {
93
95
  return (0, _react2.jsx)(_["default"], (0, _extends2["default"])({
94
96
  bg: "white",
95
97
  isDisabled: true,
96
- sx: {
97
- border: '1px solid',
98
- borderColor: 'neutral.80'
99
- },
100
98
  width: "100%",
101
99
  p: "xl"
102
- }, args), (0, _react2.jsx)(_index.TextField, {
103
- id: "custom-id",
104
- name: "custom-name",
105
- label: "Example Label"
106
- }), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.SelectField, {
107
- label: "What's your favorite color?",
108
- labelMode: "float"
109
- }, (0, _react2.jsx)(_index.Item, {
110
- key: "red"
111
- }, "Red"), (0, _react2.jsx)(_index.Item, {
112
- key: "blue"
113
- }, "Blue"), (0, _react2.jsx)(_index.Item, {
114
- key: "yellow"
115
- }, "Yellow")));
100
+ }, args), (0, _react2.jsx)(_index.Image, {
101
+ alt: "Ping identity square logo",
102
+ src: _images.pingImg,
103
+ sx: {
104
+ width: '40px',
105
+ height: '40px'
106
+ }
107
+ }), (0, _react2.jsx)(_index.Text, {
108
+ fontSize: "xl"
109
+ }, "Exceptional Experiences Start with Secure Identity"));
116
110
  };
117
111
 
118
112
  exports.Disabled = Disabled;
113
+ Disabled.parameters = {
114
+ docs: {
115
+ description: {
116
+ story: 'The disabled state only impacts styling and mouse clicks. Anything with keyboard events will still work.'
117
+ }
118
+ }
119
+ };
119
120
  Disabled.args = {
120
121
  isDisabled: {
121
122
  defaultValue: true
@@ -131,6 +132,13 @@ Disabled.args = {
131
132
  })
132
133
  },
133
134
  defaultValue: 'white'
135
+ },
136
+ sx: {
137
+ border: '1px solid',
138
+ borderColor: 'neutral.80',
139
+ display: 'flex',
140
+ flexDirection: 'row !important',
141
+ gap: '10px'
134
142
  }
135
143
  };
136
144
 
@@ -24,6 +24,8 @@ var _react = _interopRequireWildcard(require("react"));
24
24
 
25
25
  var _propTypes = _interopRequireDefault(require("prop-types"));
26
26
 
27
+ var _uuid = require("uuid");
28
+
27
29
  var _IconButton = _interopRequireDefault(require("../IconButton"));
28
30
 
29
31
  var _TooltipTrigger = _interopRequireWildcard(require("../TooltipTrigger"));
@@ -63,6 +65,7 @@ var HelpHint = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
65
  tooltipProps = props.tooltipProps,
64
66
  iconButtonProps = props.iconButtonProps,
65
67
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
68
+ var tooltipId = (0, _uuid.v4)();
66
69
  return (0, _react2.jsx)(_TooltipTrigger["default"], (0, _extends2["default"])({
67
70
  ref: ref,
68
71
  direction: "top"
@@ -70,9 +73,15 @@ var HelpHint = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
70
73
  variant: "helpHint",
71
74
  "aria-label": "label help hint",
72
75
  "data-testid": "help-hint__button"
73
- }, iconButtonProps), (0, _react2.jsx)(_Icon["default"], {
76
+ }, iconButtonProps, {
77
+ "aria-describedby": tooltipId
78
+ }), (0, _react2.jsx)(_Icon["default"], {
74
79
  icon: HelpIcon
75
- })), (0, _react2.jsx)(_TooltipTrigger.Tooltip, tooltipProps, children));
80
+ })), (0, _react2.jsx)(_TooltipTrigger.Tooltip, (0, _extends2["default"])({}, tooltipProps, {
81
+ role: "tooltip",
82
+ "aria-live": "polite",
83
+ id: tooltipId
84
+ }), children));
76
85
  });
77
86
  HelpHint.propTypes = {
78
87
  /** Props object that is spread directly into the tooltip element. */
@@ -118,7 +118,7 @@ var PasswordField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
118
118
  return inputRef.current;
119
119
  });
120
120
 
121
- var _hooks$useProgressive = hooks.useProgressiveState(isVisibleProp, onVisibleChangeProp),
121
+ var _hooks$useProgressive = hooks.useProgressiveState(isVisibleProp, isVisibleProp),
122
122
  _hooks$useProgressive2 = (0, _slicedToArray2["default"])(_hooks$useProgressive, 2),
123
123
  isVisible = _hooks$useProgressive2[0],
124
124
  setIsShown = _hooks$useProgressive2[1]; // Measure the width of the input to inform the width of the menu (below).
@@ -57,6 +57,11 @@ var buttons = {
57
57
  inline: {
58
58
  '&:not(.disabled):hover': _objectSpread(_objectSpread({}, _theme["default"].buttons.inline), _theme["default"].buttons.defaultHover)
59
59
  },
60
+ inverted: _objectSpread(_objectSpread({}, _theme["default"].buttons.inverted), {}, {
61
+ ':focus': {
62
+ border: 'none'
63
+ }
64
+ }),
60
65
  primary: {
61
66
  '&:hover': _objectSpread({}, _theme["default"].buttons.primary)
62
67
  },
@@ -123,8 +128,14 @@ var forms = {
123
128
  }
124
129
  }
125
130
  };
131
+ var links = {
132
+ app: {
133
+ '&:hover': _objectSpread({}, _theme["default"].links.app)
134
+ }
135
+ };
126
136
  var _default = {
127
137
  buttons: buttons,
128
- forms: forms
138
+ forms: forms,
139
+ links: links
129
140
  };
130
141
  exports["default"] = _default;
@@ -1,12 +1,37 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+
3
5
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
6
 
7
+ var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
8
+
9
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
10
+
11
+ var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
12
+
13
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
14
+
15
+ var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
16
+
17
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
18
+
19
+ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
20
+
5
21
  _Object$defineProperty(exports, "__esModule", {
6
22
  value: true
7
23
  });
8
24
 
9
25
  exports["default"] = void 0;
26
+
27
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
28
+
29
+ var _buttons = require("../variants/buttons");
30
+
31
+ 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; }
32
+
33
+ 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) { (0, _defineProperty2["default"])(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; }
34
+
10
35
  var accordionTitle = {
11
36
  display: 'inline-block !important',
12
37
  overflowWrap: 'break-word',
@@ -48,13 +73,9 @@ var accordionGridHeader = {
48
73
  color: 'neutral.10',
49
74
  flexGrow: 1,
50
75
  fontWeight: 700,
51
- '&.is-focused': {
52
- outline: 'none',
53
- boxShadow: 'focus',
54
- WebkitBoxShadow: 'focus',
55
- MozBoxShadow: 'focus',
76
+ '&.is-focused': _objectSpread(_objectSpread({}, _buttons.defaultFocus), {}, {
56
77
  zIndex: '10'
57
- },
78
+ }),
58
79
  minHeight: '64px',
59
80
  '&.is-hovered': {
60
81
  backgroundColor: 'accent.99'
@@ -64,9 +64,12 @@ var AccordionGridItem = function AccordionGridItem(props) {
64
64
  delete rowProps.onPointerDown;
65
65
  delete rowProps.onClick;
66
66
  return ___EmotionJSX(Box, _extends({
67
- as: "div"
67
+ as: "div",
68
+ role: "row",
69
+ tabindex: "0"
68
70
  }, mergeProps(rowProps, others), {
69
71
  "aria-selected": isSelected,
72
+ "aria-expanded": isSelected,
70
73
  className: classNames,
71
74
  variant: "accordion.accordionGridItem",
72
75
  ref: rowRef
@@ -3,7 +3,8 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
3
3
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
4
4
  import React from 'react';
5
5
  import Box from '.';
6
- import { SelectField, Item, TextField } from '../../index';
6
+ import { Image, Text } from '../../index';
7
+ import { pingImg } from '../../utils/devUtils/constants/images';
7
8
  import { flatColorList } from '../../styles/colors.js';
8
9
  import { htmlElements } from '../../utils/devUtils/constants/htmlElements';
9
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -69,26 +70,25 @@ export var Disabled = function Disabled(_ref4) {
69
70
  return ___EmotionJSX(Box, _extends({
70
71
  bg: "white",
71
72
  isDisabled: true,
72
- sx: {
73
- border: '1px solid',
74
- borderColor: 'neutral.80'
75
- },
76
73
  width: "100%",
77
74
  p: "xl"
78
- }, args), ___EmotionJSX(TextField, {
79
- id: "custom-id",
80
- name: "custom-name",
81
- label: "Example Label"
82
- }), ___EmotionJSX("br", null), ___EmotionJSX(SelectField, {
83
- label: "What's your favorite color?",
84
- labelMode: "float"
85
- }, ___EmotionJSX(Item, {
86
- key: "red"
87
- }, "Red"), ___EmotionJSX(Item, {
88
- key: "blue"
89
- }, "Blue"), ___EmotionJSX(Item, {
90
- key: "yellow"
91
- }, "Yellow")));
75
+ }, args), ___EmotionJSX(Image, {
76
+ alt: "Ping identity square logo",
77
+ src: pingImg,
78
+ sx: {
79
+ width: '40px',
80
+ height: '40px'
81
+ }
82
+ }), ___EmotionJSX(Text, {
83
+ fontSize: "xl"
84
+ }, "Exceptional Experiences Start with Secure Identity"));
85
+ };
86
+ Disabled.parameters = {
87
+ docs: {
88
+ description: {
89
+ story: 'The disabled state only impacts styling and mouse clicks. Anything with keyboard events will still work.'
90
+ }
91
+ }
92
92
  };
93
93
  Disabled.args = {
94
94
  isDisabled: {
@@ -105,6 +105,13 @@ Disabled.args = {
105
105
  })
106
106
  },
107
107
  defaultValue: 'white'
108
+ },
109
+ sx: {
110
+ border: '1px solid',
111
+ borderColor: 'neutral.80',
112
+ display: 'flex',
113
+ flexDirection: 'row !important',
114
+ gap: '10px'
108
115
  }
109
116
  };
110
117
  export var BoxesWithGaps = function BoxesWithGaps() {
@@ -3,6 +3,7 @@ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectW
3
3
  var _excluded = ["children", "tooltipProps", "iconButtonProps"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import PropTypes from 'prop-types';
6
+ import { v4 as uuid } from 'uuid';
6
7
  import IconButton from '../IconButton';
7
8
  import TooltipTrigger, { Tooltip } from '../TooltipTrigger';
8
9
  import Icon from '../Icon';
@@ -34,6 +35,7 @@ var HelpHint = /*#__PURE__*/forwardRef(function (props, ref) {
34
35
  iconButtonProps = props.iconButtonProps,
35
36
  others = _objectWithoutProperties(props, _excluded);
36
37
 
38
+ var tooltipId = uuid();
37
39
  return ___EmotionJSX(TooltipTrigger, _extends({
38
40
  ref: ref,
39
41
  direction: "top"
@@ -41,9 +43,15 @@ var HelpHint = /*#__PURE__*/forwardRef(function (props, ref) {
41
43
  variant: "helpHint",
42
44
  "aria-label": "label help hint",
43
45
  "data-testid": "help-hint__button"
44
- }, iconButtonProps), ___EmotionJSX(Icon, {
46
+ }, iconButtonProps, {
47
+ "aria-describedby": tooltipId
48
+ }), ___EmotionJSX(Icon, {
45
49
  icon: HelpIcon
46
- })), ___EmotionJSX(Tooltip, tooltipProps, children));
50
+ })), ___EmotionJSX(Tooltip, _extends({}, tooltipProps, {
51
+ role: "tooltip",
52
+ "aria-live": "polite",
53
+ id: tooltipId
54
+ }), children));
47
55
  });
48
56
  HelpHint.propTypes = {
49
57
  /** Props object that is spread directly into the tooltip element. */
@@ -72,7 +72,7 @@ var PasswordField = /*#__PURE__*/forwardRef(function (props, ref) {
72
72
  return inputRef.current;
73
73
  });
74
74
 
75
- var _hooks$useProgressive = hooks.useProgressiveState(isVisibleProp, onVisibleChangeProp),
75
+ var _hooks$useProgressive = hooks.useProgressiveState(isVisibleProp, isVisibleProp),
76
76
  _hooks$useProgressive2 = _slicedToArray(_hooks$useProgressive, 2),
77
77
  isVisible = _hooks$useProgressive2[0],
78
78
  setIsShown = _hooks$useProgressive2[1]; // Measure the width of the input to inform the width of the menu (below).
@@ -38,6 +38,11 @@ var buttons = {
38
38
  inline: {
39
39
  '&:not(.disabled):hover': _objectSpread(_objectSpread({}, theme.buttons.inline), theme.buttons.defaultHover)
40
40
  },
41
+ inverted: _objectSpread(_objectSpread({}, theme.buttons.inverted), {}, {
42
+ ':focus': {
43
+ border: 'none'
44
+ }
45
+ }),
41
46
  primary: {
42
47
  '&:hover': _objectSpread({}, theme.buttons.primary)
43
48
  },
@@ -104,7 +109,13 @@ var forms = {
104
109
  }
105
110
  }
106
111
  };
112
+ var links = {
113
+ app: {
114
+ '&:hover': _objectSpread({}, theme.links.app)
115
+ }
116
+ };
107
117
  export default {
108
118
  buttons: buttons,
109
- forms: forms
119
+ forms: forms,
120
+ links: links
110
121
  };
@@ -1,3 +1,18 @@
1
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
2
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
3
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
4
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
5
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
6
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
7
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
8
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
9
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
+
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
+
13
+ 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; }
14
+
15
+ import { defaultFocus } from '../variants/buttons';
1
16
  var accordionTitle = {
2
17
  display: 'inline-block !important',
3
18
  overflowWrap: 'break-word',
@@ -39,13 +54,9 @@ var accordionGridHeader = {
39
54
  color: 'neutral.10',
40
55
  flexGrow: 1,
41
56
  fontWeight: 700,
42
- '&.is-focused': {
43
- outline: 'none',
44
- boxShadow: 'focus',
45
- WebkitBoxShadow: 'focus',
46
- MozBoxShadow: 'focus',
57
+ '&.is-focused': _objectSpread(_objectSpread({}, defaultFocus), {}, {
47
58
  zIndex: '10'
48
- },
59
+ }),
49
60
  minHeight: '64px',
50
61
  '&.is-hovered': {
51
62
  backgroundColor: 'accent.99'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.33.0-alpha.2",
3
+ "version": "1.33.0-alpha.3",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",