@pingux/astro 2.28.0 → 2.29.1

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.
@@ -13,6 +13,8 @@ Accordions should be used:
13
13
 
14
14
  Accordions should not have focusable items as children.
15
15
 
16
+ AccordianItem labels should not include interactive elements.
17
+
16
18
  It is built on React Aria [useAccordion](https://reactspectrum.blob.core.windows.net/reactspectrum/d77b35e970e5549f66b47a83f07423f5c93b7297/docs/react-aria/useAccordion.html).
17
19
 
18
20
  ### Required components
@@ -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.UncontrolledExpanded = exports.Multiple = exports.DisabledState = exports.DifferentLevels = exports.Default = exports.CustomPresentation = exports.ControlledExpanded = void 0;
11
+ exports["default"] = exports.UncontrolledExpanded = exports.Multiple = exports.LabelWithBadge = exports.DisabledState = exports.DifferentLevels = exports.Default = exports.CustomPresentation = exports.ControlledExpanded = 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"));
@@ -280,4 +280,27 @@ CustomPresentation.parameters = {
280
280
  story: 'In addition to customizing the theme, prop objects can be passed to certain elements. This allows for simple customization in a pinch. See the source code below for an example.'
281
281
  }
282
282
  }
283
- };
283
+ };
284
+ var LabelWithBadge = function LabelWithBadge(args) {
285
+ return (0, _react2.jsx)(_index.AccordionGroup, (0, _extends2["default"])({}, args, {
286
+ labelHeadingTag: "h4"
287
+ }), (0, _react2.jsx)(_reactStately.Item, {
288
+ key: "accordionKey",
289
+ textValue: "accordionKey",
290
+ label: (0, _react2.jsx)(_index.Box, {
291
+ isRow: true,
292
+ alignItems: "center"
293
+ }, "Accordion Label", (0, _react2.jsx)(_index.Box, {
294
+ isRow: true,
295
+ gap: "5px",
296
+ ml: "5px"
297
+ }, (0, _react2.jsx)(_index.Badge, {
298
+ label: "Label",
299
+ sx: {
300
+ height: '21px'
301
+ }
302
+ }))),
303
+ "data-id": "accordionItem"
304
+ }, (0, _react2.jsx)(_index.Text, null, "Render me!")));
305
+ };
306
+ exports.LabelWithBadge = LabelWithBadge;
@@ -82,7 +82,7 @@ var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
82
82
  isPressed: isPressed
83
83
  }),
84
84
  buttonClasses = _useStatusClasses2.classNames;
85
- var ariaLabel = props['aria-label'] || item.props.label;
85
+ var ariaLabel = props['aria-label'];
86
86
  var isValidHeadingTag = (0, _includes["default"])(validHeadingTags).call(validHeadingTags, labelHeadingTag === null || labelHeadingTag === void 0 ? void 0 : labelHeadingTag.toLowerCase());
87
87
  var validLabelHeadingTag = isValidHeadingTag ? labelHeadingTag === null || labelHeadingTag === void 0 ? void 0 : labelHeadingTag.toLowerCase() : 'span';
88
88
  return (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
@@ -126,7 +126,7 @@ AccordionItem.propTypes = {
126
126
  key: _propTypes["default"].string,
127
127
  rendered: _propTypes["default"].node,
128
128
  props: _propTypes["default"].shape({
129
- label: _propTypes["default"].string,
129
+ label: _propTypes["default"].node,
130
130
  children: _propTypes["default"].node,
131
131
  textValue: _propTypes["default"].string,
132
132
  containerProps: _propTypes["default"].shape({}),
@@ -12,6 +12,7 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _AccountIcon = _interopRequireDefault(require("@pingux/mdi-react/AccountIcon"));
13
13
  var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
14
14
  var _index = require("../../index");
15
+ var _figmaLinks = require("../../utils/designUtils/figmaLinks.js");
15
16
  var _images = require("../../utils/devUtils/constants/images");
16
17
  var _listViewItemAttributes = require("../ListViewItem/listViewItemAttributes");
17
18
  var _PanelHeader = _interopRequireDefault(require("./PanelHeader.mdx"));
@@ -42,6 +43,12 @@ var Default = function Default(_ref) {
42
43
  }));
43
44
  };
44
45
  exports.Default = Default;
46
+ Default.parameters = {
47
+ design: {
48
+ type: 'figma',
49
+ url: _figmaLinks.FIGMA_LINKS.panelHeader["default"]
50
+ }
51
+ };
45
52
  var WithSubtext = function WithSubtext(_ref2) {
46
53
  var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref2), _ref2));
