funuicss 2.5.12 → 2.5.14

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.
@@ -266,15 +266,16 @@ const Input: React.FC<InputProps> = ({
266
266
  {button ? (
267
267
  button
268
268
  ) : (
269
- <Button
270
- funcss={` ${funcss} `}
271
- startIcon={icon ? icon : <PiCloudArrowUp />}
272
- bg="primary"
273
- fullWidth
274
- raised
275
- >
276
- {fileName || label || 'Upload File'}
277
- </Button>
269
+ <Button
270
+ funcss={` ${funcss} `}
271
+ startIcon={icon ? icon : <PiCloudArrowUp />}
272
+ bg="primary"
273
+ fullWidth
274
+ raised
275
+ >
276
+ {fileName || label || 'Upload File'}
277
+ </Button>
278
+
278
279
  )}
279
280
  <input
280
281
  name={name}
@@ -306,7 +307,13 @@ const Input: React.FC<InputProps> = ({
306
307
  <div className="_upload_container">
307
308
  <label htmlFor={id || "fileInput"} className="_upload_label">
308
309
  <div className="_upload_icon">{ icon || <>&#8682;</>}</div>
309
- <div className="_upload_text">{fileName || label || `Upload File`}</div>
310
+ <div className="_upload_text" style={{
311
+ whiteSpace: 'nowrap',
312
+ overflow: 'hidden',
313
+ textOverflow: 'ellipsis',
314
+ display: 'inline-block',
315
+ width: '100%',
316
+ }}>{fileName || label || `Upload File`}</div>
310
317
  <div className="text-small opacity-3">{extra || ''}</div>
311
318
  </label>
312
319
  <input onChange={handleChange} type="file" id={id || "fileInput"} className="_upload_input" {...rest} />
@@ -61,6 +61,7 @@ function ModalHeader(_a) {
61
61
  var funcss = _a.funcss, children = _a.children, close = _a.close, title = _a.title, rest = __rest(_a, ["funcss", "children", "close", "title"]);
62
62
  return (React.createElement("div", __assign({ className: "".concat(funcss, " modal-title") }, rest),
63
63
  React.createElement("div", { className: "fit" }, title ? title : children),
64
- " ",
65
- React.createElement("div", null, close ? close : '')));
64
+ close ? React.createElement("div", null,
65
+ " ",
66
+ close || '') : React.createElement(React.Fragment, null)));
66
67
  }
@@ -10,7 +10,10 @@ interface ModalHeaderProps {
10
10
  export default function ModalHeader({ funcss, children, close , title, ...rest }: ModalHeaderProps) {
11
11
  return (
12
12
  <div className={`${funcss} modal-title`} {...rest}>
13
- <div className="fit">{title ? title : children}</div> <div>{close ? close : ''}</div>
13
+ <div className="fit">{title ? title : children}</div>
14
+ {
15
+ close ? <div> {close || ''}</div> : <></>
16
+ }
14
17
  </div>
15
18
  );
16
19
  }
@@ -5,6 +5,7 @@ interface ModalProps {
5
5
  animation?: string;
6
6
  duration?: number;
7
7
  open: boolean;
8
+ hideClose: boolean;
8
9
  setOpen: (val: boolean) => void;
9
10
  maxWidth?: string;
10
11
  maxHeight?: string;
@@ -26,7 +27,7 @@ interface ModalProps {
26
27
  onOk?: () => void;
27
28
  onOkText?: string;
28
29
  }
29
- export default function Modal({ children, funcss, animation, duration, open, setOpen, maxWidth, maxHeight, okIcon, height, width, backdrop, title, titlecss, body, bodycss, footer, footercss, close, closecss, position, id, flat, onOk, // 👈 added
30
+ export default function Modal({ children, funcss, animation, duration, open, setOpen, maxWidth, maxHeight, okIcon, height, hideClose, width, backdrop, title, titlecss, body, bodycss, footer, footercss, close, closecss, position, id, flat, onOk, // 👈 added
30
31
  onOkText, // 👈 added
31
32
  ...rest }: ModalProps): React.JSX.Element | null;
32
33
  export {};
package/ui/modal/Modal.js CHANGED
@@ -67,9 +67,9 @@ var Action_1 = __importDefault(require("./Action"));
67
67
  var pi_1 = require("react-icons/pi");
68
68
  var Button_1 = __importDefault(require("../button/Button"));
69
69
  function Modal(_a) {
70
- var children = _a.children, funcss = _a.funcss, animation = _a.animation, duration = _a.duration, open = _a.open, setOpen = _a.setOpen, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, okIcon = _a.okIcon, height = _a.height, width = _a.width, _b = _a.backdrop, backdrop = _b === void 0 ? false : _b, title = _a.title, titlecss = _a.titlecss, body = _a.body, bodycss = _a.bodycss, footer = _a.footer, footercss = _a.footercss, close = _a.close, closecss = _a.closecss, position = _a.position, id = _a.id, flat = _a.flat, onOk = _a.onOk, // 👈 added
70
+ var children = _a.children, funcss = _a.funcss, animation = _a.animation, duration = _a.duration, open = _a.open, setOpen = _a.setOpen, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, okIcon = _a.okIcon, height = _a.height, _b = _a.hideClose, hideClose = _b === void 0 ? false : _b, width = _a.width, _c = _a.backdrop, backdrop = _c === void 0 ? false : _c, title = _a.title, titlecss = _a.titlecss, body = _a.body, bodycss = _a.bodycss, footer = _a.footer, footercss = _a.footercss, close = _a.close, closecss = _a.closecss, position = _a.position, id = _a.id, flat = _a.flat, onOk = _a.onOk, // 👈 added
71
71
  onOkText = _a.onOkText, // 👈 added
72
- rest = __rest(_a, ["children", "funcss", "animation", "duration", "open", "setOpen", "maxWidth", "maxHeight", "okIcon", "height", "width", "backdrop", "title", "titlecss", "body", "bodycss", "footer", "footercss", "close", "closecss", "position", "id", "flat", "onOk", "onOkText"]);
72
+ rest = __rest(_a, ["children", "funcss", "animation", "duration", "open", "setOpen", "maxWidth", "maxHeight", "okIcon", "height", "hideClose", "width", "backdrop", "title", "titlecss", "body", "bodycss", "footer", "footercss", "close", "closecss", "position", "id", "flat", "onOk", "onOkText"]);
73
73
  var modalId = id || '_mymodal';
74
74
  var handleClickOutside = function (e) {
75
75
  if (e.target && e.target.id === modalId) {
@@ -89,10 +89,12 @@ function Modal(_a) {
89
89
  animation: "".concat(duration || 0.2, "s ").concat(animation || 'ScaleUp'),
90
90
  maxWidth: maxWidth || undefined,
91
91
  maxHeight: maxHeight || undefined,
92
- width: width || undefined,
92
+ width: width || '100%',
93
93
  height: height || undefined,
94
94
  } }, rest),
95
- title && (React.createElement(Header_1.default, { funcss: titlecss || '', title: title, close: React.createElement("div", { onClick: function () { return setOpen(false); }, className: "".concat(closecss || '', " pointer hover-text-error") }, close || React.createElement(pi_1.PiX, { size: 25 })) })),
95
+ title && (React.createElement(Header_1.default, { funcss: titlecss || '', title: title, close: !hideClose ?
96
+ React.createElement("div", { onClick: function () { return setOpen(false); }, className: "".concat(closecss || '', " pointer hover-text-error") }, close || React.createElement(pi_1.PiX, { size: 25 }))
97
+ : "" })),
96
98
  body && (React.createElement(Content_1.default, { funcss: bodycss || '' }, body)),
97
99
  footer ? (React.createElement(Action_1.default, { funcss: footercss || '' }, footer)) : (React.createElement(Action_1.default, { funcss: 'text-right' },
98
100
  React.createElement(Button_1.default, { bg: 'success800', endIcon: okIcon || React.createElement(pi_1.PiPaperPlaneRight, null), raised: true, onClick: handleOkClick }, onOkText || 'OK'))),
@@ -12,6 +12,7 @@ interface ModalProps {
12
12
  animation?: string;
13
13
  duration?: number;
14
14
  open: boolean;
15
+ hideClose: boolean;
15
16
  setOpen: (val: boolean) => void;
16
17
  maxWidth?: string;
17
18
  maxHeight?: string;
@@ -45,6 +46,7 @@ export default function Modal({
45
46
  maxHeight,
46
47
  okIcon,
47
48
  height,
49
+ hideClose = false,
48
50
  width,
49
51
  backdrop = false,
50
52
  title,
@@ -89,7 +91,7 @@ export default function Modal({
89
91
  animation: `${duration || 0.2}s ${animation || 'ScaleUp'}`,
90
92
  maxWidth: maxWidth || undefined,
91
93
  maxHeight: maxHeight || undefined,
92
- width: width || undefined,
94
+ width: width || '100%',
93
95
  height: height || undefined,
94
96
  }}
95
97
  {...rest}
@@ -98,13 +100,15 @@ export default function Modal({
98
100
  <ModalHeader
99
101
  funcss={titlecss || ''}
100
102
  title={title}
101
- close={
103
+ close={!hideClose ?
104
+
102
105
  <div
103
106
  onClick={() => setOpen(false)}
104
107
  className={`${closecss || ''} pointer hover-text-error`}
105
108
  >
106
- {close || <PiX size={25} />}
109
+ {close || <PiX size={25} />}
107
110
  </div>
111
+ : ""
108
112
  }
109
113
  />
110
114
  )}
@@ -53,13 +53,13 @@ function NotFound(_a) {
53
53
  React.createElement("div", { className: "h2 text-warning round-edge" }, "404"),
54
54
  React.createElement("div", { style: { margin: "1.4rem 0px" } }, header ? header
55
55
  :
56
- React.createElement("div", { className: "text-big text-bold text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "Page Not Found")),
56
+ React.createElement("div", { className: "text-big text-bold text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "Page not found \uD83E\uDD14")),
57
57
  content ? content :
58
58
  React.createElement("div", { className: "article" },
59
- React.createElement(Text_1.default, { article: true, text: "Sorry, we couldn't find the page you're looking for.", color: "dark300", block: true })),
59
+ React.createElement(Text_1.default, { article: true, text: "Don't worry, it happens to the best of us \uD83D\uDE05. We'll help you find what you're looking for.", color: "dark300", block: true })),
60
60
  React.createElement("div", { style: { margin: "2rem 0px" } }, action ? action :
61
61
  React.createElement("div", { className: "row-flex gap", style: { justifyContent: "center", gap: "0.4rem" } },
62
62
  React.createElement(Button_1.default, { raised: true, rounded: true, startIcon: React.createElement(pi_1.PiArrowLeft, null), bg: 'primary', onClick: function () {
63
63
  window.history.back();
64
- } }, "Go Back"))))))));
64
+ } }, "Take me back \uD83C\uDFE0"))))))));
65
65
  }
@@ -36,14 +36,14 @@ export default function NotFound(
36
36
  header ? header
37
37
  :
38
38
  <div className="text-big text-bold text-dark300" style={{ display: "block", transition: "all 0.2s linear 0s" }}>
39
- Page Not Found
39
+ Page not found 🤔
40
40
  </div>
41
41
  }
42
42
  </div>
43
43
  {
44
44
  content ? content :
45
45
  <div className="article">
46
- <Text article text={`Sorry, we couldn't find the page you're looking for.`} color="dark300" block/>
46
+ <Text article text={`Don't worry, it happens to the best of us 😅. We'll help you find what you're looking for.`} color="dark300" block/>
47
47
  </div>
48
48
  }
49
49
  <div style={{ margin: "2rem 0px" }}>
@@ -53,7 +53,7 @@ export default function NotFound(
53
53
  <Button raised rounded startIcon={<PiArrowLeft />} bg='primary' onClick={() => {
54
54
  window.history.back()
55
55
  }}>
56
- Go Back
56
+ Take me back 🏠
57
57
  </Button>
58
58
  </div>
59
59
  }
@@ -64,3 +64,4 @@ export default function NotFound(
64
64
  </div>
65
65
  );
66
66
  }
