@react-spectrum/tag 3.0.0-alpha.0 → 3.0.0-alpha.3
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/dist/main.js +116 -114
- package/dist/main.js.map +1 -1
- package/dist/module.js +116 -114
- package/dist/module.js.map +1 -1
- package/package.json +17 -17
package/dist/main.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
require("./main.css");
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
6
|
-
var $
|
|
7
|
-
var $
|
|
8
|
-
var $
|
|
9
|
-
var $
|
|
10
|
-
var $
|
|
11
|
-
var $
|
|
12
|
-
var $
|
|
13
|
-
var $
|
|
14
|
-
var $
|
|
2
|
+
var $dTV3V$reactspectrumutils = require("@react-spectrum/utils");
|
|
3
|
+
var $dTV3V$reactstatelygrid = require("@react-stately/grid");
|
|
4
|
+
var $dTV3V$reactariautils = require("@react-aria/utils");
|
|
5
|
+
var $dTV3V$react = require("react");
|
|
6
|
+
var $dTV3V$reactariatag = require("@react-aria/tag");
|
|
7
|
+
var $dTV3V$reactariagrid = require("@react-aria/grid");
|
|
8
|
+
var $dTV3V$reactstatelylist = require("@react-stately/list");
|
|
9
|
+
var $dTV3V$reactariai18n = require("@react-aria/i18n");
|
|
10
|
+
var $dTV3V$reactspectrumprovider = require("@react-spectrum/provider");
|
|
11
|
+
var $dTV3V$reactspectrumbutton = require("@react-spectrum/button");
|
|
12
|
+
var $dTV3V$reactspectrumtext = require("@react-spectrum/text");
|
|
13
|
+
var $dTV3V$reactariafocus = require("@react-aria/focus");
|
|
14
|
+
var $dTV3V$reactariainteractions = require("@react-aria/interactions");
|
|
15
15
|
|
|
16
16
|
function $parcel$exportWildcard(dest, source) {
|
|
17
17
|
Object.keys(source).forEach(function(key) {
|
|
@@ -35,69 +35,69 @@ function $parcel$interopDefault(a) {
|
|
|
35
35
|
function $parcel$export(e, n, v, s) {
|
|
36
36
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
37
37
|
}
|
|
38
|
-
var $
|
|
38
|
+
var $e7b72d8874e98cd4$exports = {};
|
|
39
39
|
|
|
40
|
-
$parcel$export($
|
|
40
|
+
$parcel$export($e7b72d8874e98cd4$exports, "TagGroup", () => $e7b72d8874e98cd4$export$67ea30858aaf75e3);
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
var $
|
|
45
|
+
var $ed889f8f1f091fc8$exports = {};
|
|
46
46
|
|
|
47
|
-
$parcel$export($
|
|
48
|
-
$parcel$export($
|
|
49
|
-
$parcel$export($
|
|
50
|
-
$parcel$export($
|
|
51
|
-
$parcel$export($
|
|
52
|
-
$parcel$export($
|
|
53
|
-
$parcel$export($
|
|
54
|
-
$parcel$export($
|
|
55
|
-
$parcel$export($
|
|
56
|
-
$parcel$export($
|
|
57
|
-
$parcel$export($
|
|
58
|
-
$parcel$export($
|
|
59
|
-
$parcel$export($
|
|
60
|
-
$parcel$export($
|
|
61
|
-
$parcel$export($
|
|
62
|
-
$parcel$export($
|
|
63
|
-
$parcel$export($
|
|
64
|
-
$parcel$export($
|
|
65
|
-
var $
|
|
66
|
-
var $
|
|
67
|
-
var $
|
|
68
|
-
var $
|
|
69
|
-
var $
|
|
70
|
-
var $
|
|
71
|
-
var $
|
|
72
|
-
var $
|
|
73
|
-
var $
|
|
74
|
-
var $
|
|
75
|
-
var $
|
|
76
|
-
var $
|
|
77
|
-
var $
|
|
78
|
-
var $
|
|
79
|
-
var $
|
|
80
|
-
var $
|
|
81
|
-
var $
|
|
82
|
-
var $
|
|
83
|
-
$
|
|
84
|
-
$
|
|
85
|
-
$
|
|
86
|
-
$
|
|
87
|
-
$
|
|
88
|
-
$
|
|
89
|
-
$
|
|
90
|
-
$
|
|
91
|
-
$
|
|
92
|
-
$
|
|
93
|
-
$
|
|
94
|
-
$
|
|
95
|
-
$
|
|
96
|
-
$
|
|
97
|
-
$
|
|
98
|
-
$
|
|
99
|
-
$
|
|
100
|
-
$
|
|
47
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tags", () => $ed889f8f1f091fc8$export$eb7e80013a1212da, (v) => $ed889f8f1f091fc8$export$eb7e80013a1212da = v);
|
|
48
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tags-item", () => $ed889f8f1f091fc8$export$950d8dc0a3751654, (v) => $ed889f8f1f091fc8$export$950d8dc0a3751654 = v);
|
|
49
|
+
$parcel$export($ed889f8f1f091fc8$exports, "is-disabled", () => $ed889f8f1f091fc8$export$d35bc1e505d1ebbf, (v) => $ed889f8f1f091fc8$export$d35bc1e505d1ebbf = v);
|
|
50
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tag-icon", () => $ed889f8f1f091fc8$export$21f5254139e14871, (v) => $ed889f8f1f091fc8$export$21f5254139e14871 = v);
|
|
51
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tag-content", () => $ed889f8f1f091fc8$export$d281c967f4ee071e, (v) => $ed889f8f1f091fc8$export$d281c967f4ee071e = v);
|
|
52
|
+
$parcel$export($ed889f8f1f091fc8$exports, "tags-removable", () => $ed889f8f1f091fc8$export$7427262f66a3b803, (v) => $ed889f8f1f091fc8$export$7427262f66a3b803 = v);
|
|
53
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tag-label", () => $ed889f8f1f091fc8$export$7ea9e20fd4ac0076, (v) => $ed889f8f1f091fc8$export$7ea9e20fd4ac0076 = v);
|
|
54
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tag-action", () => $ed889f8f1f091fc8$export$c5a1243e33faa2d4, (v) => $ed889f8f1f091fc8$export$c5a1243e33faa2d4 = v);
|
|
55
|
+
$parcel$export($ed889f8f1f091fc8$exports, "is-hovered", () => $ed889f8f1f091fc8$export$b8813cd5d7824ce7, (v) => $ed889f8f1f091fc8$export$b8813cd5d7824ce7 = v);
|
|
56
|
+
$parcel$export($ed889f8f1f091fc8$exports, "focus-ring", () => $ed889f8f1f091fc8$export$f39a09f249340e2a, (v) => $ed889f8f1f091fc8$export$f39a09f249340e2a = v);
|
|
57
|
+
$parcel$export($ed889f8f1f091fc8$exports, "is-selected", () => $ed889f8f1f091fc8$export$1e0fb04f31d3c22a, (v) => $ed889f8f1f091fc8$export$1e0fb04f31d3c22a = v);
|
|
58
|
+
$parcel$export($ed889f8f1f091fc8$exports, "is-invalid", () => $ed889f8f1f091fc8$export$14a30de2866685fa, (v) => $ed889f8f1f091fc8$export$14a30de2866685fa = v);
|
|
59
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tags-itemIcon", () => $ed889f8f1f091fc8$export$8c615c557fdf3d9c, (v) => $ed889f8f1f091fc8$export$8c615c557fdf3d9c = v);
|
|
60
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tags-itemLabel", () => $ed889f8f1f091fc8$export$23caf26adee41b84, (v) => $ed889f8f1f091fc8$export$23caf26adee41b84 = v);
|
|
61
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tags-itemClearButton", () => $ed889f8f1f091fc8$export$90881dd581d6be55, (v) => $ed889f8f1f091fc8$export$90881dd581d6be55 = v);
|
|
62
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Avatar", () => $ed889f8f1f091fc8$export$2e049b8d031600fb, (v) => $ed889f8f1f091fc8$export$2e049b8d031600fb = v);
|
|
63
|
+
$parcel$export($ed889f8f1f091fc8$exports, "spectrum-Tags-item--removable", () => $ed889f8f1f091fc8$export$c1666977f4e14f87, (v) => $ed889f8f1f091fc8$export$c1666977f4e14f87 = v);
|
|
64
|
+
$parcel$export($ed889f8f1f091fc8$exports, "is-focused", () => $ed889f8f1f091fc8$export$e7dc768d35940237, (v) => $ed889f8f1f091fc8$export$e7dc768d35940237 = v);
|
|
65
|
+
var $ed889f8f1f091fc8$export$eb7e80013a1212da;
|
|
66
|
+
var $ed889f8f1f091fc8$export$950d8dc0a3751654;
|
|
67
|
+
var $ed889f8f1f091fc8$export$d35bc1e505d1ebbf;
|
|
68
|
+
var $ed889f8f1f091fc8$export$21f5254139e14871;
|
|
69
|
+
var $ed889f8f1f091fc8$export$d281c967f4ee071e;
|
|
70
|
+
var $ed889f8f1f091fc8$export$7427262f66a3b803;
|
|
71
|
+
var $ed889f8f1f091fc8$export$7ea9e20fd4ac0076;
|
|
72
|
+
var $ed889f8f1f091fc8$export$c5a1243e33faa2d4;
|
|
73
|
+
var $ed889f8f1f091fc8$export$b8813cd5d7824ce7;
|
|
74
|
+
var $ed889f8f1f091fc8$export$f39a09f249340e2a;
|
|
75
|
+
var $ed889f8f1f091fc8$export$1e0fb04f31d3c22a;
|
|
76
|
+
var $ed889f8f1f091fc8$export$14a30de2866685fa;
|
|
77
|
+
var $ed889f8f1f091fc8$export$8c615c557fdf3d9c;
|
|
78
|
+
var $ed889f8f1f091fc8$export$23caf26adee41b84;
|
|
79
|
+
var $ed889f8f1f091fc8$export$90881dd581d6be55;
|
|
80
|
+
var $ed889f8f1f091fc8$export$2e049b8d031600fb;
|
|
81
|
+
var $ed889f8f1f091fc8$export$c1666977f4e14f87;
|
|
82
|
+
var $ed889f8f1f091fc8$export$e7dc768d35940237;
|
|
83
|
+
$ed889f8f1f091fc8$export$eb7e80013a1212da = "spectrum-Tags_8407eb";
|
|
84
|
+
$ed889f8f1f091fc8$export$950d8dc0a3751654 = "spectrum-Tags-item_8407eb";
|
|
85
|
+
$ed889f8f1f091fc8$export$d35bc1e505d1ebbf = "is-disabled_8407eb";
|
|
86
|
+
$ed889f8f1f091fc8$export$21f5254139e14871 = "spectrum-Tag-icon_8407eb";
|
|
87
|
+
$ed889f8f1f091fc8$export$d281c967f4ee071e = "spectrum-Tag-content_8407eb";
|
|
88
|
+
$ed889f8f1f091fc8$export$7427262f66a3b803 = "tags-removable_8407eb";
|
|
89
|
+
$ed889f8f1f091fc8$export$7ea9e20fd4ac0076 = "spectrum-Tag-label_8407eb";
|
|
90
|
+
$ed889f8f1f091fc8$export$c5a1243e33faa2d4 = "spectrum-Tag-action_8407eb";
|
|
91
|
+
$ed889f8f1f091fc8$export$b8813cd5d7824ce7 = "is-hovered_8407eb";
|
|
92
|
+
$ed889f8f1f091fc8$export$f39a09f249340e2a = "focus-ring_8407eb";
|
|
93
|
+
$ed889f8f1f091fc8$export$1e0fb04f31d3c22a = "is-selected_8407eb";
|
|
94
|
+
$ed889f8f1f091fc8$export$14a30de2866685fa = "is-invalid_8407eb";
|
|
95
|
+
$ed889f8f1f091fc8$export$8c615c557fdf3d9c = "spectrum-Tags-itemIcon_8407eb";
|
|
96
|
+
$ed889f8f1f091fc8$export$23caf26adee41b84 = "spectrum-Tags-itemLabel_8407eb";
|
|
97
|
+
$ed889f8f1f091fc8$export$90881dd581d6be55 = "spectrum-Tags-itemClearButton_8407eb";
|
|
98
|
+
$ed889f8f1f091fc8$export$2e049b8d031600fb = "spectrum-Avatar_8407eb";
|
|
99
|
+
$ed889f8f1f091fc8$export$c1666977f4e14f87 = "spectrum-Tags-item--removable_8407eb";
|
|
100
|
+
$ed889f8f1f091fc8$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
|
|
@@ -109,20 +109,20 @@ $728b12fe3f15274a$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
function $
|
|
112
|
+
function $dd2c5d00108c1840$export$3288d34c523a1192(props) {
|
|
113
113
|
const { children: children , isDisabled: isDisabled , isRemovable: isRemovable , item: item , state: state , onRemove: onRemove , ...otherProps } = props;
|
|
114
114
|
// @ts-ignore
|
|
115
|
-
let { styleProps: styleProps } = $
|
|
116
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $
|
|
115
|
+
let { styleProps: styleProps } = $dTV3V$reactspectrumutils.useStyleProps(otherProps);
|
|
116
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = $dTV3V$reactariainteractions.useHover({
|
|
117
117
|
isDisabled: isDisabled
|
|
118
118
|
});
|
|
119
|
-
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $
|
|
119
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $dTV3V$reactariafocus.useFocusRing({
|
|
120
120
|
within: true
|
|
121
121
|
});
|
|
122
|
-
let labelRef = $
|
|
123
|
-
let tagRef = $
|
|
124
|
-
let tagRowRef = $
|
|
125
|
-
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = $
|
|
122
|
+
let labelRef = $dTV3V$react.useRef();
|
|
123
|
+
let tagRef = $dTV3V$react.useRef();
|
|
124
|
+
let tagRowRef = $dTV3V$react.useRef();
|
|
125
|
+
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = $dTV3V$reactariatag.useTag({
|
|
126
126
|
...props,
|
|
127
127
|
isDisabled: isDisabled,
|
|
128
128
|
isFocused: isFocused,
|
|
@@ -132,48 +132,48 @@ function $6a18f2ab7062d76e$export$3288d34c523a1192(props) {
|
|
|
132
132
|
tagRef: tagRef,
|
|
133
133
|
tagRowRef: tagRowRef
|
|
134
134
|
}, state);
|
|
135
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
136
|
-
...$
|
|
135
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement("div", tagRowProps, /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement("div", {
|
|
136
|
+
...$dTV3V$reactariautils.mergeProps(tagProps, hoverProps, focusProps),
|
|
137
137
|
role: "gridcell",
|
|
138
|
-
className: $
|
|
138
|
+
className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)), 'spectrum-Tags-item', {
|
|
139
139
|
'is-disabled': isDisabled,
|
|
140
140
|
'focus-ring': isFocusVisible,
|
|
141
141
|
'is-focused': isFocused,
|
|
142
142
|
'not-removable': !isRemovable,
|
|
143
143
|
'is-hovered': isHovered
|
|
144
144
|
}, styleProps.className)
|
|
145
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
145
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dTV3V$reactspectrumutils.SlotProvider, {
|
|
146
146
|
slots: {
|
|
147
147
|
tagLabel: {
|
|
148
|
-
UNSAFE_className: $
|
|
148
|
+
UNSAFE_className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)), 'spectrum-Tag-label')
|
|
149
149
|
},
|
|
150
150
|
icon: {
|
|
151
|
-
UNSAFE_className: $
|
|
151
|
+
UNSAFE_className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)), 'spectrum-Tag-icon'),
|
|
152
152
|
size: 'XS'
|
|
153
153
|
},
|
|
154
154
|
text: {
|
|
155
|
-
UNSAFE_className: $
|
|
155
|
+
UNSAFE_className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)), 'spectrum-Tag-content', {
|
|
156
156
|
'tags-removable': isRemovable
|
|
157
157
|
})
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
}, typeof children === 'string' ? /*#__PURE__*/ ($parcel$interopDefault($
|
|
160
|
+
}, typeof children === 'string' ? /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement("div", {
|
|
161
161
|
ref: labelRef,
|
|
162
162
|
...labelProps
|
|
163
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
163
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dTV3V$reactspectrumtext.Text, null, children)) : children, isRemovable && /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dd2c5d00108c1840$var$TagRemoveButton, {
|
|
164
164
|
item: item,
|
|
165
165
|
...clearButtonProps,
|
|
166
|
-
UNSAFE_className: $
|
|
166
|
+
UNSAFE_className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)), 'spectrum-Tag-action')
|
|
167
167
|
})))));
|
|
168
168
|
}
|
|
169
|
-
function $
|
|
170
|
-
props = $
|
|
171
|
-
let { styleProps: styleProps } = $
|
|
172
|
-
let clearBtnRef = $
|
|
173
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
169
|
+
function $dd2c5d00108c1840$var$TagRemoveButton(props) {
|
|
170
|
+
props = $dTV3V$reactspectrumutils.useSlotProps(props, 'tagRemoveButton');
|
|
171
|
+
let { styleProps: styleProps } = $dTV3V$reactspectrumutils.useStyleProps(props);
|
|
172
|
+
let clearBtnRef = $dTV3V$react.useRef();
|
|
173
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement("span", {
|
|
174
174
|
...styleProps,
|
|
175
175
|
ref: clearBtnRef
|
|
176
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
176
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dTV3V$reactspectrumbutton.ClearButton, {
|
|
177
177
|
preventFocus: true,
|
|
178
178
|
...props
|
|
179
179
|
})));
|
|
@@ -185,14 +185,14 @@ function $6a18f2ab7062d76e$var$TagRemoveButton(props) {
|
|
|
185
185
|
|
|
186
186
|
|
|
187
187
|
|
|
188
|
-
function $
|
|
189
|
-
props = $
|
|
188
|
+
function $e7b72d8874e98cd4$var$TagGroup(props, ref1) {
|
|
189
|
+
props = $dTV3V$reactspectrumprovider.useProviderProps(props);
|
|
190
190
|
let { isDisabled: isDisabled , isRemovable: isRemovable , onRemove: onRemove , ...otherProps } = props;
|
|
191
|
-
let domRef = $
|
|
192
|
-
let { styleProps: styleProps } = $
|
|
193
|
-
let { direction: direction } = $
|
|
194
|
-
let listState = $
|
|
195
|
-
let gridCollection = $
|
|
191
|
+
let domRef = $dTV3V$reactspectrumutils.useDOMRef(ref1);
|
|
192
|
+
let { styleProps: styleProps } = $dTV3V$reactspectrumutils.useStyleProps(otherProps);
|
|
193
|
+
let { direction: direction } = $dTV3V$reactariai18n.useLocale();
|
|
194
|
+
let listState = $dTV3V$reactstatelylist.useListState(props);
|
|
195
|
+
let gridCollection = $dTV3V$react.useMemo(()=>new $dTV3V$reactstatelygrid.GridCollection({
|
|
196
196
|
columnCount: isRemovable ? 2 : 1,
|
|
197
197
|
items: [
|
|
198
198
|
...listState.collection
|
|
@@ -226,49 +226,51 @@ function $6b983db856007a15$var$TagGroup(props, ref) {
|
|
|
226
226
|
listState.collection,
|
|
227
227
|
isRemovable
|
|
228
228
|
]);
|
|
229
|
-
let state = $
|
|
229
|
+
let state = $dTV3V$reactstatelygrid.useGridState({
|
|
230
230
|
...props,
|
|
231
231
|
collection: gridCollection,
|
|
232
232
|
focusMode: 'cell'
|
|
233
233
|
});
|
|
234
|
-
let keyboardDelegate = new $
|
|
234
|
+
let keyboardDelegate = new $dTV3V$reactariatag.TagKeyboardDelegate({
|
|
235
235
|
collection: state.collection,
|
|
236
236
|
disabledKeys: state.disabledKeys,
|
|
237
237
|
ref: domRef,
|
|
238
238
|
direction: direction,
|
|
239
239
|
focusMode: 'cell'
|
|
240
240
|
});
|
|
241
|
-
let { gridProps: gridProps } = $
|
|
241
|
+
let { gridProps: gridProps } = $dTV3V$reactariagrid.useGrid({
|
|
242
242
|
...props,
|
|
243
243
|
keyboardDelegate: keyboardDelegate
|
|
244
244
|
}, state, domRef);
|
|
245
|
-
const { tagGroupProps: tagGroupProps } = $
|
|
245
|
+
const { tagGroupProps: tagGroupProps } = $dTV3V$reactariatag.useTagGroup(props, listState);
|
|
246
246
|
// Don't want the grid to be focusable or accessible via keyboard
|
|
247
247
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
248
248
|
let { tabIndex: tabIndex , ...otherGridProps } = gridProps;
|
|
249
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
250
|
-
...$
|
|
251
|
-
className: $
|
|
249
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement("div", {
|
|
250
|
+
...$dTV3V$reactariautils.mergeProps(styleProps, tagGroupProps, otherGridProps),
|
|
251
|
+
className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)), 'spectrum-Tags', {
|
|
252
252
|
'is-disabled': isDisabled
|
|
253
253
|
}, styleProps.className),
|
|
254
254
|
ref: domRef
|
|
255
255
|
}, [
|
|
256
256
|
...gridCollection
|
|
257
|
-
].map((item)
|
|
257
|
+
].map((item)=>{
|
|
258
|
+
var ref;
|
|
259
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dd2c5d00108c1840$export$3288d34c523a1192, {
|
|
258
260
|
...item.childNodes[0].props,
|
|
259
261
|
key: item.key,
|
|
260
262
|
item: item,
|
|
261
263
|
state: state,
|
|
262
|
-
isDisabled: isDisabled || state.disabledKeys.has(item
|
|
264
|
+
isDisabled: isDisabled || state.disabledKeys.has((ref = item === null || item === void 0 ? void 0 : item.childNodes[0]) === null || ref === void 0 ? void 0 : ref.key),
|
|
263
265
|
isRemovable: isRemovable,
|
|
264
266
|
onRemove: onRemove
|
|
265
|
-
}, item.childNodes[0].rendered)
|
|
266
|
-
)));
|
|
267
|
+
}, item.childNodes[0].rendered));
|
|
268
|
+
})));
|
|
267
269
|
}
|
|
268
|
-
const $
|
|
270
|
+
const $e7b72d8874e98cd4$export$67ea30858aaf75e3 = /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).forwardRef($e7b72d8874e98cd4$var$TagGroup);
|
|
269
271
|
|
|
270
272
|
|
|
271
|
-
$parcel$exportWildcard(module.exports, $
|
|
273
|
+
$parcel$exportWildcard(module.exports, $e7b72d8874e98cd4$exports);
|
|
272
274
|
|
|
273
275
|
|
|
274
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,gBAAA,aAAa,EAAA,CAAC,GAAG,+BAAW,CAAC,KAAK,EAAE,SAAS;IAEpD,EAAiE,AAAjE,+DAAiE;IACjE,EAA6D,AAA7D,2DAA6D;IAC7D,GAAG,CAAC,CAAC,WAAA,QAAQ,MAAK,cAAc,CAAA,CAAC,GAAG,SAAS;IAC7C,MAAM,oEACH,CAAG;WACE,gCAAU,CAAC,UAAU,EAAE,aAAa,EAAE,cAAc;QACxD,SAAS,EACP,oCAAU,CACR,gEAAM,EACN,CAAe,gBACf,CAAC;YACC,CAAa,cAAE,UAAU;QAC3B,CAAC,EACD,UAAU,CAAC,SAAS;QAGxB,GAAG,EAAE,MAAM;OACV,CAAC;WAAG,cAAc;IAAA,CAAC,CAAC,GAAG,EAAC,IAAI,sEAC1B,yCAAG;eACE,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK;YAC5B,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,GAAG;YACzE,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,QAAQ;WACjB,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ;;AAKtC,CAAC;AAED,KAAK,CAAC,yCAAS,iBAAG,sCAAK,CAAC,UAAU,CAAC,8BAAQ","sources":["packages/@react-spectrum/tag/src/index.ts","packages/@react-spectrum/tag/src/TagGroup.tsx","packages/@adobe/spectrum-css-temp/components/tags/vars.css","packages/@react-spectrum/tag/src/Tag.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './TagGroup';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {GridCollection, useGridState} from '@react-stately/grid';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement, useMemo} from 'react';\nimport {SpectrumTagGroupProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Tag} from './Tag';\nimport {TagKeyboardDelegate, useTagGroup} from '@react-aria/tag';\nimport {useGrid} from '@react-aria/grid';\nimport {useListState} from '@react-stately/list';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction TagGroup<T extends object>(props: SpectrumTagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n isDisabled,\n isRemovable,\n onRemove,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let {direction} = useLocale();\n let listState = useListState(props);\n let gridCollection = useMemo(() => new GridCollection({\n columnCount: isRemovable ? 2 : 1,\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n // add column of clear buttons if removable\n if (isRemovable) {\n childNodes.push({\n key: `remove-${item.key}`,\n type: 'cell',\n index: 1,\n value: null,\n level: 0,\n rendered: null,\n textValue: item.textValue, // TODO localize?\n hasChildNodes: false,\n childNodes: []\n });\n }\n\n return {\n type: 'item',\n childNodes\n };\n })\n }), [listState.collection, isRemovable]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: domRef,\n direction,\n focusMode: 'cell'\n });\n let {gridProps} = useGrid({\n ...props,\n keyboardDelegate\n }, state, domRef);\n const {tagGroupProps} = useTagGroup(props, listState);\n\n // Don't want the grid to be focusable or accessible via keyboard\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {tabIndex, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\n className={\n classNames(\n styles,\n 'spectrum-Tags',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }\n ref={domRef}>\n {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n isDisabled={isDisabled || state.disabledKeys.has(item?.childNodes[0]?.key)}\n isRemovable={isRemovable}\n onRemove={onRemove}>\n {item.childNodes[0].rendered}\n </Tag>\n ))}\n </div>\n );\n}\n\nconst _TagGroup = React.forwardRef(TagGroup) as <T>(props: SpectrumTagGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_TagGroup as TagGroup};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport {SpectrumTagProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useTag} from '@react-aria/tag';\n\nexport function Tag<T>(props: SpectrumTagProps<T>) {\n const {\n children,\n isDisabled,\n isRemovable,\n item,\n state,\n onRemove,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let labelRef = useRef();\n let tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isDisabled,\n isFocused,\n isRemovable,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}>\n <div\n {...mergeProps(tagProps, hoverProps, focusProps)}\n role=\"gridcell\"\n className={classNames(\n styles,\n 'spectrum-Tags-item',\n {\n 'is-disabled': isDisabled,\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'not-removable': !isRemovable,\n 'is-hovered': isHovered\n },\n styleProps.className\n )}>\n <SlotProvider\n slots={{\n tagLabel: {UNSAFE_className: classNames(styles, 'spectrum-Tag-label')},\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': isRemovable})}\n }}>\n {typeof children === 'string' ? <div ref={labelRef} {...labelProps}><Text>{children}</Text></div> : children}\n {isRemovable && <TagRemoveButton item={item} {...clearButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-action')} />}\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n props = useSlotProps(props, 'tagRemoveButton');\n let {styleProps} = useStyleProps(props);\n let clearBtnRef = useRef();\n\n return (\n <span\n {...styleProps}\n ref={clearBtnRef}>\n <ClearButton\n preventFocus\n {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAAoC;AACpC,GAA6B;AAC7B,GAAmC;AACnC,GAAsC;AACtC,GAAgC;AAChC,GAAoC;AACpC,GAAqC;AACrC,GAA4B;AAC5B,GAA4B;AAC5B,GAA6B;AAC7B,GAA4B;AAC5B,GAAwC;AACxC,GAAyC;AACzC,GAA+C;AAC/C,GAAiC;AACjC,GAA+C;AAC/C,GAA4B;AAjB5B,yCAA+B,GAAG,CAAsB;AACxD,yCAAoC,GAAG,CAA2B;AAClE,yCAA6B,GAAG,CAAoB;AACpD,yCAAmC,GAAG,CAA0B;AAChE,yCAAsC,GAAG,CAA6B;AACtE,yCAAgC,GAAG,CAAuB;AAC1D,yCAAoC,GAAG,CAA2B;AAClE,yCAAqC,GAAG,CAA4B;AACpE,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA6B,GAAG,CAAoB;AACpD,yCAA4B,GAAG,CAAmB;AAClD,yCAAwC,GAAG,CAA+B;AAC1E,yCAAyC,GAAG,CAAgC;AAC5E,y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CAAJ,CAAwB,GAAxB,IAAI,CAAJ,CAAwB,OAAH,GAAG;YACzE,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,QAAQ;WACjB,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ;;AAKtC,CAAC;AAED,KAAK,CAAC,yCAAS,iBAAG,sCAAK,CAAC,UAAU,CAAC,8BAAQ","sources":["packages/@react-spectrum/tag/src/index.ts","packages/@react-spectrum/tag/src/TagGroup.tsx","packages/@adobe/spectrum-css-temp/components/tags/vars.css","packages/@react-spectrum/tag/src/Tag.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './TagGroup';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {GridCollection, useGridState} from '@react-stately/grid';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement, useMemo} from 'react';\nimport {SpectrumTagGroupProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Tag} from './Tag';\nimport {TagKeyboardDelegate, useTagGroup} from '@react-aria/tag';\nimport {useGrid} from '@react-aria/grid';\nimport {useListState} from '@react-stately/list';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction TagGroup<T extends object>(props: SpectrumTagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n isDisabled,\n isRemovable,\n onRemove,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let {direction} = useLocale();\n let listState = useListState(props);\n let gridCollection = useMemo(() => new GridCollection({\n columnCount: isRemovable ? 2 : 1,\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n // add column of clear buttons if removable\n if (isRemovable) {\n childNodes.push({\n key: `remove-${item.key}`,\n type: 'cell',\n index: 1,\n value: null,\n level: 0,\n rendered: null,\n textValue: item.textValue, // TODO localize?\n hasChildNodes: false,\n childNodes: []\n });\n }\n\n return {\n type: 'item',\n childNodes\n };\n })\n }), [listState.collection, isRemovable]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: domRef,\n direction,\n focusMode: 'cell'\n });\n let {gridProps} = useGrid({\n ...props,\n keyboardDelegate\n }, state, domRef);\n const {tagGroupProps} = useTagGroup(props, listState);\n\n // Don't want the grid to be focusable or accessible via keyboard\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {tabIndex, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\n className={\n classNames(\n styles,\n 'spectrum-Tags',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }\n ref={domRef}>\n {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n isDisabled={isDisabled || state.disabledKeys.has(item?.childNodes[0]?.key)}\n isRemovable={isRemovable}\n onRemove={onRemove}>\n {item.childNodes[0].rendered}\n </Tag>\n ))}\n </div>\n );\n}\n\nconst _TagGroup = React.forwardRef(TagGroup) as <T>(props: SpectrumTagGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_TagGroup as TagGroup};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport {SpectrumTagProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useTag} from '@react-aria/tag';\n\nexport function Tag<T>(props: SpectrumTagProps<T>) {\n const {\n children,\n isDisabled,\n isRemovable,\n item,\n state,\n onRemove,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let labelRef = useRef();\n let tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isDisabled,\n isFocused,\n isRemovable,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}>\n <div\n {...mergeProps(tagProps, hoverProps, focusProps)}\n role=\"gridcell\"\n className={classNames(\n styles,\n 'spectrum-Tags-item',\n {\n 'is-disabled': isDisabled,\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'not-removable': !isRemovable,\n 'is-hovered': isHovered\n },\n styleProps.className\n )}>\n <SlotProvider\n slots={{\n tagLabel: {UNSAFE_className: classNames(styles, 'spectrum-Tag-label')},\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': isRemovable})}\n }}>\n {typeof children === 'string' ? <div ref={labelRef} {...labelProps}><Text>{children}</Text></div> : children}\n {isRemovable && <TagRemoveButton item={item} {...clearButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-action')} />}\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n props = useSlotProps(props, 'tagRemoveButton');\n let {styleProps} = useStyleProps(props);\n let clearBtnRef = useRef();\n\n return (\n <span\n {...styleProps}\n ref={clearBtnRef}>\n <ClearButton\n preventFocus\n {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
|
-
import {useDOMRef as $
|
|
3
|
-
import {GridCollection as $
|
|
4
|
-
import {mergeProps as $
|
|
5
|
-
import $
|
|
6
|
-
import {TagKeyboardDelegate as $
|
|
7
|
-
import {useGrid as $
|
|
8
|
-
import {useListState as $
|
|
9
|
-
import {useLocale as $
|
|
10
|
-
import {useProviderProps as $
|
|
11
|
-
import {ClearButton as $
|
|
12
|
-
import {Text as $
|
|
13
|
-
import {useFocusRing as $
|
|
14
|
-
import {useHover as $
|
|
2
|
+
import {useDOMRef as $fUaQ2$useDOMRef, useStyleProps as $fUaQ2$useStyleProps, classNames as $fUaQ2$classNames, SlotProvider as $fUaQ2$SlotProvider, useSlotProps as $fUaQ2$useSlotProps} from "@react-spectrum/utils";
|
|
3
|
+
import {GridCollection as $fUaQ2$GridCollection, useGridState as $fUaQ2$useGridState} from "@react-stately/grid";
|
|
4
|
+
import {mergeProps as $fUaQ2$mergeProps} from "@react-aria/utils";
|
|
5
|
+
import $fUaQ2$react, {useMemo as $fUaQ2$useMemo, useRef as $fUaQ2$useRef} from "react";
|
|
6
|
+
import {TagKeyboardDelegate as $fUaQ2$TagKeyboardDelegate, useTagGroup as $fUaQ2$useTagGroup, useTag as $fUaQ2$useTag} from "@react-aria/tag";
|
|
7
|
+
import {useGrid as $fUaQ2$useGrid} from "@react-aria/grid";
|
|
8
|
+
import {useListState as $fUaQ2$useListState} from "@react-stately/list";
|
|
9
|
+
import {useLocale as $fUaQ2$useLocale} from "@react-aria/i18n";
|
|
10
|
+
import {useProviderProps as $fUaQ2$useProviderProps} from "@react-spectrum/provider";
|
|
11
|
+
import {ClearButton as $fUaQ2$ClearButton} from "@react-spectrum/button";
|
|
12
|
+
import {Text as $fUaQ2$Text} from "@react-spectrum/text";
|
|
13
|
+
import {useFocusRing as $fUaQ2$useFocusRing} from "@react-aria/focus";
|
|
14
|
+
import {useHover as $fUaQ2$useHover} from "@react-aria/interactions";
|
|
15
15
|
|
|
16
16
|
function $parcel$interopDefault(a) {
|
|
17
17
|
return a && a.__esModule ? a.default : a;
|
|
@@ -19,69 +19,69 @@ function $parcel$interopDefault(a) {
|
|
|
19
19
|
function $parcel$export(e, n, v, s) {
|
|
20
20
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
21
21
|
}
|
|
22
|
-
var $
|
|
22
|
+
var $880d112c7a588209$exports = {};
|
|
23
23
|
|
|
24
|
-
$parcel$export($
|
|
24
|
+
$parcel$export($880d112c7a588209$exports, "TagGroup", () => $880d112c7a588209$export$67ea30858aaf75e3);
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var $
|
|
29
|
+
var $c033a7c057e84ef1$exports = {};
|
|
30
30
|
|
|
31
|
-
$parcel$export($
|
|
32
|
-
$parcel$export($
|
|
33
|
-
$parcel$export($
|
|
34
|
-
$parcel$export($
|
|
35
|
-
$parcel$export($
|
|
36
|
-
$parcel$export($
|
|
37
|
-
$parcel$export($
|
|
38
|
-
$parcel$export($
|
|
39
|
-
$parcel$export($
|
|
40
|
-
$parcel$export($
|
|
41
|
-
$parcel$export($
|
|
42
|
-
$parcel$export($
|
|
43
|
-
$parcel$export($
|
|
44
|
-
$parcel$export($
|
|
45
|
-
$parcel$export($
|
|
46
|
-
$parcel$export($
|
|
47
|
-
$parcel$export($
|
|
48
|
-
$parcel$export($
|
|
49
|
-
var $
|
|
50
|
-
var $
|
|
51
|
-
var $
|
|
52
|
-
var $
|
|
53
|
-
var $
|
|
54
|
-
var $
|
|
55
|
-
var $
|
|
56
|
-
var $
|
|
57
|
-
var $
|
|
58
|
-
var $
|
|
59
|
-
var $
|
|
60
|
-
var $
|
|
61
|
-
var $
|
|
62
|
-
var $
|
|
63
|
-
var $
|
|
64
|
-
var $
|
|
65
|
-
var $
|
|
66
|
-
var $
|
|
67
|
-
$
|
|
68
|
-
$
|
|
69
|
-
$
|
|
70
|
-
$
|
|
71
|
-
$
|
|
72
|
-
$
|
|
73
|
-
$
|
|
74
|
-
$
|
|
75
|
-
$
|
|
76
|
-
$
|
|
77
|
-
$
|
|
78
|
-
$
|
|
79
|
-
$
|
|
80
|
-
$
|
|
81
|
-
$
|
|
82
|
-
$
|
|
83
|
-
$
|
|
84
|
-
$
|
|
31
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags", () => $c033a7c057e84ef1$export$eb7e80013a1212da, (v) => $c033a7c057e84ef1$export$eb7e80013a1212da = v);
|
|
32
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-item", () => $c033a7c057e84ef1$export$950d8dc0a3751654, (v) => $c033a7c057e84ef1$export$950d8dc0a3751654 = v);
|
|
33
|
+
$parcel$export($c033a7c057e84ef1$exports, "is-disabled", () => $c033a7c057e84ef1$export$d35bc1e505d1ebbf, (v) => $c033a7c057e84ef1$export$d35bc1e505d1ebbf = v);
|
|
34
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tag-icon", () => $c033a7c057e84ef1$export$21f5254139e14871, (v) => $c033a7c057e84ef1$export$21f5254139e14871 = v);
|
|
35
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tag-content", () => $c033a7c057e84ef1$export$d281c967f4ee071e, (v) => $c033a7c057e84ef1$export$d281c967f4ee071e = v);
|
|
36
|
+
$parcel$export($c033a7c057e84ef1$exports, "tags-removable", () => $c033a7c057e84ef1$export$7427262f66a3b803, (v) => $c033a7c057e84ef1$export$7427262f66a3b803 = v);
|
|
37
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tag-label", () => $c033a7c057e84ef1$export$7ea9e20fd4ac0076, (v) => $c033a7c057e84ef1$export$7ea9e20fd4ac0076 = v);
|
|
38
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tag-action", () => $c033a7c057e84ef1$export$c5a1243e33faa2d4, (v) => $c033a7c057e84ef1$export$c5a1243e33faa2d4 = v);
|
|
39
|
+
$parcel$export($c033a7c057e84ef1$exports, "is-hovered", () => $c033a7c057e84ef1$export$b8813cd5d7824ce7, (v) => $c033a7c057e84ef1$export$b8813cd5d7824ce7 = v);
|
|
40
|
+
$parcel$export($c033a7c057e84ef1$exports, "focus-ring", () => $c033a7c057e84ef1$export$f39a09f249340e2a, (v) => $c033a7c057e84ef1$export$f39a09f249340e2a = v);
|
|
41
|
+
$parcel$export($c033a7c057e84ef1$exports, "is-selected", () => $c033a7c057e84ef1$export$1e0fb04f31d3c22a, (v) => $c033a7c057e84ef1$export$1e0fb04f31d3c22a = v);
|
|
42
|
+
$parcel$export($c033a7c057e84ef1$exports, "is-invalid", () => $c033a7c057e84ef1$export$14a30de2866685fa, (v) => $c033a7c057e84ef1$export$14a30de2866685fa = v);
|
|
43
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-itemIcon", () => $c033a7c057e84ef1$export$8c615c557fdf3d9c, (v) => $c033a7c057e84ef1$export$8c615c557fdf3d9c = v);
|
|
44
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-itemLabel", () => $c033a7c057e84ef1$export$23caf26adee41b84, (v) => $c033a7c057e84ef1$export$23caf26adee41b84 = v);
|
|
45
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-itemClearButton", () => $c033a7c057e84ef1$export$90881dd581d6be55, (v) => $c033a7c057e84ef1$export$90881dd581d6be55 = v);
|
|
46
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Avatar", () => $c033a7c057e84ef1$export$2e049b8d031600fb, (v) => $c033a7c057e84ef1$export$2e049b8d031600fb = v);
|
|
47
|
+
$parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-item--removable", () => $c033a7c057e84ef1$export$c1666977f4e14f87, (v) => $c033a7c057e84ef1$export$c1666977f4e14f87 = v);
|
|
48
|
+
$parcel$export($c033a7c057e84ef1$exports, "is-focused", () => $c033a7c057e84ef1$export$e7dc768d35940237, (v) => $c033a7c057e84ef1$export$e7dc768d35940237 = v);
|
|
49
|
+
var $c033a7c057e84ef1$export$eb7e80013a1212da;
|
|
50
|
+
var $c033a7c057e84ef1$export$950d8dc0a3751654;
|
|
51
|
+
var $c033a7c057e84ef1$export$d35bc1e505d1ebbf;
|
|
52
|
+
var $c033a7c057e84ef1$export$21f5254139e14871;
|
|
53
|
+
var $c033a7c057e84ef1$export$d281c967f4ee071e;
|
|
54
|
+
var $c033a7c057e84ef1$export$7427262f66a3b803;
|
|
55
|
+
var $c033a7c057e84ef1$export$7ea9e20fd4ac0076;
|
|
56
|
+
var $c033a7c057e84ef1$export$c5a1243e33faa2d4;
|
|
57
|
+
var $c033a7c057e84ef1$export$b8813cd5d7824ce7;
|
|
58
|
+
var $c033a7c057e84ef1$export$f39a09f249340e2a;
|
|
59
|
+
var $c033a7c057e84ef1$export$1e0fb04f31d3c22a;
|
|
60
|
+
var $c033a7c057e84ef1$export$14a30de2866685fa;
|
|
61
|
+
var $c033a7c057e84ef1$export$8c615c557fdf3d9c;
|
|
62
|
+
var $c033a7c057e84ef1$export$23caf26adee41b84;
|
|
63
|
+
var $c033a7c057e84ef1$export$90881dd581d6be55;
|
|
64
|
+
var $c033a7c057e84ef1$export$2e049b8d031600fb;
|
|
65
|
+
var $c033a7c057e84ef1$export$c1666977f4e14f87;
|
|
66
|
+
var $c033a7c057e84ef1$export$e7dc768d35940237;
|
|
67
|
+
$c033a7c057e84ef1$export$eb7e80013a1212da = "spectrum-Tags_8407eb";
|
|
68
|
+
$c033a7c057e84ef1$export$950d8dc0a3751654 = "spectrum-Tags-item_8407eb";
|
|
69
|
+
$c033a7c057e84ef1$export$d35bc1e505d1ebbf = "is-disabled_8407eb";
|
|
70
|
+
$c033a7c057e84ef1$export$21f5254139e14871 = "spectrum-Tag-icon_8407eb";
|
|
71
|
+
$c033a7c057e84ef1$export$d281c967f4ee071e = "spectrum-Tag-content_8407eb";
|
|
72
|
+
$c033a7c057e84ef1$export$7427262f66a3b803 = "tags-removable_8407eb";
|
|
73
|
+
$c033a7c057e84ef1$export$7ea9e20fd4ac0076 = "spectrum-Tag-label_8407eb";
|
|
74
|
+
$c033a7c057e84ef1$export$c5a1243e33faa2d4 = "spectrum-Tag-action_8407eb";
|
|
75
|
+
$c033a7c057e84ef1$export$b8813cd5d7824ce7 = "is-hovered_8407eb";
|
|
76
|
+
$c033a7c057e84ef1$export$f39a09f249340e2a = "focus-ring_8407eb";
|
|
77
|
+
$c033a7c057e84ef1$export$1e0fb04f31d3c22a = "is-selected_8407eb";
|
|
78
|
+
$c033a7c057e84ef1$export$14a30de2866685fa = "is-invalid_8407eb";
|
|
79
|
+
$c033a7c057e84ef1$export$8c615c557fdf3d9c = "spectrum-Tags-itemIcon_8407eb";
|
|
80
|
+
$c033a7c057e84ef1$export$23caf26adee41b84 = "spectrum-Tags-itemLabel_8407eb";
|
|
81
|
+
$c033a7c057e84ef1$export$90881dd581d6be55 = "spectrum-Tags-itemClearButton_8407eb";
|
|
82
|
+
$c033a7c057e84ef1$export$2e049b8d031600fb = "spectrum-Avatar_8407eb";
|
|
83
|
+
$c033a7c057e84ef1$export$c1666977f4e14f87 = "spectrum-Tags-item--removable_8407eb";
|
|
84
|
+
$c033a7c057e84ef1$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
|
|
@@ -93,20 +93,20 @@ $044f79fa9b1990c6$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
function $
|
|
96
|
+
function $b5f5ee35d3b6b95c$export$3288d34c523a1192(props) {
|
|
97
97
|
const { children: children , isDisabled: isDisabled , isRemovable: isRemovable , item: item , state: state , onRemove: onRemove , ...otherProps } = props;
|
|
98
98
|
// @ts-ignore
|
|
99
|
-
let { styleProps: styleProps } = $
|
|
100
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $
|
|
99
|
+
let { styleProps: styleProps } = $fUaQ2$useStyleProps(otherProps);
|
|
100
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = $fUaQ2$useHover({
|
|
101
101
|
isDisabled: isDisabled
|
|
102
102
|
});
|
|
103
|
-
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $
|
|
103
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $fUaQ2$useFocusRing({
|
|
104
104
|
within: true
|
|
105
105
|
});
|
|
106
|
-
let labelRef = $
|
|
107
|
-
let tagRef = $
|
|
108
|
-
let tagRowRef = $
|
|
109
|
-
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = $
|
|
106
|
+
let labelRef = $fUaQ2$useRef();
|
|
107
|
+
let tagRef = $fUaQ2$useRef();
|
|
108
|
+
let tagRowRef = $fUaQ2$useRef();
|
|
109
|
+
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = $fUaQ2$useTag({
|
|
110
110
|
...props,
|
|
111
111
|
isDisabled: isDisabled,
|
|
112
112
|
isFocused: isFocused,
|
|
@@ -116,48 +116,48 @@ function $269f970a87c4d3b3$export$3288d34c523a1192(props) {
|
|
|
116
116
|
tagRef: tagRef,
|
|
117
117
|
tagRowRef: tagRowRef
|
|
118
118
|
}, state);
|
|
119
|
-
return(/*#__PURE__*/ $
|
|
120
|
-
...$
|
|
119
|
+
return(/*#__PURE__*/ $fUaQ2$react.createElement("div", tagRowProps, /*#__PURE__*/ $fUaQ2$react.createElement("div", {
|
|
120
|
+
...$fUaQ2$mergeProps(tagProps, hoverProps, focusProps),
|
|
121
121
|
role: "gridcell",
|
|
122
|
-
className: $
|
|
122
|
+
className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)), 'spectrum-Tags-item', {
|
|
123
123
|
'is-disabled': isDisabled,
|
|
124
124
|
'focus-ring': isFocusVisible,
|
|
125
125
|
'is-focused': isFocused,
|
|
126
126
|
'not-removable': !isRemovable,
|
|
127
127
|
'is-hovered': isHovered
|
|
128
128
|
}, styleProps.className)
|
|
129
|
-
}, /*#__PURE__*/ $
|
|
129
|
+
}, /*#__PURE__*/ $fUaQ2$react.createElement($fUaQ2$SlotProvider, {
|
|
130
130
|
slots: {
|
|
131
131
|
tagLabel: {
|
|
132
|
-
UNSAFE_className: $
|
|
132
|
+
UNSAFE_className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)), 'spectrum-Tag-label')
|
|
133
133
|
},
|
|
134
134
|
icon: {
|
|
135
|
-
UNSAFE_className: $
|
|
135
|
+
UNSAFE_className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)), 'spectrum-Tag-icon'),
|
|
136
136
|
size: 'XS'
|
|
137
137
|
},
|
|
138
138
|
text: {
|
|
139
|
-
UNSAFE_className: $
|
|
139
|
+
UNSAFE_className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)), 'spectrum-Tag-content', {
|
|
140
140
|
'tags-removable': isRemovable
|
|
141
141
|
})
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
}, typeof children === 'string' ? /*#__PURE__*/ $
|
|
144
|
+
}, typeof children === 'string' ? /*#__PURE__*/ $fUaQ2$react.createElement("div", {
|
|
145
145
|
ref: labelRef,
|
|
146
146
|
...labelProps
|
|
147
|
-
}, /*#__PURE__*/ $
|
|
147
|
+
}, /*#__PURE__*/ $fUaQ2$react.createElement($fUaQ2$Text, null, children)) : children, isRemovable && /*#__PURE__*/ $fUaQ2$react.createElement($b5f5ee35d3b6b95c$var$TagRemoveButton, {
|
|
148
148
|
item: item,
|
|
149
149
|
...clearButtonProps,
|
|
150
|
-
UNSAFE_className: $
|
|
150
|
+
UNSAFE_className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)), 'spectrum-Tag-action')
|
|
151
151
|
})))));
|
|
152
152
|
}
|
|
153
|
-
function $
|
|
154
|
-
props = $
|
|
155
|
-
let { styleProps: styleProps } = $
|
|
156
|
-
let clearBtnRef = $
|
|
157
|
-
return(/*#__PURE__*/ $
|
|
153
|
+
function $b5f5ee35d3b6b95c$var$TagRemoveButton(props) {
|
|
154
|
+
props = $fUaQ2$useSlotProps(props, 'tagRemoveButton');
|
|
155
|
+
let { styleProps: styleProps } = $fUaQ2$useStyleProps(props);
|
|
156
|
+
let clearBtnRef = $fUaQ2$useRef();
|
|
157
|
+
return(/*#__PURE__*/ $fUaQ2$react.createElement("span", {
|
|
158
158
|
...styleProps,
|
|
159
159
|
ref: clearBtnRef
|
|
160
|
-
}, /*#__PURE__*/ $
|
|
160
|
+
}, /*#__PURE__*/ $fUaQ2$react.createElement($fUaQ2$ClearButton, {
|
|
161
161
|
preventFocus: true,
|
|
162
162
|
...props
|
|
163
163
|
})));
|
|
@@ -169,14 +169,14 @@ function $269f970a87c4d3b3$var$TagRemoveButton(props) {
|
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
|
|
172
|
-
function $
|
|
173
|
-
props = $
|
|
172
|
+
function $880d112c7a588209$var$TagGroup(props, ref1) {
|
|
173
|
+
props = $fUaQ2$useProviderProps(props);
|
|
174
174
|
let { isDisabled: isDisabled , isRemovable: isRemovable , onRemove: onRemove , ...otherProps } = props;
|
|
175
|
-
let domRef = $
|
|
176
|
-
let { styleProps: styleProps } = $
|
|
177
|
-
let { direction: direction } = $
|
|
178
|
-
let listState = $
|
|
179
|
-
let gridCollection = $
|
|
175
|
+
let domRef = $fUaQ2$useDOMRef(ref1);
|
|
176
|
+
let { styleProps: styleProps } = $fUaQ2$useStyleProps(otherProps);
|
|
177
|
+
let { direction: direction } = $fUaQ2$useLocale();
|
|
178
|
+
let listState = $fUaQ2$useListState(props);
|
|
179
|
+
let gridCollection = $fUaQ2$useMemo(()=>new $fUaQ2$GridCollection({
|
|
180
180
|
columnCount: isRemovable ? 2 : 1,
|
|
181
181
|
items: [
|
|
182
182
|
...listState.collection
|
|
@@ -210,49 +210,51 @@ function $02877bb8b3187e23$var$TagGroup(props, ref) {
|
|
|
210
210
|
listState.collection,
|
|
211
211
|
isRemovable
|
|
212
212
|
]);
|
|
213
|
-
let state = $
|
|
213
|
+
let state = $fUaQ2$useGridState({
|
|
214
214
|
...props,
|
|
215
215
|
collection: gridCollection,
|
|
216
216
|
focusMode: 'cell'
|
|
217
217
|
});
|
|
218
|
-
let keyboardDelegate = new $
|
|
218
|
+
let keyboardDelegate = new $fUaQ2$TagKeyboardDelegate({
|
|
219
219
|
collection: state.collection,
|
|
220
220
|
disabledKeys: state.disabledKeys,
|
|
221
221
|
ref: domRef,
|
|
222
222
|
direction: direction,
|
|
223
223
|
focusMode: 'cell'
|
|
224
224
|
});
|
|
225
|
-
let { gridProps: gridProps } = $
|
|
225
|
+
let { gridProps: gridProps } = $fUaQ2$useGrid({
|
|
226
226
|
...props,
|
|
227
227
|
keyboardDelegate: keyboardDelegate
|
|
228
228
|
}, state, domRef);
|
|
229
|
-
const { tagGroupProps: tagGroupProps } = $
|
|
229
|
+
const { tagGroupProps: tagGroupProps } = $fUaQ2$useTagGroup(props, listState);
|
|
230
230
|
// Don't want the grid to be focusable or accessible via keyboard
|
|
231
231
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
232
232
|
let { tabIndex: tabIndex , ...otherGridProps } = gridProps;
|
|
233
|
-
return(/*#__PURE__*/ $
|
|
234
|
-
...$
|
|
235
|
-
className: $
|
|
233
|
+
return(/*#__PURE__*/ $fUaQ2$react.createElement("div", {
|
|
234
|
+
...$fUaQ2$mergeProps(styleProps, tagGroupProps, otherGridProps),
|
|
235
|
+
className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)), 'spectrum-Tags', {
|
|
236
236
|
'is-disabled': isDisabled
|
|
237
237
|
}, styleProps.className),
|
|
238
238
|
ref: domRef
|
|
239
239
|
}, [
|
|
240
240
|
...gridCollection
|
|
241
|
-
].map((item)
|
|
241
|
+
].map((item)=>{
|
|
242
|
+
var ref;
|
|
243
|
+
return(/*#__PURE__*/ $fUaQ2$react.createElement($b5f5ee35d3b6b95c$export$3288d34c523a1192, {
|
|
242
244
|
...item.childNodes[0].props,
|
|
243
245
|
key: item.key,
|
|
244
246
|
item: item,
|
|
245
247
|
state: state,
|
|
246
|
-
isDisabled: isDisabled || state.disabledKeys.has(item
|
|
248
|
+
isDisabled: isDisabled || state.disabledKeys.has((ref = item === null || item === void 0 ? void 0 : item.childNodes[0]) === null || ref === void 0 ? void 0 : ref.key),
|
|
247
249
|
isRemovable: isRemovable,
|
|
248
250
|
onRemove: onRemove
|
|
249
|
-
}, item.childNodes[0].rendered)
|
|
250
|
-
)));
|
|
251
|
+
}, item.childNodes[0].rendered));
|
|
252
|
+
})));
|
|
251
253
|
}
|
|
252
|
-
const $
|
|
254
|
+
const $880d112c7a588209$export$67ea30858aaf75e3 = /*#__PURE__*/ $fUaQ2$react.forwardRef($880d112c7a588209$var$TagGroup);
|
|
253
255
|
|
|
254
256
|
|
|
255
257
|
|
|
256
258
|
|
|
257
|
-
export {$
|
|
259
|
+
export {$880d112c7a588209$export$67ea30858aaf75e3 as TagGroup};
|
|
258
260
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAAoC;AACpC,GAA6B;AAC7B,GAAmC;AACnC,GAAsC;AACtC,GAAgC;AAChC,GAAoC;AACpC,GAAqC;AACrC,GAA4B;AAC5B,GAA4B;AAC5B,GAA6B;AAC7B,GAA4B;AAC5B,GAAwC;AACxC,GAAyC;AACzC,GAA+C;AAC/C,GAAiC;AACjC,GAA+C;AAC/C,GAA4B;AAjB5B,yCAA+B,GAAG,CAAsB;AACxD,yCAAoC,GAAG,CAA2B;AAClE,yCAA6B,GAAG,CAAoB;AACpD,yCAAmC,GAAG,CAA0B;AAChE,yCAAsC,GAAG,CAA6B;AACtE,yCAAgC,GAAG,CAAuB;AAC1D,yCAAoC,GAAG,CAA2B;AAClE,yCAAqC,GAAG,CAA4B;AACpE,yCAA4B,GAAG,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AAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,GAAG;YACzE,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,QAAQ;WACjB,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ;;AAKtC,CAAC;AAED,KAAK,CAAC,yCAAS,iBAAG,YAAK,CAAC,UAAU,CAAC,8BAAQ","sources":["packages/@react-spectrum/tag/src/index.ts","packages/@react-spectrum/tag/src/TagGroup.tsx","packages/@adobe/spectrum-css-temp/components/tags/vars.css","packages/@react-spectrum/tag/src/Tag.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './TagGroup';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {GridCollection, useGridState} from '@react-stately/grid';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement, useMemo} from 'react';\nimport {SpectrumTagGroupProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Tag} from './Tag';\nimport {TagKeyboardDelegate, useTagGroup} from '@react-aria/tag';\nimport {useGrid} from '@react-aria/grid';\nimport {useListState} from '@react-stately/list';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction TagGroup<T extends object>(props: SpectrumTagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n isDisabled,\n isRemovable,\n onRemove,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let {direction} = useLocale();\n let listState = useListState(props);\n let gridCollection = useMemo(() => new GridCollection({\n columnCount: isRemovable ? 2 : 1,\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n // add column of clear buttons if removable\n if (isRemovable) {\n childNodes.push({\n key: `remove-${item.key}`,\n type: 'cell',\n index: 1,\n value: null,\n level: 0,\n rendered: null,\n textValue: item.textValue, // TODO localize?\n hasChildNodes: false,\n childNodes: []\n });\n }\n\n return {\n type: 'item',\n childNodes\n };\n })\n }), [listState.collection, isRemovable]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: domRef,\n direction,\n focusMode: 'cell'\n });\n let {gridProps} = useGrid({\n ...props,\n keyboardDelegate\n }, state, domRef);\n const {tagGroupProps} = useTagGroup(props, listState);\n\n // Don't want the grid to be focusable or accessible via keyboard\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {tabIndex, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\n className={\n classNames(\n styles,\n 'spectrum-Tags',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }\n ref={domRef}>\n {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n isDisabled={isDisabled || state.disabledKeys.has(item?.childNodes[0]?.key)}\n isRemovable={isRemovable}\n onRemove={onRemove}>\n {item.childNodes[0].rendered}\n </Tag>\n ))}\n </div>\n );\n}\n\nconst _TagGroup = React.forwardRef(TagGroup) as <T>(props: SpectrumTagGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_TagGroup as TagGroup};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport {SpectrumTagProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useTag} from '@react-aria/tag';\n\nexport function Tag<T>(props: SpectrumTagProps<T>) {\n const {\n children,\n isDisabled,\n isRemovable,\n item,\n state,\n onRemove,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let labelRef = useRef();\n let tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isDisabled,\n isFocused,\n isRemovable,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}>\n <div\n {...mergeProps(tagProps, hoverProps, focusProps)}\n role=\"gridcell\"\n className={classNames(\n styles,\n 'spectrum-Tags-item',\n {\n 'is-disabled': isDisabled,\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'not-removable': !isRemovable,\n 'is-hovered': isHovered\n },\n styleProps.className\n )}>\n <SlotProvider\n slots={{\n tagLabel: {UNSAFE_className: classNames(styles, 'spectrum-Tag-label')},\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': isRemovable})}\n }}>\n {typeof children === 'string' ? <div ref={labelRef} {...labelProps}><Text>{children}</Text></div> : children}\n {isRemovable && <TagRemoveButton item={item} {...clearButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-action')} />}\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n props = useSlotProps(props, 'tagRemoveButton');\n let {styleProps} = useStyleProps(props);\n let clearBtnRef = useRef();\n\n return (\n <span\n {...styleProps}\n ref={clearBtnRef}>\n <ClearButton\n preventFocus\n {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAAoC;AACpC,GAA6B;AAC7B,GAAmC;AACnC,GAAsC;AACtC,GAAgC;AAChC,GAAoC;AACpC,GAA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AS,EACP,iBAAU,CACR,gEAAM,EACN,CAAe,gBACf,CAAC;YACC,CAAa,cAAE,UAAU;QAC3B,CAAC,EACD,UAAU,CAAC,SAAS;QAGxB,GAAG,EAAE,MAAM;OACV,CAAC;WAAG,cAAc;IAAA,CAAC,CAAC,GAAG,EAAC,IAAI;;wDAC1B,yCAAG;eACE,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK;YAC5B,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,QAAC,IAAI,aAAJ,IAAI,KAAJ,IAAI,CAAJ,CAAgB,GAAhB,IAAI,CAAJ,CAAgB,GAAhB,IAAI,CAAE,UAAU,CAAC,CAAC,uBAAlB,IAAI,CAAJ,CAAwB,GAAxB,IAAI,CAAJ,CAAwB,OAAH,GAAG;YACzE,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,QAAQ;WACjB,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ;;AAKtC,CAAC;AAED,KAAK,CAAC,yCAAS,iBAAG,YAAK,CAAC,UAAU,CAAC,8BAAQ","sources":["packages/@react-spectrum/tag/src/index.ts","packages/@react-spectrum/tag/src/TagGroup.tsx","packages/@adobe/spectrum-css-temp/components/tags/vars.css","packages/@react-spectrum/tag/src/Tag.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './TagGroup';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {GridCollection, useGridState} from '@react-stately/grid';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement, useMemo} from 'react';\nimport {SpectrumTagGroupProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Tag} from './Tag';\nimport {TagKeyboardDelegate, useTagGroup} from '@react-aria/tag';\nimport {useGrid} from '@react-aria/grid';\nimport {useListState} from '@react-stately/list';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction TagGroup<T extends object>(props: SpectrumTagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n isDisabled,\n isRemovable,\n onRemove,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let {direction} = useLocale();\n let listState = useListState(props);\n let gridCollection = useMemo(() => new GridCollection({\n columnCount: isRemovable ? 2 : 1,\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n // add column of clear buttons if removable\n if (isRemovable) {\n childNodes.push({\n key: `remove-${item.key}`,\n type: 'cell',\n index: 1,\n value: null,\n level: 0,\n rendered: null,\n textValue: item.textValue, // TODO localize?\n hasChildNodes: false,\n childNodes: []\n });\n }\n\n return {\n type: 'item',\n childNodes\n };\n })\n }), [listState.collection, isRemovable]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: domRef,\n direction,\n focusMode: 'cell'\n });\n let {gridProps} = useGrid({\n ...props,\n keyboardDelegate\n }, state, domRef);\n const {tagGroupProps} = useTagGroup(props, listState);\n\n // Don't want the grid to be focusable or accessible via keyboard\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {tabIndex, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\n className={\n classNames(\n styles,\n 'spectrum-Tags',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }\n ref={domRef}>\n {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n isDisabled={isDisabled || state.disabledKeys.has(item?.childNodes[0]?.key)}\n isRemovable={isRemovable}\n onRemove={onRemove}>\n {item.childNodes[0].rendered}\n </Tag>\n ))}\n </div>\n );\n}\n\nconst _TagGroup = React.forwardRef(TagGroup) as <T>(props: SpectrumTagGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_TagGroup as TagGroup};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport {SpectrumTagProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useTag} from '@react-aria/tag';\n\nexport function Tag<T>(props: SpectrumTagProps<T>) {\n const {\n children,\n isDisabled,\n isRemovable,\n item,\n state,\n onRemove,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let labelRef = useRef();\n let tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isDisabled,\n isFocused,\n isRemovable,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}>\n <div\n {...mergeProps(tagProps, hoverProps, focusProps)}\n role=\"gridcell\"\n className={classNames(\n styles,\n 'spectrum-Tags-item',\n {\n 'is-disabled': isDisabled,\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'not-removable': !isRemovable,\n 'is-hovered': isHovered\n },\n styleProps.className\n )}>\n <SlotProvider\n slots={{\n tagLabel: {UNSAFE_className: classNames(styles, 'spectrum-Tag-label')},\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': isRemovable})}\n }}>\n {typeof children === 'string' ? <div ref={labelRef} {...labelProps}><Text>{children}</Text></div> : children}\n {isRemovable && <TagRemoveButton item={item} {...clearButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-action')} />}\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n props = useSlotProps(props, 'tagRemoveButton');\n let {styleProps} = useStyleProps(props);\n let clearBtnRef = useRef();\n\n return (\n <span\n {...styleProps}\n ref={clearBtnRef}>\n <ClearButton\n preventFocus\n {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/tag",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.3",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.6.2",
|
|
35
|
-
"@react-aria/focus": "^3.
|
|
36
|
-
"@react-aria/grid": "^3.
|
|
37
|
-
"@react-aria/i18n": "^3.3.
|
|
38
|
-
"@react-aria/interactions": "^3.
|
|
39
|
-
"@react-aria/tag": "3.0.0-alpha.
|
|
40
|
-
"@react-aria/utils": "^3.
|
|
41
|
-
"@react-spectrum/button": "^3.
|
|
42
|
-
"@react-spectrum/text": "^3.1.
|
|
43
|
-
"@react-spectrum/utils": "^3.
|
|
44
|
-
"@react-stately/collections": "^3.3.
|
|
45
|
-
"@react-stately/grid": "^3.
|
|
46
|
-
"@react-stately/list": "^3.
|
|
47
|
-
"@react-types/shared": "^3.
|
|
48
|
-
"@react-types/tag": "3.0.0-alpha.
|
|
49
|
-
"@spectrum-icons/workflow": "^3.
|
|
35
|
+
"@react-aria/focus": "^3.5.3",
|
|
36
|
+
"@react-aria/grid": "^3.2.4",
|
|
37
|
+
"@react-aria/i18n": "^3.3.7",
|
|
38
|
+
"@react-aria/interactions": "^3.8.2",
|
|
39
|
+
"@react-aria/tag": "3.0.0-alpha.3",
|
|
40
|
+
"@react-aria/utils": "^3.11.3",
|
|
41
|
+
"@react-spectrum/button": "^3.7.2",
|
|
42
|
+
"@react-spectrum/text": "^3.1.6",
|
|
43
|
+
"@react-spectrum/utils": "^3.6.6",
|
|
44
|
+
"@react-stately/collections": "^3.3.7",
|
|
45
|
+
"@react-stately/grid": "^3.1.3",
|
|
46
|
+
"@react-stately/list": "^3.4.4",
|
|
47
|
+
"@react-types/shared": "^3.11.2",
|
|
48
|
+
"@react-types/tag": "3.0.0-alpha.2",
|
|
49
|
+
"@spectrum-icons/workflow": "^3.2.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "ed8d8d984c2f7f2c31e8b18795b97858a95e4729"
|
|
62
62
|
}
|