@pingux/astro 2.18.1-alpha.2 → 2.19.0-alpha.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.
- package/lib/cjs/components/ListView/ListView.js +3 -0
- package/lib/cjs/components/ListView/ListViewItem.js +8 -4
- package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +13 -1
- package/lib/cjs/recipes/ConditionFilter.stories.js +14 -1
- package/lib/cjs/utils/designUtils/figmaLinks.js +4 -0
- package/lib/components/ListView/ListView.js +3 -0
- package/lib/components/ListView/ListViewItem.js +6 -2
- package/lib/components/ListViewItem/ListViewItem.styles.js +13 -1
- package/lib/recipes/ConditionFilter.stories.js +13 -0
- package/lib/utils/designUtils/figmaLinks.js +4 -0
- package/package.json +1 -1
@@ -103,6 +103,9 @@ var ListView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
103
103
|
hoveredItem: hoveredItem,
|
104
104
|
setHoveredItem: setHoveredItem
|
105
105
|
};
|
106
|
+
state.isLoading = (0, _react.useMemo)(function () {
|
107
|
+
return isLoading;
|
108
|
+
}, [isLoading]);
|
106
109
|
var collection = state.collection,
|
107
110
|
selectionManager = state.selectionManager;
|
108
111
|
var layout = useListLayout(state);
|
@@ -25,7 +25,7 @@ var _interactions = require("@react-aria/interactions");
|
|
25
25
|
var _list = require("@react-aria/list");
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
27
27
|
var _hooks = require("../../hooks");
|
28
|
-
var
|
28
|
+
var _index = require("../../index");
|
29
29
|
var _ListViewContext = require("./ListViewContext");
|
30
30
|
var _react2 = require("@emotion/react");
|
31
31
|
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); }
|
@@ -86,7 +86,7 @@ var ListViewItem = function ListViewItem(props) {
|
|
86
86
|
// Whether the current component should have legacy styles removed
|
87
87
|
// TODO: [Astro 3.0.0] Remove the legacy styles and update the code here.
|
88
88
|
var shouldOverRideLegacyStyles = (0, _includes["default"])(_context = (0, _keys["default"])(item.rendered.props)).call(_context, 'data');
|
89
|
-
return (0, _react2.jsx)(
|
89
|
+
return (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
|
90
90
|
isDisabled: isDisabled,
|
91
91
|
isRow: true,
|
92
92
|
ref: rowRef
|
@@ -94,7 +94,7 @@ var ListViewItem = function ListViewItem(props) {
|
|
94
94
|
sx: {
|
95
95
|
outline: 'none'
|
96
96
|
}
|
97
|
-
}), (0, _react2.jsx)(
|
97
|
+
}), (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
|
98
98
|
as: "div"
|
99
99
|
// Apply appropriate variant dependant on whether a legacy list item is used
|
100
100
|
,
|
@@ -105,7 +105,11 @@ var ListViewItem = function ListViewItem(props) {
|
|
105
105
|
isSelected: isSelected,
|
106
106
|
className: classNames,
|
107
107
|
"data-id": dataId
|
108
|
-
}, listItemProps), item.rendered)
|
108
|
+
}, listItemProps), item.rendered, state.isLoading && isFocusVisibleWithin && (0, _react2.jsx)(_index.Box, {
|
109
|
+
variant: "listViewItem.loaderContainer"
|
110
|
+
}, (0, _react2.jsx)(_index.Loader, {
|
111
|
+
color: "neutral.50"
|
112
|
+
}))));
|
109
113
|
};
|
110
114
|
ListViewItem.propTypes = {
|
111
115
|
item: _propTypes["default"].shape({
|
@@ -71,6 +71,17 @@ var linkedViewContainer = _objectSpread(_objectSpread({}, container), {}, {
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
});
|
74
|
+
var loaderContainer = {
|
75
|
+
bg: 'white',
|
76
|
+
p: 'xs',
|
77
|
+
position: 'absolute',
|
78
|
+
top: 'calc(50% - 18px)',
|
79
|
+
left: 'calc(50% - 44px)',
|
80
|
+
borderWidth: '1px',
|
81
|
+
borderColor: 'neutral.80',
|
82
|
+
borderStyle: 'solid',
|
83
|
+
borderRadius: '25px'
|
84
|
+
};
|
74
85
|
var styledContainer = {
|
75
86
|
m: '1px',
|
76
87
|
minHeight: '72px',
|
@@ -115,6 +126,7 @@ var _default = {
|
|
115
126
|
linkedViewContainer: linkedViewContainer,
|
116
127
|
rightOfData: rightOfData,
|
117
128
|
styledContainer: styledContainer,
|
118
|
-
styledListItem: styledListItem
|
129
|
+
styledListItem: styledListItem,
|
130
|
+
loaderContainer: loaderContainer
|
119
131
|
};
|
120
132
|
exports["default"] = _default;
|
@@ -18,6 +18,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
19
19
|
var _TrashIcon = _interopRequireDefault(require("@pingux/mdi-react/TrashIcon"));
|
20
20
|
var _index = require("../index");
|
21
|
+
var _figmaLinks = require("../utils/designUtils/figmaLinks.js");
|
21
22
|
var _react2 = require("@emotion/react");
|
22
23
|
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; }
|
23
24
|
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; }
|
@@ -198,6 +199,12 @@ var DisplaySectionHeader = function DisplaySectionHeader(_ref2) {
|
|
198
199
|
}, ofTheConditionsAreTrueCopy));
|
199
200
|
};
|
200
201
|
exports.DisplaySectionHeader = DisplaySectionHeader;
|
202
|
+
Display.parameters = {
|
203
|
+
design: {
|
204
|
+
type: 'figma',
|
205
|
+
url: _figmaLinks.FIGMA_LINKS.conditionFilter.display
|
206
|
+
}
|
207
|
+
};
|
201
208
|
var Edit = function Edit() {
|
202
209
|
var trashButton = (0, _react2.jsx)(_index.IconButton, {
|
203
210
|
"aria-label": "deleteButton",
|
@@ -494,4 +501,10 @@ var Edit = function Edit() {
|
|
494
501
|
alignSelf: "start"
|
495
502
|
}, trashButton))));
|
496
503
|
};
|
497
|
-
exports.Edit = Edit;
|
504
|
+
exports.Edit = Edit;
|
505
|
+
Edit.parameters = {
|
506
|
+
design: {
|
507
|
+
type: 'figma',
|
508
|
+
url: _figmaLinks.FIGMA_LINKS.conditionFilter.edit
|
509
|
+
}
|
510
|
+
};
|
@@ -39,6 +39,10 @@ var FIGMA_LINKS = {
|
|
39
39
|
collapsiblePanel: {
|
40
40
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14546-33229&t=VgqEexa1CXAXfPpp-0'
|
41
41
|
},
|
42
|
+
conditionFilter: {
|
43
|
+
display: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=218%3A574&mode=dev',
|
44
|
+
edit: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=218%3A597&mode=dev'
|
45
|
+
},
|
42
46
|
copyText: {
|
43
47
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=218-1442&t=8Wwd3tIBh3GEjCJB-0'
|
44
48
|
},
|
@@ -90,6 +90,9 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
90
90
|
hoveredItem: hoveredItem,
|
91
91
|
setHoveredItem: setHoveredItem
|
92
92
|
};
|
93
|
+
state.isLoading = useMemo(function () {
|
94
|
+
return isLoading;
|
95
|
+
}, [isLoading]);
|
93
96
|
var collection = state.collection,
|
94
97
|
selectionManager = state.selectionManager;
|
95
98
|
var layout = useListLayout(state);
|
@@ -17,7 +17,7 @@ import { useHover } from '@react-aria/interactions';
|
|
17
17
|
import { useListItem } from '@react-aria/list';
|
18
18
|
import PropTypes from 'prop-types';
|
19
19
|
import { useStatusClasses } from '../../hooks';
|
20
|
-
import Box from '
|
20
|
+
import { Box, Loader } from '../../index';
|
21
21
|
import { ListViewContext } from './ListViewContext';
|
22
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
23
23
|
var ListViewItem = function ListViewItem(props) {
|
@@ -93,7 +93,11 @@ var ListViewItem = function ListViewItem(props) {
|
|
93
93
|
isSelected: isSelected,
|
94
94
|
className: classNames,
|
95
95
|
"data-id": dataId
|
96
|
-
}, listItemProps), item.rendered
|
96
|
+
}, listItemProps), item.rendered, state.isLoading && isFocusVisibleWithin && ___EmotionJSX(Box, {
|
97
|
+
variant: "listViewItem.loaderContainer"
|
98
|
+
}, ___EmotionJSX(Loader, {
|
99
|
+
color: "neutral.50"
|
100
|
+
}))));
|
97
101
|
};
|
98
102
|
ListViewItem.propTypes = {
|
99
103
|
item: PropTypes.shape({
|
@@ -64,6 +64,17 @@ var linkedViewContainer = _objectSpread(_objectSpread({}, container), {}, {
|
|
64
64
|
}
|
65
65
|
}
|
66
66
|
});
|
67
|
+
var loaderContainer = {
|
68
|
+
bg: 'white',
|
69
|
+
p: 'xs',
|
70
|
+
position: 'absolute',
|
71
|
+
top: 'calc(50% - 18px)',
|
72
|
+
left: 'calc(50% - 44px)',
|
73
|
+
borderWidth: '1px',
|
74
|
+
borderColor: 'neutral.80',
|
75
|
+
borderStyle: 'solid',
|
76
|
+
borderRadius: '25px'
|
77
|
+
};
|
67
78
|
var styledContainer = {
|
68
79
|
m: '1px',
|
69
80
|
minHeight: '72px',
|
@@ -108,5 +119,6 @@ export default {
|
|
108
119
|
linkedViewContainer: linkedViewContainer,
|
109
120
|
rightOfData: rightOfData,
|
110
121
|
styledContainer: styledContainer,
|
111
|
-
styledListItem: styledListItem
|
122
|
+
styledListItem: styledListItem,
|
123
|
+
loaderContainer: loaderContainer
|
112
124
|
};
|
@@ -13,6 +13,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
13
13
|
import React from 'react';
|
14
14
|
import TrashIcon from '@pingux/mdi-react/TrashIcon';
|
15
15
|
import { Badge, Box, Bracket, Button, Icon, IconButton, Item, RockerButton, RockerButtonGroup, SelectField, Text, TextField } from '../index';
|
16
|
+
import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks.js';
|
16
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
17
18
|
export default {
|
18
19
|
title: 'Recipes/Condition Filter'
|
@@ -187,6 +188,12 @@ export var DisplaySectionHeader = function DisplaySectionHeader(_ref2) {
|
|
187
188
|
alignSelf: "center"
|
188
189
|
}, ofTheConditionsAreTrueCopy));
|
189
190
|
};
|
191
|
+
Display.parameters = {
|
192
|
+
design: {
|
193
|
+
type: 'figma',
|
194
|
+
url: FIGMA_LINKS.conditionFilter.display
|
195
|
+
}
|
196
|
+
};
|
190
197
|
export var Edit = function Edit() {
|
191
198
|
var trashButton = ___EmotionJSX(IconButton, {
|
192
199
|
"aria-label": "deleteButton",
|
@@ -482,4 +489,10 @@ export var Edit = function Edit() {
|
|
482
489
|
}))), ___EmotionJSX(Box, {
|
483
490
|
alignSelf: "start"
|
484
491
|
}, trashButton))));
|
492
|
+
};
|
493
|
+
Edit.parameters = {
|
494
|
+
design: {
|
495
|
+
type: 'figma',
|
496
|
+
url: FIGMA_LINKS.conditionFilter.edit
|
497
|
+
}
|
485
498
|
};
|
@@ -32,6 +32,10 @@ export var FIGMA_LINKS = {
|
|
32
32
|
collapsiblePanel: {
|
33
33
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14546-33229&t=VgqEexa1CXAXfPpp-0'
|
34
34
|
},
|
35
|
+
conditionFilter: {
|
36
|
+
display: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=218%3A574&mode=dev',
|
37
|
+
edit: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=218%3A597&mode=dev'
|
38
|
+
},
|
35
39
|
copyText: {
|
36
40
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=218-1442&t=8Wwd3tIBh3GEjCJB-0'
|
37
41
|
},
|