@pingux/astro 2.28.0-alpha.0 → 2.28.0-alpha.10

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.DisabledItems = 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"));
@@ -41,16 +41,16 @@ var itemArray = [{
41
41
  }];
42
42
  var itemArrayDisabled = [{
43
43
  key: 't1',
44
- label: 'Disabled Accordion',
44
+ label: 'Accordion Disabled',
45
45
  children: (0, _react2.jsx)(_index.Text, null, "Hi")
46
46
  }, {
47
47
  key: 't2',
48
- label: 'Accordion',
49
- children: 'Child Renders Here'
48
+ label: 'Accordion Active',
49
+ children: (0, _react2.jsx)(_index.Text, null, "Hi")
50
50
  }, {
51
51
  key: 't3',
52
- label: 'Disabled Accordion',
53
- children: 'Child Renders Here'
52
+ label: 'Accordion Disabled',
53
+ children: (0, _react2.jsx)(_index.Text, null, "Hi")
54
54
  }];
55
55
  var _default = {
56
56
  title: 'Components/AccordionGroup',
@@ -214,13 +214,13 @@ var UncontrolledExpanded = function UncontrolledExpanded() {
214
214
  );
215
215
  };
216
216
  exports.UncontrolledExpanded = UncontrolledExpanded;
217
- var DisabledItems = function DisabledItems() {
217
+ var DisabledState = function DisabledState() {
218
218
  return (
219
219
  /*
220
220
  itemArrayDisabled = [
221
- { key: 't1', label: 'Disabled Accordion', children: <Text>Hi</Text> },
222
- { key: 't2', label: 'Accordion', children: 'Child Renders Here' },
223
- { key: 't3', label: 'Disabled Accordion', children: 'Child Renders Here' },
221
+ { key: 't1', label: 'Accordion Disabled', children: <Text>Hi</Text> },
222
+ { key: 't2', label: 'Accordion Active', children: <Text>Hi</Text> },
223
+ { key: 't3', label: 'Accordion Disabled', children: <Text>Hi</Text> },
224
224
  ];
225
225
  */
226
226
  (0, _react2.jsx)(_index.AccordionGroup, {
@@ -236,7 +236,13 @@ var DisabledItems = function DisabledItems() {
236
236
  })
237
237
  );
238
238
  };
239
- exports.DisabledItems = DisabledItems;
239
+ exports.DisabledState = DisabledState;
240
+ DisabledState.parameters = {
241
+ design: {
242
+ type: 'figma',
243
+ url: _figmaLinks.FIGMA_LINKS.accordionGroup.disabledState
244
+ }
245
+ };
240
246
  var CustomPresentation = function CustomPresentation() {
241
247
  return (
242
248
  /*
@@ -274,4 +280,27 @@ CustomPresentation.parameters = {
274
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.'
275
281
  }
276
282
  }
277
- };
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({}),
@@ -125,6 +125,7 @@ var ComboBoxInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
125
125
  tabIndex: -1
126
126
  }), (0, _react2.jsx)(_.Icon, {
127
127
  icon: _MenuDownIcon["default"],
128
+ size: "md",
128
129
  sx: isOpen ? {
129
130
  transform: 'rotate(180deg)'
130
131
  } : null,
@@ -98,6 +98,7 @@ var SelectFieldBase = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
98
98
  title: {
99
99
  name: 'Menu down'
100
100
  },
101
+ size: "md",
101
102
  sx: state.isOpen ? {
102
103
  transform: 'rotate(180deg)'
103
104
  } : null
@@ -24,7 +24,21 @@ var _react2 = require("@emotion/react");
24
24
  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; }
25
25
  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; }
26
26
  var _default = {
27
- title: 'Recipes/Condition Filter'
27
+ title: 'Recipes/Condition Filter',
28
+ parameters: {
29
+ a11y: {
30
+ config: {
31
+ /** The "color-contrast" test ends with an "incomplete" status
32
+ * since pseudo-element applies to the same container as selected values.
33
+ * A workaround to disable "color-contrast" incomplete tests.
34
+ */
35
+ rules: [{
36
+ id: 'color-contrast',
37
+ enabled: false
38
+ }]
39
+ }
40
+ }
41
+ }
28
42
  };
29
43
  exports["default"] = _default;
30
44
  var borderBox = {
@@ -8,6 +8,7 @@ exports.FIGMA_LINKS = void 0;
8
8
  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
+ disabledState: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=43917%3A31554&mode=dev',
11
12
  differentLevels: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=446%3A1949&mode=dev'
12
13
  },