47
54
  return (0, _react2.jsx)(_index.PanelHeader, (0, _extends2["default"])({}, args, {
@@ -53,6 +60,12 @@ var WithSubtext = function WithSubtext(_ref2) {
53
60
  }));
54
61
  };
55
62
  exports.WithSubtext = WithSubtext;
63
+ WithSubtext.parameters = {
64
+ design: {
65
+ type: 'figma',
66
+ url: _figmaLinks.FIGMA_LINKS.panelHeader.withSubtext
67
+ }
68
+ };
56
69
  var WithControls = function WithControls(_ref3) {
57
70
  var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref3), _ref3));
58
71
  return (0, _react2.jsx)(_index.PanelHeader, (0, _extends2["default"])({}, args, {
@@ -70,6 +83,12 @@ var WithControls = function WithControls(_ref3) {
70
83
  }, "Delete user")), (0, _react2.jsx)(_index.PanelHeaderCloseButton, null));
71
84
  };
72
85
  exports.WithControls = WithControls;
86
+ WithControls.parameters = {
87
+ design: {
88
+ type: 'figma',
89
+ url: _figmaLinks.FIGMA_LINKS.panelHeader.withControls
90
+ }
91
+ };
73
92
  var WithImage = function WithImage() {
74
93
  return (0, _react2.jsx)(_index.PanelHeader, {
75
94
  data: {
@@ -83,6 +102,12 @@ var WithImage = function WithImage() {
83
102
  });
84
103
  };
85
104
  exports.WithImage = WithImage;
105
+ WithImage.parameters = {
106
+ design: {
107
+ type: 'figma',
108
+ url: _figmaLinks.FIGMA_LINKS.panelHeader.withImage
109
+ }
110
+ };
86
111
  var WithExtraLongText = function WithExtraLongText(_ref4) {
87
112
  var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref4), _ref4));
88
113
  return (0, _react2.jsx)(_index.PanelHeader, (0, _extends2["default"])({}, args, {
@@ -99,4 +124,10 @@ var WithExtraLongText = function WithExtraLongText(_ref4) {
99
124
  key: "delete"
100
125
  }, "Delete user")), (0, _react2.jsx)(_index.PanelHeaderCloseButton, null));
101
126
  };
102
- exports.WithExtraLongText = WithExtraLongText;
127
+ exports.WithExtraLongText = WithExtraLongText;
128
+ WithExtraLongText.parameters = {
129
+ design: {
130
+ type: 'figma',
131
+ url: _figmaLinks.FIGMA_LINKS.panelHeader.withExtraLongText
132
+ }
133
+ };
@@ -14,6 +14,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/hel
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
15
15
  var _react = _interopRequireWildcard(require("react"));
16
16
  var _CheckCircleIcon = _interopRequireDefault(require("@pingux/mdi-react/CheckCircleIcon"));
17
+ var _uuid = require("uuid");
17
18
  var _index = require("../index");
18
19
  var _figmaLinks = require("../utils/designUtils/figmaLinks.js");
19
20
  var _react2 = require("@emotion/react");
@@ -67,13 +68,14 @@ var EarthCircleIcon = function EarthCircleIcon() {
67
68
  }));
68
69
  };
