@pingux/astro 1.23.0-alpha.3 → 1.23.0-alpha.4
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/Breadcrumbs/Breadcrumbs.js +0 -1
- package/lib/cjs/components/ListView/ListView.js +6 -0
- package/lib/cjs/components/SwitchField/SwitchField.js +10 -2
- package/lib/cjs/styles/forms/switch.js +3 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.js +0 -1
- package/lib/components/ListView/ListView.js +6 -0
- package/lib/components/SwitchField/SwitchField.js +9 -2
- package/lib/styles/forms/switch.js +3 -3
- package/package.json +1 -1
@@ -105,6 +105,12 @@ function useListLayout(state) {
|
|
105
105
|
* ListViews are used to display a list of items. Users can select,
|
106
106
|
* view, or edit items in this list. This virtualized component supports
|
107
107
|
* asynchronous data in infinitely scrollable lists.
|
108
|
+
*
|
109
|
+
* NOTE: be careful with putting focusable elements inside ListView.
|
110
|
+
* It is using a grid (useList hook) with its own event listeners under the hood.
|
111
|
+
* [react-specttrum-github-issue](https://github.com/adobe/react-spectrum/issues/2801)
|
112
|
+
* If you decided to add a focusable element inside ListView,
|
113
|
+
* you should stop bubbling of a pointerDown event and put a focus on the element.
|
108
114
|
*/
|
109
115
|
|
110
116
|
|
@@ -48,6 +48,8 @@ var _toggle = require("@react-stately/toggle");
|
|
48
48
|
|
49
49
|
var _switch = require("@react-aria/switch");
|
50
50
|
|
51
|
+
var _interactions = require("@react-aria/interactions");
|
52
|
+
|
51
53
|
var _hooks = require("../../hooks");
|
52
54
|
|
53
55
|
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
@@ -113,6 +115,12 @@ var SwitchField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
113
115
|
var state = (0, _toggle.useToggleState)(_objectSpread({
|
114
116
|
defaultSelected: isDefaultSelected
|
115
117
|
}, props));
|
118
|
+
|
119
|
+
var _usePress = (0, _interactions.usePress)({
|
120
|
+
isDisabled: isDisabled
|
121
|
+
}),
|
122
|
+
containerPressProps = _usePress.pressProps;
|
123
|
+
|
116
124
|
var whitelistedProps = (0, _omit["default"])(props, (0, _keys["default"])(others));
|
117
125
|
|
118
126
|
var _useSwitch = (0, _switch.useSwitch)(_objectSpread({
|
@@ -124,9 +132,9 @@ var SwitchField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
124
132
|
isSelected: inputProps.checked
|
125
133
|
};
|
126
134
|
|
127
|
-
var _useField = (0, _hooks.useField)(_objectSpread(_objectSpread({
|
135
|
+
var _useField = (0, _hooks.useField)(_objectSpread(_objectSpread(_objectSpread({
|
128
136
|
statusClasses: statusClasses
|
129
|
-
}, props), {}, {
|
137
|
+
}, containerPressProps), props), {}, {
|
130
138
|
controlProps: _objectSpread(_objectSpread({}, controlProps), inputProps)
|
131
139
|
})),
|
132
140
|
fieldContainerProps = _useField.fieldContainerProps,
|
@@ -54,11 +54,11 @@ var thumbContainer = {
|
|
54
54
|
border: '1px solid',
|
55
55
|
borderColor: 'neutral.80',
|
56
56
|
borderRadius: 9999,
|
57
|
-
'.is-selected &': {
|
57
|
+
'label.is-selected &': {
|
58
58
|
bg: 'active',
|
59
59
|
borderColor: 'active'
|
60
60
|
},
|
61
|
-
'.is-focused &, &:focus': _objectSpread({}, _buttons.defaultFocus)
|
61
|
+
'label.is-focused &, &:focus': _objectSpread({}, _buttons.defaultFocus)
|
62
62
|
};
|
63
63
|
exports.thumbContainer = thumbContainer;
|
64
64
|
var thumb = {
|
@@ -73,7 +73,7 @@ var thumb = {
|
|
73
73
|
transitionTimingFunction: 'ease-out',
|
74
74
|
transitionDuration: '0.1s',
|
75
75
|
transform: 'translateX(0)',
|
76
|
-
'.is-selected &': {
|
76
|
+
'label.is-selected &': {
|
77
77
|
transform: 'translateX(20px)',
|
78
78
|
borderColor: 'active'
|
79
79
|
}
|
@@ -59,6 +59,12 @@ export function useListLayout(state) {
|
|
59
59
|
* ListViews are used to display a list of items. Users can select,
|
60
60
|
* view, or edit items in this list. This virtualized component supports
|
61
61
|
* asynchronous data in infinitely scrollable lists.
|
62
|
+
*
|
63
|
+
* NOTE: be careful with putting focusable elements inside ListView.
|
64
|
+
* It is using a grid (useList hook) with its own event listeners under the hood.
|
65
|
+
* [react-specttrum-github-issue](https://github.com/adobe/react-spectrum/issues/2801)
|
66
|
+
* If you decided to add a focusable element inside ListView,
|
67
|
+
* you should stop bubbling of a pointerDown event and put a focus on the element.
|
62
68
|
*/
|
63
69
|
|
64
70
|
var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
@@ -21,6 +21,7 @@ import PropTypes from 'prop-types';
|
|
21
21
|
import omit from 'lodash/omit';
|
22
22
|
import { useToggleState } from '@react-stately/toggle';
|
23
23
|
import { useSwitch } from '@react-aria/switch';
|
24
|
+
import { usePress } from '@react-aria/interactions';
|
24
25
|
import { useField, usePropWarning } from '../../hooks';
|
25
26
|
import statuses from '../../utils/devUtils/constants/statuses';
|
26
27
|
import Box from '../Box';
|
@@ -71,6 +72,12 @@ var SwitchField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
71
72
|
var state = useToggleState(_objectSpread({
|
72
73
|
defaultSelected: isDefaultSelected
|
73
74
|
}, props));
|
75
|
+
|
76
|
+
var _usePress = usePress({
|
77
|
+
isDisabled: isDisabled
|
78
|
+
}),
|
79
|
+
containerPressProps = _usePress.pressProps;
|
80
|
+
|
74
81
|
var whitelistedProps = omit(props, _Object$keys(others));
|
75
82
|
|
76
83
|
var _useSwitch = useSwitch(_objectSpread({
|
@@ -82,9 +89,9 @@ var SwitchField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
82
89
|
isSelected: inputProps.checked
|
83
90
|
};
|
84
91
|
|
85
|
-
var _useField = useField(_objectSpread(_objectSpread({
|
92
|
+
var _useField = useField(_objectSpread(_objectSpread(_objectSpread({
|
86
93
|
statusClasses: statusClasses
|
87
|
-
}, props), {}, {
|
94
|
+
}, containerPressProps), props), {}, {
|
88
95
|
controlProps: _objectSpread(_objectSpread({}, controlProps), inputProps)
|
89
96
|
})),
|
90
97
|
fieldContainerProps = _useField.fieldContainerProps,
|
@@ -33,11 +33,11 @@ export var thumbContainer = {
|
|
33
33
|
border: '1px solid',
|
34
34
|
borderColor: 'neutral.80',
|
35
35
|
borderRadius: 9999,
|
36
|
-
'.is-selected &': {
|
36
|
+
'label.is-selected &': {
|
37
37
|
bg: 'active',
|
38
38
|
borderColor: 'active'
|
39
39
|
},
|
40
|
-
'.is-focused &, &:focus': _objectSpread({}, defaultFocus)
|
40
|
+
'label.is-focused &, &:focus': _objectSpread({}, defaultFocus)
|
41
41
|
};
|
42
42
|
export var thumb = {
|
43
43
|
width: 20,
|
@@ -51,7 +51,7 @@ export var thumb = {
|
|
51
51
|
transitionTimingFunction: 'ease-out',
|
52
52
|
transitionDuration: '0.1s',
|
53
53
|
transform: 'translateX(0)',
|
54
|
-
'.is-selected &': {
|
54
|
+
'label.is-selected &': {
|
55
55
|
transform: 'translateX(20px)',
|
56
56
|
borderColor: 'active'
|
57
57
|
}
|