odaptos_design_system 2.0.0 → 2.0.2

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.
@@ -8,7 +8,8 @@ interface TagProps extends HTMLAttributes<HTMLDivElement> {
8
8
  amountNumber?: number | undefined;
9
9
  customColor?: string;
10
10
  className?: string;
11
+ canBeRemoved?: boolean;
11
12
  }
12
13
  /** Figma link : https://www.figma.com/file/fjnhhbL12HvKccPmJchVnr/Atomic-Library?type=design&node-id=1359-33355&mode=dev */
13
- export declare const Tag: ({ text, status, size, iconLeft, iconRight, amountNumber, customColor, className, ...props }: TagProps) => React.JSX.Element;
14
+ export declare const Tag: ({ text, status, size, iconLeft, iconRight, amountNumber, customColor, className, canBeRemoved, ...props }: TagProps) => React.JSX.Element;
14
15
  export {};
@@ -9,9 +9,10 @@ interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
9
9
  textDecoration?: 'underline' | 'line-through';
10
10
  className?: string;
11
11
  required?: boolean;
12
+ id?: string;
12
13
  }
13
14
  /** This text should be use to display basic text
14
15
  * Figma link : https://www.figma.com/file/fjnhhbL12HvKccPmJchVnr/Atomic-Library?type=design&node-id=52-751&mode=dev
15
16
  */
16
- export declare const Text: ({ text, color, size, weight, italic, textDecoration, className, required, ...props }: TextProps) => React.JSX.Element;
17
+ export declare const Text: ({ text, color, size, weight, italic, textDecoration, className, required, id, ...props }: TextProps) => React.JSX.Element;
17
18
  export {};
