@pingux/astro 2.78.0-alpha.2 → 2.78.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.
@@ -34,7 +34,7 @@ var Icon = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
34
34
  sizeProps = _useTShirtSize.sizeProps;
35
35
  var title = props.title || ((0, _typeof2["default"])(IconComponent) === 'object' && 'type' in IconComponent ? {
36
36
  name: IconComponent.type.name
37
- } : null);
37
+ } : '');
38
38
  return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
39
39
  as: IconComponent,
40
40
  ref: ref,
@@ -29,7 +29,7 @@ var _isValidPositiveInt = _interopRequireDefault(require("../../utils/devUtils/p
29
29
  var _Line = _interopRequireDefault(require("./Line"));
30
30
  var _Stepper = require("./Stepper.constants");
31
31
  var _react2 = require("@emotion/react");
32
- var _excluded = ["activeStep", "onStepChange", "tabListProps"];
32
+ var _excluded = ["activeStep", "onStepChange", "tabListProps", "tooltipProps"];
33
33
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
34
34
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
35
  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; }
@@ -41,6 +41,7 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
41
41
  var activeStep = props.activeStep,
42
42
  onStepChange = props.onStepChange,
43
43
  tabListProps = props.tabListProps,
44
+ tooltipProps = props.tooltipProps,
44
45
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
45
46
  var state = (0, _list.useSingleSelectListState)(props);
46
47
  var getStatus = function getStatus(i) {
@@ -88,7 +89,8 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
88
89
  title: step,
89
90
  "aria-label": textValue,
90
91
  content: item.rendered,
91
- separator: !isFirst && line
92
+ separator: !isFirst && line,
93
+ tooltipTriggerProps: tooltipProps
92
94
  });
93
95
  isFirst = isFirst && !container;
94
96
  return container;
@@ -124,7 +126,8 @@ Stepper.propTypes = {
124
126
  */
125
127
  onStepChange: _propTypes["default"].func,
126
128
  /** A props object that is subsequently spread into the rendered tablist. */
127
- tabListProps: _propTypes["default"].shape({})
129
+ tabListProps: _propTypes["default"].shape({}),
130
+ tooltipProps: _propTypes["default"].shape({})
128
131
  };
129
132
  Stepper.defaultProps = {
130
133
  activeStep: 1
@@ -8,7 +8,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
8
8
  _Object$defineProperty(exports, "__esModule", {
9
9
  value: true
10
10
  });
11
- exports["default"] = exports.Panel = exports.DisabledToolTips = exports.Default = exports.ControlledStepper = void 0;
11
+ exports["default"] = exports.WithCustomTooltip = exports.Panel = exports.DisabledToolTips = exports.Default = exports.ControlledStepper = void 0;
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
14
14
  var _react = _interopRequireWildcard(require("react"));
@@ -180,6 +180,46 @@ Default.parameters = {
180
180
  url: _figmaLinks.FIGMA_LINKS.stepper["default"]
181
181
  }
182
182
  };
