funuicss 3.6.18 → 3.6.19
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 +496 -317
- package/package.json +1 -1
- package/ui/button/Button.js +56 -39
- package/ui/input/Input.js +283 -157
- package/ui/theme/theme.d.ts +16 -6
- package/ui/theme/theme.js +96 -82
- package/utils/componentUtils.d.ts +9 -6
- package/utils/componentUtils.js +42 -170
- package/utils/FireStore.d.ts +0 -10
- package/utils/FireStore.js +0 -273
- package/utils/Firebase.d.ts +0 -2
- package/utils/Firebase.js +0 -16
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.6.
|
|
2
|
+
"version": "3.6.19",
|
|
3
3
|
"name": "funuicss",
|
|
4
4
|
"description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
|
|
5
5
|
"main": "index.js",
|
package/ui/button/Button.js
CHANGED
|
@@ -62,56 +62,69 @@ var pi_1 = require("react-icons/pi");
|
|
|
62
62
|
var componentUtils_1 = require("../../utils/componentUtils");
|
|
63
63
|
var getDynamicIcon_1 = require("../../utils/getDynamicIcon");
|
|
64
64
|
function Button(_a) {
|
|
65
|
-
var _b
|
|
65
|
+
var _b, _c;
|
|
66
|
+
var _d = _a.variant, variant = _d === void 0 ? '' : _d, color = _a.color, bg = _a.bg, funcss = _a.funcss, startIcon = _a.startIcon, endIcon = _a.endIcon, stringPrefix = _a.stringPrefix, stringSuffix = _a.stringSuffix, prefix = _a.prefix, suffix = _a.suffix, iconSize = _a.iconSize, _e = _a.iconLineHeight, iconLineHeight = _e === void 0 ? 0 : _e, text = _a.text, rounded = _a.rounded, raised = _a.raised, height = _a.height, width = _a.width, float = _a.float, hoverUp = _a.hoverUp, fullWidth = _a.fullWidth, outlined = _a.outlined, small = _a.small, hoverless = _a.hoverless, smaller = _a.smaller, big = _a.big, bigger = _a.bigger, jumbo = _a.jumbo, flat = _a.flat, hoverNone = _a.hoverNone, fillAnimation = _a.fillAnimation, fillDirection = _a.fillDirection, fillTextColor = _a.fillTextColor, outlineSize = _a.outlineSize, isLoading = _a.isLoading, status = _a.status, bold = _a.bold, children = _a.children, style = _a.style, url = _a.url, onClick = _a.onClick, rest = __rest(_a, ["variant", "color", "bg", "funcss", "startIcon", "endIcon", "stringPrefix", "stringSuffix", "prefix", "suffix", "iconSize", "iconLineHeight", "text", "rounded", "raised", "height", "width", "float", "hoverUp", "fullWidth", "outlined", "small", "hoverless", "smaller", "big", "bigger", "jumbo", "flat", "hoverNone", "fillAnimation", "fillDirection", "fillTextColor", "outlineSize", "isLoading", "status", "bold", "children", "style", "url", "onClick"]);
|
|
66
67
|
var mergeWithLocal = (0, componentUtils_1.useComponentConfiguration)('Button', variant).mergeWithLocal;
|
|
67
|
-
|
|
68
|
+
// Create local props object - these will override config props
|
|
69
|
+
var localProps = __assign({ color: color, bg: bg, funcss: funcss, text: text, rounded: rounded, raised: raised, height: height, width: width, float: float, hoverUp: hoverUp, fullWidth: fullWidth, outlined: outlined, small: small, hoverless: hoverless, smaller: smaller, big: big, bigger: bigger, jumbo: jumbo, flat: flat, hoverNone: hoverNone, fillAnimation: fillAnimation, fillDirection: fillDirection, fillTextColor: fillTextColor, outlineSize: outlineSize, isLoading: isLoading, status: status, bold: bold, stringPrefix: stringPrefix, // Include stringPrefix in local props
|
|
70
|
+
stringSuffix: stringSuffix }, rest);
|
|
71
|
+
// Merge with config - LOCAL PROPS OVERRIDE CONFIG
|
|
72
|
+
var mergedProps = mergeWithLocal(localProps).props;
|
|
73
|
+
// Extract final values - local props take precedence
|
|
68
74
|
var final = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
// Use local props first, fallback to merged props
|
|
76
|
+
isLoading: isLoading !== null && isLoading !== void 0 ? isLoading : mergedProps.isLoading,
|
|
77
|
+
status: status !== null && status !== void 0 ? status : mergedProps.status,
|
|
78
|
+
text: text !== null && text !== void 0 ? text : mergedProps.text,
|
|
79
|
+
outlined: outlined !== null && outlined !== void 0 ? outlined : mergedProps.outlined,
|
|
80
|
+
bg: bg !== null && bg !== void 0 ? bg : mergedProps.bg,
|
|
81
|
+
color: color !== null && color !== void 0 ? color : mergedProps.color,
|
|
82
|
+
rounded: rounded !== null && rounded !== void 0 ? rounded : mergedProps.rounded,
|
|
83
|
+
hoverless: hoverless !== null && hoverless !== void 0 ? hoverless : mergedProps.hoverless,
|
|
84
|
+
bold: bold !== null && bold !== void 0 ? bold : mergedProps.bold,
|
|
85
|
+
float: float !== null && float !== void 0 ? float : mergedProps.float,
|
|
86
|
+
raised: raised !== null && raised !== void 0 ? raised : mergedProps.raised,
|
|
87
|
+
hoverUp: hoverUp !== null && hoverUp !== void 0 ? hoverUp : mergedProps.hoverUp,
|
|
88
|
+
flat: flat !== null && flat !== void 0 ? flat : mergedProps.flat,
|
|
89
|
+
hoverNone: hoverNone !== null && hoverNone !== void 0 ? hoverNone : mergedProps.hoverNone,
|
|
90
|
+
small: small !== null && small !== void 0 ? small : mergedProps.small,
|
|
91
|
+
smaller: smaller !== null && smaller !== void 0 ? smaller : mergedProps.smaller,
|
|
92
|
+
big: big !== null && big !== void 0 ? big : mergedProps.big,
|
|
93
|
+
bigger: bigger !== null && bigger !== void 0 ? bigger : mergedProps.bigger,
|
|
94
|
+
jumbo: jumbo !== null && jumbo !== void 0 ? jumbo : mergedProps.jumbo,
|
|
95
|
+
fillAnimation: fillAnimation !== null && fillAnimation !== void 0 ? fillAnimation : mergedProps.fillAnimation,
|
|
96
|
+
fillDirection: fillDirection !== null && fillDirection !== void 0 ? fillDirection : mergedProps.fillDirection,
|
|
97
|
+
fillTextColor: fillTextColor !== null && fillTextColor !== void 0 ? fillTextColor : mergedProps.fillTextColor,
|
|
98
|
+
funcss: funcss !== null && funcss !== void 0 ? funcss : mergedProps.funcss,
|
|
99
|
+
fullWidth: fullWidth !== null && fullWidth !== void 0 ? fullWidth : mergedProps.fullWidth,
|
|
100
|
+
stringPrefix: stringPrefix !== null && stringPrefix !== void 0 ? stringPrefix : mergedProps.stringPrefix, // Handle both local and config
|
|
101
|
+
stringSuffix: stringSuffix !== null && stringSuffix !== void 0 ? stringSuffix : mergedProps.stringSuffix, // Handle both local and config
|
|
92
102
|
};
|
|
93
|
-
var
|
|
94
|
-
var
|
|
103
|
+
var _f = (0, react_1.useState)(null), prefixNode = _f[0], setPrefixNode = _f[1];
|
|
104
|
+
var _g = (0, react_1.useState)(null), suffixNode = _g[0], setSuffixNode = _g[1];
|
|
95
105
|
function isReactElement(node) {
|
|
96
106
|
return react_1.default.isValidElement(node);
|
|
97
107
|
}
|
|
98
|
-
//
|
|
108
|
+
// Handle both local and config stringPrefix
|
|
99
109
|
(0, react_1.useEffect)(function () {
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
var effectiveStringPrefix = final.stringPrefix;
|
|
111
|
+
if (effectiveStringPrefix) {
|
|
112
|
+
(0, getDynamicIcon_1.getDynamicIcon)(effectiveStringPrefix).then(function (node) { return setPrefixNode(node); });
|
|
102
113
|
}
|
|
103
114
|
else {
|
|
104
115
|
setPrefixNode(null); // Clear when empty
|
|
105
116
|
}
|
|
106
|
-
}, [stringPrefix]);
|
|
117
|
+
}, [final.stringPrefix]);
|
|
118
|
+
// Handle both local and config stringSuffix
|
|
107
119
|
(0, react_1.useEffect)(function () {
|
|
108
|
-
|
|
109
|
-
|
|
120
|
+
var effectiveStringSuffix = final.stringSuffix;
|
|
121
|
+
if (effectiveStringSuffix) {
|
|
122
|
+
(0, getDynamicIcon_1.getDynamicIcon)(effectiveStringSuffix).then(function (node) { return setSuffixNode(node); });
|
|
110
123
|
}
|
|
111
124
|
else {
|
|
112
125
|
setSuffixNode(null); // Clear when empty
|
|
113
126
|
}
|
|
114
|
-
}, [stringSuffix]);
|
|
127
|
+
}, [final.stringSuffix]);
|
|
115
128
|
var textColorClass = final.bg
|
|
116
129
|
? final.color
|
|
117
130
|
? final.color
|
|
@@ -150,22 +163,26 @@ function Button(_a) {
|
|
|
150
163
|
alignItems: 'center',
|
|
151
164
|
justifyContent: 'center',
|
|
152
165
|
};
|
|
166
|
+
// Determine which prefix to show (priority: status > local startIcon > config stringPrefix > local stringPrefix)
|
|
167
|
+
var showPrefix = final.status || prefix || startIcon || prefixNode;
|
|
168
|
+
// Determine which suffix to show
|
|
169
|
+
var showSuffix = suffix || endIcon || suffixNode;
|
|
153
170
|
return (react_1.default.createElement("span", null,
|
|
154
|
-
react_1.default.createElement("button", __assign({ className: "".concat(classNames, " ").concat((
|
|
171
|
+
react_1.default.createElement("button", __assign({ className: "".concat(classNames, " ").concat((showPrefix || showSuffix || final.isLoading) ? 'iconic' : ''), style: __assign({ height: (_b = height !== null && height !== void 0 ? height : mergedProps.height) !== null && _b !== void 0 ? _b : '', width: final.fullWidth ? '100%' : (_c = width !== null && width !== void 0 ? width : mergedProps.width) !== null && _c !== void 0 ? _c : '', borderRadius: final.flat ? '0rem' : '' }, style), onClick: onClick || (url ? function () { return (window.location.href = url); } : undefined) }, mergedProps),
|
|
155
172
|
final.isLoading ? (react_1.default.createElement("span", { className: "btn_left_icon rotate", style: iconWrapperStyle },
|
|
156
173
|
react_1.default.createElement(pi_1.PiSpinner, { size: iconSize }))) : (react_1.default.createElement(react_1.default.Fragment, null, final.status ? (react_1.default.createElement("span", { className: "btn_left_icon", style: iconWrapperStyle },
|
|
157
174
|
final.status === 'success' && react_1.default.createElement(pi_1.PiCheck, { size: iconSize }),
|
|
158
175
|
final.status === 'info' && react_1.default.createElement(pi_1.PiInfo, { size: iconSize }),
|
|
159
176
|
final.status === 'warning' && react_1.default.createElement(pi_1.PiWarning, { size: iconSize }),
|
|
160
177
|
final.status === 'danger' && react_1.default.createElement(pi_1.PiX, { size: iconSize }))) : (
|
|
161
|
-
/* Otherwise show regular start icons */
|
|
162
|
-
|
|
178
|
+
/* Otherwise show regular start icons (priority: local startIcon > config stringPrefix) */
|
|
179
|
+
showPrefix && (react_1.default.createElement("span", { className: "btn_left_icon", style: iconWrapperStyle }, isReactElement(startIcon) ? react_1.default.cloneElement(startIcon, { size: iconSize })
|
|
163
180
|
: isReactElement(prefix) ? react_1.default.cloneElement(prefix, { size: iconSize })
|
|
164
181
|
: isReactElement(prefixNode) ? react_1.default.cloneElement(prefixNode, { size: iconSize })
|
|
165
182
|
: prefix || startIcon || prefixNode))))),
|
|
166
183
|
final.fillAnimation && react_1.default.createElement("span", { className: "button_fill_span ".concat(effectiveBg) }),
|
|
167
|
-
final.text ? final.text :
|
|
168
|
-
|
|
184
|
+
children ? children : final.text ? final.text : "",
|
|
185
|
+
showSuffix && (react_1.default.createElement("span", { className: "btn_right_icon", style: iconWrapperStyle }, isReactElement(endIcon) ? react_1.default.cloneElement(endIcon, { size: iconSize })
|
|
169
186
|
: isReactElement(suffix) ? react_1.default.cloneElement(suffix, { size: iconSize })
|
|
170
187
|
: isReactElement(suffixNode) ? react_1.default.cloneElement(suffixNode, { size: iconSize })
|
|
171
188
|
: suffix || endIcon || suffixNode)))));
|