@pingux/astro 1.27.0-alpha.10 → 1.27.0-alpha.12

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.
@@ -137,6 +137,79 @@ var data = [{
137
137
  title: 'View a workflow'
138
138
  }]
139
139
  }];
140
+ var sx = {
141
+ iconContainer: {
142
+ backgroundColor: 'accent.80',
143
+ alignItems: 'center',
144
+ justifyContent: 'center',
145
+ mr: 'sm',
146
+ borderRadius: '50%',
147
+ zIndex: 3
148
+ },
149
+ headingSeparator: {
150
+ flexGrow: 1,
151
+ backgroundColor: 'accent.80',
152
+ maxHeight: '100%',
153
+ width: '6px !important',
154
+ zIndex: 2,
155
+ m: '0px 5px 0px 17px !important'
156
+ },
157
+ title: {
158
+ fontSize: 'md',
159
+ color: 'accent.30',
160
+ lineHeight: '18px',
161
+ fontWeight: '3',
162
+ m: '12px 0px 28px 5px',
163
+ maxWidth: '195px'
164
+ },
165
+ linkRowIconButton: {
166
+ '&.is-pressed': {
167
+ backgroundColor: 'transparent'
168
+ },
169
+ '&.is-pressed > svg > path': {
170
+ fill: 'accent.30'
171
+ },
172
+ '&.is-hovered': {
173
+ backgroundColor: 'transparent'
174
+ }
175
+ },
176
+ linkRowIconSelected: {
177
+ zIndex: 3,
178
+ 'path': {
179
+ fill: 'accent.30'
180
+ }
181
+ },
182
+ linkRowIconNotSelected: {
183
+ zIndex: 3,
184
+ 'path': {
185
+ fill: 'accent.80'
186
+ }
187
+ },
188
+ linkRowSeparator: {
189
+ flexGrow: 1,
190
+ backgroundColor: 'accent.30',
191
+ maxHeight: '100%',
192
+ width: '1px !important',
193
+ zIndex: 2,
194
+ m: '-5px 5px -5px 11.5px !important'
195
+ },
196
+ linkRowText: {
197
+ fontSize: 'md',
198
+ color: '#163CE3',
199
+ lineHeight: '18px',
200
+ fontWeight: '0',
201
+ m: '3px 0px 20px 10px',
202
+ maxWidth: '140px'
203
+ },
204
+ container: {
205
+ p: '15px 15px 0px 15px',
206
+ width: '280px',
207
+ backgroundColor: 'accent.95',
208
+ borderRadius: '8px',
209
+ zIndex: 1,
210
+ boxShadow: '3px 8px 4px rgba(202, 206, 211, 0.36)'
211
+ }
212
+ };
140
213
 
