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.
- package/css/fun.css +1005 -3758
- package/index.d.ts +35 -0
- package/index.js +76 -0
- package/index.tsx +35 -0
- package/js/Fun.js +2 -2
- package/js/Fun.tsx +9 -8
- package/package.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/ui/alert/Alert.d.ts +5 -3
- package/ui/alert/Alert.js +27 -23
- package/ui/alert/Alert.tsx +71 -86
- package/ui/aos/AOS.d.ts +1 -1
- package/ui/appbar/AppBar.d.ts +1 -1
- package/ui/avatar/Avatar.d.ts +2 -1
- package/ui/breadcrumb/BreadCrumb.d.ts +2 -1
- package/ui/button/Button.d.ts +1 -1
- package/ui/card/Card.d.ts +1 -1
- package/ui/card/CardBody.d.ts +2 -2
- package/ui/card/CardFab.d.ts +2 -2
- package/ui/card/CardFooter.d.ts +2 -2
- package/ui/card/CardHeader.d.ts +2 -2
- package/ui/div/Div.d.ts +1 -1
- package/ui/drop/Action.d.ts +1 -1
- package/ui/drop/Down.d.ts +1 -1
- package/ui/drop/Item.d.ts +1 -1
- package/ui/drop/Menu.d.ts +1 -1
- package/ui/drop/Up.d.ts +1 -1
- package/ui/grid/Col.d.ts +2 -1
- package/ui/grid/Grid.d.ts +2 -1
- package/ui/input/Iconic.d.ts +2 -2
- package/ui/input/Input.d.ts +2 -0
- package/ui/input/Input.js +50 -9
- package/ui/input/Input.tsx +34 -7
- package/ui/list/Item.d.ts +1 -1
- package/ui/list/List.d.ts +1 -1
- package/ui/loader/Loader.d.ts +2 -1
- package/ui/modal/Action.d.ts +1 -1
- package/ui/modal/Close.d.ts +2 -1
- package/ui/modal/Content.d.ts +1 -1
- package/ui/modal/Header.d.ts +2 -2
- package/ui/modal/Header.tsx +1 -1
- package/ui/modal/Modal.d.ts +8 -2
- package/ui/modal/Modal.js +33 -21
- package/ui/modal/Modal.tsx +99 -52
- package/ui/notification/Content.d.ts +1 -1
- package/ui/notification/Footer.d.ts +1 -1
- package/ui/notification/Header.d.ts +1 -1
- package/ui/notification/Notification.d.ts +1 -1
- package/ui/page/NotFound.d.ts +1 -1
- package/ui/page/NotFound.js +5 -5
- package/ui/page/NotFound.tsx +6 -7
- package/ui/page/UnAuthorized.d.ts +1 -1
- package/ui/page/UnAuthorized.js +4 -2
- package/ui/page/UnAuthorized.tsx +7 -5
- package/ui/progress/Bar.d.ts +1 -1
- package/ui/sidebar/SideBar.d.ts +2 -1
- package/ui/sidebar/SideContent.d.ts +1 -1
- package/ui/snackbar/SnackBar.d.ts +4 -1
- package/ui/snackbar/SnackBar.js +16 -14
- package/ui/snackbar/SnackBar.tsx +41 -25
- package/ui/specials/Circle.d.ts +3 -2
- package/ui/specials/Circle.js +2 -2
- package/ui/specials/Circle.tsx +5 -3
- package/ui/specials/FullCenteredPage.d.ts +1 -1
- package/ui/specials/Hr.d.ts +1 -1
- package/ui/specials/RowFlex.d.ts +1 -1
- package/ui/specials/Section.d.ts +1 -1
- package/ui/table/Body.d.ts +1 -1
- package/ui/table/Data.d.ts +1 -1
- package/ui/table/Head.d.ts +1 -1
- package/ui/table/Row.d.ts +1 -1
- package/ui/table/Table.d.ts +1 -1
- package/ui/table/Table.js +11 -7
- package/ui/table/Table.tsx +20 -8
- package/ui/text/Text.d.ts +5 -5
- package/ui/text/Text.js +20 -11
- package/ui/text/Text.tsx +62 -33
- package/ui/tooltip/Tip.d.ts +2 -1
- package/ui/tooltip/Tip.js +9 -5
- package/ui/tooltip/Tip.tsx +12 -2
- package/ui/tooltip/ToolTip.d.ts +1 -1
- package/ui/tooltip/ToolTip.js +1 -1
- package/ui/tooltip/ToolTip.tsx +7 -1
- package/ui/video/FunPlayer.d.ts +0 -7
- package/ui/video/FunPlayer.js +202 -179
- package/ui/video/FunPlayer.tsx +218 -218
package/ui/snackbar/SnackBar.tsx
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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> = ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
50
|
+
)}
|
|
33
51
|
</div>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return <div></div>;
|
|
37
|
-
}
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
38
54
|
};
|
|
39
55
|
|
|
40
56
|
export default SnackBar;
|
package/ui/specials/Circle.d.ts
CHANGED
|
@@ -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.
|
|
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):
|
|
14
|
+
export default function Circle({ size, funcss, bg, color, children, hoverable, raised, key, onClick, ...rest }: Circle_Props): React.JSX.Element;
|
|
14
15
|
export {};
|
package/ui/specials/Circle.js
CHANGED
|
@@ -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
|
|
52
|
-
return (React.createElement("div", __assign({ className: "pointer avatar ".concat(funcss || '', "
|
|
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),
|
package/ui/specials/Circle.tsx
CHANGED
|
@@ -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.
|
|
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 || ''}
|
|
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) =>
|
|
7
|
+
declare const FullCenteredPage: ({ children, funcss, style, ...rest }: HrProps) => React.JSX.Element;
|
|
8
8
|
export default FullCenteredPage;
|
package/ui/specials/Hr.d.ts
CHANGED
package/ui/specials/RowFlex.d.ts
CHANGED
|
@@ -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):
|
|
13
|
+
export default function RowFlex({ funcss, content, justify, gap, alignItems, responsiveSmall, responsiveMedium, id, children, ...rest }: RowFlexProps): React.JSX.Element;
|
|
14
14
|
export {};
|
package/ui/specials/Section.d.ts
CHANGED
package/ui/table/Body.d.ts
CHANGED
package/ui/table/Data.d.ts
CHANGED
package/ui/table/Head.d.ts
CHANGED
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):
|
|
8
|
+
export default function TableRow({ children, funcss, rowKey, key }: TableRowProps): React.JSX.Element;
|
|
9
9
|
export {};
|
package/ui/table/Table.d.ts
CHANGED
|
@@ -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):
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
React.createElement(
|
|
138
|
-
|
|
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: "
|
|
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: "
|
|
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: '
|
|
190
|
+
React.createElement(Text_1.default, { text: "".concat(startPage + i), bold: true, size: 'sm' }))); }))))))));
|
|
187
191
|
}
|
|
188
192
|
exports.default = Table;
|
package/ui/table/Table.tsx
CHANGED
|
@@ -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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
<Text text={
|
|
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="
|
|
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="
|
|
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='
|
|
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
|
-
|
|
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,
|
|
32
|
-
|
|
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
|
-
|
|
43
|
+
funcss || '',
|
|
44
|
+
sizeClass,
|
|
35
45
|
color ? "text-".concat(color) : '',
|
|
36
46
|
align ? "text-".concat(align) : '',
|
|
37
47
|
monospace ? 'monospace' : '',
|
|
38
|
-
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
|
-
]
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
88
|
-
letterSpacing
|
|
89
|
-
textTransform
|
|
90
|
-
textDecoration
|
|
91
|
-
fontFamily
|
|
92
|
-
textShadow
|
|
93
|
-
textAlign
|
|
94
|
-
whiteSpace
|
|
95
|
-
wordBreak
|
|
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
|
-
|
|
132
|
+
funcss || '',
|
|
133
|
+
sizeClass,
|
|
102
134
|
color ? `text-${color}` : '',
|
|
103
135
|
align ? `text-${align}` : '',
|
|
104
136
|
monospace ? 'monospace' : '',
|
|
105
|
-
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
|
-
]
|
|
121
|
-
|
|
122
|
-
|
|
150
|
+
]
|
|
151
|
+
.filter(Boolean)
|
|
152
|
+
.join(' ');
|
|
123
153
|
|
|
124
154
|
return (
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
</
|
|
163
|
+
</Tag>
|
|
135
164
|
);
|
|
136
165
|
};
|
|
137
166
|
|
package/ui/tooltip/Tip.d.ts
CHANGED
|
@@ -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):
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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;
|