@@ -12607,10 +12607,11 @@ const MultiSelect = ({
12607
12607
  size: "sm",
12608
12608
  status: "info",
12609
12609
  key: `chipt-option-${index}`,
12610
+ canBeRemoved: true,
12610
12611
  iconRight: /*#__PURE__*/React__default.createElement(RemoveCircledIcon, {
12611
12612
  fill: colors.blue_700,
12612
12613
  style: {
12613
- cursor: 'pointer'
12614
+ cursor: 'pointer !important'
12614
12615
  },
12615
12616
  onClick: () => deleteOption(option)
12616
12617
  })
@@ -12876,6 +12877,7 @@ const MultiSelectWithCategories = ({
12876
12877
  size: "sm",
12877
12878
  status: "info",
12878
12879
  key: `chipt-option-${index}`,
12880
+ canBeRemoved: true,
12879
12881
  iconRight: /*#__PURE__*/React__default.createElement(RemoveCircledIcon, {
12880
12882
  fill: colors.blue_700,
12881
12883
  style: {
@@ -14858,8 +14860,8 @@ const TabsUnderline = ({
14858
14860
  })));
14859
14861
  };
14860
14862
 
14861
- var css_248z$N = ".Tag-modules_tag__sYiD6{align-items:center;border-radius:.25rem;display:flex;gap:.25rem;padding:0 .375rem;width:-moz-fit-content;width:fit-content}.Tag-modules_tag__sYiD6 p{max-width:95%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;width:100%}.Tag-modules_tag_idle__ym-G7{background:var(--color-neutral-dark-shades-600,#717376)}.Tag-modules_tag_idle__ym-G7 svg{stroke:#fff!important;fill:#fff!important}.Tag-modules_tag_info__Q6-WL{background:var(--color-primary-100,#e5f1ff)}.Tag-modules_tag_info__Q6-WL svg{stroke:#004799!important;fill:#004799!important}.Tag-modules_tag_violet__CgNel{background:var(--Color-Extended-Purple-100,#e9d3fd)}.Tag-modules_tag_violet__CgNel svg{stroke:#5c1994!important;fill:#5c1994!important}.Tag-modules_tag_light__RqIr6{background:var(--Color-Neutral-Clear-Shades-150,#eee)}.Tag-modules_tag_light__RqIr6 svg{stroke:#32353a!important;fill:#32353a!important}.Tag-modules_tag_success__yANfh{background:var(--color-extended-green-100,#e8f5ea)}.Tag-modules_tag_success__yANfh svg{stroke:#3c743d!important;fill:#3c743d!important}.Tag-modules_tag_warning__C-O5t{background:var(--color-extended-yellow-100,#fff3d6)}.Tag-modules_tag_warning__C-O5t svg{stroke:#6e4f00!important;fill:#6e4f00!important}.Tag-modules_tag_critical__v79so{background:var(--color-extended-red-100,#fddbdb)}.Tag-modules_tag_critical__v79so svg{stroke:#98312e!important;fill:#98312e!important}.Tag-modules_tag_sm__KQwsr{height:1.25rem}.Tag-modules_tag_sm__KQwsr svg{height:.75rem;width:.75rem}.Tag-modules_tag_base__omYEM{height:1.75rem}.Tag-modules_tag_base__omYEM svg{height:1rem;width:1rem}";
14862
- var styles$N = {"tag":"Tag-modules_tag__sYiD6","tag_idle":"Tag-modules_tag_idle__ym-G7","tag_info":"Tag-modules_tag_info__Q6-WL","tag_violet":"Tag-modules_tag_violet__CgNel","tag_light":"Tag-modules_tag_light__RqIr6","tag_success":"Tag-modules_tag_success__yANfh","tag_warning":"Tag-modules_tag_warning__C-O5t","tag_critical":"Tag-modules_tag_critical__v79so","tag_sm":"Tag-modules_tag_sm__KQwsr","tag_base":"Tag-modules_tag_base__omYEM"};
14863
+ var css_248z$N = ".Tag-modules_tag__sYiD6{align-items:center;border-radius:.25rem;display:flex;gap:.25rem;padding:0 .375rem;width:-moz-fit-content;width:fit-content}.Tag-modules_tag__sYiD6 p{max-width:95%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;width:100%}.Tag-modules_tag_idle__ym-G7{background:var(--color-neutral-dark-shades-600,#717376)}.Tag-modules_tag_idle__ym-G7 svg{stroke:#fff!important;fill:#fff!important}.Tag-modules_tag_info__Q6-WL{background:var(--color-primary-100,#e5f1ff)}.Tag-modules_tag_info__Q6-WL svg{stroke:#004799!important;fill:#004799!important}.Tag-modules_tag_violet__CgNel{background:var(--Color-Extended-Purple-100,#e9d3fd)}.Tag-modules_tag_violet__CgNel svg{stroke:#5c1994!important;fill:#5c1994!important}.Tag-modules_tag_light__RqIr6{background:var(--Color-Neutral-Clear-Shades-150,#eee)}.Tag-modules_tag_light__RqIr6 svg{stroke:#32353a!important;fill:#32353a!important}.Tag-modules_tag_success__yANfh{background:var(--color-extended-green-100,#e8f5ea)}.Tag-modules_tag_success__yANfh svg{stroke:#3c743d!important;fill:#3c743d!important}.Tag-modules_tag_warning__C-O5t{background:var(--color-extended-yellow-100,#fff3d6)}.Tag-modules_tag_warning__C-O5t svg{stroke:#6e4f00!important;fill:#6e4f00!important}.Tag-modules_tag_critical__v79so{background:var(--color-extended-red-100,#fddbdb)}.Tag-modules_tag_critical__v79so svg{stroke:#98312e!important;fill:#98312e!important}.Tag-modules_tag_sm__KQwsr{height:1.25rem}.Tag-modules_tag_sm__KQwsr svg{height:.75rem;width:.75rem}.Tag-modules_tag_base__omYEM{height:1.75rem}.Tag-modules_tag_base__omYEM svg{height:1rem;width:1rem}.Tag-modules_canBeRemoved__ei-3U svg{cursor:pointer}";
14864
+ var styles$N = {"tag":"Tag-modules_tag__sYiD6","tag_idle":"Tag-modules_tag_idle__ym-G7","tag_info":"Tag-modules_tag_info__Q6-WL","tag_violet":"Tag-modules_tag_violet__CgNel","tag_light":"Tag-modules_tag_light__RqIr6","tag_success":"Tag-modules_tag_success__yANfh","tag_warning":"Tag-modules_tag_warning__C-O5t","tag_critical":"Tag-modules_tag_critical__v79so","tag_sm":"Tag-modules_tag_sm__KQwsr","tag_base":"Tag-modules_tag_base__omYEM","canBeRemoved":"Tag-modules_canBeRemoved__ei-3U"};
14863
14865
  styleInject(css_248z$N);
14864
14866
 
14865
14867
  colord.extend([mixPlugin]); //Used for the .tints() method of colord
@@ -14873,6 +14875,7 @@ const Tag = ({
14873
14875
  amountNumber,
14874
14876
  customColor,
14875
14877
  className,
14878
+ canBeRemoved = false,
14876
14879
  ...props
14877
14880
  }) => {
14878
14881
  const tagCustomColor = customColor ? colord.colord(customColor) : undefined;
@@ -14898,17 +14901,34 @@ const Tag = ({
14898
14901
  return 'xs';
14899
14902
  } else if (size === 'base') return 'sm';else return 'sm';
14900
14903
  };
14901
- return /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
14904
+ const [isEllipsisActive, setIsEllipsisActive] = React.useState(false);
14905
+ React.useEffect(() => {
14906
+ const checkEllipsis = () => {
14907
+ const element = document.querySelector('#tag_text');
14908
+ if (element) {
14909
+ setIsEllipsisActive(element.scrollWidth > element.clientWidth);
14910
+ }
14911
+ };
14912
+ checkEllipsis();
14913
+ window.addEventListener('resize', checkEllipsis);
14914
+ return () => window.removeEventListener('resize', checkEllipsis);
14915
+ }, []);
14916
+ return /*#__PURE__*/React__default.createElement(Tooltip, {
14917
+ tooltipDescription: text,
14918
+ arrow: true,
14919
+ isTooltipActive: isEllipsisActive
14920
+ }, /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
14902
14921
  style: {
14903
14922
  backgroundColor: customColor
14904
14923
  },
14905
- className: `${styles$N.tag} ${getTagStatus()} ${getTagSize()} ${className ?? ''}`
14924
+ className: `${styles$N.tag} ${getTagStatus()} ${getTagSize()} ${className ?? ''} ${canBeRemoved && styles$N.canBeRemoved}`
14906
14925
  }), iconLeft && /*#__PURE__*/React__default.cloneElement(iconLeft, {
14907
14926
  style: {
14908
14927
  fill: getTextColor(),
14909
14928
  stroke: getTextColor()
14910
14929
  }
14911
14930
  }), /*#__PURE__*/React__default.createElement(Text, {
14931
+ id: "tag_text",
14912
14932
  size: getTextSize(),
14913
14933
  text: text,
14914
14934
  color: getTextColor()
@@ -14922,7 +14942,7 @@ const Tag = ({
14922
14942
  fill: getTextColor(),
14923
14943
  stroke: getTextColor()
14924
14944
  }
14925
- }));
14945
+ })));
14926
14946
  };
