@pingux/astro 2.104.0-alpha.4 → 2.104.0-alpha.6

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.
@@ -15,6 +15,8 @@ _Object$defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
17
  exports["default"] = void 0;
18
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
19
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
18
20
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
19
21
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
20
22
  var _react = _interopRequireWildcard(require("react"));
@@ -50,9 +52,11 @@ var ImageUploadFieldBase = /*#__PURE__*/(0, _react.forwardRef)(function (props,
50
52
  var labelRef = (0, _react.useRef)();
51
53
  var _useVisuallyHidden = (0, _reactAria.useVisuallyHidden)(),
52
54
  visuallyHiddenProps = _useVisuallyHidden.visuallyHiddenProps;
53
- var acceptableInputTypes = (0, _react.useMemo)(function () {
54
- return "".concat(fileTypes === null || fileTypes === void 0 ? void 0 : fileTypes.join('/*, '), "/*");
55
- }, [fileTypes]);
55
+ var getAcceptableInputTypes = function getAcceptableInputTypes() {
56
+ return (0, _map["default"])(fileTypes).call(fileTypes, function (type) {
57
+ return (0, _includes["default"])(type).call(type, '/') ? type : "".concat(type, "/*");
58
+ }).join(', ');
59
+ };
56
60
  return (0, _react2.jsx)(_.Box, (0, _extends2["default"])({
57
61
  variant: "forms.input.wrapper"
58
62
  }, fieldContainerProps), (0, _react2.jsx)(_.Label, (0, _extends2["default"])({}, fieldLabelProps, {
@@ -63,7 +67,7 @@ var ImageUploadFieldBase = /*#__PURE__*/(0, _react.forwardRef)(function (props,
63
67
  isOpen: isMenuOpen,
64
68
  onOpenChange: handleOpenMenuChange
65
69
  }, popoverMenuProps), children), (0, _react2.jsx)(_.Box, fieldControlWrapperProps, (0, _react2.jsx)(_.Input, (0, _extends2["default"])({}, fieldControlInputProps, visuallyHiddenProps, {
66
- accept: acceptableInputTypes,
70
+ accept: getAcceptableInputTypes(),
67
71
  "data-testid": "image-upload-input",
68
72
  onChange: handleInputChange,
69
73
  ref: inputRef,
@@ -15,6 +15,7 @@ var _AccountIcon = _interopRequireDefault(require("@pingux/mdi-react/AccountIcon
15
15
  var _FormSelectIcon = _interopRequireDefault(require("@pingux/mdi-react/FormSelectIcon"));
16
16
  var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
17
17
  var _ = require("../..");
18
+ var _figmaLinks = require("../../utils/designUtils/figmaLinks");
18
19
  var _images = require("../../utils/devUtils/constants/images");
19
20
  var _chartData = require("./controls/chart/chartData");
20
21
  var _ListViewItem = _interopRequireDefault(require("./ListViewItem.mdx"));
@@ -59,6 +60,12 @@ var Default = function Default() {
59
60
  }));
60
61
  };
61
62
  exports.Default = Default;
63
+ Default.parameters = {
64
+ design: {
65
+ type: 'figma',
66
+ url: _figmaLinks.FIGMA_LINKS.listViewItem["default"]
67
+ }
68
+ };
62
69
  var WithSubtext = function WithSubtext() {
63
70
  return (0, _react2.jsx)(Wrapper, null, (0, _react2.jsx)(_.ListViewItem, {
64
71
  data: {
@@ -69,6 +76,12 @@ var WithSubtext = function WithSubtext() {
69
76
  }));
70
77
  };
71
78
  exports.WithSubtext = WithSubtext;
79
+ WithSubtext.parameters = {
80
+ design: {
81
+ type: 'figma',
82
+ url: _figmaLinks.FIGMA_LINKS.listViewItem.withSubText
83
+ }
84
+ };
72
85
  var WithImage = function WithImage() {
73
86
  return (0, _react2.jsx)(Wrapper, null, (0, _react2.jsx)(_.ListViewItem, {
74
87
  data: {
@@ -83,13 +96,18 @@ var WithImage = function WithImage() {
83
96
  }));
84
97
  };
85
98
  exports.WithImage = WithImage;
99
+ WithImage.parameters = {
100
+ design: {
101
+ type: 'figma',
102
+ url: _figmaLinks.FIGMA_LINKS.listViewItem.withImage
103
+ }
104
+ };
86
105
  var WithControls = function WithControls() {
87
106
  return (0, _react2.jsx)(Wrapper, null, (0, _react2.jsx)(_.ListViewItem, {
88
107
  data: {
89
108
  icon: _FormSelectIcon["default"],
90
109
  text: 'Fons Vernall'
91
- },
92
- "aria-label": "Fons Vernall"
110
+ }
93
111
  }, (0, _react2.jsx)(_.ListViewItemEditButton, {
94
112
  "aria-label": "edit-icon"
95
113
  }), (0, _react2.jsx)(_.ListViewItemSwitchField, {
@@ -103,6 +121,12 @@ var WithControls = function WithControls() {
103
121
  }, "Delete user"))));
104
122
  };
105
123
  exports.WithControls = WithControls;
124
+ WithControls.parameters = {
125
+ design: {
126
+ type: 'figma',
127
+ url: _figmaLinks.FIGMA_LINKS.listViewItem.withControls
128
+ }
129
+ };
106
130
  var WithRightOfDataSlot = function WithRightOfDataSlot() {
107
131
  var renderRightOfData = (0, _react2.jsx)(_.Box, {
108
132
  isRow: true,
@@ -132,6 +156,12 @@ var WithRightOfDataSlot = function WithRightOfDataSlot() {
132
156
  }, "Delete user"))));
133
157
  };
134
158
  exports.WithRightOfDataSlot = WithRightOfDataSlot;
159
+ WithRightOfDataSlot.parameters = {
160
+ design: {
161
+ type: 'figma',
162
+ url: _figmaLinks.FIGMA_LINKS.listViewItem.withRightOfDataSlot
163
+ }
164
+ };
135
165
  var WithLeftOfDataSlot = function WithLeftOfDataSlot() {
136
166
  var renderLeftOfData = (0, _react2.jsx)(_.Box, {
137
167
  mx: "sm",
@@ -161,6 +191,12 @@ var WithLeftOfDataSlot = function WithLeftOfDataSlot() {
161
191
  }, "Delete user"))));
162
192
  };
163
193
  exports.WithLeftOfDataSlot = WithLeftOfDataSlot;
194
+ WithLeftOfDataSlot.parameters = {
195
+ design: {
196
+ type: 'figma',
197
+ url: _figmaLinks.FIGMA_LINKS.listViewItem.withLeftOfDataSlot
198
+ }
199
+ };
164
200
  var WithCharts = function WithCharts() {
165
201
  var containerRef = (0, _react.useRef)();
166
202
  return (0, _react2.jsx)(Wrapper, null, (0, _react2.jsx)(_.ListViewItem, {
@@ -190,6 +226,12 @@ var WithCharts = function WithCharts() {
190
226
  }, "Delete user"))));
191
227
  };
192
228
  exports.WithCharts = WithCharts;
229
+ WithCharts.parameters = {
230
+ design: {
231
+ type: 'figma',
232
+ url: _figmaLinks.FIGMA_LINKS.listViewItem.withCharts
233
+ }
234
+ };
193
235
  var WithExtraLongText = function WithExtraLongText() {
194
236
  var renderRightOfData = (0, _react2.jsx)(_.Box, {
195
237
  isRow: true,
@@ -219,4 +261,10 @@ var WithExtraLongText = function WithExtraLongText() {
219
261
  key: "delete"
220
262
  }, "Delete user"))));
221
263
  };
222
- exports.WithExtraLongText = WithExtraLongText;
264
+ exports.WithExtraLongText = WithExtraLongText;
265
+ WithExtraLongText.parameters = {
266
+ design: {
267
+ type: 'figma',
268
+ url: _figmaLinks.FIGMA_LINKS.listViewItem.withExtraLongText
269
+ }
270
+ };
@@ -24,10 +24,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
24
24
  * to ListItemEditButton.
25
25
  */var ListViewItemEditButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
26
26
  return (0, _react2.jsx)(_.Box, {
27
- ref: ref
27
+ ref: ref,
28
+ ml: "sm"
28
29
  }, (0, _react2.jsx)(_.IconButton, props, (0, _react2.jsx)(_.Icon, {
29
30
  icon: _CreateIcon["default"],
30
- size: "sm"
31
+ size: "md"
31
32
  })));
32
33
  });
33
34
  ListViewItemEditButton.propTypes = _iconButtonAttributes.iconButtonPropTypes;
@@ -209,4 +209,14 @@ export declare const FIGMA_LINKS: {
209
209
  editButton: {
210
210
  default: string;
211
211
  };
212
+ listViewItem: {
213
+ default: string;
214
+ withSubText: string;
215
+ withImage: string;
216
+ withControls: string;
217
+ withRightOfDataSlot: string;
218
+ withLeftOfDataSlot: string;
219
+ withCharts: string;
220
+ withExtraLongText: string;
221
+ };
212
222
  };
@@ -215,6 +215,16 @@ var FIGMA_LINKS = {
215
215
  },
216
216
  editButton: {
217
217
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58623-6267&t=pXTSE3YlGbL0X49N-4'
218
+ },
219
+ listViewItem: {
220
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688-39754&t=r7CoWppWfQQ6G2t8-4',
221
+ withSubText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688-39756&t=r7CoWppWfQQ6G2t8-4',
222
+ withImage: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44691-39794&t=r7CoWppWfQQ6G2t8-4',
223
+ withControls: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44691-39816&t=r7CoWppWfQQ6G2t8-4',
224
+ withRightOfDataSlot: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44693-39854&t=r7CoWppWfQQ6G2t8-4',
225
+ withLeftOfDataSlot: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44693-39909&t=r7CoWppWfQQ6G2t8-4',
226
+ withCharts: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44694-39944&t=r7CoWppWfQQ6G2t8-4',
227
+ withExtraLongText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44694-40069&t=r7CoWppWfQQ6G2t8-4'
218
228
  }
219
229
  };
220
230
  exports.FIGMA_LINKS = FIGMA_LINKS;
@@ -8,9 +8,11 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
8
8
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
9
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
10
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
12
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
11
13
  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; }
