@react-spectrum/tag 3.0.0-nightly.1933 → 3.0.0-nightly.1954

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/module.js CHANGED
@@ -1,14 +1,16 @@
1
1
  import "./main.css";
2
2
  import {Item as $c14698d57a91452e$re_export$Item} from "@react-stately/collections";
3
+ import {ActionButton as $fUaQ2$ActionButton, ClearButton as $fUaQ2$ClearButton} from "@react-spectrum/button";
4
+ import {TagKeyboardDelegate as $fUaQ2$TagKeyboardDelegate, useTagGroup as $fUaQ2$useTagGroup, useTag as $fUaQ2$useTag} from "@react-aria/tag";
3
5
  import {useDOMRef as $fUaQ2$useDOMRef, useStyleProps as $fUaQ2$useStyleProps, classNames as $fUaQ2$classNames, SlotProvider as $fUaQ2$SlotProvider, ClearSlots as $fUaQ2$ClearSlots} from "@react-spectrum/utils";
4
- import {mergeProps as $fUaQ2$mergeProps} from "@react-aria/utils";
5
- import $fUaQ2$react, {useRef as $fUaQ2$useRef} from "react";
6
+ import {FocusScope as $fUaQ2$FocusScope, useFocusRing as $fUaQ2$useFocusRing} from "@react-aria/focus";
7
+ import {ListCollection as $fUaQ2$ListCollection} from "@react-stately/list";
8
+ import $fUaQ2$react, {useRef as $fUaQ2$useRef, useState as $fUaQ2$useState, useMemo as $fUaQ2$useMemo, useCallback as $fUaQ2$useCallback, useEffect as $fUaQ2$useEffect} from "react";
9
+ import {useValueEffect as $fUaQ2$useValueEffect, useId as $fUaQ2$useId, useResizeObserver as $fUaQ2$useResizeObserver, useLayoutEffect as $fUaQ2$useLayoutEffect, mergeProps as $fUaQ2$mergeProps} from "@react-aria/utils";
10
+ import {useLocale as $fUaQ2$useLocale, useLocalizedStringFormatter as $fUaQ2$useLocalizedStringFormatter} from "@react-aria/i18n";
6
11
  import {useProviderProps as $fUaQ2$useProviderProps} from "@react-spectrum/provider";
7
- import {useTagGroup as $fUaQ2$useTagGroup, useTag as $fUaQ2$useTag} from "@react-aria/tag";
8
12
  import {useTagGroupState as $fUaQ2$useTagGroupState} from "@react-stately/tag";
9
- import {ClearButton as $fUaQ2$ClearButton} from "@react-spectrum/button";
10
13
  import {Text as $fUaQ2$Text} from "@react-spectrum/text";
11
- import {useFocusRing as $fUaQ2$useFocusRing} from "@react-aria/focus";
12
14
  import {useHover as $fUaQ2$useHover} from "@react-aria/interactions";
13
15
 
