@pingux/astro 2.13.0-alpha.9 → 2.14.0-alpha.0

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.
@@ -19,7 +19,7 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
19
19
  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; }
20
20
  var baseBadge = {
21
21
  cursor: 'default',
22
- p: '3px 5px 4px 5px',
22
+ p: '3px 5px 3px 5px',
23
23
  alignItems: 'center',
24
24
  justifyContent: 'center',
25
25
  minWidth: '50px',
@@ -36,7 +36,7 @@ var RefreshButton = function RefreshButton(props) {
36
36
  "data-id": "refresh-button"
37
37
  }, props), props.text);
38
38
  };
39
- var SaveBar = function SaveBar(props) {
39
+ var ButtonBar = function ButtonBar(props) {
40
40
  var _context2;
41
41
  var saveButtonProps = props.saveButtonProps,
42
42
  cancelButtonProps = props.cancelButtonProps,
@@ -66,7 +66,7 @@ var SaveBar = function SaveBar(props) {
66
66
  }
67
67
  }, others), children ? (0, _concat["default"])(_context2 = []).call(_context2, children) : (0, _react2.jsx)(Content, null));
68
68
  };
69
- SaveBar.propTypes = {
69
+ ButtonBar.propTypes = {
70
70
  saveButtonProps: _propTypes["default"].shape(_buttonAttributes.buttonPropTypes),
71
71
  cancelButtonProps: _propTypes["default"].shape(_buttonAttributes.buttonPropTypes),
72
72
  refreshButtonProps: _propTypes["default"].shape(_buttonAttributes.buttonPropTypes),
@@ -81,5 +81,5 @@ CancelButton.propTypes = {
81
81
  RefreshButton.propTypes = {
82
82
  text: _propTypes["default"].string
83
83
  };
84
- var _default = SaveBar;
84
+ var _default = ButtonBar;
85
85
  exports["default"] = _default;
@@ -1,8 +1,8 @@
1
1
  import { Meta } from '@storybook/addon-docs';
2
2
 
3
- <Meta title="Experimental/SaveBar/SaveBar" />
3
+ <Meta title="Experimental/ButtonBar/ButtonBar" />
4
4
 
5
- # SaveBar
5
+ # ButtonBar
6
6
 
7
7
  This is a composed component that renders children in a simplified, organized and consistent manner.
8
8
 
@@ -10,4 +10,4 @@ The default children are controlled by three prop objects, **saveButtonProps**,
10
10
 
11
11
  The **isJustifiedRight** prop will reverse the order of the children, and justify them to the right.
12
12
 
13
- Supplying the SaveBar with children using default React syntax will override the default render and render the custom children.
13
+ Supplying the ButtonBar with children using default React syntax will override the default render and render the custom children.
@@ -10,25 +10,25 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
12
12
  var _ = require("../..");
13
- var _SaveBar = _interopRequireDefault(require("./SaveBar.mdx"));
13
+ var _ButtonBar = _interopRequireDefault(require("./ButtonBar.mdx"));
14
14
  var _react2 = require("@emotion/react");
15
15
  var _default = {
16
- title: 'Experimental/SaveBar',
17
- component: _.SaveBar,
16
+ title: 'Experimental/ButtonBar',
17
+ component: _.ButtonBar,
18
18
  parameters: {
19
19
  docs: {
20
20
  source: {
21
21
  type: 'code'
22
22
  },
23
23
  page: function page() {
24
- return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_SaveBar["default"], null), (0, _react2.jsx)(_storybookDocsLayout["default"], null));
24
+ return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_ButtonBar["default"], null), (0, _react2.jsx)(_storybookDocsLayout["default"], null));
25
25
  }
26
26
  }
27
27
  }
28
28
  };
29
29
  exports["default"] = _default;