141
214
  var Stage = function Stage(props) {
142
215
  var title = props.title,
@@ -172,14 +245,7 @@ var Stage = function Stage(props) {
172
245
  }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Box, {
173
246
  minWidth: "39.5px",
174
247
  minHeight: "39.5px",
175
- sx: {
176
- backgroundColor: 'accent.80',
177
- alignItems: 'center',
178
- justifyContent: 'center',
179
- mr: '10px',
180
- borderRadius: '50%',
181
- zIndex: 3
182
- }
248
+ sx: sx.iconContainer
183
249
  }, (0, _react2.jsx)(_index.Icon, {
184
250
  icon: icon,
185
251
  color: "accent.40",
@@ -188,24 +254,10 @@ var Stage = function Stage(props) {
188
254
  zIndex: 3
189
255
  }
190
256
  })), !isLastStage && (0, _react2.jsx)(_index.Separator, {
191
- sx: {
192
- flexGrow: 1,
193
- backgroundColor: 'accent.80',
194
- maxHeight: '100%',
195
- width: '6px !important',
196
- zIndex: 2,
197
- m: '0px 5px 0px 17px !important'
198
- },
257
+ sx: sx.headingSeparator,
199
258
  orientation: "vertical"
200
259
  })), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, {
201
- sx: {
202
- fontSize: '15px',
203
- color: 'accent.30',
204
- lineHeight: '18px',
205
- fontWeight: '3',
206
- m: '12px 0px 28px 5px',
207
- maxWidth: '195px'
208
- }
260
+ sx: sx.title
209
261
  }, title), (0, _react2.jsx)(_index.Box, {
210
262
  pl: "0px",
211
263
  mb: "25px"
@@ -246,53 +298,19 @@ var LinkRow = function LinkRow(props) {
246
298
  }
247
299
  }, (0, _react2.jsx)(_index.IconButton, {
248
300
  onPress: onIconPress,
249
- sx: {
250
- '&.is-pressed': {
251
- backgroundColor: 'transparent'
252
- },
253
- '&.is-pressed > svg > path': {
254
- fill: 'accent.30'
255
- },
256
- '&.is-hovered': {
257
- backgroundColor: 'transparent'
258
- }
259
- },
301
+ sx: sx.linkRowIconButton,
260
302
  "aria-label": "completed step icon indicator"
261
303
  }, (0, _react2.jsx)(_index.Icon, {
262
304
  icon: isSelected ? _CheckCircleIcon["default"] : RadioButtonIcon,
263
305
  size: isSelected ? '20px' : '18px',
264
- sx: isSelected ? {
265
- zIndex: 3,
266
- 'path': {
267
- fill: 'accent.30'
268
- }
269
- } : {
270
- zIndex: 3,
271
- 'path': {
272
- fill: 'accent.80'
273
- }
274
- }
306
+ sx: isSelected ? sx.linkRowIconButton : sx.linkRowIconNotSelected
275
307
  }))), !isLastLink && isLinkSelected && (0, _react2.jsx)(_index.Separator, {
276
- sx: {
277
- flexGrow: 1,
278
- backgroundColor: 'accent.30',
279
- maxHeight: '100%',
280
- width: '1px !important',
281
- zIndex: 2,
282
- m: '-5px 5px -5px 11.5px !important'
283
- },
308
+ sx: sx.linkRowSeparator,
284
309
  orientation: "vertical"
285
310
  })), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, {
286
311
  href: "https://www.pingidentity.com",
287
312
  target: "_blank",
288
- sx: {
289
- fontSize: '15px',
290
- color: '#163CE3',
291
- lineHeight: '18px',
292
- fontWeight: '0',
293
- m: '3px 0px 20px 10px',
294
- maxWidth: '140px'
295
- }
313
+ sx: sx.linkRowText
296
314
  }, title)));
297
315
  };
298
316
 
