@semcore/tag 16.0.0-prerelease.4 → 16.0.0-prerelease.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/Tag.mjs +242 -198
- package/lib/esm/index.mjs +3 -3
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +30 -30
- package/lib/esm/translations/de.json.mjs +5 -4
- package/lib/esm/translations/en.json.mjs +5 -4
- package/lib/esm/translations/es.json.mjs +5 -4
- package/lib/esm/translations/fr.json.mjs +5 -4
- package/lib/esm/translations/it.json.mjs +5 -4
- package/lib/esm/translations/ja.json.mjs +5 -4
- package/lib/esm/translations/ko.json.mjs +5 -4
- package/lib/esm/translations/nl.json.mjs +5 -4
- package/lib/esm/translations/pl.json.mjs +5 -4
- package/lib/esm/translations/pt.json.mjs +5 -4
- package/lib/esm/translations/sv.json.mjs +5 -4
- package/lib/esm/translations/tr.json.mjs +5 -4
- package/lib/esm/translations/vi.json.mjs +5 -4
- package/lib/esm/translations/zh.json.mjs +5 -4
- package/package.json +4 -4
package/lib/esm/Tag.mjs
CHANGED
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { sstyled
|
|
9
|
-
import
|
|
10
|
-
import { Box
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { localizedMessages
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { isAdvanceMode
|
|
19
|
-
var
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { Box } from "@semcore/flex-box";
|
|
11
|
+
import addonTextChildren from "@semcore/core/lib/utils/addonTextChildren";
|
|
12
|
+
import logger from "@semcore/core/lib/utils/logger";
|
|
13
|
+
import CloseM from "@semcore/icon/Close/m";
|
|
14
|
+
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
15
|
+
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
16
|
+
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
17
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
18
|
+
import { isAdvanceMode } from "@semcore/core/lib/utils/findComponent";
|
|
19
|
+
var style = (
|
|
20
20
|
/*__reshadow_css_start__*/
|
|
21
|
-
(
|
|
21
|
+
(sstyled.insert(
|
|
22
22
|
/*__inner_css_start__*/
|
|
23
|
-
`.___SCircle_1b256_gg_{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;margin:0 var(--intergalactic-spacing-1x, 4px)}.___SCircle_1b256_gg_:first-child{margin-left:0}.___SCircle_1b256_gg_:last-child{margin-right:0}.___SCircle_1b256_gg_._size_m_1b256_gg_{width:16px;height:16px}.___SCircle_1b256_gg_._size_l_1b256_gg_,.___SCircle_1b256_gg_._size_xl_1b256_gg_{width:20px;height:20px}.___SAddon_1b256_gg_,.___STagContainerClose_1b256_gg_,.___STag_1b256_gg_{position:relative;display:inline-flex;align-items:center;justify-content:center;padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-1x, 4px)}.___SAddon_1b256_gg_{flex-shrink:0}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_{padding-left:0;padding-right:0}.___STagContainerClose_1b256_gg_,.___STag_1b256_gg_{vertical-align:middle;border:1px solid var(--intergalactic-bg-primary-neutral, #ffffff);box-sizing:border-box;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-radius:var(--intergalactic-tag-rounded, 24px);font-weight:var(--intergalactic-medium, 500);color:var(--tag-color_1b256)}.___STagContainerClose_1b256_gg_.__interactive_1b256_gg_:focus-visible,.___STag_1b256_gg_.__interactive_1b256_gg_:focus-visible{z-index:1}.___STagContainerClose_1b256_gg_::before,.___STag_1b256_gg_::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--intergalactic-tag-rounded, 24px);background-color:var(--tag-color_1b256);opacity:.2;filter:brightness(150%)}.___STagContainerClose_1b256_gg_::after,.___STag_1b256_gg_::after{content:"";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:var(--intergalactic-tag-rounded, 24px);pointer-events:none;border:1px solid var(--tag-color_1b256);opacity:.1;filter:brightness(150%)}.___STagContainerClose_1b256_gg_:active,.___STag_1b256_gg_:active{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___STagContainerClose_1b256_gg_:hover,.___STag_1b256_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___STagContainerClose_1b256_gg_.__disabled_1b256_gg_,.___STag_1b256_gg_.__disabled_1b256_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___STag_1b256_gg_.__interactiveView_1b256_gg_{cursor:pointer}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_,.___STag_1b256_gg_._size_m_1b256_gg_{height:20px;min-width:20px}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:first-child,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_ .___SCircle_1b256_gg_:first-child,.___STag_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:first-child{margin-left:calc(-1*var(--intergalactic-spacing-05x, 2px))}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:last-child,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_ .___SCircle_1b256_gg_:last-child,.___STag_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:last-child{margin-right:calc(-1*var(--intergalactic-spacing-05x, 2px))}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_ .___SText_1b256_gg_,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_ .___SText_1b256_gg_,.___STag_1b256_gg_._size_m_1b256_gg_ .___SText_1b256_gg_{font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%)}.___STagContainerClose_1b256_gg_._size_l_1b256_gg_,.___STagContainer_1b256_gg_._size_l_1b256_gg_ .___SAddon_1b256_gg_,.___STag_1b256_gg_._size_l_1b256_gg_{height:28px;min-width:28px}.___STagContainerClose_1b256_gg_._size_l_1b256_gg_ .___SText_1b256_gg_,.___STagContainer_1b256_gg_._size_l_1b256_gg_ .___SAddon_1b256_gg_ .___SText_1b256_gg_,.___STag_1b256_gg_._size_l_1b256_gg_ .___SText_1b256_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___STagContainerClose_1b256_gg_._size_xl_1b256_gg_,.___STag_1b256_gg_._size_xl_1b256_gg_{height:40px;min-width:40px;padding:0 var(--intergalactic-spacing-2x, 8px)}.___STagContainerClose_1b256_gg_._size_xl_1b256_gg_ .___SText_1b256_gg_,.___STag_1b256_gg_._size_xl_1b256_gg_ .___SText_1b256_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_::before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_::before,.___STag_1b256_gg_._theme_primary_1b256_gg_::before{top:-1px;left:-1px;right:-1px;bottom:-1px}.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_:after,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_:after,.___STag_1b256_gg_._theme_primary_1b256_gg_:after{display:none}.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_.__active_1b256_gg_:before,.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_.__active_1b256_gg_:before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STag_1b256_gg_._theme_primary_1b256_gg_.__active_1b256_gg_:before,.___STag_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:active:before{opacity:.3}@media (hover:hover){.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STag_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:hover:before{opacity:.3}}.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_::before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_::before,.___STag_1b256_gg_._theme_additional_1b256_gg_::before,.___STag_1b256_gg_._theme_secondary_1b256_gg_::before{opacity:.01}.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_.__active_1b256_gg_:before,.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_.__active_1b256_gg_:before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STag_1b256_gg_._theme_additional_1b256_gg_.__active_1b256_gg_:before,.___STag_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STag_1b256_gg_._theme_secondary_1b256_gg_.__active_1b256_gg_:before,.___STag_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:active:before{opacity:.1}@media (hover:hover){.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STag_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STag_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:hover:before{opacity:.1}}.___SClose_1b256_gg_ path,.___STagContainerClose_1b256_gg_._theme_additional-invert_1b256_gg_::after,.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_::after,.___STagContainerClose_1b256_gg_._theme_secondary-invert_1b256_gg_::after,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_::after,.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_ svg path,.___STag_1b256_gg_._theme_additional-invert_1b256_gg_::after,.___STag_1b256_gg_._theme_additional_1b256_gg_::after,.___STag_1b256_gg_._theme_secondary-invert_1b256_gg_::after,.___STag_1b256_gg_._theme_secondary_1b256_gg_::after{opacity:.5}.___STagContainerClose_1b256_gg_._theme_primary-invert_1b256_gg_,.___STag_1b256_gg_._theme_primary-invert_1b256_gg_{background-color:var(--intergalactic-tag-primary-white-normal,
|
|
24
|
-
rgba(255, 255, 255, 0.15)
|
|
25
|
-
);color:var(--intergalactic-text-primary-invert, #ffffff)}.___STagContainerClose_1b256_gg_._theme_additional-invert_1b256_gg_,.___STagContainerClose_1b256_gg_._theme_secondary-invert_1b256_gg_,.___STag_1b256_gg_._theme_additional-invert_1b256_gg_,.___STag_1b256_gg_._theme_secondary-invert_1b256_gg_{color:var(--intergalactic-text-primary-invert, #ffffff)}.___STag_1b256_gg_._theme_additional_1b256_gg_::after{border-style:dashed}.___SText_1b256_gg_{display:inline-block;padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-1x, 4px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative}.___SText_1b256_gg_:not(:only-child):first-child{padding-right:0}.___SText_1b256_gg_:not(:first-child):not(:last-child){padding-left:0;padding-right:0}.___SText_1b256_gg_:not(:only-child):last-child{padding-left:0}.___SClose_1b256_gg_{cursor:pointer;flex-shrink:0;padding:var(--intergalactic-spacing-1x, 4px)}@media (hover:hover){.___SClose_1b256_gg_:hover path{opacity:1}}.___SClose_1b256_gg_,.___STagContainer_1b256_gg_{display:inline-flex;position:relative;align-items:center;justify-content:center}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child),.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0;padding-right:var(--intergalactic-spacing-05x, 2px)}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child)::after,.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child)::before,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child)::after,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child)::before{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-1px}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child) .___SText_1b256_gg_,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child) .___SText_1b256_gg_{padding-right:0}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child),.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;padding-left:var(--intergalactic-spacing-05x, 2px)}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child)::after,.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child)::before,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child)::after,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child)::before{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child) .___SText_1b256_gg_,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child) .___SText_1b256_gg_{padding-left:0}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_{cursor:pointer;border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0;padding-right:0;min-width:20px}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_::after,.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_::before{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_::before{left:-1px}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_ svg{padding-left:0;padding-right:var(--intergalactic-spacing-1x, 4px)}@media (hover:hover){.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_:hover svg path{opacity:1}}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_._size_xl_1b256_gg_ svg{padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-2x, 8px)}`,
|
|
23
|
+
'.___SCircle_1b256_gg_{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;margin:0 var(--intergalactic-spacing-1x, 4px)}.___SCircle_1b256_gg_:first-child{margin-left:0}.___SCircle_1b256_gg_:last-child{margin-right:0}.___SCircle_1b256_gg_._size_m_1b256_gg_{width:16px;height:16px}.___SCircle_1b256_gg_._size_l_1b256_gg_,.___SCircle_1b256_gg_._size_xl_1b256_gg_{width:20px;height:20px}.___SAddon_1b256_gg_,.___STagContainerClose_1b256_gg_,.___STag_1b256_gg_{position:relative;display:inline-flex;align-items:center;justify-content:center;padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-1x, 4px)}.___SAddon_1b256_gg_{flex-shrink:0}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_{padding-left:0;padding-right:0}.___STagContainerClose_1b256_gg_,.___STag_1b256_gg_{vertical-align:middle;border:1px solid var(--intergalactic-bg-primary-neutral, #ffffff);box-sizing:border-box;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-radius:var(--intergalactic-tag-rounded, 24px);font-weight:var(--intergalactic-medium, 500);color:var(--tag-color_1b256)}.___STagContainerClose_1b256_gg_.__interactive_1b256_gg_:focus-visible,.___STag_1b256_gg_.__interactive_1b256_gg_:focus-visible{z-index:1}.___STagContainerClose_1b256_gg_::before,.___STag_1b256_gg_::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--intergalactic-tag-rounded, 24px);background-color:var(--tag-color_1b256);opacity:.2;filter:brightness(150%)}.___STagContainerClose_1b256_gg_::after,.___STag_1b256_gg_::after{content:"";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:var(--intergalactic-tag-rounded, 24px);pointer-events:none;border:1px solid var(--tag-color_1b256);opacity:.1;filter:brightness(150%)}.___STagContainerClose_1b256_gg_:active,.___STag_1b256_gg_:active{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___STagContainerClose_1b256_gg_:hover,.___STag_1b256_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___STagContainerClose_1b256_gg_.__disabled_1b256_gg_,.___STag_1b256_gg_.__disabled_1b256_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___STag_1b256_gg_.__interactiveView_1b256_gg_{cursor:pointer}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_,.___STag_1b256_gg_._size_m_1b256_gg_{height:20px;min-width:20px}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:first-child,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_ .___SCircle_1b256_gg_:first-child,.___STag_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:first-child{margin-left:calc(-1*var(--intergalactic-spacing-05x, 2px))}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:last-child,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_ .___SCircle_1b256_gg_:last-child,.___STag_1b256_gg_._size_m_1b256_gg_ .___SCircle_1b256_gg_:last-child{margin-right:calc(-1*var(--intergalactic-spacing-05x, 2px))}.___STagContainerClose_1b256_gg_._size_m_1b256_gg_ .___SText_1b256_gg_,.___STagContainer_1b256_gg_._size_m_1b256_gg_ .___SAddon_1b256_gg_ .___SText_1b256_gg_,.___STag_1b256_gg_._size_m_1b256_gg_ .___SText_1b256_gg_{font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%)}.___STagContainerClose_1b256_gg_._size_l_1b256_gg_,.___STagContainer_1b256_gg_._size_l_1b256_gg_ .___SAddon_1b256_gg_,.___STag_1b256_gg_._size_l_1b256_gg_{height:28px;min-width:28px}.___STagContainerClose_1b256_gg_._size_l_1b256_gg_ .___SText_1b256_gg_,.___STagContainer_1b256_gg_._size_l_1b256_gg_ .___SAddon_1b256_gg_ .___SText_1b256_gg_,.___STag_1b256_gg_._size_l_1b256_gg_ .___SText_1b256_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___STagContainerClose_1b256_gg_._size_xl_1b256_gg_,.___STag_1b256_gg_._size_xl_1b256_gg_{height:40px;min-width:40px;padding:0 var(--intergalactic-spacing-2x, 8px)}.___STagContainerClose_1b256_gg_._size_xl_1b256_gg_ .___SText_1b256_gg_,.___STag_1b256_gg_._size_xl_1b256_gg_ .___SText_1b256_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_::before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_::before,.___STag_1b256_gg_._theme_primary_1b256_gg_::before{top:-1px;left:-1px;right:-1px;bottom:-1px}.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_:after,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_:after,.___STag_1b256_gg_._theme_primary_1b256_gg_:after{display:none}.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_.__active_1b256_gg_:before,.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_.__active_1b256_gg_:before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STag_1b256_gg_._theme_primary_1b256_gg_.__active_1b256_gg_:before,.___STag_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:active:before{opacity:.3}@media (hover:hover){.___STagContainerClose_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STagContainer_1b256_gg_._theme_primary_1b256_gg_ .___SAddon_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STag_1b256_gg_._theme_primary_1b256_gg_.__interactiveView_1b256_gg_:hover:before{opacity:.3}}.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_::before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_::before,.___STag_1b256_gg_._theme_additional_1b256_gg_::before,.___STag_1b256_gg_._theme_secondary_1b256_gg_::before{opacity:.01}.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_.__active_1b256_gg_:before,.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_.__active_1b256_gg_:before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STag_1b256_gg_._theme_additional_1b256_gg_.__active_1b256_gg_:before,.___STag_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:active:before,.___STag_1b256_gg_._theme_secondary_1b256_gg_.__active_1b256_gg_:before,.___STag_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:active:before{opacity:.1}@media (hover:hover){.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STag_1b256_gg_._theme_additional_1b256_gg_.__interactiveView_1b256_gg_:hover:before,.___STag_1b256_gg_._theme_secondary_1b256_gg_.__interactiveView_1b256_gg_:hover:before{opacity:.1}}.___SClose_1b256_gg_ path,.___STagContainerClose_1b256_gg_._theme_additional-invert_1b256_gg_::after,.___STagContainerClose_1b256_gg_._theme_additional_1b256_gg_::after,.___STagContainerClose_1b256_gg_._theme_secondary-invert_1b256_gg_::after,.___STagContainerClose_1b256_gg_._theme_secondary_1b256_gg_::after,.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_ svg path,.___STag_1b256_gg_._theme_additional-invert_1b256_gg_::after,.___STag_1b256_gg_._theme_additional_1b256_gg_::after,.___STag_1b256_gg_._theme_secondary-invert_1b256_gg_::after,.___STag_1b256_gg_._theme_secondary_1b256_gg_::after{opacity:.5}.___STagContainerClose_1b256_gg_._theme_primary-invert_1b256_gg_,.___STag_1b256_gg_._theme_primary-invert_1b256_gg_{background-color:var(--intergalactic-tag-primary-white-normal,\n rgba(255, 255, 255, 0.15)\n );color:var(--intergalactic-text-primary-invert, #ffffff)}.___STagContainerClose_1b256_gg_._theme_additional-invert_1b256_gg_,.___STagContainerClose_1b256_gg_._theme_secondary-invert_1b256_gg_,.___STag_1b256_gg_._theme_additional-invert_1b256_gg_,.___STag_1b256_gg_._theme_secondary-invert_1b256_gg_{color:var(--intergalactic-text-primary-invert, #ffffff)}.___STag_1b256_gg_._theme_additional_1b256_gg_::after{border-style:dashed}.___SText_1b256_gg_{display:inline-block;padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-1x, 4px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative}.___SText_1b256_gg_:not(:only-child):first-child{padding-right:0}.___SText_1b256_gg_:not(:first-child):not(:last-child){padding-left:0;padding-right:0}.___SText_1b256_gg_:not(:only-child):last-child{padding-left:0}.___SClose_1b256_gg_{cursor:pointer;flex-shrink:0;padding:var(--intergalactic-spacing-1x, 4px)}@media (hover:hover){.___SClose_1b256_gg_:hover path{opacity:1}}.___SClose_1b256_gg_,.___STagContainer_1b256_gg_{display:inline-flex;position:relative;align-items:center;justify-content:center}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child),.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0;padding-right:var(--intergalactic-spacing-05x, 2px)}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child)::after,.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child)::before,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child)::after,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child)::before{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-1px}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:last-child) .___SText_1b256_gg_,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:last-child) .___SText_1b256_gg_{padding-right:0}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child),.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;padding-left:var(--intergalactic-spacing-05x, 2px)}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child)::after,.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child)::before,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child)::after,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child)::before{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.___STagContainer_1b256_gg_ .___SAddon_1b256_gg_:not(:first-child) .___SText_1b256_gg_,.___STagContainer_1b256_gg_ .___STag_1b256_gg_:not(:first-child) .___SText_1b256_gg_{padding-left:0}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_{cursor:pointer;border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0;padding-right:0;min-width:20px}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_::after,.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_::before{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_::before{left:-1px}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_ svg{padding-left:0;padding-right:var(--intergalactic-spacing-1x, 4px)}@media (hover:hover){.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_:hover svg path{opacity:1}}.___STagContainer_1b256_gg_ .___STagContainerClose_1b256_gg_._size_xl_1b256_gg_ svg{padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-2x, 8px)}',
|
|
26
24
|
"1b256_gg_"
|
|
27
25
|
), {
|
|
28
|
-
__SCircle: "___SCircle_1b256_gg_",
|
|
29
|
-
_size_m: "_size_m_1b256_gg_",
|
|
30
|
-
_size_l: "_size_l_1b256_gg_",
|
|
31
|
-
_size_xl: "_size_xl_1b256_gg_",
|
|
32
|
-
__SAddon: "___SAddon_1b256_gg_",
|
|
33
|
-
__STagContainer: "___STagContainer_1b256_gg_",
|
|
34
|
-
__STag: "___STag_1b256_gg_",
|
|
35
|
-
_disabled: "__disabled_1b256_gg_",
|
|
36
|
-
__STagContainerClose: "___STagContainerClose_1b256_gg_",
|
|
37
|
-
_interactiveView: "__interactiveView_1b256_gg_",
|
|
26
|
+
"__SCircle": "___SCircle_1b256_gg_",
|
|
27
|
+
"_size_m": "_size_m_1b256_gg_",
|
|
28
|
+
"_size_l": "_size_l_1b256_gg_",
|
|
29
|
+
"_size_xl": "_size_xl_1b256_gg_",
|
|
30
|
+
"__SAddon": "___SAddon_1b256_gg_",
|
|
31
|
+
"__STagContainer": "___STagContainer_1b256_gg_",
|
|
32
|
+
"__STag": "___STag_1b256_gg_",
|
|
33
|
+
"_disabled": "__disabled_1b256_gg_",
|
|
34
|
+
"__STagContainerClose": "___STagContainerClose_1b256_gg_",
|
|
35
|
+
"_interactiveView": "__interactiveView_1b256_gg_",
|
|
38
36
|
"_theme_primary-invert": "_theme_primary-invert_1b256_gg_",
|
|
39
37
|
"_theme_secondary-invert": "_theme_secondary-invert_1b256_gg_",
|
|
40
38
|
"_theme_additional-invert": "_theme_additional-invert_1b256_gg_",
|
|
41
|
-
__SText: "___SText_1b256_gg_",
|
|
39
|
+
"__SText": "___SText_1b256_gg_",
|
|
42
40
|
"--tag-color": "--tag-color_1b256",
|
|
43
|
-
_interactive: "__interactive_1b256_gg_",
|
|
44
|
-
_theme_primary: "_theme_primary_1b256_gg_",
|
|
45
|
-
_active: "__active_1b256_gg_",
|
|
46
|
-
_theme_secondary: "_theme_secondary_1b256_gg_",
|
|
47
|
-
_theme_additional: "_theme_additional_1b256_gg_",
|
|
48
|
-
__SClose: "___SClose_1b256_gg_"
|
|
41
|
+
"_interactive": "__interactive_1b256_gg_",
|
|
42
|
+
"_theme_primary": "_theme_primary_1b256_gg_",
|
|
43
|
+
"_active": "__active_1b256_gg_",
|
|
44
|
+
"_theme_secondary": "_theme_secondary_1b256_gg_",
|
|
45
|
+
"_theme_additional": "_theme_additional_1b256_gg_",
|
|
46
|
+
"__SClose": "___SClose_1b256_gg_"
|
|
49
47
|
})
|
|
50
|
-
)
|
|
48
|
+
);
|
|
49
|
+
var legacyThemeRecommendedMigration = {
|
|
51
50
|
primary: {
|
|
52
51
|
muted: "gray-500",
|
|
53
52
|
info: "blue-500",
|
|
@@ -58,228 +57,273 @@ var N = (
|
|
|
58
57
|
secondary: {
|
|
59
58
|
muted: "gray-50"
|
|
60
59
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
};
|
|
61
|
+
var RootTag = /* @__PURE__ */ function(_Component) {
|
|
62
|
+
_inherits(RootTag2, _Component);
|
|
63
|
+
var _super = _createSuper(RootTag2);
|
|
64
|
+
function RootTag2(props) {
|
|
65
|
+
var _legacyThemeRecommend;
|
|
66
|
+
var _this;
|
|
67
|
+
_classCallCheck(this, RootTag2);
|
|
68
|
+
_this = _super.call(this, props);
|
|
69
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function(event) {
|
|
70
|
+
switch (event.key) {
|
|
68
71
|
case " ":
|
|
69
72
|
case "Enter":
|
|
70
|
-
|
|
73
|
+
if (_this.asProps.onClick) {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
_this.asProps.onClick(event);
|
|
76
|
+
}
|
|
71
77
|
break;
|
|
72
78
|
}
|
|
73
|
-
})
|
|
79
|
+
});
|
|
80
|
+
logger.warn(props.use, `Property 'use' is deprecated, replace property to "theme='`.concat(props.use, "' color='").concat((_legacyThemeRecommend = legacyThemeRecommendedMigration[props.use]) === null || _legacyThemeRecommend === void 0 ? void 0 : _legacyThemeRecommend[props.theme], `'"`), props["data-ui-name"] || Tag.displayName);
|
|
81
|
+
return _this;
|
|
74
82
|
}
|
|
75
|
-
|
|
83
|
+
_createClass(RootTag2, [{
|
|
76
84
|
key: "getCircleProps",
|
|
77
|
-
value: function() {
|
|
78
|
-
var
|
|
85
|
+
value: function getCircleProps() {
|
|
86
|
+
var _this$asProps = this.asProps, size = _this$asProps.size, color = _this$asProps.color, resolveColor = _this$asProps.resolveColor;
|
|
79
87
|
return {
|
|
80
|
-
size
|
|
81
|
-
color
|
|
82
|
-
resolveColor
|
|
88
|
+
size,
|
|
89
|
+
color,
|
|
90
|
+
resolveColor
|
|
83
91
|
};
|
|
84
92
|
}
|
|
85
93
|
}, {
|
|
86
94
|
key: "getTextProps",
|
|
87
|
-
value: function() {
|
|
88
|
-
var
|
|
95
|
+
value: function getTextProps() {
|
|
96
|
+
var id = this.asProps.id || "igc-".concat(this.asProps.uid, "-tag");
|
|
89
97
|
return {
|
|
90
98
|
tabIndex: -1,
|
|
91
|
-
id: "".concat(
|
|
99
|
+
id: "".concat(id, "-text"),
|
|
92
100
|
role: void 0
|
|
93
101
|
};
|
|
94
102
|
}
|
|
95
103
|
}, {
|
|
96
104
|
key: "render",
|
|
97
|
-
value: function() {
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
tag:
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
value: function render() {
|
|
106
|
+
var _ref = this.asProps, _ref8;
|
|
107
|
+
var STag = Box;
|
|
108
|
+
var _this$asProps2 = this.asProps, Children = _this$asProps2.Children, styles = _this$asProps2.styles, color = _this$asProps2.color, interactive = _this$asProps2.interactive, disabled = _this$asProps2.disabled, addonLeft = _this$asProps2.addonLeft, addonRight = _this$asProps2.addonRight, resolveColor = _this$asProps2.resolveColor, outerId = _this$asProps2.id, uid = _this$asProps2.uid;
|
|
109
|
+
var id = outerId || "igc-".concat(uid, "-tag");
|
|
110
|
+
var isInteractiveView = !disabled && interactive;
|
|
111
|
+
var isInteractive = !disabled && interactive;
|
|
112
|
+
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(STag, _ref8.cn("STag", _objectSpread({}, assignProps({
|
|
113
|
+
"id": id,
|
|
114
|
+
"use:interactive": isInteractive,
|
|
115
|
+
"use:interactiveView": isInteractiveView,
|
|
116
|
+
"tag-color": resolveColor(color),
|
|
117
|
+
"onKeyDown": this.handleKeyDown,
|
|
118
|
+
"use:tabIndex": isInteractive ? 0 : -1,
|
|
119
|
+
"role": isInteractive ? "button" : void 0
|
|
120
|
+
}, _ref))), addonLeft ? /* @__PURE__ */ React.createElement(Tag.Addon, {
|
|
121
|
+
tag: addonLeft
|
|
122
|
+
}) : null, addonTextChildren(Children, Tag.Text, [Tag.Addon, TagContainer.Circle]), addonRight ? /* @__PURE__ */ React.createElement(Tag.Addon, {
|
|
123
|
+
tag: addonRight
|
|
111
124
|
}) : null);
|
|
112
125
|
}
|
|
113
|
-
}])
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
126
|
+
}]);
|
|
127
|
+
return RootTag2;
|
|
128
|
+
}(Component);
|
|
129
|
+
_defineProperty(RootTag, "displayName", "Tag");
|
|
130
|
+
_defineProperty(RootTag, "style", style);
|
|
131
|
+
_defineProperty(RootTag, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement(), resolveColorEnhance()]);
|
|
132
|
+
_defineProperty(RootTag, "defaultProps", {
|
|
119
133
|
theme: "primary",
|
|
120
134
|
color: "gray-500",
|
|
121
135
|
size: "m",
|
|
122
|
-
i18n:
|
|
136
|
+
i18n: localizedMessages,
|
|
123
137
|
locale: "en"
|
|
124
138
|
});
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
var
|
|
128
|
-
function
|
|
129
|
-
|
|
139
|
+
var RootTagContainer = /* @__PURE__ */ function(_Component2) {
|
|
140
|
+
_inherits(RootTagContainer2, _Component2);
|
|
141
|
+
var _super2 = _createSuper(RootTagContainer2);
|
|
142
|
+
function RootTagContainer2() {
|
|
143
|
+
_classCallCheck(this, RootTagContainer2);
|
|
144
|
+
return _super2.apply(this, arguments);
|
|
130
145
|
}
|
|
131
|
-
|
|
146
|
+
_createClass(RootTagContainer2, [{
|
|
132
147
|
key: "getTagProps",
|
|
133
|
-
value: function() {
|
|
134
|
-
var
|
|
148
|
+
value: function getTagProps() {
|
|
149
|
+
var _this$asProps3 = this.asProps, size = _this$asProps3.size, theme = _this$asProps3.theme, color = _this$asProps3.color, disabled = _this$asProps3.disabled, uid = _this$asProps3.uid, outerId = _this$asProps3.id, interactive = _this$asProps3.interactive, resolveColor = _this$asProps3.resolveColor;
|
|
150
|
+
var id = outerId || "igc-".concat(uid, "-tag");
|
|
135
151
|
return {
|
|
136
|
-
id: "".concat(
|
|
137
|
-
disabled
|
|
138
|
-
size
|
|
139
|
-
theme
|
|
140
|
-
color
|
|
141
|
-
tag:
|
|
142
|
-
interactive
|
|
143
|
-
resolveColor
|
|
152
|
+
id: "".concat(id, "-text"),
|
|
153
|
+
disabled,
|
|
154
|
+
size,
|
|
155
|
+
theme,
|
|
156
|
+
color,
|
|
157
|
+
tag: interactive ? "button" : void 0,
|
|
158
|
+
interactive,
|
|
159
|
+
resolveColor
|
|
144
160
|
};
|
|
145
161
|
}
|
|
146
162
|
}, {
|
|
147
163
|
key: "getCircleProps",
|
|
148
|
-
value: function() {
|
|
149
|
-
var
|
|
164
|
+
value: function getCircleProps() {
|
|
165
|
+
var _this$asProps4 = this.asProps, color = _this$asProps4.color, resolveColor = _this$asProps4.resolveColor, size = _this$asProps4.size;
|
|
150
166
|
return {
|
|
151
|
-
color
|
|
152
|
-
resolveColor
|
|
153
|
-
size
|
|
167
|
+
color,
|
|
168
|
+
resolveColor,
|
|
169
|
+
size
|
|
154
170
|
};
|
|
155
171
|
}
|
|
156
172
|
}, {
|
|
157
173
|
key: "getAddonProps",
|
|
158
|
-
value: function() {
|
|
159
|
-
var
|
|
174
|
+
value: function getAddonProps() {
|
|
175
|
+
var _this$asProps5 = this.asProps, color = _this$asProps5.color, resolveColor = _this$asProps5.resolveColor;
|
|
160
176
|
return {
|
|
161
|
-
color
|
|
162
|
-
resolveColor
|
|
177
|
+
color,
|
|
178
|
+
resolveColor
|
|
163
179
|
};
|
|
164
180
|
}
|
|
165
181
|
}, {
|
|
166
182
|
key: "getCloseProps",
|
|
167
|
-
value: function() {
|
|
168
|
-
var
|
|
183
|
+
value: function getCloseProps() {
|
|
184
|
+
var _this$asProps6 = this.asProps, size = _this$asProps6.size, theme = _this$asProps6.theme, color = _this$asProps6.color, disabled = _this$asProps6.disabled, uid = _this$asProps6.uid, outerId = _this$asProps6.id, getI18nText = _this$asProps6.getI18nText, resolveColor = _this$asProps6.resolveColor;
|
|
185
|
+
var id = outerId || "igc-".concat(uid, "-tag");
|
|
169
186
|
return {
|
|
170
|
-
disabled
|
|
171
|
-
size
|
|
172
|
-
theme
|
|
173
|
-
color
|
|
174
|
-
id: "".concat(
|
|
175
|
-
"aria-labelledby": "".concat(
|
|
176
|
-
"aria-label":
|
|
177
|
-
resolveColor
|
|
187
|
+
disabled,
|
|
188
|
+
size,
|
|
189
|
+
theme,
|
|
190
|
+
color,
|
|
191
|
+
id: "".concat(id, "-clear"),
|
|
192
|
+
"aria-labelledby": "".concat(id, "-clear ").concat(id, "-text"),
|
|
193
|
+
"aria-label": getI18nText("remove"),
|
|
194
|
+
resolveColor
|
|
178
195
|
};
|
|
179
196
|
}
|
|
180
197
|
}, {
|
|
181
198
|
key: "render",
|
|
182
|
-
value: function() {
|
|
183
|
-
var
|
|
184
|
-
|
|
199
|
+
value: function render() {
|
|
200
|
+
var _ref2 = this.asProps, _ref9;
|
|
201
|
+
var STagContainer = Box;
|
|
202
|
+
var _this$asProps7 = this.asProps, styles = _this$asProps7.styles, Children = _this$asProps7.Children, forcedAdvancedMode = _this$asProps7.forcedAdvancedMode;
|
|
203
|
+
var advancedMode = forcedAdvancedMode || isAdvanceMode(Children, ["InputTags." + Tag.Text.displayName, "InputTags." + Tag.Addon.displayName, "InputTags." + Tag.Circle.displayName, TagContainer.Tag.displayName, TagContainer.Addon.displayName, TagContainer.Close.displayName, TagContainer.Circle.displayName], true);
|
|
204
|
+
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(STagContainer, _ref9.cn("STagContainer", _objectSpread({}, assignProps({}, _ref2))), advancedMode ? /* @__PURE__ */ React.createElement(Children, _ref9.cn("Children", {})) : /* @__PURE__ */ React.createElement(TagContainer.Tag, null, /* @__PURE__ */ React.createElement(Children, _ref9.cn("Children", {}))));
|
|
185
205
|
}
|
|
186
|
-
}])
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
206
|
+
}]);
|
|
207
|
+
return RootTagContainer2;
|
|
208
|
+
}(Component);
|
|
209
|
+
_defineProperty(RootTagContainer, "displayName", "TagContainer");
|
|
210
|
+
_defineProperty(RootTagContainer, "style", style);
|
|
211
|
+
_defineProperty(RootTagContainer, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement(), resolveColorEnhance()]);
|
|
212
|
+
_defineProperty(RootTagContainer, "defaultProps", {
|
|
192
213
|
color: "gray-500",
|
|
193
214
|
theme: "primary"
|
|
194
215
|
});
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
var
|
|
198
|
-
function
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
for (var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
216
|
+
var RootCloseTagContainer = /* @__PURE__ */ function(_Component3) {
|
|
217
|
+
_inherits(RootCloseTagContainer2, _Component3);
|
|
218
|
+
var _super3 = _createSuper(RootCloseTagContainer2);
|
|
219
|
+
function RootCloseTagContainer2() {
|
|
220
|
+
var _this2;
|
|
221
|
+
_classCallCheck(this, RootCloseTagContainer2);
|
|
222
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
223
|
+
args[_key] = arguments[_key];
|
|
224
|
+
}
|
|
225
|
+
_this2 = _super3.call.apply(_super3, [this].concat(args));
|
|
226
|
+
_defineProperty(_assertThisInitialized(_this2), "handleKeyDown", function(event) {
|
|
227
|
+
var _this2$asProps = _this2.asProps, onKeyDown = _this2$asProps.onKeyDown, onClick = _this2$asProps.onClick;
|
|
228
|
+
if (onKeyDown) {
|
|
229
|
+
return onKeyDown(event);
|
|
230
|
+
}
|
|
231
|
+
if (onClick && (event.key === "Enter" || event.key === " ")) {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
onClick(event);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
return _this2;
|
|
209
237
|
}
|
|
210
|
-
|
|
238
|
+
_createClass(RootCloseTagContainer2, [{
|
|
211
239
|
key: "render",
|
|
212
|
-
value: function() {
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
240
|
+
value: function render() {
|
|
241
|
+
var _ref3 = this.asProps, _ref10;
|
|
242
|
+
var STagContainerClose = Box;
|
|
243
|
+
var _this$asProps8 = this.asProps, Children = _this$asProps8.Children, styles = _this$asProps8.styles, color = _this$asProps8.color, resolveColor = _this$asProps8.resolveColor;
|
|
244
|
+
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(STagContainerClose, _ref10.cn("STagContainerClose", _objectSpread({}, assignProps({
|
|
245
|
+
"tag": "button",
|
|
246
|
+
"type": "button",
|
|
247
|
+
"interactive": true,
|
|
248
|
+
"interactiveView": true,
|
|
249
|
+
"tag-color": resolveColor(color),
|
|
250
|
+
"onKeyDown": this.handleKeyDown
|
|
251
|
+
}, _ref3))), /* @__PURE__ */ React.createElement(Children, _ref10.cn("Children", {})));
|
|
222
252
|
}
|
|
223
|
-
}])
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
253
|
+
}]);
|
|
254
|
+
return RootCloseTagContainer2;
|
|
255
|
+
}(Component);
|
|
256
|
+
_defineProperty(RootCloseTagContainer, "displayName", "CloseTagContainer");
|
|
257
|
+
_defineProperty(RootCloseTagContainer, "style", style);
|
|
258
|
+
_defineProperty(RootCloseTagContainer, "defaultProps", function() {
|
|
228
259
|
return {
|
|
229
260
|
theme: "primary",
|
|
230
261
|
color: "gray-500",
|
|
231
262
|
size: "m",
|
|
232
|
-
i18n:
|
|
263
|
+
i18n: localizedMessages,
|
|
233
264
|
locale: "en",
|
|
234
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ React.createElement(CloseTagContainer.Close, null)
|
|
235
266
|
};
|
|
236
267
|
});
|
|
237
|
-
|
|
238
|
-
function
|
|
239
|
-
var
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
268
|
+
_defineProperty(RootCloseTagContainer, "enhance", [resolveColorEnhance()]);
|
|
269
|
+
function TagContainerCircle(props) {
|
|
270
|
+
var _ref4 = arguments[0], _ref11;
|
|
271
|
+
var SAddon = Box;
|
|
272
|
+
var SCircle = Box;
|
|
273
|
+
var styles = props.styles, color = props.color, resolveColor = props.resolveColor;
|
|
274
|
+
return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(SAddon, _ref11.cn("SAddon", {
|
|
275
|
+
"tag-color": resolveColor(color)
|
|
276
|
+
}), /* @__PURE__ */ React.createElement(SCircle, _ref11.cn("SCircle", _objectSpread({}, assignProps({}, _ref4)))));
|
|
243
277
|
}
|
|
244
|
-
function
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
},
|
|
278
|
+
function Text(props) {
|
|
279
|
+
var _ref5 = arguments[0], _ref12;
|
|
280
|
+
var SText = Box;
|
|
281
|
+
var styles = props.styles;
|
|
282
|
+
return _ref12 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref12.cn("SText", _objectSpread({}, assignProps({
|
|
283
|
+
"tag": "span"
|
|
284
|
+
}, _ref5))));
|
|
249
285
|
}
|
|
250
|
-
function
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
},
|
|
286
|
+
function Addon(props) {
|
|
287
|
+
var _ref6 = arguments[0], _ref13;
|
|
288
|
+
var SAddon = Box;
|
|
289
|
+
var styles = props.styles, color = props.color, resolveColor = props.resolveColor;
|
|
290
|
+
var tagColor = React.useMemo(function() {
|
|
291
|
+
if (typeof resolveColor !== "function") return;
|
|
292
|
+
return resolveColor(color);
|
|
293
|
+
}, [color, resolveColor]);
|
|
294
|
+
return _ref13 = sstyled(styles), /* @__PURE__ */ React.createElement(SAddon, _ref13.cn("SAddon", _objectSpread({}, assignProps({
|
|
295
|
+
"tag": "div",
|
|
296
|
+
"tag-color": tagColor
|
|
297
|
+
}, _ref6))));
|
|
259
298
|
}
|
|
260
|
-
function
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
},
|
|
299
|
+
function Circle(props) {
|
|
300
|
+
var _ref7 = arguments[0], _ref14;
|
|
301
|
+
var SCircle = Box;
|
|
302
|
+
var styles = props.styles, color = props.color, resolveColor = props.resolveColor;
|
|
303
|
+
var tagColor = React.useMemo(function() {
|
|
304
|
+
if (typeof resolveColor !== "function") return;
|
|
305
|
+
return resolveColor(color);
|
|
306
|
+
}, [color, resolveColor]);
|
|
307
|
+
return _ref14 = sstyled(styles), /* @__PURE__ */ React.createElement(SCircle, _ref14.cn("SCircle", _objectSpread({}, assignProps({
|
|
308
|
+
"tag": "span",
|
|
309
|
+
"tag-color": tagColor
|
|
310
|
+
}, _ref7))));
|
|
269
311
|
}
|
|
270
|
-
var
|
|
271
|
-
Text
|
|
272
|
-
Addon
|
|
273
|
-
Circle
|
|
274
|
-
})
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
312
|
+
var Tag = createComponent(RootTag, {
|
|
313
|
+
Text,
|
|
314
|
+
Addon,
|
|
315
|
+
Circle
|
|
316
|
+
});
|
|
317
|
+
var CloseTagContainer = createComponent(RootCloseTagContainer, {
|
|
318
|
+
Close: CloseM
|
|
319
|
+
});
|
|
320
|
+
var TagContainer = createComponent(RootTagContainer, {
|
|
321
|
+
Tag,
|
|
322
|
+
Addon,
|
|
323
|
+
Close: CloseTagContainer,
|
|
324
|
+
Circle: TagContainerCircle
|
|
281
325
|
});
|
|
282
326
|
export {
|
|
283
|
-
|
|
284
|
-
|
|
327
|
+
TagContainer,
|
|
328
|
+
Tag as default
|
|
285
329
|
};
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
var
|
|
16
|
-
de
|
|
17
|
-
en
|
|
18
|
-
es
|
|
19
|
-
fr
|
|
20
|
-
it
|
|
21
|
-
ja
|
|
22
|
-
ko
|
|
23
|
-
nl
|
|
24
|
-
pt
|
|
25
|
-
tr
|
|
26
|
-
vi
|
|
27
|
-
zh
|
|
28
|
-
pl
|
|
29
|
-
sv
|
|
1
|
+
import de from "./de.json.mjs";
|
|
2
|
+
import en from "./en.json.mjs";
|
|
3
|
+
import es from "./es.json.mjs";
|
|
4
|
+
import fr from "./fr.json.mjs";
|
|
5
|
+
import it from "./it.json.mjs";
|
|
6
|
+
import ja from "./ja.json.mjs";
|
|
7
|
+
import ko from "./ko.json.mjs";
|
|
8
|
+
import nl from "./nl.json.mjs";
|
|
9
|
+
import pt from "./pt.json.mjs";
|
|
10
|
+
import tr from "./tr.json.mjs";
|
|
11
|
+
import vi from "./vi.json.mjs";
|
|
12
|
+
import zh from "./zh.json.mjs";
|
|
13
|
+
import pl from "./pl.json.mjs";
|
|
14
|
+
import sv from "./sv.json.mjs";
|
|
15
|
+
var localizedMessages = {
|
|
16
|
+
de,
|
|
17
|
+
en,
|
|
18
|
+
es,
|
|
19
|
+
fr,
|
|
20
|
+
it,
|
|
21
|
+
ja,
|
|
22
|
+
ko,
|
|
23
|
+
nl,
|
|
24
|
+
pt,
|
|
25
|
+
tr,
|
|
26
|
+
vi,
|
|
27
|
+
zh,
|
|
28
|
+
pl,
|
|
29
|
+
sv
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
localizedMessages
|
|
33
33
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/tag",
|
|
3
3
|
"description": "Semrush Tag Component",
|
|
4
|
-
"version": "16.0.0-prerelease.
|
|
4
|
+
"version": "16.0.0-prerelease.7",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "16.0.0-prerelease.
|
|
18
|
-
"@semcore/icon": "16.0.0-prerelease.
|
|
17
|
+
"@semcore/flex-box": "16.0.0-prerelease.7",
|
|
18
|
+
"@semcore/icon": "16.0.0-prerelease.7"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@semcore/base-components": "^16.0.0-prerelease.
|
|
21
|
+
"@semcore/base-components": "^16.0.0-prerelease.7"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|