odaptos_design_system 2.0.1 → 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.
- package/dist/Atoms/Typography/Text.d.ts +2 -1
- package/dist/odaptos_design_system.cjs.development.js +21 -2
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +21 -2
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Atoms/Tag/Tag.tsx +45 -23
- package/src/Atoms/Typography/Text.tsx +3 -0
|
@@ -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 {};
|
|
@@ -14901,7 +14901,23 @@ const Tag = ({
|
|
|
14901
14901
|
return 'xs';
|
|
14902
14902
|
} else if (size === 'base') return 'sm';else return 'sm';
|
|
14903
14903
|
};
|
|
14904
|
-
|
|
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, {
|
|
14905
14921
|
style: {
|
|
14906
14922
|
backgroundColor: customColor
|
|
14907
14923
|
},
|
|
@@ -14912,6 +14928,7 @@ const Tag = ({
|
|
|
14912
14928
|
stroke: getTextColor()
|
|
14913
14929
|
}
|
|
14914
14930
|
}), /*#__PURE__*/React__default.createElement(Text, {
|
|
14931
|
+
id: "tag_text",
|
|
14915
14932
|
size: getTextSize(),
|
|
14916
14933
|
text: text,
|
|
14917
14934
|
color: getTextColor()
|
|
@@ -14925,7 +14942,7 @@ const Tag = ({
|
|
|
14925
14942
|
fill: getTextColor(),
|
|
14926
14943
|
stroke: getTextColor()
|
|
14927
14944
|
}
|
|
14928
|
-
}));
|
|
14945
|
+
})));
|
|
14929
14946
|
};
|
|
14930
14947
|
|
|
14931
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}";
|
|
@@ -16100,6 +16117,7 @@ const Text = ({
|
|
|
16100
16117
|
textDecoration,
|
|
16101
16118
|
className,
|
|
16102
16119
|
required,
|
|
16120
|
+
id,
|
|
16103
16121
|
...props
|
|
16104
16122
|
}) => {
|
|
16105
16123
|
const getTextSize = () => {
|
|
@@ -16112,6 +16130,7 @@ const Text = ({
|
|
|
16112
16130
|
if (textDecoration === 'underline') return styles$Y.text_underline;else if (textDecoration === 'line-through') return styles$Y.text_line_through;else return '';
|
|
16113
16131
|
};
|
|
16114
16132
|
return /*#__PURE__*/React__default.createElement("p", Object.assign({}, props, {
|
|
16133
|
+
id: id,
|
|
16115
16134
|
style: {
|
|
16116
16135
|
color: color
|
|
16117
16136
|
},
|