30
30
  var Default = function Default(args) {
31
- return (0, _react2.jsx)(_.SaveBar, (0, _extends2["default"])({
31
+ return (0, _react2.jsx)(_.ButtonBar, (0, _extends2["default"])({
32
32
  saveButtonProps: {
33
33
  key: 'save button',
34
34
  text: 'Save',
@@ -47,7 +47,7 @@ var Default = function Default(args) {
47
47
  };
48
48
  exports.Default = Default;
49
49
  var WithRefreshButton = function WithRefreshButton(args) {
50
- return (0, _react2.jsx)(_.SaveBar, (0, _extends2["default"])({
50
+ return (0, _react2.jsx)(_.ButtonBar, (0, _extends2["default"])({
51
51
  saveButtonProps: {
52
52
  key: 'save button',
53
53
  text: 'Save',
@@ -73,7 +73,7 @@ var WithRefreshButton = function WithRefreshButton(args) {
73
73
  };
74
74
  exports.WithRefreshButton = WithRefreshButton;
75
75
  var JustifiedRight = function JustifiedRight() {
76
- return (0, _react2.jsx)(_.SaveBar, {
76
+ return (0, _react2.jsx)(_.ButtonBar, {
77
77
  saveButtonProps: {
78
78
  key: 'next button',
79
79
  text: 'Next',
@@ -93,7 +93,7 @@ var JustifiedRight = function JustifiedRight() {
93
93
  };
94
94
  exports.JustifiedRight = JustifiedRight;
95
95
  var WithChildren = function WithChildren(args) {
96
- return (0, _react2.jsx)(_.SaveBar, args, (0, _react2.jsx)(_.Button, null, "Custom Button!"), (0, _react2.jsx)(_.Button, {
96
+ return (0, _react2.jsx)(_.ButtonBar, args, (0, _react2.jsx)(_.Button, null, "Custom Button!"), (0, _react2.jsx)(_.Button, {
97
97
  variant: "link"
98
98
  }, "Custom Link!"));
99
99
  };
@@ -7,7 +7,7 @@ var _ = require("../..");
7
7
  var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
8
8
  var _testWrapper = require("../../utils/testUtils/testWrapper");
9
9
  var _react2 = require("@emotion/react");
10
- var testId = 'test-SaveBar';
10
+ var testId = 'test-ButtonBar';
11
11
  var saveButtonProps = {
12
12
  key: 'save button',
13
13
  text: 'Save',
@@ -36,21 +36,21 @@ var defaultProps = {
36
36
  };
37
37
  var getComponent = function getComponent() {
38
38
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
39
- return (0, _testWrapper.render)((0, _react2.jsx)(_.SaveBar, (0, _extends2["default"])({}, defaultProps, props)));
39
+ return (0, _testWrapper.render)((0, _react2.jsx)(_.ButtonBar, (0, _extends2["default"])({}, defaultProps, props)));
40
40
  };
41
41
  var getComponentCustomChildren = function getComponentCustomChildren() {
42
42
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
- return (0, _testWrapper.render)((0, _react2.jsx)(_.SaveBar, (0, _extends2["default"])({}, defaultProps, props), (0, _react2.jsx)("button", null, "custom text"), (0, _react2.jsx)("button", null, "Also custom text")));
43
+ return (0, _testWrapper.render)((0, _react2.jsx)(_.ButtonBar, (0, _extends2["default"])({}, defaultProps, props), (0, _react2.jsx)("button", null, "custom text"), (0, _react2.jsx)("button", null, "Also custom text")));
44
44
  };
45
45
  var getComponentTextChildren = function getComponentTextChildren() {
46
46
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
47
- return (0, _testWrapper.render)((0, _react2.jsx)(_.SaveBar, props, "custom text"));
47
+ return (0, _testWrapper.render)((0, _react2.jsx)(_.ButtonBar, props, "custom text"));
48
48
  };
49
49
  (0, _testAxe["default"])(getComponent);
50
50
  afterEach(function () {
51
51
  jest.resetAllMocks();
52
52
  });
53
- test('SaveBar does render', function () {
53
+ test('ButtonBar does render', function () {
54
54
  getComponent({});
55
55
  var element = _testWrapper.screen.getByTestId(testId);
56
56
  expect(element).toBeInTheDocument();
@@ -8,7 +8,7 @@ _Object$defineProperty(exports, "__esModule", {
8
8
  _Object$defineProperty(exports, "default", {
9
9
  enumerable: true,
10
10
  get: function get() {
11
- return _SaveBar["default"];
11
+ return _ButtonBar["default"];
12
12
  }
13
13
  });
14
- var _SaveBar = _interopRequireDefault(require("./SaveBar"));
14
+ var _ButtonBar = _interopRequireDefault(require("./ButtonBar"));
@@ -10,6 +10,14 @@ The ListViewItem allows easy creation of list items. Styles have been included t
10
10
  This component is intended to be used inside a ListView component. See the [ListAndPanel](./?path=/story/experimental-recipes-listandpanel--list-and-panel) and [ScrollableListView](./?path=/story/experimental-recipes-scrollablelistview--scrollable-list-view)
11
11
  recipes for a more detailed examples.
12
12
 
13
+ #### Commonly Used Components
14
+ There are a few commonly used components we've created which have the correct styling pre-applied and we recommend you use these over their defaults. These go into the children of the ListViewItem component. These components are:
15
+ * `ListViewItemSwitchField` - Use in place of SwitchField. This control is used to activate / deactivate an item in a list. Apply an aria-label to this component which describes the action when used, e.g. `aria-label={item.isActive ? 'deactivate item' : 'activate item'}` .
16
+
17
+ * `ListViewItemEditButton` - Use in place of IconButton when editing is a primary action.
18
+
19
+ * `ListViewItemMenu` - Use in place of Menu. This control is used to offer a popup menu of several actions which are less important / less commonly used.
20
+
13
21
  #### Icons and Images
14
22
  Add an icon by passing an mdi or svg icon to the `data.icon` prop. Default size is 25px.
15
23
 
@@ -161,6 +161,7 @@ export * from './types';
161
161
  export { OverlayProvider, useOverlayPosition, useOverlayTrigger } from 'react-aria';
162
162
  export { Item, Section, useOverlayTriggerState } from 'react-stately';
163
163
  export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow, } from 'react-stately';
164
+ export { default as ButtonBar } from './experimental/ButtonBar/ButtonBar';
164
165
  export { default as EditButton } from './experimental/EditButton';
165
166
  export { default as ListViewItemEditButton } from './experimental/ListViewItem/controls/ListViewItemEditButton';
166
167
  export { default as ListViewItemMenu } from './experimental/ListViewItem/controls/ListViewItemMenu';
@@ -170,4 +171,3 @@ export { default as PanelHeader } from './experimental/PanelHeader';
170
171
  export { default as PanelHeaderCloseButton } from './experimental/PanelHeader/controls/PanelHeaderCloseButton';
171
172
  export { default as PanelHeaderMenu } from './experimental/PanelHeader/controls/PanelHeaderMenu';
172
173
  export { default as PanelHeaderSwitchField } from './experimental/PanelHeader/controls/PanelHeaderSwitchField';
173
- export { default as SaveBar } from './experimental/SaveBar/SaveBar';
package/lib/cjs/index.js CHANGED
@@ -110,6 +110,7 @@ var _exportNames = {
110
110
  DataTableColumn: true,
111
111
  DataTableHeader: true,
112
112
  DataTableRow: true,
113
+ ButtonBar: true,
113
114
  EditButton: true,
114
115
  ListViewItemEditButton: true,
115
116
  ListViewItemMenu: true,
@@ -118,8 +119,7 @@ var _exportNames = {
118
119
  PanelHeader: true,
119
120
  PanelHeaderCloseButton: true,
120
121
  PanelHeaderMenu: true,
121
- PanelHeaderSwitchField: true,
122
- SaveBar: true
122
+ PanelHeaderSwitchField: true
123
123
  };
124
124
  _Object$defineProperty(exports, "AccordionGridGroup", {
125
125
  enumerable: true,
@@ -199,6 +199,12 @@ _Object$defineProperty(exports, "Button", {
199
199
  return _Button["default"];
200
200
  }
201
201
  });
202
+ _Object$defineProperty(exports, "ButtonBar", {
203
+ enumerable: true,
204
+ get: function get() {
205
+ return _ButtonBar["default"];
206
+ }
207
+ });
202
208
  _Object$defineProperty(exports, "Calendar", {
203
209
  enumerable: true,
204
210
  get: function get() {
@@ -607,12 +613,6 @@ _Object$defineProperty(exports, "RockerButtonGroup", {
607
613
  return _RockerButtonGroup["default"];
608
614
  }
609
615
  });
610
- _Object$defineProperty(exports, "SaveBar", {
611
- enumerable: true,
612
- get: function get() {
613
- return _SaveBar["default"];
614
- }
615
- });
616
616
  _Object$defineProperty(exports, "ScrollBox", {
617
617
  enumerable: true,
618
618
  get: function get() {
@@ -1671,6 +1671,7 @@ _forEachInstanceProperty(_context74 = _Object$keys(_types)).call(_context74, fun
1671
1671
  });
1672
1672
  var _reactAria = require("react-aria");
1673
1673
  var _reactStately = require("react-stately");
1674
+ var _ButtonBar = _interopRequireDefault(require("./experimental/ButtonBar/ButtonBar"));
1674
1675
  var _EditButton = _interopRequireDefault(require("./experimental/EditButton"));
1675
1676
  var _ListViewItemEditButton = _interopRequireDefault(require("./experimental/ListViewItem/controls/ListViewItemEditButton"));
1676
1677
  var _ListViewItemMenu = _interopRequireDefault(require("./experimental/ListViewItem/controls/ListViewItemMenu"));
@@ -1680,6 +1681,5 @@ var _PanelHeader = _interopRequireDefault(require("./experimental/PanelHeader"))
1680
1681
  var _PanelHeaderCloseButton = _interopRequireDefault(require("./experimental/PanelHeader/controls/PanelHeaderCloseButton"));
1681
1682
  var _PanelHeaderMenu = _interopRequireDefault(require("./experimental/PanelHeader/controls/PanelHeaderMenu"));
1682
1683
  var _PanelHeaderSwitchField = _interopRequireDefault(require("./experimental/PanelHeader/controls/PanelHeaderSwitchField"));
1683
- var _SaveBar = _interopRequireDefault(require("./experimental/SaveBar/SaveBar"));
1684
1684
  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); }
1685
1685
  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; }
@@ -22,6 +22,8 @@ var _CreateIcon = _interopRequireDefault(require("@pingux/mdi-react/CreateIcon")
22
22
  var _DeleteIcon = _interopRequireDefault(require("@pingux/mdi-react/DeleteIcon"));
23
23
  var _uuid = require("uuid");
24
24
  var _index = require("../index");
25
+ var _figmaLinks = require("../utils/designUtils/figmaLinks.js");
26
+ var _statuses = _interopRequireDefault(require("../utils/devUtils/constants/statuses"));
25
27
  var _react2 = require("@emotion/react");
26
28
  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); }
27
29
  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; }
@@ -61,6 +63,11 @@ var sx = {
61
63
  color: '#253746'
62
64
  }
63
65
  },
66
+ calloutSx: {
67
+ width: '450px',
68
+ marginBottom: 'xs',
69
+ paddingRight: 'md'
70
+ },
64
71
  createIconButton: {
65
72
  marginLeft: 'xs'
66
73
  },
@@ -268,37 +275,23 @@ var Display = function Display() {
268
275
  })));
269
276
  };
270
277
  exports.Display = Display;
278
+ Display.parameters = {
279
+ design: {
280
+ type: 'figma',
281
+ url: _figmaLinks.FIGMA_LINKS.attributeMappings.display
282
+ }
283
+ };
271
284
  var DisplayWithError = function DisplayWithError() {
272
285
  var withError = true;
273
- var withErrorSx = {
274
- errorBox: {
275
- flexDirection: 'row !important',
276
- alignItems: 'center',
277
- padding: '13px 12px 13px 15px',
278
- gap: 'md',
279
- border: '1px solid #A31300',
280
- width: '450px',
281
- marginBottom: 'xs'
282
- },
283
- text: {
284
- fontSize: 'sm',
285
- lineHeight: '15px'
286
- }
287
- };
288
- return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(Title, null), withError && (0, _react2.jsx)(_index.Box, {
289
- sx: withErrorSx.errorBox
290
- }, (0, _react2.jsx)(_index.Icon, {
291
- size: 24,
292
- icon: _AlertCircleIcon["default"],
293
- color: "#A31300",
294
- title: {
295
- name: 'Alert Circle Icon'
296
- }
297
- }), (0, _react2.jsx)(_index.Text, {
298
- sx: withErrorSx.text,
299
- id: helperTextId,
300
- role: "alert"
301
- }, "This attribute is unavailable. Please map the attribute again or re-map to a different attribute.")), (0, _react2.jsx)(_index.Box, {
286
+ return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(Title, null), (0, _react2.jsx)(_index.Callout, {
287
+ status: _statuses["default"].ERROR,
288
+ sx: sx.calloutSx
289
+ }, (0, _react2.jsx)(_index.Text, null, "You\u2019ve got problems. Allow me to tell you about them in some detail so that you can address them.", (0, _react2.jsx)(_index.Link, {
290
+ href: "https://pingidentity.com",
291
+ target: "_blank",
292
+ "aria-label": "".concat(_statuses["default"].ERROR, "-callout"),
293
+ variant: "app"
294
+ }, ' ', "Read More"))), (0, _react2.jsx)(_index.Box, {
302
295
  sx: sx.defaultFieldsWrapperBox
303
296
  }, (0, _react2.jsx)(_index.Box, {
304
297
  isRow: true,
@@ -421,6 +414,12 @@ var Edit = function Edit() {
421
414
  })))));
422
415
  };
423
416
  exports.Edit = Edit;
417
+ Edit.parameters = {
418
+ design: {
419
+ type: 'figma',
420
+ url: _figmaLinks.FIGMA_LINKS.attributeMappings.edit
421
+ }
422
+ };
424
423
  var EditRow = /*#__PURE__*/(0, _react.memo)(function (props) {
425
424
  var isDisabled = props.isDisabled,
426
425
  isNewRow = props.isNewRow,
@@ -9,6 +9,11 @@ var FIGMA_LINKS = {
9
9
  accordionGroup: {
10
10
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=446-1808&t=8Wwd3tIBh3GEjCJB-0'
11
11
  },
12
+ attributeMappings: {
13
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=15076%3A33905&mode=dev',
14
+ display: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=15077-33982&t=VgqEexa1CXAXfPpp-0',
15
+ edit: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=15077-35822&t=VgqEexa1CXAXfPpp-0'
16
+ },
12
17
  badge: {
13
18
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=1899-11550&t=VgqEexa1CXAXfPpp-0',
14
19
  countBadge: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=4255%3A12558&t=3b86het2R9G2Zyo2-1'
@@ -12,7 +12,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
12
12
  import { focusWithCroppedOutline } from '../Button/Buttons.styles';
13
13
  export var baseBadge = {
14
14
  cursor: 'default',
15
- p: '3px 5px 4px 5px',
15
+ p: '3px 5px 3px 5px',
16
16
  alignItems: 'center',
17
17
  justifyContent: 'center',
18
18
  minWidth: '50px',
@@ -28,7 +28,7 @@ var RefreshButton = function RefreshButton(props) {
28
28
  "data-id": "refresh-button"
29
29
  }, props), props.text);
30
30
  };
31
- var SaveBar = function SaveBar(props) {
31
+ var ButtonBar = function ButtonBar(props) {
32
32
  var _context2;
33
33
  var saveButtonProps = props.saveButtonProps,
34
34
  cancelButtonProps = props.cancelButtonProps,
@@ -58,7 +58,7 @@ var SaveBar = function SaveBar(props) {
58
58
  }
59
59
  }, others), children ? _concatInstanceProperty(_context2 = []).call(_context2, children) : ___EmotionJSX(Content, null));
60
60
  };
61
- SaveBar.propTypes = {
61
+ ButtonBar.propTypes = {
62
62
  saveButtonProps: PropTypes.shape(buttonPropTypes),
63
63
  cancelButtonProps: PropTypes.shape(buttonPropTypes),
64
64
  refreshButtonProps: PropTypes.shape(buttonPropTypes),
@@ -73,4 +73,4 @@ CancelButton.propTypes = {
73
73
  RefreshButton.propTypes = {
74
74
  text: PropTypes.string
75
75
  };
76
- export default SaveBar;
76
+ export default ButtonBar;
@@ -1,8 +1,8 @@
1
1
  import { Meta } from '@storybook/addon-docs';
2
2
 
3
- <Meta title="Experimental/SaveBar/SaveBar" />
3
+ <Meta title="Experimental/ButtonBar/ButtonBar" />
4
4
 
5
- # SaveBar
5
+ # ButtonBar
6
6
 
7
7
  This is a composed component that renders children in a simplified, organized and consistent manner.
8
8
 
@@ -10,4 +10,4 @@ The default children are controlled by three prop objects, **saveButtonProps**,
10
10
 
11
11
  The **isJustifiedRight** prop will reverse the order of the children, and justify them to the right.
12
12
 
13
- Supplying the SaveBar with children using default React syntax will override the default render and render the custom children.
13
+ Supplying the ButtonBar with children using default React syntax will override the default render and render the custom children.
@@ -1,25 +1,25 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
3
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
4
- import { Button, SaveBar } from '../..';
5
- import SaveBarReadme from './SaveBar.mdx';
4
+ import { Button, ButtonBar } from '../..';
5
+ import ButtonBarReadme from './ButtonBar.mdx';
6
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
7
7
  export default {
8
- title: 'Experimental/SaveBar',
9
- component: SaveBar,
8
+ title: 'Experimental/ButtonBar',
9
+ component: ButtonBar,
10
10
  parameters: {
11
11
  docs: {
12
12
  source: {
13
13
  type: 'code'
14
14
  },
15
15
  page: function page() {
16
- return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(SaveBarReadme, null), ___EmotionJSX(DocsLayout, null));
16
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(ButtonBarReadme, null), ___EmotionJSX(DocsLayout, null));
17
17
  }
18
18
  }
19
19
  }
20
20
  };
21
21
  export var Default = function Default(args) {
22
- return ___EmotionJSX(SaveBar, _extends({
22
+ return ___EmotionJSX(ButtonBar, _extends({
23
23
  saveButtonProps: {
24
24
  key: 'save button',
25
25
  text: 'Save',
@@ -37,7 +37,7 @@ export var Default = function Default(args) {
37
37
  }, args));
38
38
  };
39
39
  export var WithRefreshButton = function WithRefreshButton(args) {
40
- return ___EmotionJSX(SaveBar, _extends({
40
+ return ___EmotionJSX(ButtonBar, _extends({
41
41
  saveButtonProps: {
42
42
  key: 'save button',
43
43
  text: 'Save',
@@ -62,7 +62,7 @@ export var WithRefreshButton = function WithRefreshButton(args) {
62
62
  }, args));
63
63
  };
64
64
  export var JustifiedRight = function JustifiedRight() {
65
- return ___EmotionJSX(SaveBar, {
65
+ return ___EmotionJSX(ButtonBar, {
66
66
  saveButtonProps: {
67
67
  key: 'next button',
68
68
  text: 'Next',
@@ -81,7 +81,7 @@ export var JustifiedRight = function JustifiedRight() {
81
81
  });
82
82
  };
83
83
  export var WithChildren = function WithChildren(args) {
84
- return ___EmotionJSX(SaveBar, args, ___EmotionJSX(Button, null, "Custom Button!"), ___EmotionJSX(Button, {
84
+ return ___EmotionJSX(ButtonBar, args, ___EmotionJSX(Button, null, "Custom Button!"), ___EmotionJSX(Button, {
85
85
  variant: "link"
86
86
  }, "Custom Link!"));
87
87
  };
@@ -1,10 +1,10 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
- import { SaveBar } from '../..';
3
+ import { ButtonBar } from '../..';
4
4
  import axeTest from '../../utils/testUtils/testAxe';
5
5
  import { render, screen } from '../../utils/testUtils/testWrapper';
6
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
7
- var testId = 'test-SaveBar';
7
+ var testId = 'test-ButtonBar';
8
8
  var saveButtonProps = {
9
9
  key: 'save button',
10
10
  text: 'Save',
@@ -33,21 +33,21 @@ var defaultProps = {
33
33
  };
34
34
  var getComponent = function getComponent() {
35
35
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
36
- return render(___EmotionJSX(SaveBar, _extends({}, defaultProps, props)));
36
+ return render(___EmotionJSX(ButtonBar, _extends({}, defaultProps, props)));
37
37
  };
38
38
  var getComponentCustomChildren = function getComponentCustomChildren() {
39
39
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
40
- return render(___EmotionJSX(SaveBar, _extends({}, defaultProps, props), ___EmotionJSX("button", null, "custom text"), ___EmotionJSX("button", null, "Also custom text")));
40
+ return render(___EmotionJSX(ButtonBar, _extends({}, defaultProps, props), ___EmotionJSX("button", null, "custom text"), ___EmotionJSX("button", null, "Also custom text")));
41
41
  };
42
42
  var getComponentTextChildren = function getComponentTextChildren() {
43
43
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
44
- return render(___EmotionJSX(SaveBar, props, "custom text"));
44
+ return render(___EmotionJSX(ButtonBar, props, "custom text"));
45
45
  };
46
46
  axeTest(getComponent);
47
47
  afterEach(function () {
48
48
  jest.resetAllMocks();
49
49
  });
50
- test('SaveBar does render', function () {
50
+ test('ButtonBar does render', function () {
51
51
  getComponent({});
52
52
  var element = screen.getByTestId(testId);
53
53
  expect(element).toBeInTheDocument();
@@ -0,0 +1 @@
1
+ export { default } from './ButtonBar';
@@ -10,6 +10,14 @@ The ListViewItem allows easy creation of list items. Styles have been included t
10
10
  This component is intended to be used inside a ListView component. See the [ListAndPanel](./?path=/story/experimental-recipes-listandpanel--list-and-panel) and [ScrollableListView](./?path=/story/experimental-recipes-scrollablelistview--scrollable-list-view)
11
11
  recipes for a more detailed examples.
12
12
 
13
+ #### Commonly Used Components
14
+ There are a few commonly used components we've created which have the correct styling pre-applied and we recommend you use these over their defaults. These go into the children of the ListViewItem component. These components are:
15
+ * `ListViewItemSwitchField` - Use in place of SwitchField. This control is used to activate / deactivate an item in a list. Apply an aria-label to this component which describes the action when used, e.g. `aria-label={item.isActive ? 'deactivate item' : 'activate item'}` .
16
+
17
+ * `ListViewItemEditButton` - Use in place of IconButton when editing is a primary action.
18
+
19
+ * `ListViewItemMenu` - Use in place of Menu. This control is used to offer a popup menu of several actions which are less important / less commonly used.
20
+
13
21
  #### Icons and Images
14
22
  Add an icon by passing an mdi or svg icon to the `data.icon` prop. Default size is 25px.
15
23
 
package/lib/index.js CHANGED
@@ -170,6 +170,7 @@ export { Item, Section, useOverlayTriggerState } from 'react-stately';
170
170
  export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow } from 'react-stately';
171
171
 
172
172
  // Experimental
173
+ export { default as ButtonBar } from './experimental/ButtonBar/ButtonBar';
173
174
  export { default as EditButton } from './experimental/EditButton';
174
175
  export { default as ListViewItemEditButton } from './experimental/ListViewItem/controls/ListViewItemEditButton';
175
176
  export { default as ListViewItemMenu } from './experimental/ListViewItem/controls/ListViewItemMenu';
@@ -178,5 +179,4 @@ export { default as ListViewItem } from './experimental/ListViewItem/ListViewIte
178
179
  export { default as PanelHeader } from './experimental/PanelHeader';
179
180
  export { default as PanelHeaderCloseButton } from './experimental/PanelHeader/controls/PanelHeaderCloseButton';
180
181
  export { default as PanelHeaderMenu } from './experimental/PanelHeader/controls/PanelHeaderMenu';
181
- export { default as PanelHeaderSwitchField } from './experimental/PanelHeader/controls/PanelHeaderSwitchField';
182
- export { default as SaveBar } from './experimental/SaveBar/SaveBar';
182
+ export { default as PanelHeaderSwitchField } from './experimental/PanelHeader/controls/PanelHeaderSwitchField';
@@ -10,7 +10,9 @@ import CogsIcon from '@pingux/mdi-react/CogsIcon';
10
10
  import CreateIcon from '@pingux/mdi-react/CreateIcon';
11
11
  import DeleteIcon from '@pingux/mdi-react/DeleteIcon';
12
12
  import { v4 as uuid } from 'uuid';
13
- import { Badge, Box, Button, ComboBoxField, HelpHint, Icon, IconButton, Item, ScrollBox, Separator, Text, TextField } from '../index';
13
+ import { Badge, Box, Button, Callout, ComboBoxField, HelpHint, Icon, IconButton, Item, Link, ScrollBox, Separator, Text, TextField } from '../index';
14
+ import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks.js';
15
+ import statuses from '../utils/devUtils/constants/statuses';
14
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
17
  export default {
16
18
  title: 'Recipes/Attribute Mappings'
@@ -47,6 +49,11 @@ var sx = {
47
49
  color: '#253746'
48
50
  }
49
51
  },
52
+ calloutSx: {
53
+ width: '450px',
54
+ marginBottom: 'xs',
55
+ paddingRight: 'md'
56
+ },
50
57
  createIconButton: {
51
58
  marginLeft: 'xs'
52
59
  },
@@ -253,37 +260,23 @@ export var Display = function Display() {
253
260
  rightValue: "password"
254
261
  })));
255
262
  };
263
+ Display.parameters = {
264
+ design: {
265
+ type: 'figma',
266
+ url: FIGMA_LINKS.attributeMappings.display
267
+ }
268
+ };
256
269
  export var DisplayWithError = function DisplayWithError() {
257
270
  var withError = true;
258
- var withErrorSx = {
259
- errorBox: {
260
- flexDirection: 'row !important',
261
- alignItems: 'center',
262
- padding: '13px 12px 13px 15px',
263
- gap: 'md',
264
- border: '1px solid #A31300',
265
- width: '450px',
266
- marginBottom: 'xs'
267
- },
268
- text: {
269
- fontSize: 'sm',
270
- lineHeight: '15px'
271
- }
272
- };
273
- return ___EmotionJSX(Box, null, ___EmotionJSX(Title, null), withError && ___EmotionJSX(Box, {
274
- sx: withErrorSx.errorBox
275
- }, ___EmotionJSX(Icon, {
276
- size: 24,
277
- icon: AlertCircleIcon,
278
- color: "#A31300",
279
- title: {
280
- name: 'Alert Circle Icon'
281
- }
282
- }), ___EmotionJSX(Text, {
283
- sx: withErrorSx.text,
284
- id: helperTextId,
285
- role: "alert"
286
- }, "This attribute is unavailable. Please map the attribute again or re-map to a different attribute.")), ___EmotionJSX(Box, {
271
+ return ___EmotionJSX(Box, null, ___EmotionJSX(Title, null), ___EmotionJSX(Callout, {
272
+ status: statuses.ERROR,
273
+ sx: sx.calloutSx
274
+ }, ___EmotionJSX(Text, null, "You\u2019ve got problems. Allow me to tell you about them in some detail so that you can address them.", ___EmotionJSX(Link, {
275
+ href: "https://pingidentity.com",
276
+ target: "_blank",
277
+ "aria-label": "".concat(statuses.ERROR, "-callout"),
278
+ variant: "app"
279
+ }, ' ', "Read More"))), ___EmotionJSX(Box, {
287
280
  sx: sx.defaultFieldsWrapperBox
288
281
  }, ___EmotionJSX(Box, {
289
282
  isRow: true,
@@ -404,6 +397,12 @@ export var Edit = function Edit() {
404
397
  }));
405
398
  })))));
406
399
  };
400
+ Edit.parameters = {
401
+ design: {
402
+ type: 'figma',
403
+ url: FIGMA_LINKS.attributeMappings.edit
404
+ }
405
+ };
407
406
  var EditRow = /*#__PURE__*/memo(function (props) {
408
407
  var isDisabled = props.isDisabled,
409
408
  isNewRow = props.isNewRow,
@@ -2,6 +2,11 @@ export var FIGMA_LINKS = {
2
2
  accordionGroup: {
3
3
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=446-1808&t=8Wwd3tIBh3GEjCJB-0'
4
4
  },
5
+ attributeMappings: {
6
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=15076%3A33905&mode=dev',
7
+ display: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=15077-33982&t=VgqEexa1CXAXfPpp-0',
8
+ edit: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=15077-35822&t=VgqEexa1CXAXfPpp-0'
9
+ },
5
10
  badge: {
6
11
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=1899-11550&t=VgqEexa1CXAXfPpp-0',
7
12
  countBadge: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=4255%3A12558&t=3b86het2R9G2Zyo2-1'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.13.0-alpha.9",
3
+ "version": "2.14.0-alpha.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- export { default } from './SaveBar';