12
14
  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; }
13
- import React, { forwardRef, useMemo, useRef } from 'react';
15
+ import React, { forwardRef, useRef } from 'react';
14
16
  import { useVisuallyHidden } from 'react-aria';
15
17
  import omit from 'lodash/omit';
16
18
  import PropTypes from 'prop-types';
@@ -39,9 +41,11 @@ var ImageUploadFieldBase = /*#__PURE__*/forwardRef(function (props, inputRef) {
39
41
  var labelRef = useRef();
40
42
  var _useVisuallyHidden = useVisuallyHidden(),
41
43
  visuallyHiddenProps = _useVisuallyHidden.visuallyHiddenProps;
42
- var acceptableInputTypes = useMemo(function () {
43
- return "".concat(fileTypes === null || fileTypes === void 0 ? void 0 : fileTypes.join('/*, '), "/*");
44
- }, [fileTypes]);
44
+ var getAcceptableInputTypes = function getAcceptableInputTypes() {
45
+ return _mapInstanceProperty(fileTypes).call(fileTypes, function (type) {
46
+ return _includesInstanceProperty(type).call(type, '/') ? type : "".concat(type, "/*");
47
+ }).join(', ');
48
+ };
45
49
  return ___EmotionJSX(Box, _extends({
46
50
  variant: "forms.input.wrapper"
47
51
  }, fieldContainerProps), ___EmotionJSX(Label, _extends({}, fieldLabelProps, {
@@ -52,7 +56,7 @@ var ImageUploadFieldBase = /*#__PURE__*/forwardRef(function (props, inputRef) {
52
56
  isOpen: isMenuOpen,
53
57
  onOpenChange: handleOpenMenuChange
54
58
  }, popoverMenuProps), children), ___EmotionJSX(Box, fieldControlWrapperProps, ___EmotionJSX(Input, _extends({}, fieldControlInputProps, visuallyHiddenProps, {
55
- accept: acceptableInputTypes,
59
+ accept: getAcceptableInputTypes(),
56
60
  "data-testid": "image-upload-input",
57
61
  onChange: handleInputChange,
58
62
  ref: inputRef,
@@ -4,6 +4,7 @@ import AccountIcon from '@pingux/mdi-react/AccountIcon';
4
4
  import FormSelectIcon from '@pingux/mdi-react/FormSelectIcon';
5
5
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
6
6
  import { Badge, Box, ListViewItem, ListViewItemChart, ListViewItemEditButton, ListViewItemMenu, ListViewItemSwitchField, Separator, Text } from '../..';
7
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
7
8
  import { pingImg } from '../../utils/devUtils/constants/images';
8
9
  import { chartData } from './controls/chart/chartData';
9
10
  import ListViewItemReadMe from './ListViewItem.mdx';
@@ -44,6 +45,12 @@ export var Default = function Default() {
44
45
  }
45
46
  }));
46
47
  };
48
+ Default.parameters = {
49
+ design: {
50
+ type: 'figma',
51
+ url: FIGMA_LINKS.listViewItem["default"]
52
+ }
53
+ };
47
54
  export var WithSubtext = function WithSubtext() {
48
55
  return ___EmotionJSX(Wrapper, null, ___EmotionJSX(ListViewItem, {
49
56
  data: {
@@ -53,6 +60,12 @@ export var WithSubtext = function WithSubtext() {
53
60
  }
54
61
  }));
55
62
  };
63
+ WithSubtext.parameters = {
64
+ design: {
65
+ type: 'figma',
66
+ url: FIGMA_LINKS.listViewItem.withSubText
67
+ }
68
+ };
56
69
  export var WithImage = function WithImage() {
57
70
  return ___EmotionJSX(Wrapper, null, ___EmotionJSX(ListViewItem, {
58
71
  data: {
@@ -66,13 +79,18 @@ export var WithImage = function WithImage() {
66
79
  }
67
80
  }));
68
81
  };
82
+ WithImage.parameters = {
83
+ design: {
84
+ type: 'figma',
85
+ url: FIGMA_LINKS.listViewItem.withImage
86
+ }
87
+ };
69
88
  export var WithControls = function WithControls() {
70
89
  return ___EmotionJSX(Wrapper, null, ___EmotionJSX(ListViewItem, {
71
90
  data: {
72
91
  icon: FormSelectIcon,
73
92
  text: 'Fons Vernall'
74
- },
75
- "aria-label": "Fons Vernall"
93
+ }
76
94
  }, ___EmotionJSX(ListViewItemEditButton, {
77
95
  "aria-label": "edit-icon"
78
96
  }), ___EmotionJSX(ListViewItemSwitchField, {
@@ -85,6 +103,12 @@ export var WithControls = function WithControls() {
85
103
  key: "delete"
86
104
  }, "Delete user"))));
87
105
  };
106
+ WithControls.parameters = {
107
+ design: {
108
+ type: 'figma',
109
+ url: FIGMA_LINKS.listViewItem.withControls
110
+ }
111
+ };
88
112
  export var WithRightOfDataSlot = function WithRightOfDataSlot() {
89
113
  var renderRightOfData = ___EmotionJSX(Box, {
90
114
  isRow: true,
@@ -113,6 +137,12 @@ export var WithRightOfDataSlot = function WithRightOfDataSlot() {
113
137
  key: "delete"
114
138
  }, "Delete user"))));
115
139
  };
140
+ WithRightOfDataSlot.parameters = {
141
+ design: {
142
+ type: 'figma',
143
+ url: FIGMA_LINKS.listViewItem.withRightOfDataSlot
144
+ }
145
+ };
116
146
  export var WithLeftOfDataSlot = function WithLeftOfDataSlot() {
117
147
  var renderLeftOfData = ___EmotionJSX(Box, {
118
148
  mx: "sm",
@@ -141,6 +171,12 @@ export var WithLeftOfDataSlot = function WithLeftOfDataSlot() {
141
171
  key: "delete"
142
172
  }, "Delete user"))));
143
173
  };
174
+ WithLeftOfDataSlot.parameters = {
175
+ design: {
176
+ type: 'figma',
177
+ url: FIGMA_LINKS.listViewItem.withLeftOfDataSlot
178
+ }
179
+ };
144
180
  export var WithCharts = function WithCharts() {
145
181
  var containerRef = useRef();
146
182
  return ___EmotionJSX(Wrapper, null, ___EmotionJSX(ListViewItem, {
@@ -169,6 +205,12 @@ export var WithCharts = function WithCharts() {
169
205
  key: "delete"
170
206
  }, "Delete user"))));
171
207
  };
208
+ WithCharts.parameters = {
209
+ design: {
210
+ type: 'figma',
211
+ url: FIGMA_LINKS.listViewItem.withCharts
212
+ }
213
+ };
172
214
  export var WithExtraLongText = function WithExtraLongText() {
173
215
  var renderRightOfData = ___EmotionJSX(Box, {
174
216
  isRow: true,
@@ -197,4 +239,10 @@ export var WithExtraLongText = function WithExtraLongText() {
197
239
  }, "Disable user"), ___EmotionJSX(Item, {
198
240
  key: "delete"
199
241
  }, "Delete user"))));
