@react-spectrum/tag 3.0.0-nightly.1899 → 3.0.0-nightly.1903
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.css +1 -1
- package/dist/main.js +81 -54
- package/dist/main.js.map +1 -1
- package/dist/module.mjs +81 -54
- package/dist/module.mjs.map +1 -1
- package/package.json +19 -19
package/dist/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.spectrum-Tags-item_8407eb{--spectrum-focus-ring-border-radius:var(--spectrum-textfield-border-radius,var(--spectrum-alias-border-radius-regular));--spectrum-focus-ring-gap:var(--spectrum-alias-input-focusring-gap);--spectrum-focus-ring-size:var(--spectrum-alias-input-focusring-size);--spectrum-focus-ring-border-size:0px;--spectrum-focus-ring-color:var(--spectrum-high-contrast-focus-ring-color,var(--spectrum-alias-focus-ring-color,var(--spectrum-alias-focus-color)))}.spectrum-Tags-item_8407eb:after{border-radius:calc(var(--spectrum-focus-ring-border-radius) + var(--spectrum-focus-ring-gap));content:"";margin:calc(-1*var(--spectrum-focus-ring-border-size));pointer-events:none;transition:box-shadow var(--spectrum-global-animation-duration-100,130ms)ease-out,margin var(--spectrum-global-animation-duration-100,130ms)ease-out;display:block;position:absolute;top:0;bottom:0;left:0;right:0}.spectrum-Tags-item_8407eb.focus-ring_8407eb:after{margin:calc(var(--spectrum-focus-ring-gap)*-1 - var(--spectrum-focus-ring-border-size));box-shadow:0 0 0 var(--spectrum-focus-ring-size)var(--spectrum-focus-ring-color)}.spectrum-Tags_8407eb{flex-wrap:wrap;margin:0;padding:0;list-style:none;display:inline-flex}[dir=ltr] .spectrum-Tags-item_8407eb{padding-left:calc(var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125)) - var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin)))}[dir=rtl] .spectrum-Tags-item_8407eb{padding-right:calc(var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125)) - var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin)))}.spectrum-Tags-item_8407eb{--spectrum-focus-ring-border-radius:var(--spectrum-tag-border-radius,var(--spectrum-alias-border-radius-regular));--spectrum-focus-ring-border-size:var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin));display:-ms-grid;-ms-grid-columns:1fr auto;box-sizing:border-box;margin:calc(var(--spectrum-taggroup-tag-gap-y,var(--spectrum-global-dimension-size-100))/2)calc(var(--spectrum-taggroup-tag-gap-x,var(--spectrum-global-dimension-size-100))/2);height:var(--spectrum-tag-height,var(--spectrum-global-dimension-size-300));max-width:100%;border-width:var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin));border-radius:var(--spectrum-tag-border-radius,var(--spectrum-alias-border-radius-regular));-webkit-user-select:none;user-select:none;transition:border-color var(--spectrum-global-animation-duration-100,130ms)ease-in-out,color var(--spectrum-global-animation-duration-100,130ms)ease-in-out,box-shadow var(--spectrum-global-animation-duration-100,130ms)ease-in-out,background-color var(--spectrum-global-animation-duration-100,130ms)ease-in-out;border-style:solid;outline:0;grid-template-columns:1fr auto;grid-template-areas:"icon content action";align-items:center;display:grid;position:relative}.spectrum-Tags-item_8407eb.is-disabled_8407eb{pointer-events:none}.spectrum-Tags-item_8407eb .spectrum-Tag-action_8407eb{height:calc(var(--spectrum-tag-height,var(--spectrum-global-dimension-size-300)) - 2*var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin)));width:var(--spectrum-global-dimension-size-300);grid-area:action}[dir=ltr] .spectrum-Tag-icon_8407eb{margin-right:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Tag-icon_8407eb{margin-left:var(--spectrum-global-dimension-size-100)}.spectrum-Tag-icon_8407eb{grid-area:icon}[dir=ltr] .spectrum-Tag-content_8407eb{margin-right:var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125))}[dir=rtl] .spectrum-Tag-content_8407eb{margin-left:var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125))}.spectrum-Tag-content_8407eb{height:100%;line-height:calc(var(--spectrum-tag-height,var(--spectrum-global-dimension-size-300)) - var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin))*2);font-size:var(--spectrum-tag-text-size,var(--spectrum-global-dimension-font-size-75));cursor:default;white-space:nowrap;text-overflow:ellipsis;outline:0;flex:auto;grid-area:content;overflow:hidden}[dir=ltr] .tags-removable_8407eb{margin-right:0}[dir=rtl] .tags-removable_8407eb{margin-left:0}.spectrum-Tags-item_8407eb{color:var(--spectrum-tag-text-color,var(--spectrum-global-color-gray-700));background-color:var(--spectrum-tag-background-color,var(--spectrum-global-color-gray-75));border-color:var(--spectrum-tag-border-color,var(--spectrum-global-color-gray-600))}.spectrum-Tags-item_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-background-color-hover,var(--spectrum-global-color-gray-75));color:var(--spectrum-tag-text-color-hover,var(--spectrum-global-color-gray-900));border-color:var(--spectrum-tag-border-color-hover,var(--spectrum-global-color-gray-900))}.spectrum-Tags-item_8407eb.focus-ring_8407eb{background-color:var(--spectrum-tag-background-color-key-focus,var(--spectrum-global-color-gray-75));color:var(--spectrum-tag-text-color-key-focus,var(--spectrum-global-color-gray-900));border-color:var(--spectrum-tag-border-color-key-focus,var(--spectrum-alias-border-color-focus))}.spectrum-Tags-item_8407eb.is-selected_8407eb{background-color:var(--spectrum-tag-background-color-selected,var(--spectrum-global-color-gray-700));color:var(--spectrum-tag-text-color-selected,var(--spectrum-global-color-gray-50));border-color:var(--spectrum-tag-border-color-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-background-color-selected-hover,var(--spectrum-global-color-gray-800))}.spectrum-Tags-item_8407eb.is-selected_8407eb.focus-ring_8407eb{box-shadow:0 0 0 2px var(--spectrum-tag-border-color-selected-key-focus,var(--spectrum-alias-border-color-focus));border-color:var(--spectrum-tag-text-color-selected-key-focus,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb{border-color:var(--spectrum-tag-border-color-error-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb .spectrum-Tags-itemIcon_8407eb,.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb .spectrum-Tags-itemLabel_8407eb,.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-text-color-error-selected,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb.focus-ring_8407eb{box-shadow:0 0 0 2px var(--spectrum-tag-border-color-key-focus,var(--spectrum-alias-border-color-focus));border-color:var(--spectrum-tag-border-color-error-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb.is-hovered_8407eb{border-color:var(--spectrum-tag-border-color-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-invalid_8407eb{color:var(--spectrum-tag-icon-color-error,var(--spectrum-global-color-red-500));border-color:var(--spectrum-tag-border-color-error,var(--spectrum-global-color-red-500))}.spectrum-Tags-item_8407eb.is-invalid_8407eb.is-hovered_8407eb{color:var(--spectrum-tag-icon-color-error-hover,var(--spectrum-global-color-red-600));border-color:var(--spectrum-tag-border-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item_8407eb.is-invalid_8407eb.focus-ring_8407eb{color:var(--spectrum-tag-icon-color-error-hover,var(--spectrum-global-color-red-600));border-color:var(--spectrum-tag-border-color-key-focus,var(--spectrum-alias-border-color-focus))}.spectrum-Tags-item_8407eb.is-invalid_8407eb .spectrum-Tags-itemIcon_8407eb,.spectrum-Tags-item_8407eb.is-invalid_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-border-color-error,var(--spectrum-global-color-red-500))}.spectrum-Tags-item_8407eb.is-disabled_8407eb{color:var(--spectrum-tag-text-color-disabled,var(--spectrum-global-color-gray-500));background-color:var(--spectrum-tag-background-color-disabled,var(--spectrum-global-color-gray-200));border-color:var(--spectrum-tag-border-color-disabled,var(--spectrum-global-color-gray-200))}.spectrum-Tags-item_8407eb.is-disabled_8407eb .spectrum-Avatar_8407eb{opacity:var(--spectrum-avatar-small-opacity-disabled,0.3)}.spectrum-Tags-item--removable_8407eb.is-hovered_8407eb{color:var(--spectrum-tag-removable-text-color-hover,var(--spectrum-global-color-gray-900))}.spectrum-Tags-item--removable_8407eb:active{color:var(--spectrum-tag-removable-text-color-down,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb.is-hovered_8407eb{border-color:var(--spectrum-tag-removable-border-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb.is-hovered_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-removable-border-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb .spectrum-Tags-itemClearButton_8407eb.is-focused_8407eb{color:var(--spectrum-tag-icon-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb:active{border-color:var(--spectrum-tag-removable-border-color-error-down,var(--spectrum-global-color-red-700));color:var(--spectrum-tag-removable-text-color-error-down,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-focused_8407eb{color:var(--spectrum-tag-removable-text-color-key-focus,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-focused_8407eb.is-invalid_8407eb{color:var(--spectrum-tag-removable-text-color-error-key-focus,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb{color:var(--spectrum-tag-removable-text-color-selected,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb.is-focused_8407eb{color:var(--spectrum-tag-removable-text-color-selected-key-focus,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-removable-button-icon-color-selected,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb .spectrum-Tags-itemClearButton_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-removable-button-background-color-selected-hover,var(--spectrum-global-color-gray-600));color:var(--spectrum-tag-removable-button-icon-color-selected-hover,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb .spectrum-Tags-itemClearButton_8407eb.is-focused_8407eb{border:2px solid var(--spectrum-tag-removable-border-color-key-focus,var(--spectrum-alias-border-color-focus));border-radius:var(--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50));background-color:var(--spectrum-tag-removable-button-background-color-key-focus,var(--spectrum-global-color-gray-600));color:var(--spectrum-tag-removable-button-icon-color-key-focus,var(--spectrum-global-color-gray-900))}.spectrum-Tags-item--removable_8407eb .spectrum-Tags-itemClearButton_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-removable-button-background-color-hover,var(--spectrum-global-color-gray-300));color:var(--spectrum-tag-removable-button-icon-color-hover,var(--spectrum-global-color-gray-900))}@media (forced-colors:active){.spectrum-Tags-item_8407eb{forced-color-adjust:none;--spectrum-tag-background-color:ButtonFace;--spectrum-tag-background-color-disabled:ButtonFace;--spectrum-tag-background-color-hover:ButtonFace;--spectrum-tag-background-color-key-focus:ButtonFace;--spectrum-tag-background-color-selected:Highlight;--spectrum-tag-background-color-selected-hover:Highlight;--spectrum-tag-border-color:ButtonText;--spectrum-tag-border-color-disabled:GrayText;--spectrum-tag-border-color-error:ButtonText;--spectrum-tag-border-color-error-hover:ButtonText;--spectrum-tag-border-color-error-selected:HighlightText;--spectrum-tag-border-color-hover:Highlight;--spectrum-tag-border-color-key-focus:Highlight;--spectrum-tag-border-color-selected:HighlightText;--spectrum-tag-border-color-selected-key-focus:ButtonText;--spectrum-tag-icon-color-error:ButtonText;--spectrum-tag-icon-color-error-hover:ButtonText;--spectrum-tag-removable-border-color-error-down:Highlight;--spectrum-tag-removable-border-color-error-hover:Highlight;--spectrum-tag-removable-border-color-key-focus:Highlight;--spectrum-tag-removable-button-background-color-hover:ButtonFace;--spectrum-tag-removable-button-background-color-key-focus:ButtonFace;--spectrum-tag-removable-button-background-color-selected-hover:Highlight;--spectrum-tag-removable-button-icon-color-hover:Highlight;--spectrum-tag-removable-button-icon-color-key-focus:Highlight;--spectrum-tag-removable-button-icon-color-selected:HighlightText;--spectrum-tag-removable-button-icon-color-selected-hover:HighlightText;--spectrum-tag-removable-text-color-down:ButtonText;--spectrum-tag-removable-text-color-error-down:Highlight;--spectrum-tag-removable-text-color-error-key-focus:Highlight;--spectrum-tag-removable-text-color-hover:ButtonText;--spectrum-tag-removable-text-color-key-focus:ButtonText;--spectrum-tag-removable-text-color-selected:HighlightText;--spectrum-tag-removable-text-color-selected-key-focus:HighlightText;--spectrum-tag-text-color:ButtonText;--spectrum-tag-text-color-disabled:GrayText;--spectrum-tag-text-color-error-selected:HighlightText;--spectrum-tag-text-color-hover:ButtonText;--spectrum-tag-text-color-key-focus:ButtonText;--spectrum-tag-text-color-selected:HighlightText;--spectrum-tag-text-color-selected-key-focus:HighlightText}}
|
|
1
|
+
.spectrum-Tags-item_8407eb{--spectrum-focus-ring-border-radius:var(--spectrum-textfield-border-radius,var(--spectrum-alias-border-radius-regular));--spectrum-focus-ring-gap:var(--spectrum-alias-input-focusring-gap);--spectrum-focus-ring-size:var(--spectrum-alias-input-focusring-size);--spectrum-focus-ring-border-size:0px;--spectrum-focus-ring-color:var(--spectrum-high-contrast-focus-ring-color,var(--spectrum-alias-focus-ring-color,var(--spectrum-alias-focus-color)))}.spectrum-Tags-item_8407eb:after{border-radius:calc(var(--spectrum-focus-ring-border-radius) + var(--spectrum-focus-ring-gap));content:"";margin:calc(-1*var(--spectrum-focus-ring-border-size));pointer-events:none;transition:box-shadow var(--spectrum-global-animation-duration-100,.13s)ease-out,margin var(--spectrum-global-animation-duration-100,.13s)ease-out;display:block;position:absolute;top:0;bottom:0;left:0;right:0}.spectrum-Tags-item_8407eb.focus-ring_8407eb:after{margin:calc(var(--spectrum-focus-ring-gap)*-1 - var(--spectrum-focus-ring-border-size));box-shadow:0 0 0 var(--spectrum-focus-ring-size)var(--spectrum-focus-ring-color)}.spectrum-Tags_8407eb{flex-wrap:wrap;margin:0;padding:0;list-style:none;display:inline-flex}[dir=ltr] .spectrum-Tags-item_8407eb{padding-left:calc(var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125)) - var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin)))}[dir=rtl] .spectrum-Tags-item_8407eb{padding-right:calc(var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125)) - var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin)))}.spectrum-Tags-item_8407eb{--spectrum-focus-ring-border-radius:var(--spectrum-tag-border-radius,var(--spectrum-alias-border-radius-regular));--spectrum-focus-ring-border-size:var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin));display:-ms-grid;-ms-grid-columns:1fr auto;box-sizing:border-box;margin:calc(var(--spectrum-taggroup-tag-gap-y,var(--spectrum-global-dimension-size-100))/2)calc(var(--spectrum-taggroup-tag-gap-x,var(--spectrum-global-dimension-size-100))/2);height:var(--spectrum-tag-height,var(--spectrum-global-dimension-size-300));max-width:100%;border-width:var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin));border-radius:var(--spectrum-tag-border-radius,var(--spectrum-alias-border-radius-regular));-webkit-user-select:none;user-select:none;transition:border-color var(--spectrum-global-animation-duration-100,.13s)ease-in-out,color var(--spectrum-global-animation-duration-100,.13s)ease-in-out,box-shadow var(--spectrum-global-animation-duration-100,.13s)ease-in-out,background-color var(--spectrum-global-animation-duration-100,.13s)ease-in-out;border-style:solid;outline:none;grid-template-columns:1fr auto;grid-template-areas:"icon content action";align-items:center;display:grid;position:relative}.spectrum-Tags-item_8407eb.is-disabled_8407eb{pointer-events:none}.spectrum-Tags-item_8407eb .spectrum-Tag-action_8407eb{height:calc(var(--spectrum-tag-height,var(--spectrum-global-dimension-size-300)) - 2*var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin)));width:var(--spectrum-global-dimension-size-300);grid-area:action}[dir=ltr] .spectrum-Tag-icon_8407eb{margin-right:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Tag-icon_8407eb{margin-left:var(--spectrum-global-dimension-size-100)}.spectrum-Tag-icon_8407eb{grid-area:icon}[dir=ltr] .spectrum-Tag-content_8407eb{margin-right:var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125))}[dir=rtl] .spectrum-Tag-content_8407eb{margin-left:var(--spectrum-tag-padding-x,var(--spectrum-global-dimension-size-125))}.spectrum-Tag-content_8407eb{height:100%;line-height:calc(var(--spectrum-tag-height,var(--spectrum-global-dimension-size-300)) - var(--spectrum-tag-border-size,var(--spectrum-alias-border-size-thin))*2);font-size:var(--spectrum-tag-text-size,var(--spectrum-global-dimension-font-size-75));cursor:default;white-space:nowrap;text-overflow:ellipsis;outline:none;flex:auto;grid-area:content;overflow:hidden}[dir=ltr] .tags-removable_8407eb{margin-right:0}[dir=rtl] .tags-removable_8407eb{margin-left:0}.spectrum-Tags-item_8407eb{color:var(--spectrum-tag-text-color,var(--spectrum-global-color-gray-700));background-color:var(--spectrum-tag-background-color,var(--spectrum-global-color-gray-75));border-color:var(--spectrum-tag-border-color,var(--spectrum-global-color-gray-600))}.spectrum-Tags-item_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-background-color-hover,var(--spectrum-global-color-gray-75));color:var(--spectrum-tag-text-color-hover,var(--spectrum-global-color-gray-900));border-color:var(--spectrum-tag-border-color-hover,var(--spectrum-global-color-gray-900))}.spectrum-Tags-item_8407eb.focus-ring_8407eb{background-color:var(--spectrum-tag-background-color-key-focus,var(--spectrum-global-color-gray-75));color:var(--spectrum-tag-text-color-key-focus,var(--spectrum-global-color-gray-900));border-color:var(--spectrum-tag-border-color-key-focus,var(--spectrum-alias-border-color-focus))}.spectrum-Tags-item_8407eb.is-selected_8407eb{background-color:var(--spectrum-tag-background-color-selected,var(--spectrum-global-color-gray-700));color:var(--spectrum-tag-text-color-selected,var(--spectrum-global-color-gray-50));border-color:var(--spectrum-tag-border-color-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-background-color-selected-hover,var(--spectrum-global-color-gray-800))}.spectrum-Tags-item_8407eb.is-selected_8407eb.focus-ring_8407eb{box-shadow:0 0 0 2px var(--spectrum-tag-border-color-selected-key-focus,var(--spectrum-alias-border-color-focus));border-color:var(--spectrum-tag-text-color-selected-key-focus,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb{border-color:var(--spectrum-tag-border-color-error-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb .spectrum-Tags-itemIcon_8407eb,.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb .spectrum-Tags-itemLabel_8407eb,.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-text-color-error-selected,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb.focus-ring_8407eb{box-shadow:0 0 0 2px var(--spectrum-tag-border-color-key-focus,var(--spectrum-alias-border-color-focus));border-color:var(--spectrum-tag-border-color-error-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-selected_8407eb.is-invalid_8407eb.is-hovered_8407eb{border-color:var(--spectrum-tag-border-color-selected,var(--spectrum-alias-border-color-transparent))}.spectrum-Tags-item_8407eb.is-invalid_8407eb{color:var(--spectrum-tag-icon-color-error,var(--spectrum-global-color-red-500));border-color:var(--spectrum-tag-border-color-error,var(--spectrum-global-color-red-500))}.spectrum-Tags-item_8407eb.is-invalid_8407eb.is-hovered_8407eb{color:var(--spectrum-tag-icon-color-error-hover,var(--spectrum-global-color-red-600));border-color:var(--spectrum-tag-border-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item_8407eb.is-invalid_8407eb.focus-ring_8407eb{color:var(--spectrum-tag-icon-color-error-hover,var(--spectrum-global-color-red-600));border-color:var(--spectrum-tag-border-color-key-focus,var(--spectrum-alias-border-color-focus))}.spectrum-Tags-item_8407eb.is-invalid_8407eb .spectrum-Tags-itemIcon_8407eb,.spectrum-Tags-item_8407eb.is-invalid_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-border-color-error,var(--spectrum-global-color-red-500))}.spectrum-Tags-item_8407eb.is-disabled_8407eb{color:var(--spectrum-tag-text-color-disabled,var(--spectrum-global-color-gray-500));background-color:var(--spectrum-tag-background-color-disabled,var(--spectrum-global-color-gray-200));border-color:var(--spectrum-tag-border-color-disabled,var(--spectrum-global-color-gray-200))}.spectrum-Tags-item_8407eb.is-disabled_8407eb .spectrum-Avatar_8407eb{opacity:var(--spectrum-avatar-small-opacity-disabled,.3)}.spectrum-Tags-item--removable_8407eb.is-hovered_8407eb{color:var(--spectrum-tag-removable-text-color-hover,var(--spectrum-global-color-gray-900))}.spectrum-Tags-item--removable_8407eb:active{color:var(--spectrum-tag-removable-text-color-down,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb.is-hovered_8407eb{border-color:var(--spectrum-tag-removable-border-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb.is-hovered_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-removable-border-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb .spectrum-Tags-itemClearButton_8407eb.is-focused_8407eb{color:var(--spectrum-tag-icon-color-error-hover,var(--spectrum-global-color-red-600))}.spectrum-Tags-item--removable_8407eb.is-invalid_8407eb:active{border-color:var(--spectrum-tag-removable-border-color-error-down,var(--spectrum-global-color-red-700));color:var(--spectrum-tag-removable-text-color-error-down,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-focused_8407eb{color:var(--spectrum-tag-removable-text-color-key-focus,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-focused_8407eb.is-invalid_8407eb{color:var(--spectrum-tag-removable-text-color-error-key-focus,var(--spectrum-global-color-gray-700))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb{color:var(--spectrum-tag-removable-text-color-selected,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb.is-focused_8407eb{color:var(--spectrum-tag-removable-text-color-selected-key-focus,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb .spectrum-Tags-itemClearButton_8407eb{color:var(--spectrum-tag-removable-button-icon-color-selected,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb.is-selected_8407eb .spectrum-Tags-itemClearButton_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-removable-button-background-color-selected-hover,var(--spectrum-global-color-gray-600));color:var(--spectrum-tag-removable-button-icon-color-selected-hover,var(--spectrum-global-color-gray-50))}.spectrum-Tags-item--removable_8407eb .spectrum-Tags-itemClearButton_8407eb.is-focused_8407eb{border:2px solid var(--spectrum-tag-removable-border-color-key-focus,var(--spectrum-alias-border-color-focus));border-radius:var(--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50));background-color:var(--spectrum-tag-removable-button-background-color-key-focus,var(--spectrum-global-color-gray-600));color:var(--spectrum-tag-removable-button-icon-color-key-focus,var(--spectrum-global-color-gray-900))}.spectrum-Tags-item--removable_8407eb .spectrum-Tags-itemClearButton_8407eb.is-hovered_8407eb{background-color:var(--spectrum-tag-removable-button-background-color-hover,var(--spectrum-global-color-gray-300));color:var(--spectrum-tag-removable-button-icon-color-hover,var(--spectrum-global-color-gray-900))}@media (forced-colors:active){.spectrum-Tags-item_8407eb{forced-color-adjust:none;--spectrum-tag-background-color:ButtonFace;--spectrum-tag-background-color-disabled:ButtonFace;--spectrum-tag-background-color-hover:ButtonFace;--spectrum-tag-background-color-key-focus:ButtonFace;--spectrum-tag-background-color-selected:Highlight;--spectrum-tag-background-color-selected-hover:Highlight;--spectrum-tag-border-color:ButtonText;--spectrum-tag-border-color-disabled:GrayText;--spectrum-tag-border-color-error:ButtonText;--spectrum-tag-border-color-error-hover:ButtonText;--spectrum-tag-border-color-error-selected:HighlightText;--spectrum-tag-border-color-hover:Highlight;--spectrum-tag-border-color-key-focus:Highlight;--spectrum-tag-border-color-selected:HighlightText;--spectrum-tag-border-color-selected-key-focus:ButtonText;--spectrum-tag-icon-color-error:ButtonText;--spectrum-tag-icon-color-error-hover:ButtonText;--spectrum-tag-removable-border-color-error-down:Highlight;--spectrum-tag-removable-border-color-error-hover:Highlight;--spectrum-tag-removable-border-color-key-focus:Highlight;--spectrum-tag-removable-button-background-color-hover:ButtonFace;--spectrum-tag-removable-button-background-color-key-focus:ButtonFace;--spectrum-tag-removable-button-background-color-selected-hover:Highlight;--spectrum-tag-removable-button-icon-color-hover:Highlight;--spectrum-tag-removable-button-icon-color-key-focus:Highlight;--spectrum-tag-removable-button-icon-color-selected:HighlightText;--spectrum-tag-removable-button-icon-color-selected-hover:HighlightText;--spectrum-tag-removable-text-color-down:ButtonText;--spectrum-tag-removable-text-color-error-down:Highlight;--spectrum-tag-removable-text-color-error-key-focus:Highlight;--spectrum-tag-removable-text-color-hover:ButtonText;--spectrum-tag-removable-text-color-key-focus:ButtonText;--spectrum-tag-removable-text-color-selected:HighlightText;--spectrum-tag-removable-text-color-selected-key-focus:HighlightText;--spectrum-tag-text-color:ButtonText;--spectrum-tag-text-color-disabled:GrayText;--spectrum-tag-text-color-error-selected:HighlightText;--spectrum-tag-text-color-hover:ButtonText;--spectrum-tag-text-color-key-focus:ButtonText;--spectrum-tag-text-color-selected:HighlightText;--spectrum-tag-text-color-selected-key-focus:HighlightText}}
|
package/dist/main.js
CHANGED
|
@@ -23,7 +23,27 @@ function $parcel$interopDefault(a) {
|
|
|
23
23
|
|
|
24
24
|
$parcel$export(module.exports, "TagGroup", () => $e7b72d8874e98cd4$export$67ea30858aaf75e3);
|
|
25
25
|
$parcel$export(module.exports, "Item", () => $dTV3V$reactstatelycollections.Item);
|
|
26
|
-
|
|
26
|
+
/*
|
|
27
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
28
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
29
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
30
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
31
|
+
*
|
|
32
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
33
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
34
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
35
|
+
* governing permissions and limitations under the License.
|
|
36
|
+
*/ /*
|
|
37
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
38
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
39
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
40
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
41
|
+
*
|
|
42
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
43
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
44
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
45
|
+
* governing permissions and limitations under the License.
|
|
46
|
+
*/
|
|
27
47
|
|
|
28
48
|
|
|
29
49
|
|
|
@@ -82,7 +102,17 @@ $ed889f8f1f091fc8$export$c1666977f4e14f87 = "spectrum-Tags-item--removable_8407e
|
|
|
82
102
|
$ed889f8f1f091fc8$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
83
103
|
|
|
84
104
|
|
|
85
|
-
|
|
105
|
+
/*
|
|
106
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
107
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
108
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
109
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
110
|
+
*
|
|
111
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
112
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
113
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
114
|
+
* governing permissions and limitations under the License.
|
|
115
|
+
*/
|
|
86
116
|
|
|
87
117
|
|
|
88
118
|
|
|
@@ -94,15 +124,14 @@ $ed889f8f1f091fc8$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
|
94
124
|
function $dd2c5d00108c1840$export$3288d34c523a1192(props) {
|
|
95
125
|
const { children: children , allowsRemoving: allowsRemoving , item: item , state: state , onRemove: onRemove , ...otherProps } = props;
|
|
96
126
|
// @ts-ignore
|
|
97
|
-
let { styleProps: styleProps } = $dTV3V$reactspectrumutils.useStyleProps(otherProps);
|
|
98
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $dTV3V$reactariainteractions.useHover({
|
|
99
|
-
})
|
|
100
|
-
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $dTV3V$reactariafocus.useFocusRing({
|
|
127
|
+
let { styleProps: styleProps } = (0, $dTV3V$reactspectrumutils.useStyleProps)(otherProps);
|
|
128
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $dTV3V$reactariainteractions.useHover)({});
|
|
129
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $dTV3V$reactariafocus.useFocusRing)({
|
|
101
130
|
within: true
|
|
102
131
|
});
|
|
103
|
-
let tagRef = $dTV3V$react.useRef();
|
|
104
|
-
let tagRowRef = $dTV3V$react.useRef();
|
|
105
|
-
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = $dTV3V$reactariatag.useTag({
|
|
132
|
+
let tagRef = (0, $dTV3V$react.useRef)();
|
|
133
|
+
let tagRowRef = (0, $dTV3V$react.useRef)();
|
|
134
|
+
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = (0, $dTV3V$reactariatag.useTag)({
|
|
106
135
|
...props,
|
|
107
136
|
isFocused: isFocused,
|
|
108
137
|
allowsRemoving: allowsRemoving,
|
|
@@ -111,47 +140,47 @@ function $dd2c5d00108c1840$export$3288d34c523a1192(props) {
|
|
|
111
140
|
tagRef: tagRef,
|
|
112
141
|
tagRowRef: tagRowRef
|
|
113
142
|
}, state);
|
|
114
|
-
return
|
|
143
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement("div", {
|
|
115
144
|
...tagRowProps,
|
|
116
145
|
ref: tagRowRef
|
|
117
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement("div", {
|
|
118
|
-
|
|
119
|
-
className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
146
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement("div", {
|
|
147
|
+
...(0, $dTV3V$reactariautils.mergeProps)(tagProps, hoverProps, focusProps),
|
|
148
|
+
className: (0, $dTV3V$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports))), "spectrum-Tags-item", {
|
|
149
|
+
"focus-ring": isFocusVisible,
|
|
150
|
+
"is-focused": isFocused,
|
|
151
|
+
"is-hovered": isHovered
|
|
123
152
|
}, styleProps.className),
|
|
124
153
|
ref: tagRef
|
|
125
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dTV3V$reactspectrumutils.SlotProvider, {
|
|
154
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement((0, $dTV3V$reactspectrumutils.SlotProvider), {
|
|
126
155
|
slots: {
|
|
127
156
|
icon: {
|
|
128
|
-
UNSAFE_className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)),
|
|
129
|
-
size:
|
|
157
|
+
UNSAFE_className: (0, $dTV3V$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports))), "spectrum-Tag-icon"),
|
|
158
|
+
size: "XS"
|
|
130
159
|
},
|
|
131
160
|
text: {
|
|
132
|
-
UNSAFE_className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)),
|
|
133
|
-
|
|
161
|
+
UNSAFE_className: (0, $dTV3V$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports))), "spectrum-Tag-content", {
|
|
162
|
+
"tags-removable": allowsRemoving
|
|
134
163
|
}),
|
|
135
164
|
...labelProps
|
|
136
165
|
}
|
|
137
166
|
}
|
|
138
|
-
}, typeof children ===
|
|
167
|
+
}, typeof children === "string" ? /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement((0, $dTV3V$reactspectrumtext.Text), null, children) : children, allowsRemoving && /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement($dd2c5d00108c1840$var$TagRemoveButton, {
|
|
139
168
|
item: item,
|
|
140
169
|
...clearButtonProps,
|
|
141
|
-
UNSAFE_className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)),
|
|
142
|
-
}))))
|
|
170
|
+
UNSAFE_className: (0, $dTV3V$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports))), "spectrum-Tag-action")
|
|
171
|
+
}))));
|
|
143
172
|
}
|
|
144
173
|
function $dd2c5d00108c1840$var$TagRemoveButton(props) {
|
|
145
|
-
props = $dTV3V$reactspectrumutils.useSlotProps(props,
|
|
146
|
-
let { styleProps: styleProps } = $dTV3V$reactspectrumutils.useStyleProps(props);
|
|
147
|
-
let clearBtnRef = $dTV3V$react.useRef();
|
|
148
|
-
return
|
|
174
|
+
props = (0, $dTV3V$reactspectrumutils.useSlotProps)(props, "tagRemoveButton");
|
|
175
|
+
let { styleProps: styleProps } = (0, $dTV3V$reactspectrumutils.useStyleProps)(props);
|
|
176
|
+
let clearBtnRef = (0, $dTV3V$react.useRef)();
|
|
177
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement("span", {
|
|
149
178
|
...styleProps,
|
|
150
179
|
ref: clearBtnRef
|
|
151
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dTV3V$reactspectrumbutton.ClearButton, {
|
|
180
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement((0, $dTV3V$reactspectrumbutton.ClearButton), {
|
|
152
181
|
preventFocus: true,
|
|
153
182
|
...props
|
|
154
|
-
}))
|
|
183
|
+
}));
|
|
155
184
|
}
|
|
156
185
|
|
|
157
186
|
|
|
@@ -161,13 +190,13 @@ function $dd2c5d00108c1840$var$TagRemoveButton(props) {
|
|
|
161
190
|
|
|
162
191
|
|
|
163
192
|
function $e7b72d8874e98cd4$var$TagGroup(props, ref) {
|
|
164
|
-
props = $dTV3V$reactspectrumprovider.useProviderProps(props);
|
|
193
|
+
props = (0, $dTV3V$reactspectrumprovider.useProviderProps)(props);
|
|
165
194
|
let { allowsRemoving: allowsRemoving , onRemove: onRemove , ...otherProps } = props;
|
|
166
|
-
let domRef = $dTV3V$reactspectrumutils.useDOMRef(ref);
|
|
167
|
-
let { styleProps: styleProps } = $dTV3V$reactspectrumutils.useStyleProps(otherProps);
|
|
168
|
-
let { direction: direction } = $dTV3V$reactariai18n.useLocale();
|
|
169
|
-
let listState = $dTV3V$reactstatelylist.useListState(props);
|
|
170
|
-
let gridCollection = $dTV3V$react.useMemo(()=>new $dTV3V$reactstatelygrid.GridCollection({
|
|
195
|
+
let domRef = (0, $dTV3V$reactspectrumutils.useDOMRef)(ref);
|
|
196
|
+
let { styleProps: styleProps } = (0, $dTV3V$reactspectrumutils.useStyleProps)(otherProps);
|
|
197
|
+
let { direction: direction } = (0, $dTV3V$reactariai18n.useLocale)();
|
|
198
|
+
let listState = (0, $dTV3V$reactstatelylist.useListState)(props);
|
|
199
|
+
let gridCollection = (0, $dTV3V$react.useMemo)(()=>new (0, $dTV3V$reactstatelygrid.GridCollection)({
|
|
171
200
|
columnCount: 1,
|
|
172
201
|
items: [
|
|
173
202
|
...listState.collection
|
|
@@ -176,57 +205,55 @@ function $e7b72d8874e98cd4$var$TagGroup(props, ref) {
|
|
|
176
205
|
{
|
|
177
206
|
...item,
|
|
178
207
|
index: 0,
|
|
179
|
-
type:
|
|
208
|
+
type: "cell"
|
|
180
209
|
}
|
|
181
210
|
];
|
|
182
211
|
return {
|
|
183
|
-
type:
|
|
212
|
+
type: "item",
|
|
184
213
|
childNodes: childNodes
|
|
185
214
|
};
|
|
186
215
|
})
|
|
187
|
-
})
|
|
188
|
-
, [
|
|
216
|
+
}), [
|
|
189
217
|
listState.collection,
|
|
190
218
|
allowsRemoving
|
|
191
219
|
]);
|
|
192
|
-
let state = $dTV3V$reactstatelygrid.useGridState({
|
|
220
|
+
let state = (0, $dTV3V$reactstatelygrid.useGridState)({
|
|
193
221
|
...props,
|
|
194
222
|
collection: gridCollection,
|
|
195
|
-
focusMode:
|
|
223
|
+
focusMode: "cell"
|
|
196
224
|
});
|
|
197
|
-
let keyboardDelegate = new $dTV3V$reactariatag.TagKeyboardDelegate({
|
|
225
|
+
let keyboardDelegate = new (0, $dTV3V$reactariatag.TagKeyboardDelegate)({
|
|
198
226
|
collection: state.collection,
|
|
199
227
|
disabledKeys: new Set(),
|
|
200
228
|
ref: domRef,
|
|
201
229
|
direction: direction,
|
|
202
|
-
focusMode:
|
|
230
|
+
focusMode: "cell"
|
|
203
231
|
});
|
|
204
|
-
let { gridProps: gridProps } = $dTV3V$reactariagrid.useGrid({
|
|
232
|
+
let { gridProps: gridProps } = (0, $dTV3V$reactariagrid.useGrid)({
|
|
205
233
|
...props,
|
|
206
234
|
keyboardDelegate: keyboardDelegate
|
|
207
235
|
}, state, domRef);
|
|
208
|
-
const { tagGroupProps: tagGroupProps } = $dTV3V$reactariatag.useTagGroup(props);
|
|
236
|
+
const { tagGroupProps: tagGroupProps } = (0, $dTV3V$reactariatag.useTagGroup)(props);
|
|
209
237
|
// Don't want the grid to be focusable or accessible via keyboard
|
|
210
238
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
211
239
|
let { tabIndex: tabIndex , role: role , ...otherGridProps } = gridProps;
|
|
212
|
-
return
|
|
213
|
-
|
|
214
|
-
className: $dTV3V$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports)),
|
|
215
|
-
role: state.collection.size ?
|
|
240
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement("div", {
|
|
241
|
+
...(0, $dTV3V$reactariautils.mergeProps)(styleProps, tagGroupProps, otherGridProps),
|
|
242
|
+
className: (0, $dTV3V$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ed889f8f1f091fc8$exports))), "spectrum-Tags", styleProps.className),
|
|
243
|
+
role: state.collection.size ? "grid" : null,
|
|
216
244
|
ref: domRef
|
|
217
245
|
}, [
|
|
218
246
|
...gridCollection
|
|
219
|
-
].map((item)=>/*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).createElement($dd2c5d00108c1840$export$3288d34c523a1192, {
|
|
247
|
+
].map((item)=>/*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).createElement((0, $dd2c5d00108c1840$export$3288d34c523a1192), {
|
|
220
248
|
...item.childNodes[0].props,
|
|
221
249
|
key: item.key,
|
|
222
250
|
item: item,
|
|
223
251
|
state: state,
|
|
224
252
|
allowsRemoving: allowsRemoving,
|
|
225
253
|
onRemove: onRemove
|
|
226
|
-
}, item.childNodes[0].rendered)
|
|
227
|
-
)));
|
|
254
|
+
}, item.childNodes[0].rendered)));
|
|
228
255
|
}
|
|
229
|
-
/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */ const $e7b72d8874e98cd4$export$67ea30858aaf75e3 = /*#__PURE__*/ ($parcel$interopDefault($dTV3V$react)).forwardRef($e7b72d8874e98cd4$var$TagGroup);
|
|
256
|
+
/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */ const $e7b72d8874e98cd4$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, ($parcel$interopDefault($dTV3V$react))).forwardRef($e7b72d8874e98cd4$var$TagGroup);
|
|
230
257
|
|
|
231
258
|
|
|
232
259
|
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAoC;AACpC,GAA4B;AAC5B,GAA+B;AAC/B,GAA6B;AAC7B,GAAqC;AACrC,GAAmC;AACnC,GAAsC;AACtC,GAAgC;AAChC,GAA4B;AAC5B,GAA6B;AAC7B,GAA4B;AAC5B,GAAwC;AACxC,GAAyC;AACzC,GAA+C;AAC/C,GAAiC;AACjC,GAA+C;AAC/C,GAA4B;AAhB5B,yCAAoC,GAAG,CAA2B;AAClE,yCAA4B,GAAG,CAAmB;AAClD,yCAA+B,GAAG,CAAsB;AACxD,yCAA6B,GAAG,CAAoB;AACpD,yCAAqC,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,MAAM;IAChB,KAAK,CAAC,CAAC,gBAAA,aAAa,EAAA,CAAC,GAAG,+BAAW,CAAC,KAAK;IAEzC,EAAiE,AAAjE,+DAAiE;IACjE,EAA6D,AAA7D,2DAA6D;IAC7D,GAAG,CAAC,CAAC,WAAA,QAAQ,SAAE,IAAI,MAAK,cAAc,CAAA,CAAC,GAAG,SAAS;IACnD,MAAM,oEACH,CAAG;WACE,gCAAU,CAAC,UAAU,EAAE,aAAa,EAAE,cAAc;QACxD,SAAS,EACP,oCAAU,CACR,gEAAM,EACN,CAAe,gBACf,UAAU,CAAC,SAAS;QAGxB,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,CAAM,QAAG,IAAI;QAC3C,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,cAAc,EAAE,cAAc;YAC9B,QAAQ,EAAE,QAAQ;WACjB,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ;;AAKtC,CAAC;AAED,EAA8I,AAA9I,0IAA8I,AAA9I,EAA8I,CAC9I,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\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 {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 allowsRemoving,\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: 1, // unused, but required for grid collections\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n return {\n type: 'item',\n childNodes\n };\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [listState.collection, allowsRemoving]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: new Set(),\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);\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, role, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\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 {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n allowsRemoving={allowsRemoving}\n onRemove={onRemove}>\n {item.childNodes[0].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, 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 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 tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isFocused,\n allowsRemoving,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}\n ref={tagRowRef}>\n <div\n {...mergeProps(tagProps, 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 },\n styleProps.className\n )}\n ref={tagRef}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': allowsRemoving}), ...labelProps}\n }}>\n\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n {allowsRemoving && <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":";;;;;;;;;;;;;;;;;;;;;;;;;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;AAhBA,4CAAuC;AACvC,4CAA+B;AAC/B,4CAAkC;AAClC,4CAAgC;AAChC,4CAAwC;AACxC,4CAAsC;AACtC,4CAAyC;AACzC,4CAAmC;AACnC,4CAA+B;AAC/B,4CAAgC;AAChC,4CAA+B;AAC/B,4CAA2C;AAC3C,4CAA4C;AAC5C,4CAAkD;AAClD,4CAAoC;AACpC,4CAAkD;AAClD,4CAA+B;;;AChB/B;;;;;;;;;;CAUC,GAED;;;;;;;;;AAWO,SAAS,0CAAO,KAA0B,EAAE;IACjD,MAAM,YACJ,SAAQ,kBACR,eAAc,QACd,KAAI,SACJ,MAAK,YACL,SAAQ,EACR,GAAG,YACJ,GAAG;IAEJ,aAAa;IACb,IAAI,cAAC,WAAU,EAAC,GAAG,CAAA,GAAA,uCAAa,AAAD,EAAE;IACjC,IAAI,cAAC,WAAU,aAAE,UAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE,CAAC;IACxC,IAAI,aAAC,UAAS,kBAAE,eAAc,cAAE,WAAU,EAAC,GAAG,CAAA,GAAA,k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W,AAAD,EAAE;IAEpC,iEAAiE;IACjE,6DAA6D;IAC7D,IAAI,YAAC,SAAQ,QAAE,KAAI,EAAE,GAAG,gBAAe,GAAG;IAC1C,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,eAAe,eAAe;QACzD,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,yDAAM,OAAD,GACL,iBACA,WAAW,SAAS;QAGxB,MAAM,MAAM,UAAU,CAAC,IAAI,GAAG,SAAS,IAAI;QAC3C,KAAK;OACJ;WAAI;KAAe,CAAC,GAAG,CAAC,CAAA,qBACvB,0DAAC,CAAA,GAAA,yCAAE;YACA,GAAG,KAAK,UAAU,CAAC,EAAE,CAAC,KAAK;YAC5B,KAAK,KAAK,GAAG;YACb,MAAM;YACN,OAAO;YACP,gBAAgB;YAChB,UAAU;WACT,KAAK,UAAU,CAAC,EAAE,CAAC,QAAQ;AAKtC;AAEA,4IAA4I,GAC5I,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;;CD7FlC,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 {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 allowsRemoving,\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: 1, // unused, but required for grid collections\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n return {\n type: 'item',\n childNodes\n };\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [listState.collection, allowsRemoving]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: new Set(),\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);\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, role, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\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 {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n allowsRemoving={allowsRemoving}\n onRemove={onRemove}>\n {item.childNodes[0].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, 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 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 tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isFocused,\n allowsRemoving,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}\n ref={tagRowRef}>\n <div\n {...mergeProps(tagProps, 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 },\n styleProps.className\n )}\n ref={tagRef}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': allowsRemoving}), ...labelProps}\n }}>\n\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n {allowsRemoving && <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.mjs
CHANGED
|
@@ -20,7 +20,27 @@ function $parcel$interopDefault(a) {
|
|
|
20
20
|
function $parcel$export(e, n, v, s) {
|
|
21
21
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/*
|
|
24
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
25
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
26
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
27
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
28
|
+
*
|
|
29
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
30
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
31
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
32
|
+
* governing permissions and limitations under the License.
|
|
33
|
+
*/ /*
|
|
34
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
35
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
36
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
37
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
38
|
+
*
|
|
39
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
40
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
41
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
42
|
+
* governing permissions and limitations under the License.
|
|
43
|
+
*/
|
|
24
44
|
|
|
25
45
|
|
|
26
46
|
|
|
@@ -79,7 +99,17 @@ $c033a7c057e84ef1$export$c1666977f4e14f87 = "spectrum-Tags-item--removable_8407e
|
|
|
79
99
|
$c033a7c057e84ef1$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
80
100
|
|
|
81
101
|
|
|
82
|
-
|
|
102
|
+
/*
|
|
103
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
104
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
105
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
106
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
107
|
+
*
|
|
108
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
109
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
110
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
111
|
+
* governing permissions and limitations under the License.
|
|
112
|
+
*/
|
|
83
113
|
|
|
84
114
|
|
|
85
115
|
|
|
@@ -91,15 +121,14 @@ $c033a7c057e84ef1$export$e7dc768d35940237 = "is-focused_8407eb";
|
|
|
91
121
|
function $b5f5ee35d3b6b95c$export$3288d34c523a1192(props) {
|
|
92
122
|
const { children: children , allowsRemoving: allowsRemoving , item: item , state: state , onRemove: onRemove , ...otherProps } = props;
|
|
93
123
|
// @ts-ignore
|
|
94
|
-
let { styleProps: styleProps } = $fUaQ2$useStyleProps(otherProps);
|
|
95
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $fUaQ2$useHover({
|
|
96
|
-
})
|
|
97
|
-
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $fUaQ2$useFocusRing({
|
|
124
|
+
let { styleProps: styleProps } = (0, $fUaQ2$useStyleProps)(otherProps);
|
|
125
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $fUaQ2$useHover)({});
|
|
126
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $fUaQ2$useFocusRing)({
|
|
98
127
|
within: true
|
|
99
128
|
});
|
|
100
|
-
let tagRef = $fUaQ2$useRef();
|
|
101
|
-
let tagRowRef = $fUaQ2$useRef();
|
|
102
|
-
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = $fUaQ2$useTag({
|
|
129
|
+
let tagRef = (0, $fUaQ2$useRef)();
|
|
130
|
+
let tagRowRef = (0, $fUaQ2$useRef)();
|
|
131
|
+
let { clearButtonProps: clearButtonProps , labelProps: labelProps , tagProps: tagProps , tagRowProps: tagRowProps } = (0, $fUaQ2$useTag)({
|
|
103
132
|
...props,
|
|
104
133
|
isFocused: isFocused,
|
|
105
134
|
allowsRemoving: allowsRemoving,
|
|
@@ -108,47 +137,47 @@ function $b5f5ee35d3b6b95c$export$3288d34c523a1192(props) {
|
|
|
108
137
|
tagRef: tagRef,
|
|
109
138
|
tagRowRef: tagRowRef
|
|
110
139
|
}, state);
|
|
111
|
-
return
|
|
140
|
+
return /*#__PURE__*/ (0, $fUaQ2$react).createElement("div", {
|
|
112
141
|
...tagRowProps,
|
|
113
142
|
ref: tagRowRef
|
|
114
|
-
}, /*#__PURE__*/ $fUaQ2$react.createElement("div", {
|
|
115
|
-
|
|
116
|
-
className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
143
|
+
}, /*#__PURE__*/ (0, $fUaQ2$react).createElement("div", {
|
|
144
|
+
...(0, $fUaQ2$mergeProps)(tagProps, hoverProps, focusProps),
|
|
145
|
+
className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags-item", {
|
|
146
|
+
"focus-ring": isFocusVisible,
|
|
147
|
+
"is-focused": isFocused,
|
|
148
|
+
"is-hovered": isHovered
|
|
120
149
|
}, styleProps.className),
|
|
121
150
|
ref: tagRef
|
|
122
|
-
}, /*#__PURE__*/ $fUaQ2$react.createElement($fUaQ2$SlotProvider, {
|
|
151
|
+
}, /*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $fUaQ2$SlotProvider), {
|
|
123
152
|
slots: {
|
|
124
153
|
icon: {
|
|
125
|
-
UNSAFE_className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)),
|
|
126
|
-
size:
|
|
154
|
+
UNSAFE_className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tag-icon"),
|
|
155
|
+
size: "XS"
|
|
127
156
|
},
|
|
128
157
|
text: {
|
|
129
|
-
UNSAFE_className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)),
|
|
130
|
-
|
|
158
|
+
UNSAFE_className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tag-content", {
|
|
159
|
+
"tags-removable": allowsRemoving
|
|
131
160
|
}),
|
|
132
161
|
...labelProps
|
|
133
162
|
}
|
|
134
163
|
}
|
|
135
|
-
}, typeof children ===
|
|
164
|
+
}, typeof children === "string" ? /*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $fUaQ2$Text), null, children) : children, allowsRemoving && /*#__PURE__*/ (0, $fUaQ2$react).createElement($b5f5ee35d3b6b95c$var$TagRemoveButton, {
|
|
136
165
|
item: item,
|
|
137
166
|
...clearButtonProps,
|
|
138
|
-
UNSAFE_className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)),
|
|
139
|
-
}))))
|
|
167
|
+
UNSAFE_className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tag-action")
|
|
168
|
+
}))));
|
|
140
169
|
}
|
|
141
170
|
function $b5f5ee35d3b6b95c$var$TagRemoveButton(props) {
|
|
142
|
-
props = $fUaQ2$useSlotProps(props,
|
|
143
|
-
let { styleProps: styleProps } = $fUaQ2$useStyleProps(props);
|
|
144
|
-
let clearBtnRef = $fUaQ2$useRef();
|
|
145
|
-
return
|
|
171
|
+
props = (0, $fUaQ2$useSlotProps)(props, "tagRemoveButton");
|
|
172
|
+
let { styleProps: styleProps } = (0, $fUaQ2$useStyleProps)(props);
|
|
173
|
+
let clearBtnRef = (0, $fUaQ2$useRef)();
|
|
174
|
+
return /*#__PURE__*/ (0, $fUaQ2$react).createElement("span", {
|
|
146
175
|
...styleProps,
|
|
147
176
|
ref: clearBtnRef
|
|
148
|
-
}, /*#__PURE__*/ $fUaQ2$react.createElement($fUaQ2$ClearButton, {
|
|
177
|
+
}, /*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $fUaQ2$ClearButton), {
|
|
149
178
|
preventFocus: true,
|
|
150
179
|
...props
|
|
151
|
-
}))
|
|
180
|
+
}));
|
|
152
181
|
}
|
|
153
182
|
|
|
154
183
|
|
|
@@ -158,13 +187,13 @@ function $b5f5ee35d3b6b95c$var$TagRemoveButton(props) {
|
|
|
158
187
|
|
|
159
188
|
|
|
160
189
|
function $880d112c7a588209$var$TagGroup(props, ref) {
|
|
161
|
-
props = $fUaQ2$useProviderProps(props);
|
|
190
|
+
props = (0, $fUaQ2$useProviderProps)(props);
|
|
162
191
|
let { allowsRemoving: allowsRemoving , onRemove: onRemove , ...otherProps } = props;
|
|
163
|
-
let domRef = $fUaQ2$useDOMRef(ref);
|
|
164
|
-
let { styleProps: styleProps } = $fUaQ2$useStyleProps(otherProps);
|
|
165
|
-
let { direction: direction } = $fUaQ2$useLocale();
|
|
166
|
-
let listState = $fUaQ2$useListState(props);
|
|
167
|
-
let gridCollection = $fUaQ2$useMemo(()=>new $fUaQ2$GridCollection({
|
|
192
|
+
let domRef = (0, $fUaQ2$useDOMRef)(ref);
|
|
193
|
+
let { styleProps: styleProps } = (0, $fUaQ2$useStyleProps)(otherProps);
|
|
194
|
+
let { direction: direction } = (0, $fUaQ2$useLocale)();
|
|
195
|
+
let listState = (0, $fUaQ2$useListState)(props);
|
|
196
|
+
let gridCollection = (0, $fUaQ2$useMemo)(()=>new (0, $fUaQ2$GridCollection)({
|
|
168
197
|
columnCount: 1,
|
|
169
198
|
items: [
|
|
170
199
|
...listState.collection
|
|
@@ -173,57 +202,55 @@ function $880d112c7a588209$var$TagGroup(props, ref) {
|
|
|
173
202
|
{
|
|
174
203
|
...item,
|
|
175
204
|
index: 0,
|
|
176
|
-
type:
|
|
205
|
+
type: "cell"
|
|
177
206
|
}
|
|
178
207
|
];
|
|
179
208
|
return {
|
|
180
|
-
type:
|
|
209
|
+
type: "item",
|
|
181
210
|
childNodes: childNodes
|
|
182
211
|
};
|
|
183
212
|
})
|
|
184
|
-
})
|
|
185
|
-
, [
|
|
213
|
+
}), [
|
|
186
214
|
listState.collection,
|
|
187
215
|
allowsRemoving
|
|
188
216
|
]);
|
|
189
|
-
let state = $fUaQ2$useGridState({
|
|
217
|
+
let state = (0, $fUaQ2$useGridState)({
|
|
190
218
|
...props,
|
|
191
219
|
collection: gridCollection,
|
|
192
|
-
focusMode:
|
|
220
|
+
focusMode: "cell"
|
|
193
221
|
});
|
|
194
|
-
let keyboardDelegate = new $fUaQ2$TagKeyboardDelegate({
|
|
222
|
+
let keyboardDelegate = new (0, $fUaQ2$TagKeyboardDelegate)({
|
|
195
223
|
collection: state.collection,
|
|
196
224
|
disabledKeys: new Set(),
|
|
197
225
|
ref: domRef,
|
|
198
226
|
direction: direction,
|
|
199
|
-
focusMode:
|
|
227
|
+
focusMode: "cell"
|
|
200
228
|
});
|
|
201
|
-
let { gridProps: gridProps } = $fUaQ2$useGrid({
|
|
229
|
+
let { gridProps: gridProps } = (0, $fUaQ2$useGrid)({
|
|
202
230
|
...props,
|
|
203
231
|
keyboardDelegate: keyboardDelegate
|
|
204
232
|
}, state, domRef);
|
|
205
|
-
const { tagGroupProps: tagGroupProps } = $fUaQ2$useTagGroup(props);
|
|
233
|
+
const { tagGroupProps: tagGroupProps } = (0, $fUaQ2$useTagGroup)(props);
|
|
206
234
|
// Don't want the grid to be focusable or accessible via keyboard
|
|
207
235
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
208
236
|
let { tabIndex: tabIndex , role: role , ...otherGridProps } = gridProps;
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
className: $fUaQ2$classNames((/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports)),
|
|
212
|
-
role: state.collection.size ?
|
|
237
|
+
return /*#__PURE__*/ (0, $fUaQ2$react).createElement("div", {
|
|
238
|
+
...(0, $fUaQ2$mergeProps)(styleProps, tagGroupProps, otherGridProps),
|
|
239
|
+
className: (0, $fUaQ2$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c033a7c057e84ef1$exports))), "spectrum-Tags", styleProps.className),
|
|
240
|
+
role: state.collection.size ? "grid" : null,
|
|
213
241
|
ref: domRef
|
|
214
242
|
}, [
|
|
215
243
|
...gridCollection
|
|
216
|
-
].map((item)=>/*#__PURE__*/ $fUaQ2$react.createElement($b5f5ee35d3b6b95c$export$3288d34c523a1192, {
|
|
244
|
+
].map((item)=>/*#__PURE__*/ (0, $fUaQ2$react).createElement((0, $b5f5ee35d3b6b95c$export$3288d34c523a1192), {
|
|
217
245
|
...item.childNodes[0].props,
|
|
218
246
|
key: item.key,
|
|
219
247
|
item: item,
|
|
220
248
|
state: state,
|
|
221
249
|
allowsRemoving: allowsRemoving,
|
|
222
250
|
onRemove: onRemove
|
|
223
|
-
}, item.childNodes[0].rendered)
|
|
224
|
-
)));
|
|
251
|
+
}, item.childNodes[0].rendered)));
|
|
225
252
|
}
|
|
226
|
-
/** 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__*/ $fUaQ2$react.forwardRef($880d112c7a588209$var$TagGroup);
|
|
253
|
+
/** 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);
|
|
227
254
|
|
|
228
255
|
|
|
229
256
|
|
package/dist/module.mjs.map
CHANGED
|
@@ -1 +1 @@
|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9I,0IAA8I,AAA9I,EAA8I,CAC9I,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\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 {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 allowsRemoving,\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: 1, // unused, but required for grid collections\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n return {\n type: 'item',\n childNodes\n };\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [listState.collection, allowsRemoving]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: new Set(),\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);\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, role, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\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 {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n allowsRemoving={allowsRemoving}\n onRemove={onRemove}>\n {item.childNodes[0].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, 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 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 tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isFocused,\n allowsRemoving,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}\n ref={tagRowRef}>\n <div\n {...mergeProps(tagProps, 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 },\n styleProps.className\n )}\n ref={tagRef}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': allowsRemoving}), ...labelProps}\n }}>\n\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n {allowsRemoving && <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.mjs.map"}
|
|
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;AAhBA,4CAAuC;AACvC,4CAA+B;AAC/B,4CAAkC;AAClC,4CAAgC;AAChC,4CAAwC;AACxC,4CAAsC;AACtC,4CAAyC;AACzC,4CAAmC;AACnC,4CAA+B;AAC/B,4CAAgC;AAChC,4CAA+B;AAC/B,4CAA2C;AAC3C,4CAA4C;AAC5C,4CAAkD;AAClD,4CAAoC;AACpC,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AAI;QAAC,UAAU,UAAU;QAAE;KAAe;IAC1C,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE;QACvB,GAAG,KAAK;QACR,YAAY;QACZ,WAAW;IACb;IACA,IAAI,mBAAmB,IAAI,CAAA,GAAA,0BAAkB,EAAE;QAC7C,YAAY,MAAM,UAAU;QAC5B,cAAc,IAAI;QAClB,KAAK;mBACL;QACA,WAAW;IACb;IACA,IAAI,aAAC,UAAS,EAAC,GAAG,CAAA,GAAA,cAAO,AAAD,EAAE;QACxB,GAAG,KAAK;0BACR;IACF,GAAG,OAAO;IACV,MAAM,iBAAC,cAAa,EAAC,GAAG,CAAA,GAAA,kBAAW,AAAD,EAAE;IAEpC,iEAAiE;IACjE,6DAA6D;IAC7D,IAAI,YAAC,SAAQ,QAAE,KAAI,EAAE,GAAG,gBAAe,GAAG;IAC1C,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,eAAe,eAAe;QACzD,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,yDAAM,OAAD,GACL,iBACA,WAAW,SAAS;QAGxB,MAAM,MAAM,UAAU,CAAC,IAAI,GAAG,SAAS,IAAI;QAC3C,KAAK;OACJ;WAAI;KAAe,CAAC,GAAG,CAAC,CAAA,qBACvB,gCAAC,CAAA,GAAA,yCAAE;YACA,GAAG,KAAK,UAAU,CAAC,EAAE,CAAC,KAAK;YAC5B,KAAK,KAAK,GAAG;YACb,MAAM;YACN,OAAO;YACP,gBAAgB;YAChB,UAAU;WACT,KAAK,UAAU,CAAC,EAAE,CAAC,QAAQ;AAKtC;AAEA,4IAA4I,GAC5I,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;;CD7FlC,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 {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 allowsRemoving,\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: 1, // unused, but required for grid collections\n items: [...listState.collection].map(item => {\n let childNodes = [{\n ...item,\n index: 0,\n type: 'cell'\n }];\n\n return {\n type: 'item',\n childNodes\n };\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [listState.collection, allowsRemoving]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell'\n });\n let keyboardDelegate = new TagKeyboardDelegate({\n collection: state.collection,\n disabledKeys: new Set(),\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);\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, role, ...otherGridProps} = gridProps;\n return (\n <div\n {...mergeProps(styleProps, tagGroupProps, otherGridProps)}\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 {[...gridCollection].map(item => (\n <Tag\n {...item.childNodes[0].props}\n key={item.key}\n item={item}\n state={state}\n allowsRemoving={allowsRemoving}\n onRemove={onRemove}>\n {item.childNodes[0].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, 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 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 tagRef = useRef();\n let tagRowRef = useRef();\n let {clearButtonProps, labelProps, tagProps, tagRowProps} = useTag({\n ...props,\n isFocused,\n allowsRemoving,\n item,\n onRemove,\n tagRef,\n tagRowRef\n }, state);\n\n return (\n <div\n {...tagRowProps}\n ref={tagRowRef}>\n <div\n {...mergeProps(tagProps, 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 },\n styleProps.className\n )}\n ref={tagRef}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content', {'tags-removable': allowsRemoving}), ...labelProps}\n }}>\n\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n {allowsRemoving && <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.mjs.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/tag",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1903+22cb32d32",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@react-aria/
|
|
41
|
-
"@react-aria/
|
|
42
|
-
"@react-aria/
|
|
43
|
-
"@react-aria/
|
|
44
|
-
"@react-aria/
|
|
45
|
-
"@react-
|
|
46
|
-
"@react-spectrum/
|
|
47
|
-
"@react-spectrum/
|
|
48
|
-
"@react-
|
|
49
|
-
"@react-stately/
|
|
50
|
-
"@react-stately/
|
|
51
|
-
"@react-
|
|
52
|
-
"@react-types/
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
39
|
+
"@react-aria/focus": "3.0.0-nightly.1903+22cb32d32",
|
|
40
|
+
"@react-aria/grid": "3.5.2-nightly.3603+22cb32d32",
|
|
41
|
+
"@react-aria/i18n": "3.0.0-nightly.1903+22cb32d32",
|
|
42
|
+
"@react-aria/interactions": "3.0.0-nightly.1903+22cb32d32",
|
|
43
|
+
"@react-aria/tag": "3.0.0-nightly.1903+22cb32d32",
|
|
44
|
+
"@react-aria/utils": "3.0.0-nightly.1903+22cb32d32",
|
|
45
|
+
"@react-spectrum/button": "3.0.0-nightly.1903+22cb32d32",
|
|
46
|
+
"@react-spectrum/text": "3.3.4-nightly.3603+22cb32d32",
|
|
47
|
+
"@react-spectrum/utils": "3.0.0-nightly.1903+22cb32d32",
|
|
48
|
+
"@react-stately/collections": "3.0.0-nightly.1903+22cb32d32",
|
|
49
|
+
"@react-stately/grid": "3.4.2-nightly.3603+22cb32d32",
|
|
50
|
+
"@react-stately/list": "3.6.1-nightly.3603+22cb32d32",
|
|
51
|
+
"@react-types/shared": "3.0.0-nightly.1903+22cb32d32",
|
|
52
|
+
"@react-types/tag": "3.0.0-nightly.1903+22cb32d32",
|
|
53
|
+
"@spectrum-icons/workflow": "3.0.0-nightly.1903+22cb32d32",
|
|
54
|
+
"@swc/helpers": "^0.4.14"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
|
57
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.1903+22cb32d32"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@react-spectrum/provider": "^3.0.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "22cb32d329e66c60f55d4fc4025d1d44bb015d71"
|
|
67
67
|
}
|