@pingux/astro 1.22.0 → 1.23.0-alpha.2

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.
@@ -64,7 +64,8 @@ var RockerButtonGroup = /*#__PURE__*/forwardRef(function (props, ref) {
64
64
  variant: "rockerbutton.rockerContainerInner",
65
65
  isRow: true
66
66
  }, tabListProps, raTabListProps, {
67
- ref: buttonGroupRef
67
+ ref: buttonGroupRef,
68
+ role: "toolbar"
68
69
  }), _mapInstanceProperty(_context = _Array$from(state.collection)).call(_context, function (item) {
69
70
  return ___EmotionJSX(CollectionRockerButton, {
70
71
  key: item.key,
@@ -22,7 +22,8 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
22
22
  var TooltipTrigger = /*#__PURE__*/forwardRef(function (props, ref) {
23
23
  var _context, _useStatusClasses2;
24
24
 
25
- var children = props.children,
25
+ var arrowCrossOffset = props.arrowCrossOffset,
26
+ children = props.children,
26
27
  crossOffset = props.crossOffset,
27
28
  isDisabled = props.isDisabled,
28
29
  align = props.align,
@@ -33,7 +34,8 @@ var TooltipTrigger = /*#__PURE__*/forwardRef(function (props, ref) {
33
34
  isNotFlippable = props.isNotFlippable,
34
35
  isDarkMode = props.isDarkMode,
35
36
  hasNoArrow = props.hasNoArrow,
36
- targetRef = props.targetRef;
37
+ targetRef = props.targetRef,
38
+ width = props.width;
37
39
 
38
40
  var _React$Children$toArr = React.Children.toArray(children),
39
41
  _React$Children$toArr2 = _slicedToArray(_React$Children$toArr, 2),
@@ -81,7 +83,10 @@ var TooltipTrigger = /*#__PURE__*/forwardRef(function (props, ref) {
81
83
  placement: placement,
82
84
  arrowProps: arrowProps,
83
85
  className: classNames,
84
- hasNoArrow: hasNoArrow
86
+ hasNoArrow: hasNoArrow,
87
+ arrowCrossOffset: arrowCrossOffset,
88
+ width: width,
89
+ direction: direction
85
90
  }, positionProps, tooltipProps), tooltip);
86
91
 
87
92
  return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(PressResponder, _extends({}, triggerProps, {
@@ -132,12 +137,19 @@ TooltipTrigger.propTypes = {
132
137
  /** Tooltip offset relative to its trigger. */
133
138
  offset: PropTypes.number,
134
139
 
140
+ /** Arrow offset relative to the left of the tooltip.
141
+ * Must be passed as a px or percentage. */
142
+ arrowCrossOffset: PropTypes.string,
143
+
135
144
  /** The placement of the element with respect to its anchor element. */
136
145
  placement: PropTypes.string,
137
146
 
138
147
  /** By default, opens for both focus and hover. Can be made to open only for focus. */
139
148
  trigger: PropTypes.string,
140
149
 
150
+ /** Width applied to the wrapper of the tooltip component. */
151
+ width: PropTypes.string,
152
+
141
153
  /* The ref for the element which the overlay positions itself with respect to. */
142
154
  targetRef: PropTypes.shape({})
143
155
  };
@@ -27,6 +27,17 @@ export var withDelayProp = function withDelayProp() {
27
27
  delay: 700
28
28
  }, ___EmotionJSX(Button, null, "Hover Over Me!"), ___EmotionJSX(Tooltip, null, "Display with a delay"));
29
29
  };
30
+ export var withWidthProp = function withWidthProp() {
31
+ return ___EmotionJSX(TooltipTrigger, {
32
+ width: "200px"
33
+ }, ___EmotionJSX(Button, null, "Hover Over Me!"), ___EmotionJSX(Tooltip, null, "Custom width display"));
34
+ };
35
+ export var withArrowCrossOffsetProp = function withArrowCrossOffsetProp() {
36
+ return ___EmotionJSX(TooltipTrigger, {
37
+ arrowCrossOffset: "30px",
38
+ isOpen: true
39
+ }, ___EmotionJSX(Button, null, "Hover Over Me!"), ___EmotionJSX(Tooltip, null, "Display with a delay"));
40
+ };
30
41
  export var isOpen = function isOpen() {
31
42
  return ___EmotionJSX(TooltipTrigger, {
32
43
  isOpen: true
@@ -71,4 +71,12 @@ test('trigger press events work when a tooltip is disabled', function () {
71
71
  expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
72
72
  userEvent.click(button);
73
73
  expect(onPress).toHaveBeenCalledTimes(1);
74
+ });
75
+ test('passing in width applies the correct width to the container', function () {
76
+ getComponent({
77
+ isOpen: true,
78
+ width: '100px'
79
+ });
80
+ var arrow = screen.getByTestId('popover-container');
81
+ expect(arrow).toHaveStyle('width: 100px');
74
82
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.22.0",
3
+ "version": "1.23.0-alpha.2",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "ux-development@pingidentity.com",
6
6
  "license": "Apache-2.0",