13
14
  attributeMappings: {
@@ -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';
@@ -28,16 +28,16 @@ var itemArray = [{
28
28
  }];
29
29
  var itemArrayDisabled = [{
30
30
  key: 't1',
31
- label: 'Disabled Accordion',
31
+ label: 'Accordion Disabled',
32
32
  children: ___EmotionJSX(Text, null, "Hi")
33
33
  }, {
34
34
  key: 't2',
35
- label: 'Accordion',
36
- children: 'Child Renders Here'
35
+ label: 'Accordion Active',
36
+ children: ___EmotionJSX(Text, null, "Hi")
37
37
  }, {
38
38
  key: 't3',
39
- label: 'Disabled Accordion',
40
- children: 'Child Renders Here'
39
+ label: 'Accordion Disabled',
40
+ children: ___EmotionJSX(Text, null, "Hi")
41
41
  }];
42
42
  export default {
43
43
  title: 'Components/AccordionGroup',
@@ -195,13 +195,13 @@ export var UncontrolledExpanded = function UncontrolledExpanded() {
195
195
  })
196
196
  );
197
197
  };
198
- export var DisabledItems = function DisabledItems() {
198
+ export var DisabledState = function DisabledState() {
199
199
  return (
200
200
  /*
201
201
  itemArrayDisabled = [
202
- { key: 't1', label: 'Disabled Accordion', children: <Text>Hi</Text> },
203
- { key: 't2', label: 'Accordion', children: 'Child Renders Here' },
204
- { key: 't3', label: 'Disabled Accordion', children: 'Child Renders Here' },
202
+ { key: 't1', label: 'Accordion Disabled', children: <Text>Hi</Text> },
203
+ { key: 't2', label: 'Accordion Active', children: <Text>Hi</Text> },
204
+ { key: 't3', label: 'Accordion Disabled', children: <Text>Hi</Text> },
205
205
  ];
206
206
  */
207
207
  ___EmotionJSX(AccordionGroup, {
@@ -217,6 +217,12 @@ export var DisabledItems = function DisabledItems() {
217
217
  })
218
218
  );
219
219
  };
220
+ DisabledState.parameters = {
221
+ design: {
222
+ type: 'figma',
223
+ url: FIGMA_LINKS.accordionGroup.disabledState
224
+ }
225
+ };
220
226
  export var CustomPresentation = function CustomPresentation() {
221
227
  return (
222
228
  /*
@@ -253,4 +259,26 @@ CustomPresentation.parameters = {
253
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.'
254
260
  }
255
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!")));
256
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({}),
@@ -114,6 +114,7 @@ var ComboBoxInput = /*#__PURE__*/forwardRef(function (props, ref) {
114
114
  tabIndex: -1
115
115
  }), ___EmotionJSX(Icon, {
116
116
  icon: MenuDown,
117
+ size: "md",
117
118
  sx: isOpen ? {
118
119
  transform: 'rotate(180deg)'
119
120
  } : null,
@@ -88,6 +88,7 @@ var SelectFieldBase = /*#__PURE__*/forwardRef(function (_ref, ref) {
88
88
  title: {
89
89
  name: 'Menu down'
90
90
  },
91
+ size: "md",
91
92
  sx: state.isOpen ? {
92
93
  transform: 'rotate(180deg)'
93
94
  } : null
@@ -17,7 +17,21 @@ import { Badge, Box, Bracket, Button, Icon, IconButton, Item, RockerButton, Rock
17
17
  import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks.js';
18
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
19
  export default {
20
- title: 'Recipes/Condition Filter'
20
+ title: 'Recipes/Condition Filter',
21
+ parameters: {
22
+ a11y: {
23
+ config: {
24
+ /** The "color-contrast" test ends with an "incomplete" status
25
+ * since pseudo-element applies to the same container as selected values.
26
+ * A workaround to disable "color-contrast" incomplete tests.
27
+ */
28
+ rules: [{
29
+ id: 'color-contrast',
30
+ enabled: false
31
+ }]
32
+ }
33
+ }
34
+ }
21
35
  };
22
36
  var borderBox = {
23
37
  borderColor: 'neutral.80',
@@ -1,6 +1,7 @@
1
1
  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
+ disabledState: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=43917%3A31554&mode=dev',
4
5
  differentLevels: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=446%3A1949&mode=dev'
5
6
  },
6
7
  attributeMappings: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.28.0-alpha.0",
3
+ "version": "2.28.0-alpha.10",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -114,6 +114,7 @@
114
114
  "devDependencies": {
115
115
  "@babel/cli": "^7.22.0",
116
116
  "@babel/core": "^7.22.0",
117
+ "@babel/eslint-parser": "^7.22.15",
117
118
  "@babel/plugin-transform-runtime": "7.13.9",
118
119
  "@babel/plugin-transform-spread": "^7.16.7",
119
120
  "@babel/preset-env": "^7.11.5",
@@ -143,7 +144,6 @@
143
144
  "@types/uuid": "^8.3.2",
144
145
  "@typescript-eslint/eslint-plugin": "^5.61.0",
145
146
  "@typescript-eslint/parser": "^5.61.0",
146
- "babel-eslint": "^9.0.0",
147
147
  "babel-loader": "^8.1.0",
148
148
  "babel-plugin-react-docgen": "^4.2.1",
149
149
  "babel-plugin-transform-node-env-inline": "^0.4.3",