67
+
@@ -51,12 +51,12 @@ function UnAuthorized(_a) {
51
51
  React.createElement("div", { className: "h2 text-warning round-edge" }, "401"),
52
52
  React.createElement("div", { style: { margin: "1.4rem 0px" } }, header ? header
53
53
  :
54
- React.createElement("div", { className: "text-bigger text-bold text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "Unauthorized Access")),
54
+ React.createElement("div", { className: "text-big text-bold text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "\uD83D\uDEAB Unauthorized Access")),
55
55
  content ? content :
56
56
  React.createElement("div", { className: "article" }, "Sorry! You do not have access to this resource."),
57
57
  React.createElement("div", { style: { margin: "2rem 0px" } }, action ? action :
58
58
  React.createElement("div", { className: "row-flex gap", style: { justifyContent: "center", gap: "0.4rem" } },
59
59
  React.createElement(Button_1.default, { raised: true, rounded: true, startIcon: React.createElement(pi_1.PiArrowLeft, null), bg: 'primary', onClick: function () {
60
60
  window.history.back();
61
- } }, "Go Back"))))))));
61
+ } }, "Take Me Back"))))))));
62
62
  }
@@ -33,15 +33,15 @@ export default function UnAuthorized(
33
33
  {
34
34
  header ? header
35
35
  :
36
- <div className="text-bigger text-bold text-dark300" style={{ display: "block", transition: "all 0.2s linear 0s" }}>
37
- Unauthorized Access
36
+ <div className="text-big text-bold text-dark300" style={{ display: "block", transition: "all 0.2s linear 0s" }}>
37
+ 🚫 Unauthorized Access
38
38
  </div>
39
39
  }
40
40
  </div>
41
41
  {
42
42
  content ? content :
43
43
  <div className="article">
44
- Sorry! You do not have access to this resource.
44
+ Sorry! You do not have access to this resource.
45
45
  </div>
46
46
  }
47
47
  <div style={{ margin: "2rem 0px" }}>
@@ -51,7 +51,7 @@ export default function UnAuthorized(
51
51
  <Button raised rounded startIcon={<PiArrowLeft />} bg='primary' onClick={() => {
52
52
  window.history.back()
53
53
  }}>
54
- Go Back
54
+ Take Me Back
55
55
  </Button>
56
56
  </div>
57
57
  }
@@ -60,7 +60,7 @@ exports.default = Circle;
60
60
  var React = __importStar(require("react"));
61
61
  function Circle(_a) {
62
62
  var _b = _a.size, size = _b === void 0 ? 2 : _b, funcss = _a.funcss, bg = _a.bg, color = _a.color, children = _a.children, hoverable = _a.hoverable, raised = _a.raised, key = _a.key, onClick = _a.onClick, rest = __rest(_a, ["size", "funcss", "bg", "color", "children", "hoverable", "raised", "key", "onClick"]);
63
- return (React.createElement("div", __assign({ className: "pointer avatar ".concat(funcss || '', " ").concat("text-" + (color === null || color === void 0 ? void 0 : color.trim()) || '', " ").concat(raised ? "raised" : '', " ").concat(bg || '', " ").concat(hoverable ? 'hoverable' : ''), style: {
63
+ return (React.createElement("div", __assign({ className: "pointer avatar ".concat(funcss || '', " ").concat("text-" + (color === null || color === void 0 ? void 0 : color.trim()) || '', " ").concat(raised ? "raised" : '', " ").concat(bg || 'lighter', " ").concat(hoverable ? 'hoverable' : ''), style: {
64
64
  width: "".concat(size + "rem" || '2.3rem'),
65
65
  height: "".concat(size + "rem" || '2.3rem'),
66
66
  }, key: key, onClick: onClick }, rest),
@@ -30,7 +30,7 @@ export default function Circle({
30
30
  }: Circle_Props) {
31
31
  return (
32
32
  <div
33
- className={`pointer avatar ${funcss || ''} ${`text-` + color?.trim() || ''} ${raised ? "raised" : ''} ${bg || ''} ${
33
+ className={`pointer avatar ${funcss || ''} ${`text-` + color?.trim() || ''} ${raised ? "raised" : ''} ${bg || 'lighter'} ${
34
34
  hoverable ? 'hoverable' : ''
35
35
  }`}
36
36
  style={{
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface AvatarGroupProps {
3
+ avatars: React.ReactElement[];
4
+ size?: number;
5
+ overlap?: number;
6
+ maxVisible?: number;
7
+ }
8
+ export default function CircleGroup({ avatars, size, overlap, maxVisible, }: AvatarGroupProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ 'use client';
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = CircleGroup;
8
+ var react_1 = __importDefault(require("react"));
9
+ function CircleGroup(_a) {
10
+ var avatars = _a.avatars, _b = _a.size, size = _b === void 0 ? 2 : _b, _c = _a.overlap, overlap = _c === void 0 ? 0.8 : _c, _d = _a.maxVisible, maxVisible = _d === void 0 ? avatars.length : _d;
11
+ var displayed = avatars.slice(0, maxVisible);
12
+ var extra = avatars.length - maxVisible;
13
+ return (react_1.default.createElement("div", { className: "flex", style: { direction: 'ltr' } },
14
+ displayed.map(function (avatar, i) { return (react_1.default.createElement("div", { key: i, style: {
15
+ marginLeft: i === 0 ? '0' : "-".concat(overlap, "rem"),
16
+ zIndex: avatars.length - i,
17
+ } }, react_1.default.cloneElement(avatar, { size: size }))); }),
18
+ extra > 0 && (react_1.default.createElement("div", { className: "avatar lighter text-small flex ", style: {
19
+ width: "".concat(size, "rem"),
20
+ height: "".concat(size, "rem"),
21
+ marginLeft: "-".concat(overlap, "rem"),
22
+ zIndex: 0,
23
+ } },
24
+ "+",
25
+ extra))));
26
+ }
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import React from 'react';
3
+
4
+ interface AvatarGroupProps {
5
+ avatars: React.ReactElement[]; // Or you can accept props data instead
6
+ size?: number;
7
+ overlap?: number; // how much they overlap in rem
8
+ maxVisible?: number; // optional limit
9
+ }
10
+
11
+ export default function CircleGroup({
12
+ avatars,
13
+ size = 2,
14
+ overlap = 0.8,
15
+ maxVisible = avatars.length,
16
+ }: AvatarGroupProps) {
17
+ const displayed = avatars.slice(0, maxVisible);
18
+ const extra = avatars.length - maxVisible;
19
+
20
+ return (
21
+ <div className="flex" style={{ direction: 'ltr' }}>
22
+ {displayed.map((avatar, i) => (
23
+ <div
24
+ key={i}
25
+ style={{
26
+ marginLeft: i === 0 ? '0' : `-${overlap}rem`,
27
+ zIndex: avatars.length - i,
28
+ }}
29
+ >
30
+ {React.cloneElement(avatar, { size })}
31
+ </div>
32
+ ))}
33
+ {extra > 0 && (
34
+ <div
35
+ className="avatar lighter text-small flex "
36
+ style={{
37
+ width: `${size}rem`,
38
+ height: `${size}rem`,
39
+ marginLeft: `-${overlap}rem`,
40
+ zIndex: 0,
41
+
42
+ }}
43
+ >
44
+ +{extra}
45
+ </div>
46
+ )}
47
+ </div>
48
+ );
49
+ }
package/ui/text/Text.d.ts CHANGED
@@ -34,6 +34,7 @@ type TypographyProps = {
34
34
  textAlign?: "left" | "center" | "right" | "justify";
35
35
  opacity?: number;
36
36
  zIndex?: number;
37
+ truncate?: number;
37
38
  transform?: string;
38
39
  customStyles?: React.CSSProperties;
39
40
  onClick?: () => void;
package/ui/text/Text.js CHANGED
@@ -28,8 +28,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
28
28
  var react_1 = __importDefault(require("react"));
29
29
  var pi_1 = require("react-icons/pi");
30
30
  var Text = function (_a) {
31
- var id = _a.id, bg = _a.bg, color = _a.color, children = _a.children, hoverBg = _a.hoverBg, hoverText = _a.hoverText, text = _a.text, funcss = _a.funcss, emp = _a.emp, bold = _a.bold, block = _a.block, body = _a.body, article = _a.article, light = _a.light, lighter = _a.lighter, italic = _a.italic, weight = _a.weight, underline = _a.underline, align = _a.align, lineHeight = _a.lineHeight, letterSpacing = _a.letterSpacing, uppercase = _a.uppercase, lowercase = _a.lowercase, capitalize = _a.capitalize, textDecoration = _a.textDecoration, textTransform = _a.textTransform, whiteSpace = _a.whiteSpace, wordBreak = _a.wordBreak, fontFamily = _a.fontFamily, textShadow = _a.textShadow, textAlign = _a.textAlign, customStyles = _a.customStyles, monospace = _a.monospace, quote = _a.quote, _b = _a.size, size = _b === void 0 ? 'base' : _b, // default
32
- rest = __rest(_a, ["id", "bg", "color", "children", "hoverBg", "hoverText", "text", "funcss", "emp", "bold", "block", "body", "article", "light", "lighter", "italic", "weight", "underline", "align", "lineHeight", "letterSpacing", "uppercase", "lowercase", "capitalize", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "fontFamily", "textShadow", "textAlign", "customStyles", "monospace", "quote", "size"]);
31
+ var id = _a.id, bg = _a.bg, color = _a.color, children = _a.children, hoverBg = _a.hoverBg, hoverText = _a.hoverText, text = _a.text, funcss = _a.funcss, emp = _a.emp, bold = _a.bold, block = _a.block, body = _a.body, article = _a.article, light = _a.light, lighter = _a.lighter, italic = _a.italic, weight = _a.weight, underline = _a.underline, align = _a.align, lineHeight = _a.lineHeight, letterSpacing = _a.letterSpacing, uppercase = _a.uppercase, lowercase = _a.lowercase, capitalize = _a.capitalize, textDecoration = _a.textDecoration, textTransform = _a.textTransform, whiteSpace = _a.whiteSpace, wordBreak = _a.wordBreak, fontFamily = _a.fontFamily, truncate = _a.truncate, textShadow = _a.textShadow, textAlign = _a.textAlign, customStyles = _a.customStyles, monospace = _a.monospace, quote = _a.quote, _b = _a.size, size = _b === void 0 ? 'base' : _b, // default
32
+ rest = __rest(_a, ["id", "bg", "color", "children", "hoverBg", "hoverText", "text", "funcss", "emp", "bold", "block", "body", "article", "light", "lighter", "italic", "weight", "underline", "align", "lineHeight", "letterSpacing", "uppercase", "lowercase", "capitalize", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "fontFamily", "truncate", "textShadow", "textAlign", "customStyles", "monospace", "quote", "size"]);
33
33
  var Tag = block ? 'div' : 'span';
34
34
  var sizeClass = "".concat(size === 'h1' ? "h1" :
35
35
  size === 'h2' ? "h2" :
@@ -38,7 +38,15 @@ var Text = function (_a) {
38
38
  size === 'h5' ? "h5" :
39
39
  size === 'h6' ? "h6" :
40
40
  "text-".concat(size));
41
- var mergedStyles = __assign({ display: block ? 'block' : undefined, fontWeight: bold ? 'bold' : weight ? weight : undefined, lineHeight: lineHeight, letterSpacing: letterSpacing, textTransform: textTransform, textDecoration: textDecoration, fontFamily: fontFamily, textShadow: textShadow, textAlign: textAlign, whiteSpace: whiteSpace, wordBreak: wordBreak, transform: customStyles === null || customStyles === void 0 ? void 0 : customStyles.transform }, customStyles);
41
+ var mergedStyles = __assign(__assign({ display: block ? 'block' : undefined, fontWeight: bold ? 'bold' : weight ? weight : undefined, lineHeight: lineHeight, letterSpacing: letterSpacing, textTransform: textTransform, textDecoration: textDecoration, fontFamily: fontFamily, textShadow: textShadow, textAlign: textAlign, whiteSpace: whiteSpace, wordBreak: wordBreak, transform: customStyles === null || customStyles === void 0 ? void 0 : customStyles.transform }, customStyles), (truncate
42
+ ? {
43
+ display: '-webkit-box',
44
+ WebkitBoxOrient: 'vertical',
45
+ WebkitLineClamp: truncate,
46
+ overflow: 'hidden',
47
+ textOverflow: 'ellipsis',
48
+ }
49
+ : {}));
42
50
  var classNames = [
43
51
  funcss || '',
44
52
  sizeClass,
package/ui/text/Text.tsx CHANGED
@@ -36,6 +36,7 @@ type TypographyProps = {
36
36
  textAlign?: "left" | "center" | "right" | "justify";
37
37
  opacity?: number;
38
38
  zIndex?: number;
39
+ truncate?: number;
39
40
  transform?: string;
40
41
  customStyles?: React.CSSProperties;
41
42
  onClick?: () => void;
@@ -93,6 +94,7 @@ const Text: React.FC<TypographyProps> = ({
93
94
  whiteSpace,
94
95
  wordBreak,
95
96
  fontFamily,
97
+ truncate,
96
98
  textShadow,
97
99
  textAlign,
98
100
  customStyles,
@@ -112,21 +114,31 @@ const Text: React.FC<TypographyProps> = ({
112
114
  size === 'h6' ? `h6` :
113
115
  `text-${size}`}`;
114
116
 
115
- const mergedStyles: React.CSSProperties = {
116
- display: block ? 'block' : undefined,
117
- fontWeight: bold ? 'bold' : weight ? weight : undefined,
118
- lineHeight,
119
- letterSpacing,
120
- textTransform,
121
- textDecoration,
122
- fontFamily,
123
- textShadow,
124
- textAlign,
125
- whiteSpace,
126
- wordBreak,
127
- transform: customStyles?.transform,
128
- ...customStyles,
129
- };
117
+ const mergedStyles: React.CSSProperties = {
118
+ display: block ? 'block' : undefined,
119
+ fontWeight: bold ? 'bold' : weight ? weight : undefined,
120
+ lineHeight,
121
+ letterSpacing,
122
+ textTransform,
123
+ textDecoration,
124
+ fontFamily,
125
+ textShadow,
126
+ textAlign,
127
+ whiteSpace,
128
+ wordBreak,
129
+ transform: customStyles?.transform,
130
+ ...customStyles,
131
+ ...(truncate
132
+ ? {
133
+ display: '-webkit-box',
134
+ WebkitBoxOrient: 'vertical',
135
+ WebkitLineClamp: truncate,
136
+ overflow: 'hidden',
137
+ textOverflow: 'ellipsis',
138
+ }
139
+ : {}),
140
+ };
141
+
130
142
 
131
143
  const classNames = [
132
144
  funcss || '',