69
70
  var RadioButtonIcon = function RadioButtonIcon(props) {
71
+ var id = (0, _uuid.v4)();
70
72
  return (0, _react2.jsx)("svg", (0, _extends2["default"])({
71
73
  viewBox: "0 0 22 22",
72
74
  fill: "none",
73
75
  xmlns: "http://www.w3.org/2000/svg",
74
- "aria-labelledby": "radio-button-icon-title"
76
+ "aria-labelledby": "radio-button-icon-title-".concat(id)
75
77
  }, props), (0, _react2.jsx)("title", {
76
- id: "radio-button-icon-title"
78
+ id: "radio-button-icon-title-".concat(id)
77
79
  }, "Radio Button Icon"), (0, _react2.jsx)("path", {
78
80
  d: "M11 18.3333C9.05508 18.3333 7.18982 17.5607 5.81455 16.1854C4.43928 14.8102 3.66667 12.9449 3.66667 11C3.66667 9.05507 4.43928 7.18981 5.81455 5.81455C7.18982 4.43928 9.05508 3.66666 11 3.66666C12.9449 3.66666 14.8102 4.43928 16.1854 5.81455C17.5607 7.18981 18.3333 9.05507 18.3333 11C18.3333 12.9449 17.5607 14.8102 16.1854 16.1854C14.8102 17.5607 12.9449 18.3333 11 18.3333ZM11 1.83333C9.79621 1.83333 8.60422 2.07043 7.49207 2.5311C6.37992 2.99177 5.36939 3.66698 4.51819 4.51818C2.7991 6.23727 1.83333 8.56884 1.83333 11C1.83333 13.4311 2.7991 15.7627 4.51819 17.4818C5.36939 18.333 6.37992 19.0082 7.49207 19.4689C8.60422 19.9296 9.79621 20.1667 11 20.1667C13.4311 20.1667 15.7627 19.2009 17.4818 17.4818C19.2009 15.7627 20.1667 13.4311 20.1667 11C20.1667 9.79621 19.9296 8.60421 19.4689 7.49206C19.0082 6.37991 18.333 5.36939 17.4818 4.51818C16.6306 3.66698 15.6201 2.99177 14.5079 2.5311C13.3958 2.07043 12.2038 1.83333 11 1.83333Z",
79
81
  fill: "#B3BEE8"
@@ -104,6 +104,13 @@ var FIGMA_LINKS = {
104
104
  OnewayToBidirectionalArrow: {
105
105
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=43504-1214&mode=design&t=R4kdj0liRHxsqbV5-0'
106
106
  },
107
+ panelHeader: {
108
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44688%3A39612&mode=dev',
109
+ withSubtext: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39651&mode=dev',
110
+ withControls: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39662&mode=dev',
111
+ withImage: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39682&mode=dev',
112
+ withExtraLongText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39713&mode=dev'
113
+ },
107
114
  popoverMenu: {
108
115
  "default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A3073&t=We3h7LaaFJQnxdSy-1'
109
116
  },
@@ -13,6 +13,8 @@ Accordions should be used:
13
13
 
14
14
  Accordions should not have focusable items as children.
15
15
 
16
+ AccordianItem labels should not include interactive elements.
17
+
16
18
  It is built on React Aria [useAccordion](https://reactspectrum.blob.core.windows.net/reactspectrum/d77b35e970e5549f66b47a83f07423f5c93b7297/docs/react-aria/useAccordion.html).
17
19
 
18
20
  ### Required components
@@ -4,7 +4,7 @@ import React, { useState } from 'react';
4
4
  import { Item } from 'react-stately';
5
5
  import { withDesign } from 'storybook-addon-designs';
6
6
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
7
- import { AccordionGroup, Button, Text, TextField } from '../../index';
7
+ import { AccordionGroup, Badge, Box, Button, Text, TextField } from '../../index';
8
8
  import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
9
9
  import { validHeadingTags } from '../AccordionItem/AccordionItem';
10
10
  import AccordionReadme from './AccordionGroup.mdx';
@@ -259,4 +259,26 @@ CustomPresentation.parameters = {
259
259
  story: 'In addition to customizing the theme, prop objects can be passed to certain elements. This allows for simple customization in a pinch. See the source code below for an example.'
260
260
  }
261
261
  }
262
+ };
263
+ export var LabelWithBadge = function LabelWithBadge(args) {
264
+ return ___EmotionJSX(AccordionGroup, _extends({}, args, {
265
+ labelHeadingTag: "h4"
266
+ }), ___EmotionJSX(Item, {
267
+ key: "accordionKey",
268
+ textValue: "accordionKey",
269
+ label: ___EmotionJSX(Box, {
270
+ isRow: true,
271
+ alignItems: "center"
272
+ }, "Accordion Label", ___EmotionJSX(Box, {
273
+ isRow: true,
274
+ gap: "5px",
275
+ ml: "5px"
276
+ }, ___EmotionJSX(Badge, {
277
+ label: "Label",
278
+ sx: {
279
+ height: '21px'
280
+ }
281
+ }))),
282
+ "data-id": "accordionItem"
283
+ }, ___EmotionJSX(Text, null, "Render me!")));
262
284
  };
@@ -68,7 +68,7 @@ var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
68
68
  isPressed: isPressed
69
69
  }),
70
70
  buttonClasses = _useStatusClasses2.classNames;
71
- var ariaLabel = props['aria-label'] || item.props.label;
71
+ var ariaLabel = props['aria-label'];
72
72
  var isValidHeadingTag = _includesInstanceProperty(validHeadingTags).call(validHeadingTags, labelHeadingTag === null || labelHeadingTag === void 0 ? void 0 : labelHeadingTag.toLowerCase());
73
73
  var validLabelHeadingTag = isValidHeadingTag ? labelHeadingTag === null || labelHeadingTag === void 0 ? void 0 : labelHeadingTag.toLowerCase() : 'span';
74
74
  return ___EmotionJSX(Box, _extends({
@@ -112,7 +112,7 @@ AccordionItem.propTypes = {
112
112
  key: PropTypes.string,
113
113
  rendered: PropTypes.node,
114
114
  props: PropTypes.shape({
115
- label: PropTypes.string,
115
+ label: PropTypes.node,
116
116
  children: PropTypes.node,
117
117
  textValue: PropTypes.string,
118
118
  containerProps: PropTypes.shape({}),
@@ -4,6 +4,7 @@ import React from 'react';
4
4
  import AccountIcon from '@pingux/mdi-react/AccountIcon';
5
5
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
6
6
  import { Item, PanelHeader, PanelHeaderCloseButton, PanelHeaderMenu, PanelHeaderSwitchField } from '../../index';
7
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
7
8
  import { pingImg } from '../../utils/devUtils/constants/images';
8
9
  import { SharedItemArgTypes } from '../ListViewItem/listViewItemAttributes';
9
10
  import PanelHeaderReadMe from './PanelHeader.mdx';
@@ -32,6 +33,12 @@ export var Default = function Default(_ref) {
32
33
  }
33
34
  }));
34
35
  };
36
+ Default.parameters = {
37
+ design: {
38
+ type: 'figma',
39
+ url: FIGMA_LINKS.panelHeader["default"]
40
+ }
41
+ };
35
42
  export var WithSubtext = function WithSubtext(_ref2) {
36
43
  var args = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
37
44
  return ___EmotionJSX(PanelHeader, _extends({}, args, {
@@ -42,6 +49,12 @@ export var WithSubtext = function WithSubtext(_ref2) {
42
49
  }
43
50
  }));
44
51
  };
52
+ WithSubtext.parameters = {
53
+ design: {
54
+ type: 'figma',
55
+ url: FIGMA_LINKS.panelHeader.withSubtext
56
+ }
57
+ };
45
58
  export var WithControls = function WithControls(_ref3) {
46
59
  var args = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));
47
60
  return ___EmotionJSX(PanelHeader, _extends({}, args, {
@@ -58,6 +71,12 @@ export var WithControls = function WithControls(_ref3) {
58
71
  key: "delete"
59
72
  }, "Delete user")), ___EmotionJSX(PanelHeaderCloseButton, null));
60
73
  };
74
+ WithControls.parameters = {
75
+ design: {
76
+ type: 'figma',
77
+ url: FIGMA_LINKS.panelHeader.withControls
78
+ }
79
+ };
61
80
  export var WithImage = function WithImage() {
62
81
  return ___EmotionJSX(PanelHeader, {
63
82
  data: {
@@ -70,6 +89,12 @@ export var WithImage = function WithImage() {
70
89
  }
71
90
  });
72
91
  };
92
+ WithImage.parameters = {
93
+ design: {
94
+ type: 'figma',
95
+ url: FIGMA_LINKS.panelHeader.withImage
96
+ }
97
+ };
73
98
  export var WithExtraLongText = function WithExtraLongText(_ref4) {
74
99
  var args = _extends({}, (_objectDestructuringEmpty(_ref4), _ref4));
75
100
  return ___EmotionJSX(PanelHeader, _extends({}, args, {
@@ -85,4 +110,10 @@ export var WithExtraLongText = function WithExtraLongText(_ref4) {
85
110
  }, "Disable user"), ___EmotionJSX(Item, {
86
111
  key: "delete"
87
112
  }, "Delete user")), ___EmotionJSX(PanelHeaderCloseButton, null));
113
+ };
114
+ WithExtraLongText.parameters = {
115
+ design: {
116
+ type: 'figma',
117
+ url: FIGMA_LINKS.panelHeader.withExtraLongText
118
+ }
88
119
  };
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
3
3
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
4
4
  import React, { useState } from 'react';
5
5
  import CheckCircleIcon from '@pingux/mdi-react/CheckCircleIcon';
6
+ import { v4 as uuid } from 'uuid';
6
7
  import { Box, Icon, IconButton, Link, Separator, Text } from '../index';
7
8
  import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks.js';
8
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -53,13 +54,14 @@ var EarthCircleIcon = function EarthCircleIcon() {
53
54
  }));
54
55
  };