14
16
  function $parcel$interopDefault(a) {
@@ -40,6 +42,254 @@ function $parcel$export(e, n, v, s) {
40
42
  */
41
43
 
42
44
 
45
+
46
+ var $70cc9ce0ced2eb4a$exports = {};
47
+ var $4f97095b36611c9c$exports = {};
48
+ $4f97095b36611c9c$exports = {
49
+ "actions": `الإجراءات`
50
+ };
51
+
52
+
53
+ var $d1606ced019b0a9e$exports = {};
54
+ $d1606ced019b0a9e$exports = {
55
+ "actions": `Действия`
56
+ };
57
+
58
+
59
+ var $01e300f7d0078144$exports = {};
60
+ $01e300f7d0078144$exports = {
61
+ "actions": `Akce`
62
+ };
63
+
64
+
65
+ var $f3862a5e5adf53a4$exports = {};
66
+ $f3862a5e5adf53a4$exports = {
67
+ "actions": `Handlinger`
68
+ };
69
+
70
+
71
+ var $74c0b6e11258b497$exports = {};
72
+ $74c0b6e11258b497$exports = {
73
+ "actions": `Aktionen`
74
+ };
75
+
76
+
77
+ var $54fc4e3090259431$exports = {};
78
+ $54fc4e3090259431$exports = {
79
+ "actions": `Ενέργειες`
80
+ };
81
+
82
+
83
+ var $edf02907a7caaf96$exports = {};
84
+ $edf02907a7caaf96$exports = {
85
+ "showAllButtonLabel": (args)=>`Show all (${args.tagCount})`,
86
+ "hideButtonLabel": `Show less`,
87
+ "actions": `Actions`
88
+ };
89
+
90
+
91
+ var $b15ad3cf4b213b8e$exports = {};
92
+ $b15ad3cf4b213b8e$exports = {
93
+ "actions": `Acciones`
94
+ };
95
+
96
+
97
+ var $36cfda096c3db653$exports = {};
98
+ $36cfda096c3db653$exports = {
99
+ "actions": `Toimingud`
100
+ };
101
+
102
+
103
+ var $1a42e74299cab64d$exports = {};
104
+ $1a42e74299cab64d$exports = {
105
+ "actions": `Toiminnot`
106
+ };
107
+
108
+
109
+ var $dd8d3f41a5bfc373$exports = {};
110
+ $dd8d3f41a5bfc373$exports = {
111
+ "actions": `Actions`
112
+ };
113
+
114
+
115
+ var $35d68da324c3ed3e$exports = {};
116
+ $35d68da324c3ed3e$exports = {
117
+ "actions": `פעולות`
118
+ };
119
+
120
+
121
+ var $92746ce1284cd29f$exports = {};
122
+ $92746ce1284cd29f$exports = {
123
+ "actions": `Radnje`
124
+ };
125
+
126
+
127
+ var $570956f4f59f34b9$exports = {};
128
+ $570956f4f59f34b9$exports = {
129
+ "actions": `Műveletek`
130
+ };
131
+
132
+
133
+ var $f680d16d6f0d92d8$exports = {};
134
+ $f680d16d6f0d92d8$exports = {
135
+ "actions": `Azioni`
136
+ };
137
+
138
+
139
+ var $d28c56f33dc08452$exports = {};
140
+ $d28c56f33dc08452$exports = {
141
+ "actions": `アクション`
142
+ };
143
+
144
+
145
+ var $fc6f973338bd2d9c$exports = {};
146
+ $fc6f973338bd2d9c$exports = {
147
+ "actions": `액션`
148
+ };
149
+
150
+
151
+ var $8664f3f6a18cfaa6$exports = {};
152
+ $8664f3f6a18cfaa6$exports = {
153
+ "actions": `Veiksmai`
154
+ };
155
+
156
+
157
+ var $bd6e0fb18b482534$exports = {};
158
+ $bd6e0fb18b482534$exports = {
159
+ "actions": `Darbības`
160
+ };
161
+
162
+
163
+ var $3df66303c61fb25b$exports = {};
164
+ $3df66303c61fb25b$exports = {
165
+ "actions": `Handlinger`
166
+ };
167
+
168
+
169
+ var $0f533b61cdf70176$exports = {};
170
+ $0f533b61cdf70176$exports = {
171
+ "actions": `Acties`
172
+ };
173
+
174
+
175
+ var $03a6cd8f61b18787$exports = {};
176
+ $03a6cd8f61b18787$exports = {
177
+ "actions": `Działania`
178
+ };
179
+
180
+
181
+ var $c726a9d931f60c66$exports = {};
182
+ $c726a9d931f60c66$exports = {
183
+ "actions": `Ações`
184
+ };
185
+
186
+
187
+ var $ae9982f17f7235eb$exports = {};
188
+ $ae9982f17f7235eb$exports = {
189
+ "actions": `Ações`
190
+ };
191
+
192
+
193
+ var $c756723b814c63fa$exports = {};
194
+ $c756723b814c63fa$exports = {
195
+ "actions": `Acțiuni`
196
+ };
197
+
198
+
199
+ var $1601284ef6ec0730$exports = {};
200
+ $1601284ef6ec0730$exports = {
201
+ "actions": `Действия`
202
+ };
203
+
204
+
205
+ var $0388aac8e3bc5b59$exports = {};
206
+ $0388aac8e3bc5b59$exports = {
207
+ "actions": `Akcie`
208
+ };
209
+
210
+
211
+ var $247d9c4a71da6b08$exports = {};
212
+ $247d9c4a71da6b08$exports = {
213
+ "actions": `Dejanja`
214
+ };
215
+
216
+
217
+ var $91424dbafdc02f68$exports = {};
218
+ $91424dbafdc02f68$exports = {
219
+ "actions": `Radnje`
220
+ };
221
+
222
+
223
+ var $23c23096b6c1b0fa$exports = {};
224
+ $23c23096b6c1b0fa$exports = {
225
+ "actions": `Åtgärder`
226
+ };
227
+
228
+
229
+ var $d82875ae28963e58$exports = {};
230
+ $d82875ae28963e58$exports = {
231
+ "actions": `Eylemler`
232
+ };
233
+
234
+
235
+ var $1dd153688f5574fc$exports = {};
236
+ $1dd153688f5574fc$exports = {
237
+ "actions": `Дії`
238
+ };
239
+
240
+
241
+ var $6427307c9596258c$exports = {};
242
+ $6427307c9596258c$exports = {
243
+ "actions": `操作`
244
+ };
245
+
246
+
247
+ var $18b85da2aafaaf3e$exports = {};
248
+ $18b85da2aafaaf3e$exports = {
249
+ "actions": `動作`
250
+ };
251
+
252
+
253
+ $70cc9ce0ced2eb4a$exports = {
254
+ "ar-AE": $4f97095b36611c9c$exports,
255
+ "bg-BG": $d1606ced019b0a9e$exports,
256
+ "cs-CZ": $01e300f7d0078144$exports,
257
+ "da-DK": $f3862a5e5adf53a4$exports,
258
+ "de-DE": $74c0b6e11258b497$exports,
259
+ "el-GR": $54fc4e3090259431$exports,
260
+ "en-US": $edf02907a7caaf96$exports,
261
+ "es-ES": $b15ad3cf4b213b8e$exports,
262
+ "et-EE": $36cfda096c3db653$exports,
263
+ "fi-FI": $1a42e74299cab64d$exports,
264
+ "fr-FR": $dd8d3f41a5bfc373$exports,
265
+ "he-IL": $35d68da324c3ed3e$exports,
266
+ "hr-HR": $92746ce1284cd29f$exports,
267
+ "hu-HU": $570956f4f59f34b9$exports,
268
+ "it-IT": $f680d16d6f0d92d8$exports,
269
+ "ja-JP": $d28c56f33dc08452$exports,
270
+ "ko-KR": $fc6f973338bd2d9c$exports,
271
+ "lt-LT": $8664f3f6a18cfaa6$exports,
272
+ "lv-LV": $bd6e0fb18b482534$exports,
273
+ "nb-NO": $3df66303c61fb25b$exports,
274
+ "nl-NL": $0f533b61cdf70176$exports,
275
+ "pl-PL": $03a6cd8f61b18787$exports,
276
+ "pt-BR": $c726a9d931f60c66$exports,
277
+ "pt-PT": $ae9982f17f7235eb$exports,
278
+ "ro-RO": $c756723b814c63fa$exports,
279
+ "ru-RU": $1601284ef6ec0730$exports,
280
+ "sk-SK": $0388aac8e3bc5b59$exports,
281
+ "sl-SI": $247d9c4a71da6b08$exports,
282
+ "sr-SP": $91424dbafdc02f68$exports,
283
+ "sv-SE": $23c23096b6c1b0fa$exports,
284
+ "tr-TR": $d82875ae28963e58$exports,
285
+ "uk-UA": $1dd153688f5574fc$exports,
286
+ "zh-CN": $6427307c9596258c$exports,
287
+ "zh-TW": $18b85da2aafaaf3e$exports
288
+ };
289
+
290
+
291
+
292
+
43
293
  var $c033a7c057e84ef1$exports = {};
44
294
 
45
295
  $parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-item", () => $c033a7c057e84ef1$export$950d8dc0a3751654, (v) => $c033a7c057e84ef1$export$950d8dc0a3751654 = v);
@@ -51,6 +301,8 @@ $parcel$export($c033a7c057e84ef1$exports, "spectrum-Tag-cell", () => $c033a7c057
51
301
  $parcel$export($c033a7c057e84ef1$exports, "spectrum-Tag-icon", () => $c033a7c057e84ef1$export$21f5254139e14871, (v) => $c033a7c057e84ef1$export$21f5254139e14871 = v);
52
302
  $parcel$export($c033a7c057e84ef1$exports, "spectrum-Tag-content", () => $c033a7c057e84ef1$export$d281c967f4ee071e, (v) => $c033a7c057e84ef1$export$d281c967f4ee071e = v);
53
303
  $parcel$export($c033a7c057e84ef1$exports, "is-removable", () => $c033a7c057e84ef1$export$52d72cb84c5fde5e, (v) => $c033a7c057e84ef1$export$52d72cb84c5fde5e = v);
304
+ $parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-actions", () => $c033a7c057e84ef1$export$8afaa02110915bbb, (v) => $c033a7c057e84ef1$export$8afaa02110915bbb = v);
305
+ $parcel$export($c033a7c057e84ef1$exports, "spectrum-Tags-actionButton", () => $c033a7c057e84ef1$export$e6882f8db018e3bd, (v) => $c033a7c057e84ef1$export$e6882f8db018e3bd = v);
54
306
  $parcel$export($c033a7c057e84ef1$exports, "is-hovered", () => $c033a7c057e84ef1$export$b8813cd5d7824ce7, (v) => $c033a7c057e84ef1$export$b8813cd5d7824ce7 = v);
55
307
  $parcel$export($c033a7c057e84ef1$exports, "is-selected", () => $c033a7c057e84ef1$export$1e0fb04f31d3c22a, (v) => $c033a7c057e84ef1$export$1e0fb04f31d3c22a = v);
56
308
  $parcel$export($c033a7c057e84ef1$exports, "is-invalid", () => $c033a7c057e84ef1$export$14a30de2866685fa, (v) => $c033a7c057e84ef1$export$14a30de2866685fa = v);
@@ -69,6 +321,8 @@ var $c033a7c057e84ef1$export$9c4fd4d7faada408;
69
321
  var $c033a7c057e84ef1$export$21f5254139e14871;
70
322
  var $c033a7c057e84ef1$export$d281c967f4ee071e;
71
323
  var $c033a7c057e84ef1$export$52d72cb84c5fde5e;
324
+ var $c033a7c057e84ef1$export$8afaa02110915bbb;
325
+ var $c033a7c057e84ef1$export$e6882f8db018e3bd;
72
326
  var $c033a7c057e84ef1$export$b8813cd5d7824ce7;
73
327
  var $c033a7c057e84ef1$export$1e0fb04f31d3c22a;
74
328
  var $c033a7c057e84ef1$export$14a30de2866685fa;
@@ -87,6 +341,8 @@ $c033a7c057e84ef1$export$9c4fd4d7faada408 = "spectrum-Tag-cell_8407eb";
87
341
  $c033a7c057e84ef1$export$21f5254139e14871 = "spectrum-Tag-icon_8407eb";
88
342
  $c033a7c057e84ef1$export$d281c967f4ee071e = "spectrum-Tag-content_8407eb";
89
343
  $c033a7c057e84ef1$export$52d72cb84c5fde5e = "is-removable_8407eb";
344
+ $c033a7c057e84ef1$export$8afaa02110915bbb = "spectrum-Tags-actions_8407eb";
345
+ $c033a7c057e84ef1$export$e6882f8db018e3bd = "spectrum-Tags-actionButton_8407eb";
90
346
  $c033a7c057e84ef1$export$b8813cd5d7824ce7 = "is-hovered_8407eb";
91
347
  $c033a7c057e84ef1$export$1e0fb04f31d3c22a = "is-selected_8407eb";
92
348
  $c033a7c057e84ef1$export$14a30de2866685fa = "is-invalid_8407eb";
@@ -175,28 +431,157 @@ function $b5f5ee35d3b6b95c$var$TagRemoveButton(props) {
175
431
 
176
432
 
177
433
 
434
+
178
435
  function $880d112c7a588209$var$TagGroup(props, ref) {
179
436
  props = (0, $fUaQ2$useProviderProps)(props);
180
- let { allowsRemoving: allowsRemoving , onRemove: onRemove , ...otherProps } = props;
437
+ let { allowsRemoving: allowsRemoving , onRemove: onRemove , maxRows: maxRows , children: children , actionLabel: actionLabel , onAction: onAction , ...otherProps } = props;
181
438
  let domRef = (0, $fUaQ2$useDOMRef)(ref);
439
+ let containerRef = (0, $fUaQ2$useRef)(null);
182
440
  let { styleProps: styleProps } = (0, $fUaQ2$useStyleProps)(otherProps);
441
+ let { direction: direction } = (0, $fUaQ2$useLocale)();
442
+ let stringFormatter = (0, $fUaQ2$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($70cc9ce0ced2eb4a$exports))));
443
+ let [isCollapsed, setIsCollapsed] = (0, $fUaQ2$useState)(maxRows != null);
183
444
  let state = (0, $fUaQ2$useTagGroupState)(props);
184
- let { tagGroupProps: tagGroupProps } = (0, $fUaQ2$useTagGroup)(props, state, domRef);
185
- return /*#__PURE__*/ (0, $fUaQ2$react).createElement("div", {
186
- ...(0, $fUaQ2$mergeProps)(styleProps, tagGroupProps),
187
- className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags", styleProps.className),
188
- role: state.collection.size ? "grid" : null,
189
- ref: domRef
445
+ let [tagState, setTagState] = (0, $fUaQ2$useValueEffect)({
446
+ visibleTagCount: state.collection.size,
447
+ showCollapseButton: false
448
+ });
449
+ let keyboardDelegate = (0, $fUaQ2$useMemo)(()=>isCollapsed ? new (0, $fUaQ2$TagKeyboardDelegate)(new (0, $fUaQ2$ListCollection)([
450
+ ...state.collection
451
+ ].slice(0, tagState.visibleTagCount)), direction) : new (0, $fUaQ2$TagKeyboardDelegate)(new (0, $fUaQ2$ListCollection)([
452
+ ...state.collection
453
+ ]), direction), [
454
+ direction,
455
+ isCollapsed,
456
+ state.collection,
457
+ tagState.visibleTagCount
458
+ ]);
459
+ // Remove onAction from props so it doesn't make it into useGridList.
460
+ delete props.onAction;
461
+ let { tagGroupProps: tagGroupProps } = (0, $fUaQ2$useTagGroup)({
462
+ ...props,
463
+ keyboardDelegate: keyboardDelegate
464
+ }, state, domRef);
465
+ let actionsId = (0, $fUaQ2$useId)();
466
+ let updateVisibleTagCount = (0, $fUaQ2$useCallback)(()=>{
467
+ if (maxRows > 0) {
468
+ let computeVisibleTagCount = ()=>{
469
+ var _tags_;
470
+ // Refs can be null at runtime.
471
+ let currDomRef = domRef.current;
472
+ let currContainerRef = containerRef.current;
473
+ if (!currDomRef || !currContainerRef) return;
474
+ let tags = [
475
+ ...currDomRef.children
476
+ ];
477
+ let buttons = [
478
+ ...currContainerRef.parentElement.querySelectorAll("button")
479
+ ];
480
+ let currY = -Infinity;
481
+ let rowCount = 0;
482
+ let index = 0;
483
+ let tagWidths = [];
484
+ // Count rows and show tags until we hit the maxRows.
485
+ for (let tag of tags){
486
+ let { width: width , y: y } = tag.getBoundingClientRect();
487
+ if (y !== currY) {
488
+ currY = y;
489
+ rowCount++;
490
+ }
491
+ if (rowCount > maxRows) break;
492
+ tagWidths.push(width);
493
+ index++;
494
+ }
495
+ // Remove tags until there is space for the collapse button and action button (if present) on the last row.
496
+ let buttonsWidth = buttons.reduce((acc, curr)=>acc += curr.getBoundingClientRect().width, 0);
497
+ let end = direction === "ltr" ? "right" : "left";
498
+ let containerEnd = currContainerRef.getBoundingClientRect()[end];
499
+ let lastTagEnd = (_tags_ = tags[index - 1]) === null || _tags_ === void 0 ? void 0 : _tags_.getBoundingClientRect()[end];
500
+ let availableWidth = containerEnd - lastTagEnd;
501
+ for (let tagWidth of tagWidths.reverse()){
502
+ if (availableWidth >= buttonsWidth || index <= 1 || index >= state.collection.size) break;
503
+ availableWidth += tagWidth;
504
+ index--;
505
+ }
506
+ return {
507
+ visibleTagCount: index,
508
+ showCollapseButton: index < state.collection.size
509
+ };
510
+ };
511
+ setTagState(function*() {
512
+ // Update to show all items.
513
+ yield {
514
+ visibleTagCount: state.collection.size,
515
+ showCollapseButton: true
516
+ };
517
+ // Measure, and update to show the items until maxRows is reached.
518
+ yield computeVisibleTagCount();
519
+ });
520
+ }
190
521
  }, [
522
+ maxRows,
523
+ setTagState,
524
+ domRef,
525
+ direction,
526
+ state.collection.size
527
+ ]);
528
+ (0, $fUaQ2$useResizeObserver)({
529
+ ref: containerRef,
530
+ onResize: updateVisibleTagCount
531
+ });
532
+ // eslint-disable-next-line react-hooks/exhaustive-deps
533
+ (0, $fUaQ2$useLayoutEffect)(updateVisibleTagCount, [
534
+ children
535
+ ]);
536
+ (0, $fUaQ2$useEffect)(()=>{
537
+ var // Recalculate visible tags when fonts are loaded.
538
+ _document_fonts;
539
+ (_document_fonts = document.fonts) === null || _document_fonts === void 0 ? void 0 : _document_fonts.ready.then(()=>updateVisibleTagCount());
540
+ // eslint-disable-next-line react-hooks/exhaustive-deps
541
+ }, []);
542
+ let visibleTags = [
191
543
  ...state.collection
192
- ].map((item)=>/*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $b5f5ee35d3b6b95c$export$3288d34c523a1192), {
544
+ ];
545
+ if (maxRows != null && isCollapsed) visibleTags = visibleTags.slice(0, tagState.visibleTagCount);
546
+ let handlePressCollapse = ()=>{
547
+ // Prevents button from losing focus if focusedKey got collapsed.
548
+ state.selectionManager.setFocusedKey(null);
549
+ setIsCollapsed((prevCollapsed)=>!prevCollapsed);
550
+ };
551
+ let showActions = tagState.showCollapseButton || actionLabel && onAction;
552
+ return /*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $fUaQ2$FocusScope), null, /*#__PURE__*/ (0, $fUaQ2$react).createElement("div", {
553
+ ref: containerRef,
554
+ ...styleProps,
555
+ className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags-container", styleProps.className)
556
+ }, /*#__PURE__*/ (0, $fUaQ2$react).createElement("div", {
557
+ ...tagGroupProps,
558
+ className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags"),
559
+ role: state.collection.size ? "grid" : null,
560
+ ref: domRef
561
+ }, visibleTags.map((item)=>/*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $b5f5ee35d3b6b95c$export$3288d34c523a1192), {
193
562
  ...item.props,
194
563
  key: item.key,
195
564
  item: item,
196
565
  state: state,
197
566
  allowsRemoving: allowsRemoving,
198
567
  onRemove: onRemove
199
- }, item.rendered)));
568
+ }, item.rendered))), showActions && /*#__PURE__*/ (0, $fUaQ2$react).createElement("div", {
569
+ role: "group",
570
+ id: actionsId,
571
+ "aria-label": stringFormatter.format("actions"),
572
+ "aria-labelledby": `${tagGroupProps.id} ${actionsId}`,
573
+ className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags-actions")
574
+ }, tagState.showCollapseButton && /*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $fUaQ2$ActionButton), {
575
+ isQuiet: true,
576
+ onPress: handlePressCollapse,
577
+ UNSAFE_className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags-actionButton")
578
+ }, isCollapsed ? stringFormatter.format("showAllButtonLabel", {
579
+ tagCount: state.collection.size
580
+ }) : stringFormatter.format("hideButtonLabel")), actionLabel && onAction && /*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $fUaQ2$ActionButton), {
581
+ isQuiet: true,
582
+ onPress: onAction,
583
+ UNSAFE_className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags-actionButton")
584
+ }, actionLabel))));
200
585
  }
201
586
  /** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */ const $880d112c7a588209$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, $fUaQ2$react).forwardRef($880d112c7a588209$var$TagGroup);
202
587
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;ACZA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAjBA,4CAAuC;AACvC,4CAA+B;AAC/B,4CAAkC;AAClC,4CAAgC;AAChC,4CAAwC;AACxC,4CAAsC;AACtC,4CAAsC;AACtC,4CAAyC;AACzC,4CAAiC;AACjC,4CAA+B;AAC/B,4CAAgC;AAChC,4CAA+B;AAC/B,4CAA2C;AAC3C,4CAA4C;A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KAAK;YACd,KAAK,KAAK,GAAG;YACb,MAAM;YACN,OAAO;YACP,gBAAgB;YAChB,UAAU;WACT,KAAK,QAAQ;AAKxB;AAEA,4IAA4I,GAC5I,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;;CDpDlC,GAED","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\nexport {TagGroup} from './TagGroup';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumTagGroupProps} from '@react-types/tag';\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 {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {SpectrumTagGroupProps} from '@react-types/tag';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Tag} from './Tag';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTagGroup} from '@react-aria/tag';\nimport {useTagGroupState} from '@react-stately/tag';\n\nfunction TagGroup<T extends object>(props: SpectrumTagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n allowsRemoving,\n onRemove,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let state = useTagGroupState(props);\n let {tagGroupProps} = useTagGroup(props, state, domRef);\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps)}\n className={\n classNames(\n styles,\n 'spectrum-Tags',\n styleProps.className\n )\n }\n role={state.collection.size ? 'grid' : null}\n ref={domRef}>\n {[...state.collection].map(item => (\n <Tag\n {...item.props}\n key={item.key}\n item={item}\n state={state}\n allowsRemoving={allowsRemoving}\n onRemove={onRemove}>\n {item.rendered}\n </Tag>\n ))}\n </div>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\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, ClearSlots, SlotProvider, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport type {TagGroupState} from '@react-stately/tag';\nimport {TagProps} from '@react-types/tag';\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 interface SpectrumTagProps<T> extends TagProps<T> {\n state: TagGroupState<T>\n}\n\nexport function Tag<T>(props: SpectrumTagProps<T>) {\n const {\n children,\n allowsRemoving,\n item,\n state,\n onRemove,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isFocused,\n allowsRemoving,\n item,\n onRemove,\n tagRowRef\n }, state);\n\n return (\n <div\n {...mergeProps(tagRowProps, hoverProps, focusProps)}\n className={classNames(\n styles,\n 'spectrum-Tags-item',\n {\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'is-hovered': isHovered,\n 'is-removable': allowsRemoving\n },\n styleProps.className\n )}\n ref={tagRowRef}>\n <div\n className={classNames(styles, 'spectrum-Tag-cell')}\n {...tagProps}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content'), ...labelProps}\n }}>\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n <ClearSlots>\n {allowsRemoving && <TagRemoveButton item={item} {...clearButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-action')} />}\n </ClearSlots>\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n let {styleProps} = useStyleProps(props);\n\n return (\n <span\n {...styleProps}>\n <ClearButton\n preventFocus\n {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;;;;AEZA,4BAAiB;IAAG,WAAW,CAAC,SAAS,CAAC;AAC1C;;ADDA;;AEAA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;AACzC;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,IAAI,CAAC;AACrC;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,UAAU,CAAC;AAC3C;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;AACzC;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,SAAS,CAAC;AAC1C;;;;ACDA,4BAAiB;IAAG,sBAAsB,CAAC,OAAS,CAAC,UAAU,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC;IAC/E,mBAAmB,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,OAAO,CAAC;AACtB;;;;ACHA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;AACzC;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,SAAS,CAAC;AAC1C;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,SAAS,CAAC;AAC1C;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,OAAO,CAAC;AACxC;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,MAAM,CAAC;AACvC;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,MAAM,CAAC;AACvC;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,SAAS,CAAC;AAC1C;;;;ACDA,4BAAiB;IAAG,WAAW,CAAC,MAAM,CAAC;AACvC;;;;ACDA,4B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AAC,IAAI,GAAG,SAAS,IAAI;QAC3C,KAAK;OACJ,YAAY,GAAG,CAAC,CAAA,qBACf,gCAAC,CAAA,GAAA,yCAAE;YACA,GAAG,KAAK,KAAK;YACd,KAAK,KAAK,GAAG;YACb,MAAM;YACN,OAAO;YACP,gBAAgB;YAChB,UAAU;WACT,KAAK,QAAQ,KAInB,6BACC,gCAAC;QACC,MAAK;QACL,IAAI;QACJ,cAAY,gBAAgB,MAAM,CAAC;QACnC,mBAAiB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC;QACnD,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAM,AAAD,GAAG;OAC7B,SAAS,kBAAkB,kBAC1B,gCAAC,CAAA,GAAA,mBAAY,AAAD;QACV,SAAA,IAAO;QACP,SAAS;QACT,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAM,AAAD,GAAG;OACpC,cACC,gBAAgB,MAAM,CAAC,sBAAsB;QAAC,UAAU,MAAM,UAAU,CAAC,IAAI;IAAA,KAC7E,gBAAgB,MAAM,CAAC,kBAAkB,GAI9C,eAAe,0BACd,gCAAC,CAAA,GAAA,mBAAW;QACV,SAAA,IAAO;QACP,SAAS;QACT,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAM,AAAD,GAAG;OACpC;AAQjB;AAEA,4IAA4I,GAC5I,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;;CDjMlC,GAED","sources":["packages/@react-spectrum/tag/src/index.ts","packages/@react-spectrum/tag/src/TagGroup.tsx","packages/@react-spectrum/tag/intl/*.js","packages/@react-spectrum/tag/intl/ar-AE.json","packages/@react-spectrum/tag/intl/bg-BG.json","packages/@react-spectrum/tag/intl/cs-CZ.json","packages/@react-spectrum/tag/intl/da-DK.json","packages/@react-spectrum/tag/intl/de-DE.json","packages/@react-spectrum/tag/intl/el-GR.json","packages/@react-spectrum/tag/intl/en-US.json","packages/@react-spectrum/tag/intl/es-ES.json","packages/@react-spectrum/tag/intl/et-EE.json","packages/@react-spectrum/tag/intl/fi-FI.json","packages/@react-spectrum/tag/intl/fr-FR.json","packages/@react-spectrum/tag/intl/he-IL.json","packages/@react-spectrum/tag/intl/hr-HR.json","packages/@react-spectrum/tag/intl/hu-HU.json","packages/@react-spectrum/tag/intl/it-IT.json","packages/@react-spectrum/tag/intl/ja-JP.json","packages/@react-spectrum/tag/intl/ko-KR.json","packages/@react-spectrum/tag/intl/lt-LT.json","packages/@react-spectrum/tag/intl/lv-LV.json","packages/@react-spectrum/tag/intl/nb-NO.json","packages/@react-spectrum/tag/intl/nl-NL.json","packages/@react-spectrum/tag/intl/pl-PL.json","packages/@react-spectrum/tag/intl/pt-BR.json","packages/@react-spectrum/tag/intl/pt-PT.json","packages/@react-spectrum/tag/intl/ro-RO.json","packages/@react-spectrum/tag/intl/ru-RU.json","packages/@react-spectrum/tag/intl/sk-SK.json","packages/@react-spectrum/tag/intl/sl-SI.json","packages/@react-spectrum/tag/intl/sr-SP.json","packages/@react-spectrum/tag/intl/sv-SE.json","packages/@react-spectrum/tag/intl/tr-TR.json","packages/@react-spectrum/tag/intl/uk-UA.json","packages/@react-spectrum/tag/intl/zh-CN.json","packages/@react-spectrum/tag/intl/zh-TW.json","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\nexport {TagGroup} from './TagGroup';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumTagGroupProps} 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 {ActionButton} from '@react-spectrum/button';\nimport {AriaTagGroupProps, TagKeyboardDelegate, useTagGroup} from '@react-aria/tag';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {FocusScope} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListCollection} from '@react-stately/list';\nimport React, {ReactElement, useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Tag} from './Tag';\nimport {useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTagGroupState} from '@react-stately/tag';\n\nexport interface SpectrumTagGroupProps<T> extends AriaTagGroupProps<T>, StyleProps {\n /** The label to display on the action button. */\n actionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onAction?: () => void\n}\n\nfunction TagGroup<T extends object>(props: SpectrumTagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n allowsRemoving,\n onRemove,\n maxRows,\n children,\n actionLabel,\n onAction,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let containerRef = useRef(null);\n let {styleProps} = useStyleProps(otherProps);\n let {direction} = useLocale();\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let state = useTagGroupState(props);\n let [tagState, setTagState] = useValueEffect({visibleTagCount: state.collection.size, showCollapseButton: false});\n let keyboardDelegate = useMemo(() => (\n isCollapsed\n ? new TagKeyboardDelegate(new ListCollection([...state.collection].slice(0, tagState.visibleTagCount)), direction)\n : new TagKeyboardDelegate(new ListCollection([...state.collection]), direction)\n ), [direction, isCollapsed, state.collection, tagState.visibleTagCount]) as TagKeyboardDelegate<T>;\n // Remove onAction from props so it doesn't make it into useGridList.\n delete props.onAction;\n let {tagGroupProps} = useTagGroup({...props, keyboardDelegate}, state, domRef);\n let actionsId = useId();\n\n let updateVisibleTagCount = useCallback(() => {\n if (maxRows > 0) {\n let computeVisibleTagCount = () => {\n // Refs can be null at runtime.\n let currDomRef: HTMLDivElement | null = domRef.current;\n let currContainerRef: HTMLDivElement | null = containerRef.current; \n if (!currDomRef || !currContainerRef) {\n return;\n }\n\n let tags = [...currDomRef.children];\n let buttons = [...currContainerRef.parentElement.querySelectorAll('button')];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths = [];\n // Count rows and show tags until we hit the maxRows.\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.getBoundingClientRect()[end];\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n let availableWidth = containerEnd - lastTagEnd;\n for (let tagWidth of tagWidths.reverse()) {\n if (availableWidth >= buttonsWidth || index <= 1 || index >= state.collection.size) {\n break;\n }\n availableWidth += tagWidth;\n index--;\n }\n return {visibleTagCount: index, showCollapseButton: index < state.collection.size};\n };\n \n setTagState(function *() {\n // Update to show all items.\n yield {visibleTagCount: state.collection.size, showCollapseButton: true};\n\n // Measure, and update to show the items until maxRows is reached.\n yield computeVisibleTagCount();\n });\n }\n }, [maxRows, setTagState, domRef, direction, state.collection.size]);\n\n useResizeObserver({ref: containerRef, onResize: updateVisibleTagCount});\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(updateVisibleTagCount, [children]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let visibleTags = [...state.collection];\n if (maxRows != null && isCollapsed) {\n visibleTags = visibleTags.slice(0, tagState.visibleTagCount);\n }\n\n let handlePressCollapse = () => {\n // Prevents button from losing focus if focusedKey got collapsed.\n state.selectionManager.setFocusedKey(null);\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let showActions = tagState.showCollapseButton || (actionLabel && onAction);\n\n return (\n <FocusScope>\n <div\n ref={containerRef}\n {...styleProps}\n className={classNames(styles, 'spectrum-Tags-container', styleProps.className)}>\n <div\n {...tagGroupProps}\n className={classNames(styles, 'spectrum-Tags')}\n role={state.collection.size ? 'grid' : null}\n ref={domRef}>\n {visibleTags.map(item => (\n <Tag\n {...item.props}\n key={item.key}\n item={item}\n state={state}\n allowsRemoving={allowsRemoving}\n onRemove={onRemove}>\n {item.rendered}\n </Tag>\n ))}\n </div>\n {showActions &&\n <div\n role=\"group\"\n id={actionsId}\n aria-label={stringFormatter.format('actions')}\n aria-labelledby={`${tagGroupProps.id} ${actionsId}`}\n className={classNames(styles, 'spectrum-Tags-actions')}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n onPress={handlePressCollapse}\n UNSAFE_className={classNames(styles, 'spectrum-Tags-actionButton')}>\n {isCollapsed ?\n stringFormatter.format('showAllButtonLabel', {tagCount: state.collection.size}) :\n stringFormatter.format('hideButtonLabel')\n }\n </ActionButton>\n }\n {actionLabel && onAction &&\n <ActionButton\n isQuiet\n onPress={onAction}\n UNSAFE_className={classNames(styles, 'spectrum-Tags-actionButton')}>\n {actionLabel}\n </ActionButton>\n }\n </div>\n }\n </div>\n </FocusScope>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nconst _TagGroup = React.forwardRef(TagGroup) as <T>(props: SpectrumTagGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_TagGroup as TagGroup};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"actions\": \"الإجراءات\"\n}\n","{\n \"actions\": \"Действия\"\n}\n","{\n \"actions\": \"Akce\"\n}\n","{\n \"actions\": \"Handlinger\"\n}\n","{\n \"actions\": \"Aktionen\"\n}\n","{\n \"actions\": \"Ενέργειες\"\n}\n","{\n \"showAllButtonLabel\": \"Show all ({tagCount})\",\n \"hideButtonLabel\": \"Show less\",\n \"actions\": \"Actions\"\n}","{\n \"actions\": \"Acciones\"\n}\n","{\n \"actions\": \"Toimingud\"\n}\n","{\n \"actions\": \"Toiminnot\"\n}\n","{\n \"actions\": \"Actions\"\n}\n","{\n \"actions\": \"פעולות\"\n}\n","{\n \"actions\": \"Radnje\"\n}\n","{\n \"actions\": \"Műveletek\"\n}\n","{\n \"actions\": \"Azioni\"\n}\n","{\n \"actions\": \"アクション\"\n}\n","{\n \"actions\": \"액션\"\n}\n","{\n \"actions\": \"Veiksmai\"\n}\n","{\n \"actions\": \"Darbības\"\n}\n","{\n \"actions\": \"Handlinger\"\n}\n","{\n \"actions\": \"Acties\"\n}\n","{\n \"actions\": \"Działania\"\n}\n","{\n \"actions\": \"Ações\"\n}\n","{\n \"actions\": \"Ações\"\n}\n","{\n \"actions\": \"Acțiuni\"\n}\n","{\n \"actions\": \"Действия\"\n}\n","{\n \"actions\": \"Akcie\"\n}\n","{\n \"actions\": \"Dejanja\"\n}\n","{\n \"actions\": \"Radnje\"\n}\n","{\n \"actions\": \"Åtgärder\"\n}\n","{\n \"actions\": \"Eylemler\"\n}\n","{\n \"actions\": \"Дії\"\n}\n","{\n \"actions\": \"操作\"\n}\n","{\n \"actions\": \"動作\"\n}\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, ClearSlots, SlotProvider, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport type {TagGroupState} from '@react-stately/tag';\nimport {TagProps} from '@react-types/tag';\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 interface SpectrumTagProps<T> extends TagProps<T> {\n state: TagGroupState<T>\n}\n\nexport function Tag<T>(props: SpectrumTagProps<T>) {\n const {\n children,\n allowsRemoving,\n item,\n state,\n onRemove,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isFocused,\n allowsRemoving,\n item,\n onRemove,\n tagRowRef\n }, state);\n\n return (\n <div\n {...mergeProps(tagRowProps, hoverProps, focusProps)}\n className={classNames(\n styles,\n 'spectrum-Tags-item',\n {\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'is-hovered': isHovered,\n 'is-removable': allowsRemoving\n },\n styleProps.className\n )}\n ref={tagRowRef}>\n <div\n className={classNames(styles, 'spectrum-Tag-cell')}\n {...tagProps}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content'), ...labelProps}\n }}>\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n <ClearSlots>\n {allowsRemoving && <TagRemoveButton item={item} {...clearButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-action')} />}\n </ClearSlots>\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n let {styleProps} = useStyleProps(props);\n\n return (\n <span\n {...styleProps}>\n <ClearButton\n preventFocus\n {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,11 +1,16 @@
1
- import { DOMRef } from "@react-types/shared";
1
+ import { AriaTagGroupProps } from "@react-aria/tag";
2
+ import { DOMRef, StyleProps } from "@react-types/shared";
2
3
  import { ReactElement } from "react";
3
- import { SpectrumTagGroupProps } from "@react-types/tag";
4
+ export interface SpectrumTagGroupProps<T> extends AriaTagGroupProps<T>, StyleProps {
5
+ /** The label to display on the action button. */
6
+ actionLabel?: string;
7
+ /** Handler that is called when the action button is pressed. */
8
+ onAction?: () => void;
9
+ }
4
10
  /** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */
5
11
  export const TagGroup: <T>(props: SpectrumTagGroupProps<T> & {
6
12
  ref?: DOMRef<HTMLDivElement>;
7
13
  }) => ReactElement;
8
14
  export { Item } from '@react-stately/collections';
9
- export type { SpectrumTagGroupProps } from '@react-types/tag';
10
15
 
11
16
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";;;AC6DA,8IAA8I;AAC9I,OAAA,MAAM;UAAuF,OAAO,cAAc,CAAC;MAAM,YAAY,CAAC;ACjDtI,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAChD,YAAY,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC","sources":["packages/@react-spectrum/tag/src/packages/@react-spectrum/tag/src/Tag.tsx","packages/@react-spectrum/tag/src/packages/@react-spectrum/tag/src/TagGroup.tsx","packages/@react-spectrum/tag/src/packages/@react-spectrum/tag/src/index.ts","packages/@react-spectrum/tag/src/index.ts"],"sourcesContent":[null,null,null,"/*\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\nexport {TagGroup} from './TagGroup';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumTagGroupProps} from '@react-types/tag';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AC4BA,uCAAuC,CAAC,CAAE,SAAQ,kBAAkB,CAAC,CAAC,EAAE,UAAU;IAChF,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAyKD,8IAA8I;AAC9I,OAAA,MAAM;UAAuF,OAAO,cAAc,CAAC;MAAM,YAAY,CAAC;AC9LtI,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC","sources":["packages/@react-spectrum/tag/src/packages/@react-spectrum/tag/src/Tag.tsx","packages/@react-spectrum/tag/src/packages/@react-spectrum/tag/src/TagGroup.tsx","packages/@react-spectrum/tag/src/packages/@react-spectrum/tag/src/index.ts","packages/@react-spectrum/tag/src/index.ts"],"sourcesContent":[null,null,null,"/*\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\nexport {TagGroup} from './TagGroup';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumTagGroupProps} from './TagGroup';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/tag",
3
- "version": "3.0.0-nightly.1933+080488a85",
3
+ "version": "3.0.0-nightly.1954+ff3e690ff",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -31,21 +31,23 @@
31
31
  "url": "https://github.com/adobe/react-spectrum"
32
32
  },
33
33
  "dependencies": {
34
- "@react-aria/focus": "3.0.0-nightly.1933+080488a85",
35
- "@react-aria/interactions": "3.0.0-nightly.1933+080488a85",
36
- "@react-aria/tag": "3.0.0-nightly.1933+080488a85",
37
- "@react-aria/utils": "3.0.0-nightly.1933+080488a85",
38
- "@react-spectrum/button": "3.0.0-nightly.1933+080488a85",
39
- "@react-spectrum/text": "3.3.5-nightly.3633+080488a85",
40
- "@react-spectrum/utils": "3.0.0-nightly.1933+080488a85",
41
- "@react-stately/collections": "3.0.0-nightly.1933+080488a85",
42
- "@react-stately/tag": "3.0.0-nightly.3633+080488a85",
43
- "@react-types/shared": "3.0.0-nightly.1933+080488a85",
44
- "@react-types/tag": "3.0.0-nightly.1933+080488a85",
34
+ "@react-aria/focus": "3.0.0-nightly.1954+ff3e690ff",
35
+ "@react-aria/i18n": "3.0.0-nightly.1954+ff3e690ff",
36
+ "@react-aria/interactions": "3.0.0-nightly.1954+ff3e690ff",
37
+ "@react-aria/tag": "3.0.0-nightly.1954+ff3e690ff",
38
+ "@react-aria/utils": "3.0.0-nightly.1954+ff3e690ff",
39
+ "@react-spectrum/button": "3.0.0-nightly.1954+ff3e690ff",
40
+ "@react-spectrum/text": "3.3.5-nightly.3654+ff3e690ff",
41
+ "@react-spectrum/utils": "3.0.0-nightly.1954+ff3e690ff",
42
+ "@react-stately/collections": "3.0.0-nightly.1954+ff3e690ff",
43
+ "@react-stately/list": "3.6.2-nightly.3654+ff3e690ff",
44
+ "@react-stately/tag": "3.0.0-nightly.3654+ff3e690ff",
45
+ "@react-types/shared": "3.0.0-nightly.1954+ff3e690ff",
46
+ "@react-types/tag": "3.0.0-nightly.1954+ff3e690ff",
45
47
  "@swc/helpers": "^0.4.14"
46
48
  },
47
49
  "devDependencies": {
48
- "@adobe/spectrum-css-temp": "3.0.0-nightly.1933+080488a85"
50
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.1954+ff3e690ff"
49
51
  },
50
52
  "peerDependencies": {
51
53
  "@react-spectrum/provider": "^3.0.0",
@@ -54,5 +56,5 @@
54
56
  "publishConfig": {
55
57
  "access": "public"
56
58
  },
57
- "gitHead": "080488a859be32a1ee30f4f9fdcc4d5e8331a144"
59
+ "gitHead": "ff3e690fffc6c54367b8057e28a0e5b9211f37b5"
58
60
  }