funuicss 2.0.25 → 2.5.1

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.
Files changed (86) hide show
  1. package/css/fun.css +1005 -3758
  2. package/index.d.ts +35 -0
  3. package/index.js +76 -0
  4. package/index.tsx +35 -0
  5. package/js/Fun.js +2 -2
  6. package/js/Fun.tsx +9 -8
  7. package/package.json +2 -1
  8. package/tsconfig.tsbuildinfo +1 -1
  9. package/ui/alert/Alert.d.ts +5 -3
  10. package/ui/alert/Alert.js +27 -23
  11. package/ui/alert/Alert.tsx +71 -86
  12. package/ui/aos/AOS.d.ts +1 -1
  13. package/ui/appbar/AppBar.d.ts +1 -1
  14. package/ui/avatar/Avatar.d.ts +2 -1
  15. package/ui/breadcrumb/BreadCrumb.d.ts +2 -1
  16. package/ui/button/Button.d.ts +1 -1
  17. package/ui/card/Card.d.ts +1 -1
  18. package/ui/card/CardBody.d.ts +2 -2
  19. package/ui/card/CardFab.d.ts +2 -2
  20. package/ui/card/CardFooter.d.ts +2 -2
  21. package/ui/card/CardHeader.d.ts +2 -2
  22. package/ui/div/Div.d.ts +1 -1
  23. package/ui/drop/Action.d.ts +1 -1
  24. package/ui/drop/Down.d.ts +1 -1
  25. package/ui/drop/Item.d.ts +1 -1
  26. package/ui/drop/Menu.d.ts +1 -1
  27. package/ui/drop/Up.d.ts +1 -1
  28. package/ui/grid/Col.d.ts +2 -1
  29. package/ui/grid/Grid.d.ts +2 -1
  30. package/ui/input/Iconic.d.ts +2 -2
  31. package/ui/input/Input.d.ts +2 -0
  32. package/ui/input/Input.js +50 -9
  33. package/ui/input/Input.tsx +34 -7
  34. package/ui/list/Item.d.ts +1 -1
  35. package/ui/list/List.d.ts +1 -1
  36. package/ui/loader/Loader.d.ts +2 -1
  37. package/ui/modal/Action.d.ts +1 -1
  38. package/ui/modal/Close.d.ts +2 -1
  39. package/ui/modal/Content.d.ts +1 -1
  40. package/ui/modal/Header.d.ts +2 -2
  41. package/ui/modal/Header.tsx +1 -1
  42. package/ui/modal/Modal.d.ts +8 -2
  43. package/ui/modal/Modal.js +33 -21
  44. package/ui/modal/Modal.tsx +99 -52
  45. package/ui/notification/Content.d.ts +1 -1
  46. package/ui/notification/Footer.d.ts +1 -1
  47. package/ui/notification/Header.d.ts +1 -1
  48. package/ui/notification/Notification.d.ts +1 -1
  49. package/ui/page/NotFound.d.ts +1 -1
  50. package/ui/page/NotFound.js +5 -5
  51. package/ui/page/NotFound.tsx +6 -7
  52. package/ui/page/UnAuthorized.d.ts +1 -1
  53. package/ui/page/UnAuthorized.js +4 -2
  54. package/ui/page/UnAuthorized.tsx +7 -5
  55. package/ui/progress/Bar.d.ts +1 -1
  56. package/ui/sidebar/SideBar.d.ts +2 -1
  57. package/ui/sidebar/SideContent.d.ts +1 -1
  58. package/ui/snackbar/SnackBar.d.ts +4 -1
  59. package/ui/snackbar/SnackBar.js +16 -14
  60. package/ui/snackbar/SnackBar.tsx +41 -25
  61. package/ui/specials/Circle.d.ts +3 -2
  62. package/ui/specials/Circle.js +2 -2
  63. package/ui/specials/Circle.tsx +5 -3
  64. package/ui/specials/FullCenteredPage.d.ts +1 -1
  65. package/ui/specials/Hr.d.ts +1 -1
  66. package/ui/specials/RowFlex.d.ts +1 -1
  67. package/ui/specials/Section.d.ts +1 -1
  68. package/ui/table/Body.d.ts +1 -1
  69. package/ui/table/Data.d.ts +1 -1
  70. package/ui/table/Head.d.ts +1 -1
  71. package/ui/table/Row.d.ts +1 -1
  72. package/ui/table/Table.d.ts +1 -1
  73. package/ui/table/Table.js +11 -7
  74. package/ui/table/Table.tsx +20 -8
  75. package/ui/text/Text.d.ts +5 -5
  76. package/ui/text/Text.js +20 -11
  77. package/ui/text/Text.tsx +62 -33
  78. package/ui/tooltip/Tip.d.ts +2 -1
  79. package/ui/tooltip/Tip.js +9 -5
  80. package/ui/tooltip/Tip.tsx +12 -2
  81. package/ui/tooltip/ToolTip.d.ts +1 -1
  82. package/ui/tooltip/ToolTip.js +1 -1
  83. package/ui/tooltip/ToolTip.tsx +7 -1
  84. package/ui/video/FunPlayer.d.ts +0 -7
  85. package/ui/video/FunPlayer.js +202 -179
  86. package/ui/video/FunPlayer.tsx +218 -218
