funuicss 2.5.13 → 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
  }
package/ui/modal/Modal.js CHANGED
@@ -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") }, !hideClose && (React.createElement(React.Fragment, null, 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'))),
@@ -91,7 +91,7 @@ export default function Modal({
91
91
  animation: `${duration || 0.2}s ${animation || 'ScaleUp'}`,
92
92
  maxWidth: maxWidth || undefined,
93
93
  maxHeight: maxHeight || undefined,
94
- width: width || undefined,
94
+ width: width || '100%',
95
95
  height: height || undefined,
96
96
  }}
97
97
  {...rest}
@@ -100,19 +100,15 @@ export default function Modal({
100
100
  <ModalHeader
101
101
  funcss={titlecss || ''}
102
102
  title={title}
103
- close={
103
+ close={!hideClose ?
104
+
104
105
  <div
105
106
  onClick={() => setOpen(false)}
106
107
  className={`${closecss || ''} pointer hover-text-error`}
107
108
  >
108
- {
109
- !hideClose && (
110
- <>
111
109
  {close || <PiX size={25} />}
112
- </>
113
- )
114
- }
115
110
  </div>
111
+ : ""
116
112
  }
117
113
  />
118
114
  )}
@@ -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 || '',