55
56
  var RadioButtonIcon = function RadioButtonIcon(props) {
57
+ var id = uuid();
56
58
  return ___EmotionJSX("svg", _extends({
57
59
  viewBox: "0 0 22 22",
58
60
  fill: "none",
59
61
  xmlns: "http://www.w3.org/2000/svg",
60
- "aria-labelledby": "radio-button-icon-title"
62
+ "aria-labelledby": "radio-button-icon-title-".concat(id)
61
63
  }, props), ___EmotionJSX("title", {
62
- id: "radio-button-icon-title"
64
+ id: "radio-button-icon-title-".concat(id)
63
65
  }, "Radio Button Icon"), ___EmotionJSX("path", {
64
66
  d: "M11 18.3333C9.05508 18.3333 7.18982 17.5607 5.81455 16.1854C4.43928 14.8102 3.66667 12.9449 3.66667 11C3.66667 9.05507 4.43928 7.18981 5.81455 5.81455C7.18982 4.43928 9.05508 3.66666 11 3.66666C12.9449 3.66666 14.8102 4.43928 16.1854 5.81455C17.5607 7.18981 18.3333 9.05507 18.3333 11C18.3333 12.9449 17.5607 14.8102 16.1854 16.1854C14.8102 17.5607 12.9449 18.3333 11 18.3333ZM11 1.83333C9.79621 1.83333 8.60422 2.07043 7.49207 2.5311C6.37992 2.99177 5.36939 3.66698 4.51819 4.51818C2.7991 6.23727 1.83333 8.56884 1.83333 11C1.83333 13.4311 2.7991 15.7627 4.51819 17.4818C5.36939 18.333 6.37992 19.0082 7.49207 19.4689C8.60422 19.9296 9.79621 20.1667 11 20.1667C13.4311 20.1667 15.7627 19.2009 17.4818 17.4818C19.2009 15.7627 20.1667 13.4311 20.1667 11C20.1667 9.79621 19.9296 8.60421 19.4689 7.49206C19.0082 6.37991 18.333 5.36939 17.4818 4.51818C16.6306 3.66698 15.6201 2.99177 14.5079 2.5311C13.3958 2.07043 12.2038 1.83333 11 1.83333Z",
65
67
  fill: "#B3BEE8"
@@ -97,6 +97,13 @@ export var FIGMA_LINKS = {
97
97
  OnewayToBidirectionalArrow: {
98
98
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=43504-1214&mode=design&t=R4kdj0liRHxsqbV5-0'
99
99
  },
100
+ panelHeader: {
101
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44688%3A39612&mode=dev',
102
+ withSubtext: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39651&mode=dev',
103
+ withControls: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39662&mode=dev',
104
+ withImage: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39682&mode=dev',
105
+ withExtraLongText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688%3A39713&mode=dev'
106
+ },
100
107
  popoverMenu: {
101
108
  "default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A3073&t=We3h7LaaFJQnxdSy-1'
102
109
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.28.0",
3
+ "version": "2.29.1",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",