242
+ };
243
+ WithExtraLongText.parameters = {
244
+ design: {
245
+ type: 'figma',
246
+ url: FIGMA_LINKS.listViewItem.withExtraLongText
247
+ }
200
248
  };
@@ -13,10 +13,11 @@ import { iconButtonPropTypes } from '../../IconButton/iconButtonAttributes';
13
13
  import { jsx as ___EmotionJSX } from "@emotion/react";
14
14
  var ListViewItemEditButton = /*#__PURE__*/forwardRef(function (props, ref) {
15
15
  return ___EmotionJSX(Box, {
16
- ref: ref
16
+ ref: ref,
17
+ ml: "sm"
17
18
  }, ___EmotionJSX(IconButton, props, ___EmotionJSX(Icon, {
18
19
  icon: CreateIcon,
19
- size: "sm"
20
+ size: "md"
20
21
  })));
21
22
  });
22
23
  ListViewItemEditButton.propTypes = iconButtonPropTypes;
@@ -208,5 +208,15 @@ export var FIGMA_LINKS = {
208
208
  },
209
209
  editButton: {
210
210
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58623-6267&t=pXTSE3YlGbL0X49N-4'
211
+ },
212
+ listViewItem: {
213
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688-39754&t=r7CoWppWfQQ6G2t8-4',
214
+ withSubText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44688-39756&t=r7CoWppWfQQ6G2t8-4',
215
+ withImage: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44691-39794&t=r7CoWppWfQQ6G2t8-4',
216
+ withControls: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44691-39816&t=r7CoWppWfQQ6G2t8-4',
217
+ withRightOfDataSlot: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44693-39854&t=r7CoWppWfQQ6G2t8-4',
218
+ withLeftOfDataSlot: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44693-39909&t=r7CoWppWfQQ6G2t8-4',
219
+ withCharts: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44694-39944&t=r7CoWppWfQQ6G2t8-4',
220
+ withExtraLongText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=44694-40069&t=r7CoWppWfQQ6G2t8-4'
211
221
  }
212
222
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.104.0-alpha.4",
3
+ "version": "2.104.0-alpha.6",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",