@@ -1,40 +1,56 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
 
3
4
  interface SnackbarProps {
4
5
  message: string;
5
- close: React.ReactNode;
6
+ close?: React.ReactNode;
6
7
  open: boolean;
8
+ setOpen: (val: boolean) => void;
7
9
  position: string;
8
10
  funcss?: string;
9
11
  animation?: string;
10
- duration?: number;
11
- flat?:boolean
12
+ duration?: number; // animation duration (in seconds)
13
+ autoHide?: boolean; // 👈 NEW
14
+ autoHideDuration?: number; // 👈 NEW in milliseconds
15
+ flat?: boolean;
12
16
  }
13
17
 
14
- const SnackBar: React.FC<SnackbarProps> = ({ message, close, open, position, funcss, animation, duration , flat}) => {
15
- if (open) {
16
- return (
17
- <div>
18
- <div className={`snackbar ${position} ${funcss} ${flat ? "flat" : ""}`} style={{ animation: ` ${duration}s ${animation}` }}>
19
- <div className="snackbar-content">
20
- <div className="snackbar-body">
21
- {message}
22
- </div>
23
- {
24
- close &&
25
- <div>
26
- <span className="close-snackbar">
27
- <span>{close}</span>
28
- </span>
29
- </div>
30
- }
18
+ const SnackBar: React.FC<SnackbarProps> = ({
19
+ message,
20
+ close,
21
+ open,
22
+ setOpen,
23
+ position,
24
+ funcss,
25
+ animation,
26
+ duration = 0.3,
27
+ autoHide = false,
28
+ autoHideDuration = 3000,
29
+ flat,
30
+ }) => {
31
+ React.useEffect(() => {
32
+ if (open && autoHide) {
33
+ const timer = setTimeout(() => {
34
+ setOpen(false);
35
+ }, autoHideDuration);
36
+ return () => clearTimeout(timer);
37
+ }
38
+ }, [open, autoHide, autoHideDuration, setOpen]);
39
+
40
+ if (!open) return null;
41
+
42
+ return (
43
+ <div className={`snackbar ${position} ${funcss || ''} ${flat ? 'flat' : ''}`} style={{ animation: `${duration}s ${animation || 'SlideUp'}` }}>
44
+ <div className="snackbar-content">
45
+ <div className="snackbar-body">{message}</div>
46
+ {close && (
47
+ <div className="close-snackbar pointer" onClick={() =>setOpen ? setOpen(false) : null}>
48
+ {close}
31
49
  </div>
32
- </div>
50
+ )}
33
51
  </div>
34
- );
35
- } else {
36
- return <div></div>;
37
- }
52
+ </div>
53
+ );
38
54
  };
39
55
 
40
56
  export default SnackBar;
@@ -4,11 +4,12 @@ interface Circle_Props extends HTMLProps<HTMLDivElement> {
4
4
  size?: number;
5
5
  funcss?: string;
6
6
  bg?: string;
7
+ color?: string;
7
8
  children?: ReactNode;
8
9
  hoverable?: boolean;
9
10
  raised?: boolean;
10
- key?: React.key;
11
+ key?: React.Key;
11
12
  onClick?: () => void;
12
13
  }
13
- export default function Circle({ size, funcss, bg, children, hoverable, raised, key, onClick, ...rest }: Circle_Props): any;
14
+ export default function Circle({ size, funcss, bg, color, children, hoverable, raised, key, onClick, ...rest }: Circle_Props): React.JSX.Element;
14
15
  export {};
@@ -48,8 +48,8 @@ var __rest = (this && this.__rest) || function (s, e) {
48
48
  Object.defineProperty(exports, "__esModule", { value: true });
49
49
  var React = __importStar(require("react"));
50
50
  function Circle(_a) {
51
- var size = _a.size, funcss = _a.funcss, bg = _a.bg, children = _a.children, hoverable = _a.hoverable, raised = _a.raised, key = _a.key, onClick = _a.onClick, rest = __rest(_a, ["size", "funcss", "bg", "children", "hoverable", "raised", "key", "onClick"]);
52
- return (React.createElement("div", __assign({ className: "pointer avatar ".concat(funcss || '', " ").concat(raised ? "raised" : '', " ").concat(bg || '', " ").concat(hoverable ? 'hoverable' : ''), style: {
51
+ 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"]);
52
+ 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: {
53
53
  width: "".concat(size + "rem" || '2.3rem'),
54
54
  height: "".concat(size + "rem" || '2.3rem'),
55
55
  }, key: key, onClick: onClick }, rest),
@@ -7,18 +7,20 @@ interface Circle_Props extends HTMLProps<HTMLDivElement> {
7
7
  size?: number;
8
8
  funcss?: string;
9
9
  bg?: string;
10
+ color?: string;
10
11
  children?: ReactNode;
11
12
  hoverable?: boolean;
12
13
  raised?:boolean
13
- key?:React.key
14
+ key?:React.Key
14
15
  onClick?: ()=> void
15
16
  }
16
17
 
17
18
 
18
19
  export default function Circle({
19
- size,
20
+ size = 2,
20
21
  funcss,
21
22
  bg,
23
+ color,
22
24
  children,
23
25
  hoverable,
24
26
  raised ,
@@ -28,7 +30,7 @@ export default function Circle({
28
30
  }: Circle_Props) {
29
31
  return (
30
32
  <div
31
- className={`pointer avatar ${funcss || ''} ${raised ? "raised" : ''} ${bg || ''} ${
33
+ className={`pointer avatar ${funcss || ''} ${`text-` + color?.trim() || ''} ${raised ? "raised" : ''} ${bg || ''} ${
32
34
  hoverable ? 'hoverable' : ''
33
35
  }`}
34
36
  style={{
@@ -4,5 +4,5 @@ type HrProps = {
4
4
  funcss?: string;
5
5
  style?: object;
6
6
  };
7
- declare const FullCenteredPage: ({ children, funcss, style, ...rest }: HrProps) => any;
7
+ declare const FullCenteredPage: ({ children, funcss, style, ...rest }: HrProps) => React.JSX.Element;
8
8
  export default FullCenteredPage;
@@ -3,5 +3,5 @@ type HrProps = {
3
3
  children: React.ReactNode;
4
4
  funcss?: string;
5
5
  };
6
- declare const Hr: ({ children, funcss }: HrProps) => any;
6
+ declare const Hr: ({ children, funcss }: HrProps) => React.JSX.Element;
7
7
  export default Hr;
@@ -10,5 +10,5 @@ interface RowFlexProps {
10
10
  id?: string;
11
11
  children?: React.ReactNode;
12
12
  }
13
- export default function RowFlex({ funcss, content, justify, gap, alignItems, responsiveSmall, responsiveMedium, id, children, ...rest }: RowFlexProps): any;
13
+ export default function RowFlex({ funcss, content, justify, gap, alignItems, responsiveSmall, responsiveMedium, id, children, ...rest }: RowFlexProps): React.JSX.Element;
14
14
  export {};
@@ -4,5 +4,5 @@ type SectionProps = {
4
4
  funcss?: string;
5
5
  gap?: number;
6
6
  };
7
- declare const Section: ({ children, funcss, gap, ...rest }: SectionProps) => any;
7
+ declare const Section: ({ children, funcss, gap, ...rest }: SectionProps) => React.JSX.Element;
8
8
  export default Section;
@@ -3,5 +3,5 @@ type TableBodyProps = {
3
3
  children?: React.ReactNode;
4
4
  funcss?: string;
5
5
  };
6
- export default function TableBody({ children, funcss }: TableBodyProps): any;
6
+ export default function TableBody({ children, funcss }: TableBodyProps): React.JSX.Element;
7
7
  export {};
@@ -4,5 +4,5 @@ interface TableDataProps {
4
4
  funcss?: string;
5
5
  key?: string;
6
6
  }
7
- export default function TableData({ children, funcss, key }: TableDataProps): any;
7
+ export default function TableData({ children, funcss, key }: TableDataProps): React.JSX.Element;
8
8
  export {};
@@ -3,5 +3,5 @@ type TableHeadProps = {
3
3
  children?: React.ReactNode;
4
4
  funcss?: string;
5
5
  };
6
- export default function TableHead({ children, funcss }: TableHeadProps): any;
6
+ export default function TableHead({ children, funcss }: TableHeadProps): React.JSX.Element;
7
7
  export {};
package/ui/table/Row.d.ts CHANGED
@@ -5,5 +5,5 @@ type TableRowProps = {
5
5
  rowKey?: React.Key;
6
6
  key?: React.Key;
7
7
  };
8
- export default function TableRow({ children, funcss, rowKey, key }: TableRowProps): any;
8
+ export default function TableRow({ children, funcss, rowKey, key }: TableRowProps): React.JSX.Element;
9
9
  export {};
@@ -29,5 +29,5 @@ type TableProps = {
29
29
  };
30
30
  export default function Table({ children, funcss, bordered, noStripped, hoverable, title, showTotal, light, dark, head, body, data, isLoading, right, height, pageSize, // Default page size,
31
31
  customColumns, filterableFields, // New prop
32
- ...rest }: TableProps): any;
32
+ ...rest }: TableProps): React.JSX.Element;
33
33
  export {};
package/ui/table/Table.js CHANGED
@@ -132,21 +132,25 @@ function Table(_a) {
132
132
  data &&
133
133
  React.createElement("div", { className: "padding bb" },
134
134
  React.createElement(RowFlex_1.default, { justify: 'space-between' },
135
- data &&
136
- React.createElement("div", { className: "text-bold" },
137
- React.createElement(Text_1.default, { text: 'Records:', size: "small", bold: true, color: 'primary' }),
138
- React.createElement(Text_1.default, { text: filteredData.length, heading: 'h4' })),
135
+ React.createElement("div", null,
136
+ title &&
137
+ React.createElement("div", null,
138
+ React.createElement(Text_1.default, { text: title || "", size: 'h4' })),
139
+ showTotal && data &&
140
+ React.createElement("div", null,
141
+ React.createElement(Text_1.default, { text: 'Records:', size: 'sm', color: 'primary' }),
142
+ React.createElement(Text_1.default, { text: filteredData.length, size: 'h6' }))),
139
143
  data && filterableFields ?
140
144
  React.createElement("div", { className: "col width-200-max" },
141
145
  React.createElement(RowFlex_1.default, { gap: 0.7 },
142
- React.createElement("select", { className: "dark800 input text-dark200 borderless roundEdgeSmall smallInput", value: selectedField || '', onChange: function (e) {
146
+ React.createElement("select", { className: " input borderedInput roundEdgeSmall smallInput", value: selectedField || '', onChange: function (e) {
143
147
  handleFieldChange(e.target.value);
144
148
  } },
145
149
  React.createElement("option", { value: "" }, "\uD83D\uDD0D Filter"),
146
150
  React.createElement("option", { value: "" }, "All*"), filterableFields === null || filterableFields === void 0 ? void 0 :
147
151
  filterableFields.map(function (field) { return (React.createElement("option", { key: field, value: field }, field)); })),
148
152
  selectedField && React.createElement("div", null, "="),
149
- selectedField && (React.createElement("select", { className: "dark800 input text-dark200 width-200-max borderless roundEdgeSmall smallInput", value: selectedValue || '', onChange: function (e) {
153
+ selectedField && (React.createElement("select", { className: " input borderedInput width-200-max roundEdgeSmall smallInput", value: selectedValue || '', onChange: function (e) {
150
154
  handleValueChange(e.target.value);
151
155
  handleChangePage(1);
152
156
  } },
@@ -183,6 +187,6 @@ function Table(_a) {
183
187
  React.createElement("div", { className: "padding bt" },
184
188
  React.createElement(RowFlex_1.default, { gap: 1, justify: 'center' },
185
189
  React.createElement("div", { className: "pagination" }, Array.from({ length: endPage - startPage + 1 }, function (_, i) { return (React.createElement(Circle_1.default, { size: 2.5, key: startPage + i, onClick: function () { return handleChangePage(startPage + i); }, funcss: currentPage === startPage + i ? 'primary pageCircle' : 'dark800 pageCircle text-primary' },
186
- React.createElement(Text_1.default, { text: "".concat(startPage + i), bold: true, size: 'small' }))); }))))))));
190
+ React.createElement(Text_1.default, { text: "".concat(startPage + i), bold: true, size: 'sm' }))); }))))))));
187
191
  }
188
192
  exports.default = Table;
@@ -139,19 +139,30 @@ export default function Table({
139
139
  data &&
140
140
  <div className="padding bb">
141
141
  <RowFlex justify='space-between'>
142
- {
143
- data &&
144
- <div className="text-bold">
145
- <Text text='Records:' size="small" bold color='primary'/>
146
- <Text text={filteredData.length} heading='h4'/>
142
+ <div>
143
+ {
144
+ title &&
145
+ <div >
146
+ <Text text={title || ""} size='h4'/>
147
+ </div>
148
+
149
+
150
+ }
151
+ {
152
+ showTotal && data &&
153
+ <div >
154
+ <Text text='Records:' size='sm' color='primary'/>
155
+ <Text text={filteredData.length} size='h6'/>
147
156
  </div>
148
157
  }
158
+ </div>
159
+
149
160
  {
150
161
  data && filterableFields ?
151
162
  <div className="col width-200-max">
152
163
  <RowFlex gap={0.7}>
153
164
  <select
154
- className="dark800 input text-dark200 borderless roundEdgeSmall smallInput"
165
+ className=" input borderedInput roundEdgeSmall smallInput"
155
166
  value={selectedField || ''}
156
167
  onChange={(e) => {
157
168
  handleFieldChange(e.target.value)
@@ -169,7 +180,7 @@ export default function Table({
169
180
  }
170
181
  {selectedField && (
171
182
  <select
172
- className="dark800 input text-dark200 width-200-max borderless roundEdgeSmall smallInput"
183
+ className=" input borderedInput width-200-max roundEdgeSmall smallInput"
173
184
  value={selectedValue || ''}
174
185
  onChange={(e) => {
175
186
  handleValueChange(e.target.value)
@@ -290,10 +301,11 @@ export default function Table({
290
301
  onClick={() => handleChangePage(startPage + i)}
291
302
  funcss={currentPage === startPage + i ? 'primary pageCircle' : 'dark800 pageCircle text-primary'}
292
303
  >
293
- <Text text={`${startPage + i}`} bold size='small'/>
304
+ <Text text={`${startPage + i}`} bold size='sm'/>
294
305
  </Circle>
295
306
  ))}
296
307
  </div>
308
+
297
309
  </RowFlex>
298
310
  </div>
299
311
  }
package/ui/text/Text.d.ts CHANGED
@@ -1,16 +1,13 @@
1
1
  import React from 'react';
2
2
  type TypographyProps = {
3
3
  id?: string;
4
- size?: "smaller" | "small" | "big" | "bigger" | "jumbo" | "minified";
4
+ text?: React.ReactNode;
5
+ funcss?: string;
5
6
  bg?: string;
6
7
  color?: string;
7
- children?: React.ReactNode;
8
8
  hoverBg?: string;
9
9
  hoverText?: string;
10
10
  monospace?: boolean;
11
- text?: string;
12
- heading?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
13
- funcss?: string;
14
11
  emp?: boolean;
15
12
  bold?: boolean;
16
13
  block?: boolean;
@@ -20,6 +17,7 @@ type TypographyProps = {
20
17
  lighter?: boolean;
21
18
  italic?: boolean;
22
19
  underline?: boolean;
20
+ weight?: number;
23
21
  quote?: boolean;
24
22
  align?: "left" | "center" | "right" | "justify";
25
23
  lineHeight?: string;
@@ -39,6 +37,8 @@ type TypographyProps = {
39
37
  transform?: string;
40
38
  customStyles?: React.CSSProperties;
41
39
  onClick?: () => void;
40
+ children?: React.ReactNode;
41
+ size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
42
42
  };
43
43
  declare const Text: React.FC<TypographyProps>;
44
44
  export default Text;
package/ui/text/Text.js CHANGED
@@ -28,33 +28,42 @@ 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, size = _a.size, bg = _a.bg, color = _a.color, children = _a.children, hoverBg = _a.hoverBg, hoverText = _a.hoverText, text = _a.text, heading = _a.heading, 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, 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, rest = __rest(_a, ["id", "size", "bg", "color", "children", "hoverBg", "hoverText", "text", "heading", "funcss", "emp", "bold", "block", "body", "article", "light", "lighter", "italic", "underline", "align", "lineHeight", "letterSpacing", "uppercase", "lowercase", "capitalize", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "fontFamily", "textShadow", "textAlign", "customStyles", "monospace", "quote"]);
32
- var mergedStyles = __assign({ display: block ? 'block' : undefined, fontWeight: bold ? 'bold' : undefined, lineHeight: lineHeight ? lineHeight : undefined, letterSpacing: letterSpacing ? letterSpacing : undefined, textTransform: textTransform ? textTransform : undefined, textDecoration: textDecoration ? textDecoration : undefined, fontFamily: fontFamily ? fontFamily : undefined, textShadow: textShadow ? textShadow : undefined, textAlign: textAlign ? textAlign : undefined, whiteSpace: whiteSpace ? whiteSpace : undefined, wordBreak: wordBreak ? wordBreak : undefined, transform: customStyles === null || customStyles === void 0 ? void 0 : customStyles.transform }, customStyles);
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"]);
33
+ var Tag = block ? 'div' : 'span';
34
+ var sizeClass = "".concat(size === 'h1' ? "h1" :
35
+ size === 'h2' ? "h2" :
36
+ size === 'h3' ? "h3" :
37
+ size === 'h4' ? "h4" :
38
+ size === 'h5' ? "h5" :
39
+ size === 'h6' ? "h6" :
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);
33
42
  var classNames = [
34
- size ? "text-".concat(size) : '',
43
+ funcss || '',
44
+ sizeClass,
35
45
  color ? "text-".concat(color) : '',
36
46
  align ? "text-".concat(align) : '',
37
47
  monospace ? 'monospace' : '',
38
- bg ? bg : '',
48
+ bg || '',
39
49
  hoverText ? "hover-text-".concat(hoverText) : '',
40
50
  hoverBg ? "hover-".concat(hoverBg) : '',
41
51
  light ? 'lightText' : lighter ? 'lighterText' : '',
42
- heading ? heading : '',
43
52
  italic ? 'italicText' : '',
44
53
  underline ? 'underlineText' : '',
45
54
  body ? 'body' : '',
46
55
  article ? 'article' : '',
47
- funcss ? funcss : '',
48
56
  emp ? 'emp' : '',
49
57
  bold ? 'bold' : '',
50
58
  uppercase ? 'uppercase' : '',
51
59
  lowercase ? 'lowercase' : '',
52
60
  capitalize ? 'capitalize' : '',
53
- ].filter(Boolean).join(' ');
54
- var HeadingTag = heading ? heading : block ? "div" : 'span';
55
- return (react_1.default.createElement(HeadingTag, __assign({ id: id, className: classNames, style: mergedStyles }, rest),
56
- quote && react_1.default.createElement("div", { className: "" },
57
- react_1.default.createElement(pi_1.PiQuotesLight, null)),
61
+ ]
62
+ .filter(Boolean)
63
+ .join(' ');
64
+ return (react_1.default.createElement(Tag, __assign({ id: id, className: classNames, style: mergedStyles }, rest),
65
+ quote && (react_1.default.createElement("div", null,
66
+ react_1.default.createElement(pi_1.PiQuotesLight, null))),
58
67
  children,
59
68
  text));
60
69
  };
package/ui/text/Text.tsx CHANGED
@@ -3,16 +3,13 @@ import { PiQuotesLight } from 'react-icons/pi';
3
3
 
4
4
  type TypographyProps = {
5
5
  id?: string;
6
- size?: "smaller" | "small" | "big" | "bigger" | "jumbo" | "minified";
6
+ text?: React.ReactNode;
7
+ funcss?: string;
7
8
  bg?: string;
8
9
  color?: string;
9
- children?: React.ReactNode;
10
10
  hoverBg?: string;
11
11
  hoverText?: string;
12
12
  monospace?: boolean;
13
- text?: string;
14
- heading?: "h1" | "h2" |"h3" |"h4" |"h5" |"h6" ;
15
- funcss?: string;
16
13
  emp?: boolean;
17
14
  bold?: boolean;
18
15
  block?: boolean;
@@ -22,7 +19,8 @@ type TypographyProps = {
22
19
  lighter?: boolean;
23
20
  italic?: boolean;
24
21
  underline?: boolean;
25
- quote?:boolean;
22
+ weight?: number;
23
+ quote?: boolean;
26
24
  align?: "left" | "center" | "right" | "justify";
27
25
  lineHeight?: string;
28
26
  letterSpacing?: string;
@@ -41,18 +39,38 @@ type TypographyProps = {
41
39
  transform?: string;
42
40
  customStyles?: React.CSSProperties;
43
41
  onClick?: () => void;
42
+ children?: React.ReactNode;
43
+
44
+ size?:
45
+ | "xs"
46
+ | "sm"
47
+ | "base"
48
+ | "lg"
49
+ | "xl"
50
+ | "2xl"
51
+ | "3xl"
52
+ | "4xl"
53
+ | "5xl"
54
+ | "6xl"
55
+ | "7xl"
56
+ | "8xl"
57
+ | "9xl"
58
+ | "h1"
59
+ | "h2"
60
+ | "h3"
61
+ | "h4"
62
+ | "h5"
63
+ | "h6";
44
64
  };
45
65
 
46
66
  const Text: React.FC<TypographyProps> = ({
47
67
  id,
48
- size,
49
68
  bg,
50
69
  color,
51
70
  children,
52
71
  hoverBg,
53
72
  hoverText,
54
73
  text,
55
- heading,
56
74
  funcss,
57
75
  emp,
58
76
  bold,
@@ -62,6 +80,7 @@ const Text: React.FC<TypographyProps> = ({
62
80
  light,
63
81
  lighter,
64
82
  italic,
83
+ weight,
65
84
  underline,
66
85
  align,
67
86
  lineHeight,
@@ -79,59 +98,69 @@ const Text: React.FC<TypographyProps> = ({
79
98
  customStyles,
80
99
  monospace,
81
100
  quote,
101
+ size = 'base', // default
102
+
82
103
  ...rest
83
104
  }) => {
105
+ const Tag = block ? 'div' : 'span';
106
+
107
+ const sizeClass = `${size === 'h1' ? `h1` :
108
+ size === 'h2' ? `h2` :
109
+ size === 'h3' ? `h3` :
110
+ size === 'h4' ? `h4` :
111
+ size === 'h5' ? `h5` :
112
+ size === 'h6' ? `h6` :
113
+ `text-${size}`}`;
114
+
84
115
  const mergedStyles: React.CSSProperties = {
85
116
  display: block ? 'block' : undefined,
86
- fontWeight: bold ? 'bold' : undefined,
87
- lineHeight: lineHeight ? lineHeight : undefined,
88
- letterSpacing: letterSpacing ? letterSpacing : undefined,
89
- textTransform: textTransform ? textTransform : undefined,
90
- textDecoration: textDecoration ? textDecoration : undefined,
91
- fontFamily: fontFamily ? fontFamily : undefined,
92
- textShadow: textShadow ? textShadow : undefined,
93
- textAlign: textAlign ? textAlign : undefined,
94
- whiteSpace: whiteSpace ? whiteSpace : undefined,
95
- wordBreak: wordBreak ? wordBreak : 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,
96
127
  transform: customStyles?.transform,
97
128
  ...customStyles,
98
129
  };
99
130
 
100
131
  const classNames = [
101
- size ? `text-${size}` : '',
132
+ funcss || '',
133
+ sizeClass,
102
134
  color ? `text-${color}` : '',
103
135
  align ? `text-${align}` : '',
104
136
  monospace ? 'monospace' : '',
105
- bg ? bg : '',
137
+ bg || '',
106
138
  hoverText ? `hover-text-${hoverText}` : '',
107
139
  hoverBg ? `hover-${hoverBg}` : '',
108
140
  light ? 'lightText' : lighter ? 'lighterText' : '',
109
- heading ? heading : '',
110
141
  italic ? 'italicText' : '',
111
142
  underline ? 'underlineText' : '',
112
143
  body ? 'body' : '',
113
144
  article ? 'article' : '',
114
- funcss ? funcss : '',
115
145
  emp ? 'emp' : '',
116
146
  bold ? 'bold' : '',
117
147
  uppercase ? 'uppercase' : '',
118
148
  lowercase ? 'lowercase' : '',
119
149
  capitalize ? 'capitalize' : '',
120
- ].filter(Boolean).join(' ');
121
-
122
- const HeadingTag = heading ? heading : block ? "div" : 'span';
150
+ ]
151
+ .filter(Boolean)
152
+ .join(' ');
123
153
 
124
154
  return (
125
- <HeadingTag
126
- id={id}
127
- className={classNames}
128
- style={mergedStyles}
129
- {...rest}
130
- >
131
- {quote && <div className=""><PiQuotesLight /></div>}
155
+ <Tag id={id} className={classNames} style={mergedStyles} {...rest}>
156
+ {quote && (
157
+ <div>
158
+ <PiQuotesLight />
159
+ </div>
160
+ )}
132
161
  {children}
133
162
  {text}
134
- </HeadingTag>
163
+ </Tag>
135
164
  );
136
165
  };
137
166
 
@@ -4,8 +4,9 @@ interface TipProps {
4
4
  funcss?: string;
5
5
  children?: React.ReactNode;
6
6
  content?: React.ReactNode;
7
+ message?: React.ReactNode;
7
8
  animation?: string;
8
9
  duration?: number;
9
10
  }
10
- export default function Tip({ tip, funcss, children, content, animation, duration, ...rest }: TipProps): any;
11
+ export default function Tip({ tip, funcss, children, content, message, animation, duration, ...rest }: TipProps): React.JSX.Element;
11
12
  export {};
package/ui/tooltip/Tip.js CHANGED
@@ -47,10 +47,14 @@ var __rest = (this && this.__rest) || function (s, e) {
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  var React = __importStar(require("react"));
49
49
  function Tip(_a) {
50
- var tip = _a.tip, funcss = _a.funcss, children = _a.children, content = _a.content, animation = _a.animation, duration = _a.duration, rest = __rest(_a, ["tip", "funcss", "children", "content", "animation", "duration"]);
51
- return (React.createElement("span", __assign({ className: "tip-".concat(tip, " tip ").concat(funcss ? funcss : ''), style: { animation: " ".concat(duration ? duration : 0, "s ").concat(animation ? animation : '') } }, rest),
52
- children,
53
- " ",
54
- content));
50
+ var tip = _a.tip, funcss = _a.funcss, children = _a.children, content = _a.content, message = _a.message, animation = _a.animation, duration = _a.duration, rest = __rest(_a, ["tip", "funcss", "children", "content", "message", "animation", "duration"]);
51
+ // Calculate width only if content is a string
52
+ var text = message || content || children;
53
+ // Check if content is a plain string to calculate width
54
+ var isString = typeof text === 'string';
55
+ var minWidth = isString
56
+ ? "".concat(text.replace(/\s+/g, '').length * 8, "px")
57
+ : 'auto';
58
+ return (React.createElement("span", __assign({ className: "tip-".concat(tip, " tip ").concat(funcss ? funcss : ''), style: { animation: " ".concat(duration ? duration : 0, "s ").concat(animation ? animation : ''), minWidth: minWidth } }, rest), text));
55
59
  }
56
60
  exports.default = Tip;