14927
14947
 
14928
14948
  var css_248z$O = ".TextInput-modules_input__Ky9uR{font-family:var(--sdFontFamilyOpenSans);font-size:var(--sdTypoTextNoDecorationRegularBase);font-style:normal;font-weight:var(--sdFontWeightRegular);letter-spacing:var(--sdLetterSpacingButtons);line-height:var(--sdLineHeight130);margin:unset;text-align:left;width:100%}.TextInput-modules_input__Ky9uR svg{height:1rem;width:1rem}input{font-family:var(--sdFontFamilyOpenSans);font-size:var(--sdTypoTextNoDecorationRegularBase);font-style:normal;font-weight:var(--sdFontWeightRegular);letter-spacing:var(--sdLetterSpacingButtons);line-height:var(--sdLineHeight130);margin:unset;text-align:left}input.TextInput-modules_input__Ky9uR{height:1rem}.TextInput-modules_MuiInputBase-root-MuiOutlinedInput-root__Kq7D9{font-family:var(--sdFontFamilyOpenSans);font-size:var(--sdTypoTextNoDecorationRegularBase);font-style:normal;font-weight:var(--sdFontWeightRegular);letter-spacing:var(--sdLetterSpacingButtons);line-height:var(--sdLineHeight130);margin:unset;text-align:left}.TextInput-modules_input_top_label__Xj8GH{margin-bottom:.625rem}.TextInput-modules_input__Ky9uR .TextInput-modules_MuiInputBase-input__beBli{color:var(--gray-black);font-family:OpenSans;font-size:1rem;padding:.375rem .75rem}.TextInput-modules_text_below__oT18E{margin:.25rem .5rem .25rem .75rem}";
@@ -16097,6 +16117,7 @@ const Text = ({
16097
16117
  textDecoration,
16098
16118
  className,
16099
16119
  required,
16120
+ id,
16100
16121
  ...props
16101
16122
  }) => {
16102
16123
  const getTextSize = () => {
@@ -16109,6 +16130,7 @@ const Text = ({
16109
16130
  if (textDecoration === 'underline') return styles$Y.text_underline;else if (textDecoration === 'line-through') return styles$Y.text_line_through;else return '';
16110
16131
  };
16111
16132
  return /*#__PURE__*/React__default.createElement("p", Object.assign({}, props, {
16133
+ id: id,
16112
16134
  style: {
16113
16135
  color: color
16114
16136
  },