@pingux/astro 2.71.0-alpha.0 → 2.71.0-alpha.2
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/ListBox/ListBox.js +4 -2
- package/lib/cjs/components/ListBox/ListBox.styles.js +20 -0
- package/lib/cjs/components/ListBox/Option.js +47 -8
- package/lib/cjs/components/MultivaluesField/CondensedMultivaluesField.js +508 -0
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +616 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +18 -481
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +114 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +251 -2
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +3 -1
- package/lib/cjs/recipes/DateTimeRangePicker.stories.js +182 -0
- package/lib/cjs/types/listBox.d.ts +6 -0
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +3 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +3 -0
- package/lib/components/ListBox/ListBox.js +4 -2
- package/lib/components/ListBox/ListBox.styles.js +20 -0
- package/lib/components/ListBox/Option.js +47 -8
- package/lib/components/MultivaluesField/CondensedMultivaluesField.js +495 -0
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +603 -0
- package/lib/components/MultivaluesField/MultivaluesField.js +18 -480
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +111 -1
- package/lib/components/MultivaluesField/MultivaluesField.test.js +250 -2
- package/lib/components/SelectFieldBase/SelectFieldBase.js +3 -1
- package/lib/recipes/DateTimeRangePicker.stories.js +167 -0
- package/lib/utils/designUtils/figmaLinks.js +3 -0
- package/package.json +1 -1
@@ -33,7 +33,7 @@ var _index = require("./index");
|
|
33
33
|
var _ListBoxContext = require("./ListBoxContext");
|
34
34
|
var _ListBoxSection = _interopRequireDefault(require("./ListBoxSection"));
|
35
35
|
var _react2 = require("@emotion/react");
|
36
|
-
var _excluded = ["defaultSelectedKeys", "disabledKeys", "hasAutoFocus", "hasFocusWrap", "hasNoEmptySelection", "hasVirtualFocus", "id", "isLoading", "isFocusedOnHover", "isSelectedOnPressUp", "isVirtualized", "items", "keyboardDelegate", "label", "onLoadMore", "onScroll", "onSelectionChange", "renderEmptyState", "selectedKeys", "selectionMode", "state", "aria-label", "aria-labelledby", "aria-describedby", "aria-details"];
|
36
|
+
var _excluded = ["defaultSelectedKeys", "disabledKeys", "hasAutoFocus", "hasFocusWrap", "hasNoEmptySelection", "hasVirtualFocus", "id", "isCondensed", "isLoading", "isFocusedOnHover", "isSelectedOnPressUp", "isVirtualized", "items", "keyboardDelegate", "label", "onLoadMore", "onScroll", "onSelectionChange", "renderEmptyState", "selectedKeys", "selectionMode", "state", "aria-label", "aria-labelledby", "aria-describedby", "aria-details"];
|
37
37
|
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); }
|
38
38
|
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; }
|
39
39
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
@@ -72,6 +72,7 @@ var ListBox = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
72
72
|
hasNoEmptySelection = props.hasNoEmptySelection,
|
73
73
|
hasVirtualFocus = props.hasVirtualFocus,
|
74
74
|
id = props.id,
|
75
|
+
isCondensed = props.isCondensed,
|
75
76
|
isLoading = props.isLoading,
|
76
77
|
isFocusedOnHover = props.isFocusedOnHover,
|
77
78
|
isSelectedOnPressUp = props.isSelectedOnPressUp,
|
@@ -176,7 +177,8 @@ var ListBox = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
176
177
|
return (0, _react2.jsx)(_index.Option, {
|
177
178
|
key: item.key,
|
178
179
|
item: item,
|
179
|
-
hasVirtualFocus: hasVirtualFocus
|
180
|
+
hasVirtualFocus: hasVirtualFocus,
|
181
|
+
isCondensed: isCondensed
|
180
182
|
});
|
181
183
|
}
|
182
184
|
if (type === collectionTypes.LOADER) {
|
@@ -33,8 +33,28 @@ listBox.option = _objectSpread(_objectSpread({}, _Text.text.base), {}, {
|
|
33
33
|
'&.is-focused': {
|
34
34
|
color: 'white',
|
35
35
|
bg: 'active'
|
36
|
+
},
|
37
|
+
'&.is-condensed': {
|
38
|
+
'&.is-selected': {
|
39
|
+
pl: 'md',
|
40
|
+
color: 'text.primary',
|
41
|
+
fontWeight: 400
|
42
|
+
},
|
43
|
+
'&.is-focused': {
|
44
|
+
color: 'text.primary',
|
45
|
+
fontWeight: 400,
|
46
|
+
bg: 'white'
|
47
|
+
}
|
36
48
|
}
|
37
49
|
});
|
50
|
+
listBox.checkboxIcon = {
|
51
|
+
'&.is-focus-visible': {
|
52
|
+
boxShadow: 'none',
|
53
|
+
outline: '1px solid',
|
54
|
+
outlineColor: 'focus',
|
55
|
+
outlineOffset: '0px'
|
56
|
+
}
|
57
|
+
};
|
38
58
|
listBox.selectField = {
|
39
59
|
maxHeight: '200px',
|
40
60
|
overflow: 'auto',
|
@@ -15,9 +15,9 @@ _Object$defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
16
16
|
});
|
17
17
|
exports["default"] = void 0;
|
18
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
19
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
20
19
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
20
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
21
21
|
var _react = _interopRequireWildcard(require("react"));
|
22
22
|
var _CircleSmallIcon = _interopRequireDefault(require("@pingux/mdi-react/CircleSmallIcon"));
|
23
23
|
var _listbox = require("@react-aria/listbox");
|
@@ -27,16 +27,45 @@ var _Box = _interopRequireDefault(require("../Box"));
|
|
27
27
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
28
28
|
var _ListBoxContext = require("./ListBoxContext");
|
29
29
|
var _react2 = require("@emotion/react");
|
30
|
-
var _excluded = ["item", "hasVirtualFocus"],
|
30
|
+
var _excluded = ["item", "hasVirtualFocus", "isCondensed"],
|
31
31
|
_excluded2 = ["onPressStart", "onPressUp"];
|
32
32
|
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); }
|
33
33
|
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; }
|
34
34
|
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; }
|
35
35
|
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; }
|
36
|
+
var UncheckedIcon = function UncheckedIcon(prop) {
|
37
|
+
return (0, _react2.jsx)("svg", (0, _extends2["default"])({
|
38
|
+
width: "24",
|
39
|
+
height: "24",
|
40
|
+
viewBox: "0 0 24 24",
|
41
|
+
fill: "none",
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
43
|
+
"aria-labelledby": "variable-icon-title"
|
44
|
+
}, prop), (0, _react2.jsx)("title", {
|
45
|
+
id: "variable-icon-title"
|
46
|
+
}, "Unchecked Icon"), (0, _react2.jsx)("path", {
|
47
|
+
d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
48
|
+
}));
|
49
|
+
};
|
50
|
+
var CheckedIcon = function CheckedIcon(prop) {
|
51
|
+
return (0, _react2.jsx)("svg", (0, _extends2["default"])({
|
52
|
+
width: "24",
|
53
|
+
height: "24",
|
54
|
+
viewBox: "0 0 24 24",
|
55
|
+
fill: "none",
|
56
|
+
xmlns: "http://www.w3.org/2000/svg",
|
57
|
+
"aria-labelledby": "variable-icon-title"
|
58
|
+
}, prop), (0, _react2.jsx)("title", {
|
59
|
+
id: "variable-icon-title"
|
60
|
+
}, "Checked Icon"), (0, _react2.jsx)("path", {
|
61
|
+
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
62
|
+
}));
|
63
|
+
};
|
36
64
|
var Option = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
37
65
|
var _state$selectionManag;
|
38
66
|
var item = props.item,
|
39
67
|
hasVirtualFocus = props.hasVirtualFocus,
|
68
|
+
isCondensed = props.isCondensed,
|
40
69
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
41
70
|
var key = item.key,
|
42
71
|
itemProps = item.props,
|
@@ -54,24 +83,27 @@ var Option = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
54
83
|
var _useOption = (0, _listbox.useOption)(_objectSpread({
|
55
84
|
key: key,
|
56
85
|
shouldSelectOnPressUp: true,
|
57
|
-
shouldFocusOnHover:
|
58
|
-
shouldUseVirtualFocus: hasVirtualFocus,
|
86
|
+
shouldFocusOnHover: !isCondensed,
|
87
|
+
shouldUseVirtualFocus: isCondensed ? false : hasVirtualFocus,
|
59
88
|
isVirtualized: true
|
60
89
|
}, others), state, optionRef),
|
61
90
|
optionProps = _useOption.optionProps,
|
62
91
|
isDisabled = _useOption.isDisabled,
|
63
92
|
isSelected = _useOption.isSelected,
|
64
|
-
isFocused = _useOption.isFocused
|
93
|
+
isFocused = _useOption.isFocused,
|
94
|
+
isFocusVisible = _useOption.isFocusVisible;
|
65
95
|
var focused = isFocused || (state === null || state === void 0 || (_state$selectionManag = state.selectionManager) === null || _state$selectionManag === void 0 ? void 0 : _state$selectionManag.focusedKey) === item.key;
|
66
96
|
var setFocusOnHover = function setFocusOnHover() {
|
67
|
-
if (!focused) {
|
97
|
+
if (!focused && !isCondensed) {
|
68
98
|
state.selectionManager.setFocusedKey(item.key);
|
69
99
|
}
|
70
100
|
};
|
71
101
|
var _useStatusClasses = (0, _hooks.useStatusClasses)(null, {
|
72
102
|
isDisabled: isDisabled || isSeparator,
|
73
103
|
isFocused: focused,
|
74
|
-
isSelected: isSelected
|
104
|
+
isSelected: isSelected,
|
105
|
+
isCondensed: isCondensed,
|
106
|
+
isFocusVisible: isFocusVisible
|
75
107
|
}),
|
76
108
|
classNames = _useStatusClasses.classNames;
|
77
109
|
var updateActiveDescendant = (0, _MultivaluesContext.useMultivaluesContext)();
|
@@ -98,7 +130,14 @@ var Option = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
98
130
|
onPointerOver: setFocusOnHover
|
99
131
|
}, theseOptionProps, others, {
|
100
132
|
"aria-label": ariaLabel
|
101
|
-
}),
|
133
|
+
}), isCondensed ? (0, _react2.jsx)(_Icon["default"], {
|
134
|
+
icon: isSelected ? CheckedIcon : UncheckedIcon,
|
135
|
+
color: "active",
|
136
|
+
size: "24px",
|
137
|
+
mr: "xs",
|
138
|
+
className: classNames,
|
139
|
+
variant: "listBox.checkboxIcon"
|
140
|
+
}) : isSelected && (0, _react2.jsx)(_Icon["default"], {
|
102
141
|
icon: _CircleSmallIcon["default"],
|
103
142
|
title: {
|
104
143
|
name: 'Circle Small Icon'
|