183
+ var WithCustomTooltip = function WithCustomTooltip(args) {
184
+ return (0, _react2.jsx)(_index.Stepper, (0, _extends2["default"])({}, args, {
185
+ items: steps,
186
+ tooltipProps: {
187
+ direction: 'left',
188
+ offset: 15
189
+ }
190
+ }), (0, _react2.jsx)(_reactStately.Item, {
191
+ key: "step1",
192
+ textValue: "Duis Aute"
193
+ }, (0, _react2.jsx)(_index.Box, {
194
+ sx: sx.contentContainer
195
+ }, (0, _react2.jsx)(_index.Text, {
196
+ fontSize: "md",
197
+ fontWeight: "3"
198
+ }, "Duis Aute"), (0, _react2.jsx)(_index.Text, {
199
+ fontSize: "md"
200
+ }, "Quis autem vel eum iure reprehenderit qui in ea voluptate"))), (0, _react2.jsx)(_reactStately.Item, {
201
+ key: "step2",
202
+ textValue: "Lorem Ipsum"
203
+ }, (0, _react2.jsx)(_index.Box, {
204
+ sx: sx.contentContainer
205
+ }, (0, _react2.jsx)(_index.Text, {
206
+ fontSize: "md",
207
+ fontWeight: "3"
208
+ }, "Lorem Ipsum"), (0, _react2.jsx)(_index.Text, {
209
+ fontSize: "md"
210
+ }, "Sed ut perspiciatis unde omnis"))), (0, _react2.jsx)(_reactStately.Item, {
211
+ key: "step3",
212
+ textValue: "Excepteur Sint"
213
+ }, (0, _react2.jsx)(_index.Box, {
214
+ sx: sx.contentContainer
215
+ }, (0, _react2.jsx)(_index.Text, {
216
+ fontSize: "md",
217
+ fontWeight: "3"
218
+ }, "Excepteur Sint"), (0, _react2.jsx)(_index.Text, {
219
+ fontSize: "md"
220
+ }, "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam"))));
221
+ };
222
+ exports.WithCustomTooltip = WithCustomTooltip;
183
223
  var ControlledStepper = function ControlledStepper() {
184
224
  var _useState = (0, _react.useState)(2),
185
225
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
@@ -34,8 +34,7 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
34
34
  tabsDisabled = props.isDisabled,
35
35
  orientation = props.orientation,
36
36
  mode = props.mode,
37
- slots = props.slots,
38
- tooltipTriggerProps = props.tooltipTriggerProps;
37
+ slots = props.slots;
39
38
  var key = item.key,
40
39
  rendered = item.rendered,
41
40
  itemProps = item.props;
@@ -69,11 +68,10 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
69
68
  }, slots === null || slots === void 0 ? void 0 : slots.beforeTab, (0, _react2.jsx)(_.Box, (0, _extends2["default"])({
70
69
  className: classNames,
71
70
  variant: "tab"
72
- // title={itemProps?.titleAttr || undefined}
73
71
  }, (0, _reactAria.mergeProps)(focusProps, hoverProps, tabProps), (0, _pendoID.getPendoID)('Tab'), {
74
- // {...otherItemProps}
75
72
  ref: tabRef
76
73
  }, itemProps, {
74
+ title: itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue,
77
75
  role: "tab"
78
76
  }), (0, _react2.jsx)(_react["default"].Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.icon, (0, _react2.jsx)(_.Text, (0, _extends2["default"])({
79
77
  variant: "tabLabel"
@@ -88,7 +86,7 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
88
86
  }, (0, _reactAria.mergeProps)(focusProps, hoverProps, tabProps), itemProps));
89
87
  }
90
88
  if (mode === 'tooltip') {
91
- return (0, _react2.jsx)(_react["default"].Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, (0, _react2.jsx)(_.TooltipTrigger, (0, _extends2["default"])({}, tooltipTriggerProps, {
89
+ return (0, _react2.jsx)(_react["default"].Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, (0, _react2.jsx)(_.TooltipTrigger, (0, _extends2["default"])({}, itemProps === null || itemProps === void 0 ? void 0 : itemProps.tooltipTriggerProps, {
92
90
  isOpen: isHovered || isFocusVisible
93
91
  }), (0, _react2.jsx)(_interactions.Pressable, null, (0, _react2.jsx)("span", null, tab)), (0, _react2.jsx)(_.Tooltip, null, (itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue) || (itemProps === null || itemProps === void 0 ? void 0 : itemProps.title))));
94
92
  }
@@ -142,6 +142,10 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
142
142
  isSelected?: boolean | undefined;
143
143
  isUnavailable?: boolean | undefined;
144
144
  hidden?: boolean | undefined;
145
+ title?: string | {
146
+ id?: string | undefined;
147
+ name: string;
148
+ } | undefined;
145
149
  variant?: string | undefined;
146
150
  as?: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | React.ComponentClass<any, any> | React.FunctionComponent<any> | null | undefined;
147
151
  style?: string | React.CSSProperties | undefined;
@@ -1,5 +1,9 @@
1
1
  import { StylePropertyValue } from 'theme-ui';
2
2
  import { DOMAttributes, StyleProps } from './shared';
3
+ type BoxIconTitleProps = {
4
+ id?: string;
5
+ name: string;
6
+ };
3
7
  export interface BoxProps extends StyleProps, DOMAttributes {
4
8
  id?: string;
5
9
  /** The background color of the box. */
@@ -14,4 +18,6 @@ export interface BoxProps extends StyleProps, DOMAttributes {
14
18
  isSelected?: boolean;
15
19
  isUnavailable?: boolean;
16
20
  hidden?: boolean;
21
+ title?: string | BoxIconTitleProps;
17
22
  }
23
+ export {};
@@ -2,6 +2,7 @@ import { ElementType, ReactNode } from 'react';
2
2
  import { ThemeUICSSProperties } from 'theme-ui';
3
3
  import { TestingAttributes } from './shared/test';
4
4
  import { DOMAttributes, OrientationProps, StyleProps } from './shared';
5
+ import { TooltipTriggerProps } from './tooltipTrigger';
5
6
  export interface TabProps extends StyleProps, DOMAttributes, OrientationProps, TestingAttributes {
6
7
  isDisabled?: boolean;
7
8
  item: {
@@ -17,6 +18,7 @@ export interface TabProps extends StyleProps, DOMAttributes, OrientationProps, T
17
18
  title: string;
18
19
  separator: Element | boolean;
19
20
  list: object[];
21
+ tooltipTriggerProps?: TooltipTriggerProps;
20
22
  };
21
23
  rendered?: string | ReactNode;
22
24
  };
@@ -23,7 +23,7 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
23
23
  sizeProps = _useTShirtSize.sizeProps;
24
24
  var title = props.title || (_typeof(IconComponent) === 'object' && 'type' in IconComponent ? {
25
25
  name: IconComponent.type.name
26
- } : null);
26
+ } : '');
27
27
  return ___EmotionJSX(Box, _extends({
28
28
  as: IconComponent,
29
29
  ref: ref,
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["activeStep", "onStepChange", "tabListProps"];
4
+ var _excluded = ["activeStep", "onStepChange", "tabListProps", "tooltipProps"];
5
5
  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; }
6
6
  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; }
7
7
  import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
@@ -30,6 +30,7 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
30
30
  var activeStep = props.activeStep,
31
31
  onStepChange = props.onStepChange,
32
32
  tabListProps = props.tabListProps,
33
+ tooltipProps = props.tooltipProps,
33
34
  others = _objectWithoutProperties(props, _excluded);
34
35
  var state = useSingleSelectListState(props);
35
36
  var getStatus = function getStatus(i) {
@@ -77,7 +78,8 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
77
78
  title: step,
78
79
  "aria-label": textValue,
79
80
  content: item.rendered,
80
- separator: !isFirst && line
81
+ separator: !isFirst && line,
82
+ tooltipTriggerProps: tooltipProps
81
83
  });
82
84
  isFirst = isFirst && !container;
83
85
  return container;
@@ -113,7 +115,8 @@ Stepper.propTypes = {
113
115
  */
114
116
  onStepChange: PropTypes.func,
115
117
  /** A props object that is subsequently spread into the rendered tablist. */
116
- tabListProps: PropTypes.shape({})
118
+ tabListProps: PropTypes.shape({}),
119
+ tooltipProps: PropTypes.shape({})
117
120
  };
118
121
  Stepper.defaultProps = {
119
122
  activeStep: 1
@@ -164,6 +164,45 @@ Default.parameters = {
164
164
  url: FIGMA_LINKS.stepper["default"]
165
165
  }
166
166
  };
167
+ export var WithCustomTooltip = function WithCustomTooltip(args) {
168
+ return ___EmotionJSX(Stepper, _extends({}, args, {
169
+ items: steps,
170
+ tooltipProps: {
171
+ direction: 'left',
172
+ offset: 15
173
+ }
174
+ }), ___EmotionJSX(Item, {
175
+ key: "step1",
176
+ textValue: "Duis Aute"
177
+ }, ___EmotionJSX(Box, {
178
+ sx: sx.contentContainer
179
+ }, ___EmotionJSX(Text, {
180
+ fontSize: "md",
181
+ fontWeight: "3"
182
+ }, "Duis Aute"), ___EmotionJSX(Text, {
183
+ fontSize: "md"
184
+ }, "Quis autem vel eum iure reprehenderit qui in ea voluptate"))), ___EmotionJSX(Item, {
185
+ key: "step2",
186
+ textValue: "Lorem Ipsum"
187
+ }, ___EmotionJSX(Box, {
188
+ sx: sx.contentContainer
189
+ }, ___EmotionJSX(Text, {
190
+ fontSize: "md",
191
+ fontWeight: "3"
192
+ }, "Lorem Ipsum"), ___EmotionJSX(Text, {
193
+ fontSize: "md"
194
+ }, "Sed ut perspiciatis unde omnis"))), ___EmotionJSX(Item, {
195
+ key: "step3",
196
+ textValue: "Excepteur Sint"
197
+ }, ___EmotionJSX(Box, {
198
+ sx: sx.contentContainer
199
+ }, ___EmotionJSX(Text, {
200
+ fontSize: "md",
201
+ fontWeight: "3"
202
+ }, "Excepteur Sint"), ___EmotionJSX(Text, {
203
+ fontSize: "md"
204
+ }, "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam"))));
205
+ };
167
206
  export var ControlledStepper = function ControlledStepper() {
168
207
  var _useState = useState(2),
169
208
  _useState2 = _slicedToArray(_useState, 2),
@@ -21,8 +21,7 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
21
21
  tabsDisabled = props.isDisabled,
22
22
  orientation = props.orientation,
23
23
  mode = props.mode,
24
- slots = props.slots,
25
- tooltipTriggerProps = props.tooltipTriggerProps;
24
+ slots = props.slots;
26
25
  var key = item.key,
27
26
  rendered = item.rendered,
28
27
  itemProps = item.props;
@@ -56,11 +55,10 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
56
55
  }, slots === null || slots === void 0 ? void 0 : slots.beforeTab, ___EmotionJSX(Box, _extends({
57
56
  className: classNames,
58
57
  variant: "tab"
59
- // title={itemProps?.titleAttr || undefined}
60
58
  }, mergeProps(focusProps, hoverProps, tabProps), getPendoID('Tab'), {
61
- // {...otherItemProps}
62
59
  ref: tabRef
63
60
  }, itemProps, {
61
+ title: itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue,
64
62
  role: "tab"
65
63
  }), ___EmotionJSX(React.Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.icon, ___EmotionJSX(Text, _extends({
66
64
  variant: "tabLabel"
@@ -75,7 +73,7 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
75
73
  }, mergeProps(focusProps, hoverProps, tabProps), itemProps));
76
74
  }
77
75
  if (mode === 'tooltip') {
78
- return ___EmotionJSX(React.Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, ___EmotionJSX(TooltipTrigger, _extends({}, tooltipTriggerProps, {
76
+ return ___EmotionJSX(React.Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, ___EmotionJSX(TooltipTrigger, _extends({}, itemProps === null || itemProps === void 0 ? void 0 : itemProps.tooltipTriggerProps, {
79
77
  isOpen: isHovered || isFocusVisible
80
78
  }), ___EmotionJSX(Pressable, null, ___EmotionJSX("span", null, tab)), ___EmotionJSX(Tooltip, null, (itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue) || (itemProps === null || itemProps === void 0 ? void 0 : itemProps.title))));
81
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.78.0-alpha.2",
3
+ "version": "2.78.0-alpha.3",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",