funuicss 3.8.7 → 3.8.9
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 +702 -87
- package/index.d.ts +3 -0
- package/index.js +8 -2
- package/package.json +1 -1
- package/ui/button/Button.d.ts +6 -5
- package/ui/button/Button.js +190 -84
- package/ui/div/Div.d.ts +3 -1
- package/ui/div/Div.js +2 -2
- package/ui/feature/Feature.d.ts +9 -38
- package/ui/feature/Feature.js +62 -147
- package/ui/flex/Flex.d.ts +11 -10
- package/ui/flex/Flex.js +102 -6
- package/ui/form/Form.d.ts +77 -0
- package/ui/form/Form.js +724 -0
- package/ui/input/FileUpload.js +370 -21
- package/ui/input/Input.d.ts +44 -15
- package/ui/input/Input.js +1145 -369
- package/ui/products/CartModal.d.ts +0 -2
- package/ui/products/CartModal.js +59 -39
- package/ui/products/ProductCard.js +9 -22
- package/ui/products/ProductDetail.js +136 -97
- package/ui/products/ProductLoader.d.ts +3 -0
- package/ui/products/ProductLoader.js +22 -0
- package/ui/products/Store.d.ts +32 -7
- package/ui/products/Store.js +393 -94
- package/ui/progress/Bar.js +2 -2
- package/ui/sidebar/SideBar.js +1 -2
- package/ui/specials/CircleGroup.d.ts +2 -1
- package/ui/specials/CircleGroup.js +3 -3
- package/ui/theme/theme.d.ts +4 -0
- package/ui/theme/theme.js +336 -133
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as Alert } from "./ui/alert/Alert";
|
|
2
2
|
export { default as ThemeProvider } from "./ui/theme/theme";
|
|
3
3
|
export { default as Button } from "./ui/button/Button";
|
|
4
|
+
export { default as Badge } from "./ui/button/Button";
|
|
4
5
|
export { default as Card } from "./ui/card/Card";
|
|
5
6
|
export { default as BreadCrumb } from "./ui/breadcrumb/BreadCrumb";
|
|
6
7
|
export { default as Container } from "./ui/container/Container";
|
|
@@ -34,6 +35,7 @@ export { default as Tip } from "./ui/tooltip/Tip";
|
|
|
34
35
|
export { default as RowFlex } from "./ui/specials/RowFlex";
|
|
35
36
|
export { default as Section } from "./ui/specials/Section";
|
|
36
37
|
export { default as Hr } from "./ui/specials/Hr";
|
|
38
|
+
export { default as Divider } from "./ui/specials/Hr";
|
|
37
39
|
export { default as Circle } from "./ui/specials/Circle";
|
|
38
40
|
export { default as CircleGroup } from "./ui/specials/CircleGroup";
|
|
39
41
|
export { default as FullCenteredPage } from "./ui/specials/FullCenteredPage";
|
|
@@ -60,6 +62,7 @@ export { default as Footer } from "./ui/footer/Footer";
|
|
|
60
62
|
export { default as Feature } from "./ui/feature/Feature";
|
|
61
63
|
export { default as Store } from "./ui/products/Store";
|
|
62
64
|
export { default as Empty } from "./ui/empty/Empty";
|
|
65
|
+
export { default as Form } from "./ui/form/Form";
|
|
63
66
|
export { default as Cookie } from "./js/Cookie";
|
|
64
67
|
export { useVariable, useAsset, useAssetType, useAssetValue, useAssets, useVariables, } from "./ui/theme/theme";
|
|
65
68
|
export { FunGet } from "./js/Fun";
|
package/index.js
CHANGED
|
@@ -3,14 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.GoogleAnalytics = exports.FunGet = exports.useVariables = exports.useAssets = exports.useAssetValue = exports.useAssetType = exports.useAsset = exports.useVariable = exports.Cookie = exports.Empty = exports.Store = exports.Feature = exports.Footer = exports.FileUpload = exports.Select = exports.ScrollToTop = exports.FlexItem = exports.Slider = exports.Vista = exports.Calendar = exports.DatePicker = void 0;
|
|
6
|
+
exports.Accordion = exports.Flex = exports.RichText = exports.Carousel = exports.Video = exports.SideBar = exports.ChartPie = exports.Lines = exports.Bars = exports.FullCenteredPage = exports.CircleGroup = exports.Circle = exports.Divider = exports.Hr = exports.Section = exports.RowFlex = exports.Tip = exports.AppBar = exports.ToolTip = exports.Notification = exports.FunLoader = exports.ProgressBar = exports.DropMenu = exports.DropItem = exports.Dropdown = exports.DropDown = exports.DropUp = exports.UnAuthorized = exports.NotFound = exports.StepLine = exports.StepHeader = exports.Step = exports.StepContainer = exports.Div = exports.Text = exports.List = exports.Table = exports.Modal = exports.Loader = exports.SearchableInput = exports.Input = exports.Col = exports.Grid = exports.Container = exports.BreadCrumb = exports.Card = exports.Badge = exports.Button = exports.ThemeProvider = exports.Alert = void 0;
|
|
7
|
+
exports.GoogleAnalytics = exports.FunGet = exports.useVariables = exports.useAssets = exports.useAssetValue = exports.useAssetType = exports.useAsset = exports.useVariable = exports.Cookie = exports.Form = exports.Empty = exports.Store = exports.Feature = exports.Footer = exports.FileUpload = exports.Select = exports.ScrollToTop = exports.FlexItem = exports.Slider = exports.Vista = exports.Calendar = exports.DatePicker = exports.View = exports.ScrollInView = void 0;
|
|
8
8
|
var Alert_1 = require("./ui/alert/Alert");
|
|
9
9
|
Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return __importDefault(Alert_1).default; } });
|
|
10
10
|
var theme_1 = require("./ui/theme/theme");
|
|
11
11
|
Object.defineProperty(exports, "ThemeProvider", { enumerable: true, get: function () { return __importDefault(theme_1).default; } });
|
|
12
12
|
var Button_1 = require("./ui/button/Button");
|
|
13
13
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return __importDefault(Button_1).default; } });
|
|
14
|
+
var Button_2 = require("./ui/button/Button");
|
|
15
|
+
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return __importDefault(Button_2).default; } });
|
|
14
16
|
var Card_1 = require("./ui/card/Card");
|
|
15
17
|
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return __importDefault(Card_1).default; } });
|
|
16
18
|
var BreadCrumb_1 = require("./ui/breadcrumb/BreadCrumb");
|
|
@@ -77,6 +79,8 @@ var Section_1 = require("./ui/specials/Section");
|
|
|
77
79
|
Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return __importDefault(Section_1).default; } });
|
|
78
80
|
var Hr_1 = require("./ui/specials/Hr");
|
|
79
81
|
Object.defineProperty(exports, "Hr", { enumerable: true, get: function () { return __importDefault(Hr_1).default; } });
|
|
82
|
+
var Hr_2 = require("./ui/specials/Hr");
|
|
83
|
+
Object.defineProperty(exports, "Divider", { enumerable: true, get: function () { return __importDefault(Hr_2).default; } });
|
|
80
84
|
var Circle_1 = require("./ui/specials/Circle");
|
|
81
85
|
Object.defineProperty(exports, "Circle", { enumerable: true, get: function () { return __importDefault(Circle_1).default; } });
|
|
82
86
|
var CircleGroup_1 = require("./ui/specials/CircleGroup");
|
|
@@ -129,6 +133,8 @@ var Store_1 = require("./ui/products/Store");
|
|
|
129
133
|
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return __importDefault(Store_1).default; } });
|
|
130
134
|
var Empty_1 = require("./ui/empty/Empty");
|
|
131
135
|
Object.defineProperty(exports, "Empty", { enumerable: true, get: function () { return __importDefault(Empty_1).default; } });
|
|
136
|
+
var Form_1 = require("./ui/form/Form");
|
|
137
|
+
Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return __importDefault(Form_1).default; } });
|
|
132
138
|
// js
|
|
133
139
|
var Cookie_1 = require("./js/Cookie");
|
|
134
140
|
Object.defineProperty(exports, "Cookie", { enumerable: true, get: function () { return __importDefault(Cookie_1).default; } });
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.8.
|
|
2
|
+
"version": "3.8.9",
|
|
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.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ interface ButtonProps {
|
|
|
3
3
|
color?: string;
|
|
4
4
|
bg?: string;
|
|
5
5
|
funcss?: string;
|
|
6
|
-
startIcon?: ReactNode;
|
|
7
|
-
endIcon?: ReactNode;
|
|
6
|
+
startIcon?: ReactNode | string;
|
|
7
|
+
endIcon?: ReactNode | string;
|
|
8
8
|
stringPrefix?: string;
|
|
9
9
|
stringSuffix?: string;
|
|
10
|
-
prefix?: ReactNode;
|
|
11
|
-
suffix?: ReactNode;
|
|
10
|
+
prefix?: ReactNode | string;
|
|
11
|
+
suffix?: ReactNode | string;
|
|
12
12
|
iconSize?: number | string;
|
|
13
13
|
iconLineHeight?: string | number;
|
|
14
14
|
text?: string;
|
|
@@ -37,11 +37,12 @@ interface ButtonProps {
|
|
|
37
37
|
isLoading?: boolean;
|
|
38
38
|
variant?: string;
|
|
39
39
|
url?: string;
|
|
40
|
+
type?: 'button' | 'submit' | 'reset';
|
|
40
41
|
disabled?: boolean;
|
|
41
42
|
status?: 'success' | 'warning' | 'info' | 'error';
|
|
42
43
|
children?: React.ReactNode;
|
|
43
44
|
style?: React.CSSProperties;
|
|
44
45
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
45
46
|
}
|
|
46
|
-
export default function Button({ 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, disabled, ...rest }: ButtonProps): React.JSX.Element;
|
|
47
|
+
export default function Button({ 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, type, outlineSize, isLoading, status, bold, children, style, url, onClick, disabled, ...rest }: ButtonProps): React.JSX.Element;
|
|
47
48
|
export {};
|
package/ui/button/Button.js
CHANGED
|
@@ -63,10 +63,10 @@ var componentUtils_1 = require("../../utils/componentUtils");
|
|
|
63
63
|
var getDynamicIcon_1 = require("../../utils/getDynamicIcon");
|
|
64
64
|
function Button(_a) {
|
|
65
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, disabled = _a.disabled, 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", "disabled"]);
|
|
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, _f = _a.type, type = _f === void 0 ? 'button' : _f, outlineSize = _a.outlineSize, isLoading = _a.isLoading, status = _a.status, bold = _a.bold, children = _a.children, style = _a.style, url = _a.url, onClick = _a.onClick, disabled = _a.disabled, 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", "type", "outlineSize", "isLoading", "status", "bold", "children", "style", "url", "onClick", "disabled"]);
|
|
67
67
|
var mergeWithLocal = (0, componentUtils_1.useComponentConfiguration)('Button', variant).mergeWithLocal;
|
|
68
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, disabled: disabled, outlineSize: outlineSize, isLoading: isLoading, status: status, bold: bold, stringPrefix: stringPrefix, stringSuffix: stringSuffix }, rest);
|
|
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, disabled: disabled, outlineSize: outlineSize, isLoading: isLoading, status: status, type: type, bold: bold, stringPrefix: stringPrefix, stringSuffix: stringSuffix }, rest);
|
|
70
70
|
// Merge with config - LOCAL PROPS OVERRIDE CONFIG
|
|
71
71
|
var mergedProps = mergeWithLocal(localProps).props;
|
|
72
72
|
// Extract final values - local props take precedence
|
|
@@ -90,6 +90,7 @@ function Button(_a) {
|
|
|
90
90
|
big: big !== null && big !== void 0 ? big : mergedProps.big,
|
|
91
91
|
bigger: bigger !== null && bigger !== void 0 ? bigger : mergedProps.bigger,
|
|
92
92
|
jumbo: jumbo !== null && jumbo !== void 0 ? jumbo : mergedProps.jumbo,
|
|
93
|
+
type: type !== null && type !== void 0 ? type : mergedProps.type,
|
|
93
94
|
fillAnimation: fillAnimation !== null && fillAnimation !== void 0 ? fillAnimation : mergedProps.fillAnimation,
|
|
94
95
|
fillDirection: fillDirection !== null && fillDirection !== void 0 ? fillDirection : mergedProps.fillDirection,
|
|
95
96
|
fillTextColor: fillTextColor !== null && fillTextColor !== void 0 ? fillTextColor : mergedProps.fillTextColor,
|
|
@@ -98,75 +99,170 @@ function Button(_a) {
|
|
|
98
99
|
stringPrefix: stringPrefix !== null && stringPrefix !== void 0 ? stringPrefix : mergedProps.stringPrefix,
|
|
99
100
|
stringSuffix: stringSuffix !== null && stringSuffix !== void 0 ? stringSuffix : mergedProps.stringSuffix,
|
|
100
101
|
};
|
|
101
|
-
|
|
102
|
-
var _g = (0, react_1.useState)(null),
|
|
103
|
-
var _h = (0, react_1.useState)(
|
|
104
|
-
var _j = (0, react_1.useState)(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
//
|
|
102
|
+
// State for dynamic icons
|
|
103
|
+
var _g = (0, react_1.useState)(null), dynamicStartIcon = _g[0], setDynamicStartIcon = _g[1];
|
|
104
|
+
var _h = (0, react_1.useState)(null), dynamicEndIcon = _h[0], setDynamicEndIcon = _h[1];
|
|
105
|
+
var _j = (0, react_1.useState)(null), dynamicPrefix = _j[0], setDynamicPrefix = _j[1];
|
|
106
|
+
var _k = (0, react_1.useState)(null), dynamicSuffix = _k[0], setDynamicSuffix = _k[1];
|
|
107
|
+
var _l = (0, react_1.useState)(null), dynamicStringPrefix = _l[0], setDynamicStringPrefix = _l[1];
|
|
108
|
+
var _m = (0, react_1.useState)(null), dynamicStringSuffix = _m[0], setDynamicStringSuffix = _m[1];
|
|
109
|
+
// Function to check if a value is a string (dynamic icon)
|
|
110
|
+
var isStringIcon = function (icon) {
|
|
111
|
+
return typeof icon === 'string' && icon.trim() !== '';
|
|
112
|
+
};
|
|
113
|
+
// Function to check if a value is a ReactNode (static icon)
|
|
114
|
+
var isReactNodeIcon = function (icon) {
|
|
115
|
+
return icon !== undefined && !isStringIcon(icon) && react_1.default.isValidElement(icon);
|
|
116
|
+
};
|
|
117
|
+
// Load dynamic icons from string props
|
|
109
118
|
(0, react_1.useEffect)(function () {
|
|
110
|
-
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
// Handle startIcon if it's a string
|
|
120
|
+
if (isStringIcon(startIcon)) {
|
|
121
|
+
(0, getDynamicIcon_1.getDynamicIcon)(startIcon).then(function (node) {
|
|
122
|
+
if (node) {
|
|
123
|
+
setDynamicStartIcon(node);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
setDynamicStartIcon(null);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
setDynamicStartIcon(null);
|
|
132
|
+
}
|
|
133
|
+
// Handle endIcon if it's a string
|
|
134
|
+
if (isStringIcon(endIcon)) {
|
|
135
|
+
(0, getDynamicIcon_1.getDynamicIcon)(endIcon).then(function (node) {
|
|
136
|
+
if (node) {
|
|
137
|
+
setDynamicEndIcon(node);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
setDynamicEndIcon(null);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
setDynamicEndIcon(null);
|
|
146
|
+
}
|
|
147
|
+
// Handle prefix if it's a string
|
|
148
|
+
if (isStringIcon(prefix)) {
|
|
149
|
+
(0, getDynamicIcon_1.getDynamicIcon)(prefix).then(function (node) {
|
|
150
|
+
if (node) {
|
|
151
|
+
setDynamicPrefix(node);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
setDynamicPrefix(null);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
setDynamicPrefix(null);
|
|
160
|
+
}
|
|
161
|
+
// Handle suffix if it's a string
|
|
162
|
+
if (isStringIcon(suffix)) {
|
|
163
|
+
(0, getDynamicIcon_1.getDynamicIcon)(suffix).then(function (node) {
|
|
164
|
+
if (node) {
|
|
165
|
+
setDynamicSuffix(node);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
setDynamicSuffix(null);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
setDynamicSuffix(null);
|
|
174
|
+
}
|
|
175
|
+
}, [startIcon, endIcon, prefix, suffix]);
|
|
176
|
+
// Load dynamic icons from stringPrefix and stringSuffix (backward compatibility)
|
|
128
177
|
(0, react_1.useEffect)(function () {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
178
|
+
if (final.stringPrefix && final.stringPrefix.trim() !== '') {
|
|
179
|
+
(0, getDynamicIcon_1.getDynamicIcon)(final.stringPrefix).then(function (node) {
|
|
180
|
+
if (node) {
|
|
181
|
+
setDynamicStringPrefix(node);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
setDynamicStringPrefix(null);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
setDynamicStringPrefix(null);
|
|
190
|
+
}
|
|
191
|
+
if (final.stringSuffix && final.stringSuffix.trim() !== '') {
|
|
192
|
+
(0, getDynamicIcon_1.getDynamicIcon)(final.stringSuffix).then(function (node) {
|
|
193
|
+
if (node) {
|
|
194
|
+
setDynamicStringSuffix(node);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
setDynamicStringSuffix(null);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
setDynamicStringSuffix(null);
|
|
203
|
+
}
|
|
204
|
+
}, [final.stringPrefix, final.stringSuffix]);
|
|
205
|
+
// Determine which start icon to show with proper priority
|
|
206
|
+
var actualStartIcon = (0, react_1.useMemo)(function () {
|
|
207
|
+
if (final.status) {
|
|
208
|
+
// Status icons have highest priority for start position
|
|
209
|
+
switch (final.status) {
|
|
210
|
+
case 'success':
|
|
211
|
+
return react_1.default.createElement(pi_1.PiCheck, { size: iconSize });
|
|
212
|
+
case 'info':
|
|
213
|
+
return react_1.default.createElement(pi_1.PiInfo, { size: iconSize });
|
|
214
|
+
case 'warning':
|
|
215
|
+
return react_1.default.createElement(pi_1.PiWarning, { size: iconSize });
|
|
216
|
+
case 'error':
|
|
217
|
+
return react_1.default.createElement(pi_1.PiX, { size: iconSize });
|
|
218
|
+
default:
|
|
219
|
+
return null;
|
|
143
220
|
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (
|
|
152
|
-
return
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
221
|
+
}
|
|
222
|
+
if (isStringIcon(startIcon)) {
|
|
223
|
+
return dynamicStartIcon;
|
|
224
|
+
}
|
|
225
|
+
if (isReactNodeIcon(startIcon)) {
|
|
226
|
+
return startIcon;
|
|
227
|
+
}
|
|
228
|
+
if (isStringIcon(prefix)) {
|
|
229
|
+
return dynamicPrefix;
|
|
230
|
+
}
|
|
231
|
+
if (isReactNodeIcon(prefix)) {
|
|
232
|
+
return prefix;
|
|
233
|
+
}
|
|
234
|
+
if (dynamicStringPrefix) {
|
|
235
|
+
return dynamicStringPrefix;
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
}, [
|
|
239
|
+
final.status,
|
|
240
|
+
startIcon,
|
|
241
|
+
prefix,
|
|
242
|
+
dynamicStartIcon,
|
|
243
|
+
dynamicPrefix,
|
|
244
|
+
dynamicStringPrefix,
|
|
245
|
+
iconSize,
|
|
246
|
+
]);
|
|
247
|
+
// Determine which end icon to show with proper priority
|
|
248
|
+
var actualEndIcon = (0, react_1.useMemo)(function () {
|
|
249
|
+
if (isStringIcon(endIcon)) {
|
|
250
|
+
return dynamicEndIcon;
|
|
251
|
+
}
|
|
252
|
+
if (isReactNodeIcon(endIcon)) {
|
|
253
|
+
return endIcon;
|
|
254
|
+
}
|
|
255
|
+
if (isStringIcon(suffix)) {
|
|
256
|
+
return dynamicSuffix;
|
|
257
|
+
}
|
|
258
|
+
if (isReactNodeIcon(suffix)) {
|
|
259
|
+
return suffix;
|
|
260
|
+
}
|
|
261
|
+
if (dynamicStringSuffix) {
|
|
262
|
+
return dynamicStringSuffix;
|
|
263
|
+
}
|
|
264
|
+
return null;
|
|
265
|
+
}, [endIcon, suffix, dynamicEndIcon, dynamicSuffix, dynamicStringSuffix]);
|
|
170
266
|
var textColorClass = final.bg
|
|
171
267
|
? final.color
|
|
172
268
|
? final.color
|
|
@@ -207,27 +303,37 @@ function Button(_a) {
|
|
|
207
303
|
};
|
|
208
304
|
// Helper function to render icon with proper size
|
|
209
305
|
var renderIcon = function (icon, className) {
|
|
306
|
+
var _a;
|
|
210
307
|
if (className === void 0) { className = ''; }
|
|
211
308
|
if (!icon)
|
|
212
309
|
return null;
|
|
213
|
-
|
|
310
|
+
// If it's a React element that we know accepts size prop
|
|
311
|
+
if (react_1.default.isValidElement(icon)) {
|
|
312
|
+
// Create a wrapper span and clone the icon with size prop if needed
|
|
313
|
+
var iconProps = {};
|
|
314
|
+
// Only add size prop if iconSize is provided and not already set
|
|
315
|
+
if (iconSize && !((_a = icon.props) === null || _a === void 0 ? void 0 : _a.size)) {
|
|
316
|
+
iconProps.size = iconSize;
|
|
317
|
+
}
|
|
318
|
+
// Only clone with props if we have props to add
|
|
319
|
+
if (Object.keys(iconProps).length > 0) {
|
|
320
|
+
return (react_1.default.createElement("span", { className: className, style: iconWrapperStyle }, react_1.default.cloneElement(icon, iconProps)));
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
// Otherwise just render the icon in a span
|
|
324
|
+
return (react_1.default.createElement("span", { className: className, style: iconWrapperStyle }, icon));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// If it's not a valid React element, just render it as is
|
|
328
|
+
return (react_1.default.createElement("span", { className: className, style: iconWrapperStyle }, icon));
|
|
214
329
|
};
|
|
330
|
+
// Determine if we should show icons on left or right
|
|
331
|
+
var hasStartIcon = Boolean(actualStartIcon);
|
|
332
|
+
var hasEndIcon = Boolean(actualEndIcon);
|
|
215
333
|
return (react_1.default.createElement("span", null,
|
|
216
|
-
react_1.default.createElement("button", __assign({ disabled: disabled || final.isLoading || false, className: "".concat(classNames, " ").concat((
|
|
217
|
-
final.isLoading ? (renderIcon(react_1.default.createElement(pi_1.PiSpinner, { className: "rotate" }), 'btn_left_icon')) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
218
|
-
final.status && (react_1.default.createElement("span", { className: "btn_left_icon", style: iconWrapperStyle },
|
|
219
|
-
final.status === 'success' && react_1.default.createElement(pi_1.PiCheck, { size: iconSize }),
|
|
220
|
-
final.status === 'info' && react_1.default.createElement(pi_1.PiInfo, { size: iconSize }),
|
|
221
|
-
final.status === 'warning' && react_1.default.createElement(pi_1.PiWarning, { size: iconSize }),
|
|
222
|
-
final.status === 'error' && react_1.default.createElement(pi_1.PiX, { size: iconSize }))),
|
|
223
|
-
!final.status && showPrefix && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
224
|
-
startIcon && renderIcon(startIcon, 'btn_left_icon'),
|
|
225
|
-
!startIcon && prefix && renderIcon(prefix, 'btn_left_icon'),
|
|
226
|
-
!startIcon && !prefix && hasValidStringPrefix && renderIcon(prefixNode, 'btn_left_icon'))))),
|
|
334
|
+
react_1.default.createElement("button", __assign({ type: final.type || 'button', disabled: disabled || final.isLoading || false, className: "".concat(classNames, " ").concat((hasStartIcon || hasEndIcon || 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),
|
|
335
|
+
final.isLoading ? (renderIcon(react_1.default.createElement(pi_1.PiSpinner, { className: "rotate" }), 'btn_left_icon')) : (react_1.default.createElement(react_1.default.Fragment, null, hasStartIcon && renderIcon(actualStartIcon, 'btn_left_icon'))),
|
|
227
336
|
final.fillAnimation && react_1.default.createElement("span", { className: "button_fill_span ".concat(effectiveBg) }),
|
|
228
337
|
children ? children : final.text ? final.text : "",
|
|
229
|
-
|
|
230
|
-
endIcon && renderIcon(endIcon, 'btn_right_icon'),
|
|
231
|
-
!endIcon && suffix && renderIcon(suffix, 'btn_right_icon'),
|
|
232
|
-
!endIcon && !suffix && hasValidStringSuffix && renderIcon(suffixNode, 'btn_right_icon'))))));
|
|
338
|
+
hasEndIcon && !final.isLoading && renderIcon(actualEndIcon, 'btn_right_icon'))));
|
|
233
339
|
}
|
package/ui/div/Div.d.ts
CHANGED
|
@@ -12,10 +12,12 @@ type DivProps = {
|
|
|
12
12
|
padding?: string;
|
|
13
13
|
margin?: string;
|
|
14
14
|
id?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
15
17
|
fit?: boolean;
|
|
16
18
|
ref?: React.Ref<HTMLDivElement>;
|
|
17
19
|
customStyle?: React.CSSProperties;
|
|
18
20
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
19
21
|
};
|
|
20
|
-
declare const Div: ({ children, funcss, content, minHeight, maxHeight, maxWidth, minWidth, height, width, padding, margin, id, fit, ref, customStyle, ...rest }: DivProps) => React.JSX.Element;
|
|
22
|
+
declare const Div: ({ children, funcss, content, minHeight, maxHeight, maxWidth, minWidth, height, width, padding, className, style, margin, id, fit, ref, customStyle, ...rest }: DivProps) => React.JSX.Element;
|
|
21
23
|
export default Div;
|
package/ui/div/Div.js
CHANGED
|
@@ -58,8 +58,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
58
58
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
59
|
var React = __importStar(require("react"));
|
|
60
60
|
var Div = function (_a) {
|
|
61
|
-
var children = _a.children, funcss = _a.funcss, content = _a.content, minHeight = _a.minHeight, maxHeight = _a.maxHeight, maxWidth = _a.maxWidth, minWidth = _a.minWidth, height = _a.height, width = _a.width, padding = _a.padding, margin = _a.margin, id = _a.id, fit = _a.fit, ref = _a.ref, customStyle = _a.customStyle, rest = __rest(_a, ["children", "funcss", "content", "minHeight", "maxHeight", "maxWidth", "minWidth", "height", "width", "padding", "margin", "id", "fit", "ref", "customStyle"]);
|
|
61
|
+
var children = _a.children, funcss = _a.funcss, content = _a.content, minHeight = _a.minHeight, maxHeight = _a.maxHeight, maxWidth = _a.maxWidth, minWidth = _a.minWidth, height = _a.height, width = _a.width, padding = _a.padding, className = _a.className, style = _a.style, margin = _a.margin, id = _a.id, fit = _a.fit, ref = _a.ref, customStyle = _a.customStyle, rest = __rest(_a, ["children", "funcss", "content", "minHeight", "maxHeight", "maxWidth", "minWidth", "height", "width", "padding", "className", "style", "margin", "id", "fit", "ref", "customStyle"]);
|
|
62
62
|
return (React.createElement("div", null,
|
|
63
|
-
React.createElement("div", __assign({ ref: ref, className: "".concat(fit ? 'width-100-p height-100-p' : '', " ").concat(funcss), style: __assign({ height: height || '', maxHeight: maxHeight || '', minHeight: minHeight || '', maxWidth: maxWidth || '', minWidth: minWidth || '', width: width || '', padding: padding || '', margin: margin || '' }, customStyle), id: id }, rest), content || children)));
|
|
63
|
+
React.createElement("div", __assign({ ref: ref, className: "".concat(fit ? 'width-100-p height-100-p' : '', " ").concat(funcss, " ").concat(className || ''), style: __assign(__assign({ height: height || '', maxHeight: maxHeight || '', minHeight: minHeight || '', maxWidth: maxWidth || '', minWidth: minWidth || '', width: width || '', padding: padding || '', margin: margin || '' }, style), customStyle), id: id }, rest), content || children)));
|
|
64
64
|
};
|
|
65
65
|
exports.default = Div;
|
package/ui/feature/Feature.d.ts
CHANGED
|
@@ -9,13 +9,11 @@ type FeatureItem = {
|
|
|
9
9
|
titleWeight?: number;
|
|
10
10
|
titleColor?: string;
|
|
11
11
|
titleClassName?: string;
|
|
12
|
-
titleVariant?: string;
|
|
13
12
|
description?: React.ReactNode;
|
|
14
13
|
descriptionSize?: string;
|
|
15
14
|
descriptionWeight?: number;
|
|
16
15
|
descriptionColor?: string;
|
|
17
16
|
descriptionClassName?: string;
|
|
18
|
-
descriptionVariant?: string;
|
|
19
17
|
imageUrl?: string;
|
|
20
18
|
imageAlt?: string;
|
|
21
19
|
imageClassName?: string;
|
|
@@ -23,18 +21,9 @@ type FeatureItem = {
|
|
|
23
21
|
content?: React.ReactNode;
|
|
24
22
|
className?: string;
|
|
25
23
|
style?: React.CSSProperties;
|
|
26
|
-
cardBg?: string;
|
|
27
|
-
cardPadding?: string;
|
|
28
|
-
cardRounded?: string;
|
|
29
|
-
cardShadow?: 'sm' | 'md' | 'lg' | 'xl' | 'none';
|
|
30
|
-
cardBorder?: boolean;
|
|
31
|
-
cardBorderColor?: string;
|
|
32
|
-
cardHoverEffect?: 'lift' | 'glow' | 'scale' | 'none';
|
|
33
24
|
ctaText?: string;
|
|
34
25
|
ctaUrl?: string;
|
|
35
|
-
ctaVariant?: 'primary' | 'secondary' | 'accent' | 'text' | 'outline';
|
|
36
26
|
ctaOnClick?: () => void;
|
|
37
|
-
ctaCss?: string;
|
|
38
27
|
ctaClassName?: string;
|
|
39
28
|
customRender?: () => React.ReactNode;
|
|
40
29
|
};
|
|
@@ -47,33 +36,23 @@ type FeatureProps = {
|
|
|
47
36
|
titleColor?: string;
|
|
48
37
|
titleClassName?: string;
|
|
49
38
|
titleAlign?: 'left' | 'center' | 'right';
|
|
50
|
-
titleVariant?: string;
|
|
51
39
|
subtitle?: React.ReactNode;
|
|
52
40
|
subtitleSize?: string;
|
|
53
41
|
subtitleWeight?: number;
|
|
54
42
|
subtitleColor?: string;
|
|
55
43
|
subtitleClassName?: string;
|
|
56
|
-
subtitleVariant?: string;
|
|
57
44
|
description?: React.ReactNode;
|
|
58
45
|
descriptionSize?: string;
|
|
59
46
|
descriptionWeight?: number;
|
|
60
47
|
descriptionColor?: string;
|
|
61
48
|
descriptionClassName?: string;
|
|
62
|
-
descriptionVariant?: string;
|
|
63
49
|
features?: FeatureItem[] | string;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
itemGap?: string;
|
|
50
|
+
gap?: number;
|
|
51
|
+
itemMaxWidth?: string;
|
|
67
52
|
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
68
53
|
justify?: 'start' | 'center' | 'end' | 'between' | 'around';
|
|
69
54
|
wrap?: boolean;
|
|
70
|
-
|
|
71
|
-
padding?: string;
|
|
72
|
-
className?: string;
|
|
73
|
-
style?: React.CSSProperties;
|
|
74
|
-
containerClassName?: string;
|
|
75
|
-
containerStyle?: React.CSSProperties;
|
|
76
|
-
cardBg?: string;
|
|
55
|
+
card?: boolean;
|
|
77
56
|
cardPadding?: string;
|
|
78
57
|
cardRounded?: string;
|
|
79
58
|
cardShadow?: 'sm' | 'md' | 'lg' | 'xl' | 'none';
|
|
@@ -81,27 +60,28 @@ type FeatureProps = {
|
|
|
81
60
|
cardBorderColor?: string;
|
|
82
61
|
cardHoverEffect?: 'lift' | 'glow' | 'scale' | 'none';
|
|
83
62
|
cardClassName?: string;
|
|
63
|
+
padding?: string;
|
|
64
|
+
className?: string;
|
|
65
|
+
style?: React.CSSProperties;
|
|
66
|
+
containerClassName?: string;
|
|
67
|
+
containerStyle?: React.CSSProperties;
|
|
84
68
|
iconColor?: string;
|
|
85
69
|
iconSize?: number;
|
|
86
70
|
iconClassName?: string;
|
|
87
71
|
itemTitleSize?: string;
|
|
88
72
|
itemTitleWeight?: number;
|
|
89
73
|
itemTitleColor?: string;
|
|
90
|
-
itemTitleVariant?: string;
|
|
91
74
|
itemDescriptionSize?: string;
|
|
92
75
|
itemDescriptionWeight?: number;
|
|
93
76
|
itemDescriptionColor?: string;
|
|
94
|
-
itemDescriptionVariant?: string;
|
|
95
77
|
checkmarkIcon?: string;
|
|
96
78
|
checkmarkColor?: string;
|
|
97
79
|
checkmarkSize?: number;
|
|
98
80
|
checkmarkClassName?: string;
|
|
99
81
|
ctaText?: string;
|
|
100
82
|
ctaUrl?: string;
|
|
101
|
-
ctaVariant?: 'primary' | 'secondary' | 'accent' | 'text' | 'outline';
|
|
102
83
|
ctaOnClick?: () => void;
|
|
103
84
|
ctaClassName?: string;
|
|
104
|
-
ctaCss?: string;
|
|
105
85
|
ctaAlign?: 'left' | 'center' | 'right';
|
|
106
86
|
ctaStringPrefix?: string;
|
|
107
87
|
ctaStringSuffix?: string;
|
|
@@ -110,21 +90,12 @@ type FeatureProps = {
|
|
|
110
90
|
ctaIconSize?: number;
|
|
111
91
|
ctaIsLoading?: boolean;
|
|
112
92
|
ctaStatus?: 'success' | 'warning' | 'info' | 'error';
|
|
113
|
-
|
|
114
|
-
patternOpacity?: number;
|
|
115
|
-
patternColor?: string;
|
|
116
|
-
patternSize?: string;
|
|
117
|
-
fade?: boolean;
|
|
118
|
-
fadeColor?: string;
|
|
119
|
-
fadeDirection?: 'top' | 'bottom' | 'left' | 'right';
|
|
120
|
-
fadeRadial?: boolean;
|
|
121
|
-
hoverEffect?: 'lift' | 'glow' | 'scale' | 'none';
|
|
93
|
+
ctaBg?: string;
|
|
122
94
|
children?: React.ReactNode;
|
|
123
95
|
id?: string;
|
|
124
96
|
funcss?: string;
|
|
125
97
|
sectionClass?: string;
|
|
126
98
|
maxWidth?: string;
|
|
127
|
-
responsiveColumns?: string;
|
|
128
99
|
};
|
|
129
100
|
declare const Feature: React.FC<FeatureProps>;
|
|
130
101
|
export default Feature;
|