@@ -300,16 +318,7 @@ var Default = function Default() {
300
318
  // Open the `Story` addons tab to view the source code for full context.
301
319
  return (0, _react2.jsx)(_index.Box, {
302
320
  as: "nav",
303
- backgroundColor: "accent.95",
304
- width: "280px",
305
- sx: {
306
- p: '15px 15px 0px 15px',
307
- width: '280px',
308
- backgroundColor: 'accent.95',
309
- borderRadius: '8px',
310
- zIndex: 1,
311
- boxShadow: '3px 8px 4px rgba(202, 206, 211, 0.36)'
312
- }
321
+ sx: sx.container
313
322
  }, (0, _react2.jsx)(_index.Box, {
314
323
  paddingLeft: "0px"
315
324
  }, (0, _map["default"])(data).call(data, function (stage, index) {
@@ -12,7 +12,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
12
12
  import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
13
13
  import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
14
14
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
15
- var _excluded = ["children", "disabledKeys", "emptySearchText", "isDefaultOpen", "isOpen", "items", "itemsFilter", "onOpenChange", "onNamePress", "onPopoverClose", "onPopoverOpen", "onSelectionChange", "name", "searchProps", "selectedItem"];
15
+ var _excluded = ["children", "disabledKeys", "emptySearchText", "isDefaultOpen", "isOpen", "items", "itemsFilter", "onOpenChange", "onNamePress", "onPopoverClose", "onPopoverOpen", "onSelectionChange", "name", "searchProps", "selectedItem", "popoverProps"];
16
16
 
17
17
  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; }
18
18
 
@@ -25,6 +25,7 @@ import HomeIcon from 'mdi-react/HomeIcon';
25
25
  import PropTypes from 'prop-types';
26
26
  import { useOverlayTriggerState } from '@react-stately/overlays';
27
27
  import { useOverlayPosition, useOverlayTrigger } from '@react-aria/overlays';
28
+ import { mergeProps } from '@react-aria/utils';
28
29
  import ArrowDropUpIcon from 'mdi-react/ArrowDropUpIcon';
29
30
  import ArrowDropDownIcon from 'mdi-react/ArrowDropDownIcon';
30
31
  import { FocusScope } from '@react-aria/focus';
@@ -51,6 +52,7 @@ var EnvironmentBreadcrumb = /*#__PURE__*/forwardRef(function (props, ref) {
51
52
  name = props.name,
52
53
  searchProps = props.searchProps,
53
54
  selectedItem = props.selectedItem,
55
+ popoverProps = props.popoverProps,
54
56
  others = _objectWithoutProperties(props, _excluded);
55
57
 
56
58
  var _useState = useState(''),
@@ -215,7 +217,7 @@ var EnvironmentBreadcrumb = /*#__PURE__*/forwardRef(function (props, ref) {
215
217
  "aria-label": "".concat((typeof selectedItem === 'string' ? selectedItem : selectedValue) || 'Selected Item')
216
218
  }), selectedItem, ___EmotionJSX(Icon, {
217
219
  icon: popoverState.isOpen ? ArrowDropUpIcon : ArrowDropDownIcon
218
- })), ___EmotionJSX(PopoverContainer, _extends({}, overlayProps, positionProps, {
220
+ })), ___EmotionJSX(PopoverContainer, _extends({}, overlayProps, positionProps, mergeProps(overlayProps, positionProps, popoverProps), {
219
221
  ref: overlayRef,
220
222
  isOpen: popoverState.isOpen,
221
223
  scrollRef: scrollBoxRef,
@@ -303,6 +305,9 @@ EnvironmentBreadcrumb.propTypes = {
303
305
  /** Callback function that fires when the dropdown is closed. */
304
306
  onPopoverClose: PropTypes.func,
305
307
 
308
+ /** Props object that is spread directly into the popover container component. */
309
+ popoverProps: PropTypes.shape({}),
310
+
306
311
  /** Props object that is spread directly into the SearchField element. */
307
312
  searchProps: PropTypes.shape({}),
308
313
 
@@ -1,6 +1,20 @@
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";
1
9
  import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
2
10
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
11
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
3
12
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
13
+
14
+ 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; }
15
+
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
17
+
4
18
  import React from 'react';
5
19
  import userEvent from '@testing-library/user-event';
6
20
  import { Section } from '@react-stately/collections';
@@ -38,6 +52,10 @@ var defaultProps = {
38
52
  },
39
53
  items: items
40
54
  };
55
+ var popoverProps = {
56
+ maxWidth: '100px',
57
+ 'data-testid': 'popover-container'
58
+ };
41
59
  var defaultWithSectionsProps = {
42
60
  'data-testid': testEnvBreadcrumb,
43
61
  name: testName,
@@ -115,6 +133,13 @@ test('should display name', function () {
115
133
  getComponent();
116
134
  expect(screen.getByText(testName)).toBeInTheDocument();
117
135
  });
136
+ test('should spread props into popover container', function () {
137
+ getComponent(_objectSpread(_objectSpread({}, popoverProps), {}, {
138
+ isDefaultOpen: true
139
+ }));
140
+ userEvent.click(screen.getByText(testSelectedItem));
141
+ expect(screen.queryByTestId('popover-container')).toHaveStyle('max-width: 100px');
142
+ });
118
143
  test('should display selectedItem', function () {
119
144
  getComponent();
120
145
  expect(screen.getByText(testSelectedItem)).toBeInTheDocument();
@@ -31,6 +31,40 @@ export default {
31
31
  title: 'Recipes/FlippableCaretMenuButton'
32
32
  };
33
33
  var buttonArray = ['Web App', 'Native App', 'Single Page App', 'Non-Interactive', 'Worker', 'Advanced Configuration', 'Built-in admin console for this environment', 'Built-in Application portal'];
34
+ var sx = {
35
+ openButton: {
36
+ height: '30px',
37
+ borderRadius: 'md',
38
+ fontSize: '13px',
39
+ mb: 'sm'
40
+ },
41
+ closeIconButton: {
42
+ position: 'absolute',
43
+ top: '14px',
44
+ right: 'sm'
45
+ },
46
+ buttonsContainer: {
47
+ p: 'lg',
48
+ flexDirection: 'initial !important',
49
+ alignContent: 'space-between',
50
+ flexWrap: 'wrap'
51
+ },
52
+ selectedButton: {
53
+ mb: 'sm',
54
+ mr: '4px',
55
+ height: '30px',
56
+ borderRadius: '15px',
57
+ fontSize: '13px'
58
+ },
59
+ unSelectedButton: {
60
+ mb: 'sm',
61
+ mr: '4px',
62
+ borderColor: 'neutral.80',
63
+ height: '30px',
64
+ borderRadius: '15px',
65
+ fontSize: '13px'
66
+ }
67
+ };
34
68
  export var Default = function Default() {
35
69
  var buttonRef = useRef();
36
70
  var popoverRef = useRef();
@@ -89,14 +123,9 @@ export var Default = function Default() {
89
123
 
90
124
  return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Button, {
91
125
  ref: buttonRef,
92
- mb: "sm",
93
126
  variant: "inline",
94
127
  onPress: onChange,
95
- sx: {
96
- height: '30px',
97
- borderRadius: '15px',
98
- fontSize: '13px'
99
- }
128
+ sx: sx.openButton
100
129
  }, ___EmotionJSX(Box, {
101
130
  isRow: true,
102
131
  alignItems: "center"
@@ -119,36 +148,15 @@ export var Default = function Default() {
119
148
  onPress: function onPress() {
120
149
  return setIsOpen(false);
121
150
  },
122
- sx: {
123
- position: 'absolute',
124
- top: 14,
125
- right: 10
126
- }
151
+ sx: sx.closeIconButton
127
152
  }, ___EmotionJSX(Icon, {
128
153
  icon: CloseIcon
129
154
  })), ___EmotionJSX(Box, {
130
- sx: {
131
- p: 'lg',
132
- flexDirection: 'initial !important',
133
- alignContent: 'space-between',
134
- flexWrap: 'wrap'
135
- }
155
+ sx: sx.buttonsContainer
136
156
  }, _mapInstanceProperty(buttonArray).call(buttonArray, function (item) {
137
157
  return ___EmotionJSX(Button, {
138
- mb: "sm",
139
158
  variant: "inline",
140
- sx: _includesInstanceProperty(selectedButtons).call(selectedButtons, item) ? {
141
- mr: '4px',
142
- height: '30px',
143
- borderRadius: '15px',
144
- fontSize: '13px'
145
- } : {
146
- mr: '4px',
147
- borderColor: 'neutral.80',
148
- height: '30px',
149
- borderRadius: '15px',
150
- fontSize: '13px'
151
- },
159
+ sx: _includesInstanceProperty(selectedButtons).call(selectedButtons, item) ? sx.selectedButton : sx.unSelectedButton,
152
160
  key: item,
153
161
  onPress: function onPress() {
154
162
  return toggleButton(item);
@@ -23,6 +23,13 @@ export default {
23
23
  }
24
24
  }
25
25
  };
26
+ var sx = {
27
+ showHideButton: {
28
+ width: 'fit-content',
29
+ marginLeft: 'sm',
30
+ alignSelf: 'auto'
31
+ }
32
+ };
26
33
  export var Default = function Default(_ref) {
27
34
  var _context;
28
35
 
@@ -52,11 +59,7 @@ export var Default = function Default(_ref) {
52
59
  onPress: function onPress() {
53
60
  return setIsMasked(!isMasked);
54
61
  },
55
- sx: {
56
- width: 'fit-content',
57
- marginLeft: 10,
58
- alignSelf: 'auto'
59
- }
62
+ sx: sx.showHideButton
60
63
  }, ___EmotionJSX(Icon, {
61
64
  icon: isMasked ? EyeOffIcon : EyeIcon
62
65
  }))));
@@ -4,10 +4,13 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
4
4
  export default {
5
5
  title: 'Recipes/NeutralCheckboxField'
6
6
  };
7
+ var sx = {
8
+ checkboxColor: {
9
+ color: 'neutral.10'
10
+ }
11
+ };
7
12
  export var Default = function Default() {
8
13
  return ___EmotionJSX(CheckboxField, {
9
- controlProps: {
10
- color: 'neutral.10'
11
- }
14
+ sx: sx.checkboxColor
12
15
  }, "Click me");
13
16
  };