@pingux/astro 2.20.0-alpha.6 → 2.20.0-alpha.8
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.
- package/lib/cjs/components/ListView/ListView.js +8 -2
- package/lib/cjs/recipes/CountryPicker.stories.js +11 -2
- package/lib/cjs/utils/designUtils/figmaLinks.js +3 -0
- package/lib/components/ListView/ListView.js +8 -2
- package/lib/recipes/CountryPicker.stories.js +10 -1
- package/lib/utils/designUtils/figmaLinks.js +3 -0
- package/package.json +1 -1
@@ -34,7 +34,7 @@ var _Loader = _interopRequireDefault(require("../Loader"));
|
|
34
34
|
var _ListViewContext = require("./ListViewContext");
|
35
35
|
var _ListViewItem = _interopRequireDefault(require("./ListViewItem"));
|
36
36
|
var _react2 = require("@emotion/react");
|
37
|
-
var _excluded = ["disabledKeys", "isHoverable", "loadingState", "onLoadMore", "onSelectionChange", "selectedKeys", "selectionMode", "selectionStyle"];
|
37
|
+
var _excluded = ["disabledKeys", "isHoverable", "loadingState", "onLoadMore", "onSelectionChange", "selectedKeys", "selectionMode", "selectionStyle", "items"];
|
38
38
|
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); }
|
39
39
|
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; }
|
40
40
|
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; }
|
@@ -76,6 +76,7 @@ var ListView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
76
76
|
selectedKeys = props.selectedKeys,
|
77
77
|
selectionMode = props.selectionMode,
|
78
78
|
selectionStyle = props.selectionStyle,
|
79
|
+
items = props.items,
|
79
80
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
80
81
|
var _useState = (0, _react.useState)(null),
|
81
82
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -119,6 +120,9 @@ var ListView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
119
120
|
layout.isLoading = isLoading;
|
120
121
|
var focusedKey = selectionManager.focusedKey;
|
121
122
|
delete gridProps.onMouseDown;
|
123
|
+
if (!items) {
|
124
|
+
delete others['aria-label'];
|
125
|
+
}
|
122
126
|
var onFocus = function onFocus(e) {
|
123
127
|
gridProps.onFocus(e);
|
124
128
|
if (others.onFocus) {
|
@@ -134,7 +138,9 @@ var ListView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
134
138
|
value: {
|
135
139
|
state: state
|
136
140
|
}
|
137
|
-
}, (0, _react2.jsx)(_virtualizer.Virtualizer, (0, _extends2["default"])({}, gridProps
|
141
|
+
}, (0, _react2.jsx)(_virtualizer.Virtualizer, (0, _extends2["default"])({}, items ? gridProps : {
|
142
|
+
role: 'presentation'
|
143
|
+
}, {
|
138
144
|
onLoadMore: onLoadMore,
|
139
145
|
ref: listViewRef,
|
140
146
|
focusedKey: focusedKey,
|
@@ -14,12 +14,15 @@ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
16
16
|
var _countriesList = require("countries-list");
|
17
|
+
var _storybookAddonDesigns = require("storybook-addon-designs");
|
17
18
|
var _index = require("../index");
|
19
|
+
var _figmaLinks = require("../utils/designUtils/figmaLinks");
|
18
20
|
var _react2 = require("@emotion/react");
|
19
21
|
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); }
|
20
22
|
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; }
|
21
23
|
var _default = {
|
22
|
-
title: 'Recipes/Country Picker'
|
24
|
+
title: 'Recipes/Country Picker',
|
25
|
+
decorators: [_storybookAddonDesigns.withDesign]
|
23
26
|
};
|
24
27
|
exports["default"] = _default;
|
25
28
|
var validatePhoneNumber = function validatePhoneNumber(str) {
|
@@ -132,4 +135,10 @@ var Default = function Default() {
|
|
132
135
|
value: phoneNumber
|
133
136
|
})));
|
134
137
|
};
|
135
|
-
exports.Default = Default;
|
138
|
+
exports.Default = Default;
|
139
|
+
Default.parameters = {
|
140
|
+
design: {
|
141
|
+
type: 'figma',
|
142
|
+
url: _figmaLinks.FIGMA_LINKS.countryPicker["default"]
|
143
|
+
}
|
144
|
+
};
|
@@ -50,6 +50,9 @@ var FIGMA_LINKS = {
|
|
50
50
|
copyText: {
|
51
51
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=218-1442&t=8Wwd3tIBh3GEjCJB-0'
|
52
52
|
},
|
53
|
+
countryPicker: {
|
54
|
+
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=4568-7532&mode=design&t=eSfQYHRFNPf37J4C-0'
|
55
|
+
},
|
53
56
|
helpHint: {
|
54
57
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A4534&t=We3h7LaaFJQnxdSy-1',
|
55
58
|
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=28958%3A40081&mode=design&t=WmSYPx1hR8kxFiXf-1'
|
@@ -10,7 +10,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
11
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
12
12
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
13
|
-
var _excluded = ["disabledKeys", "isHoverable", "loadingState", "onLoadMore", "onSelectionChange", "selectedKeys", "selectionMode", "selectionStyle"];
|
13
|
+
var _excluded = ["disabledKeys", "isHoverable", "loadingState", "onLoadMore", "onSelectionChange", "selectedKeys", "selectionMode", "selectionStyle", "items"];
|
14
14
|
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
15
15
|
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; }
|
16
16
|
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; }
|
@@ -63,6 +63,7 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
63
63
|
selectedKeys = props.selectedKeys,
|
64
64
|
selectionMode = props.selectionMode,
|
65
65
|
selectionStyle = props.selectionStyle,
|
66
|
+
items = props.items,
|
66
67
|
others = _objectWithoutProperties(props, _excluded);
|
67
68
|
var _useState = useState(null),
|
68
69
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -106,6 +107,9 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
106
107
|
layout.isLoading = isLoading;
|
107
108
|
var focusedKey = selectionManager.focusedKey;
|
108
109
|
delete gridProps.onMouseDown;
|
110
|
+
if (!items) {
|
111
|
+
delete others['aria-label'];
|
112
|
+
}
|
109
113
|
var onFocus = function onFocus(e) {
|
110
114
|
gridProps.onFocus(e);
|
111
115
|
if (others.onFocus) {
|
@@ -121,7 +125,9 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
121
125
|
value: {
|
122
126
|
state: state
|
123
127
|
}
|
124
|
-
}, ___EmotionJSX(Virtualizer, _extends({}, gridProps
|
128
|
+
}, ___EmotionJSX(Virtualizer, _extends({}, items ? gridProps : {
|
129
|
+
role: 'presentation'
|
130
|
+
}, {
|
125
131
|
onLoadMore: onLoadMore,
|
126
132
|
ref: listViewRef,
|
127
133
|
focusedKey: focusedKey,
|
@@ -3,10 +3,13 @@ import _Object$entries from "@babel/runtime-corejs3/core-js-stable/object/entrie
|
|
3
3
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
4
4
|
import React, { useState } from 'react';
|
5
5
|
import { countries as countriesObj } from 'countries-list';
|
6
|
+
import { withDesign } from 'storybook-addon-designs';
|
6
7
|
import { Box, ComboBoxField, Input, Item } from '../index';
|
8
|
+
import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks';
|
7
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
10
|
export default {
|
9
|
-
title: 'Recipes/Country Picker'
|
11
|
+
title: 'Recipes/Country Picker',
|
12
|
+
decorators: [withDesign]
|
10
13
|
};
|
11
14
|
var validatePhoneNumber = function validatePhoneNumber(str) {
|
12
15
|
var reg = /^$|^[\d\-(\d)\s.]+$|^\+/g;
|
@@ -117,4 +120,10 @@ export var Default = function Default() {
|
|
117
120
|
onChange: onPhoneNumberValueChange,
|
118
121
|
value: phoneNumber
|
119
122
|
})));
|
123
|
+
};
|
124
|
+
Default.parameters = {
|
125
|
+
design: {
|
126
|
+
type: 'figma',
|
127
|
+
url: FIGMA_LINKS.countryPicker["default"]
|
128
|
+
}
|
120
129
|
};
|
@@ -43,6 +43,9 @@ export var FIGMA_LINKS = {
|
|
43
43
|
copyText: {
|
44
44
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=218-1442&t=8Wwd3tIBh3GEjCJB-0'
|
45
45
|
},
|
46
|
+
countryPicker: {
|
47
|
+
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=4568-7532&mode=design&t=eSfQYHRFNPf37J4C-0'
|
48
|
+
},
|
46
49
|
helpHint: {
|
47
50
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A4534&t=We3h7LaaFJQnxdSy-1',
|
48
51
|
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=28958%3A40081&mode=design&t=WmSYPx1hR8kxFiXf-1'
|