funuicss 3.7.4 → 3.7.5

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.7.4",
2
+ "version": "3.7.5",
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",
@@ -37,7 +37,7 @@ interface ButtonProps {
37
37
  isLoading?: boolean;
38
38
  variant?: string;
39
39
  url?: string;
40
- status?: 'success' | 'warning' | 'info' | 'danger';
40
+ status?: 'success' | 'warning' | 'info' | 'error';
41
41
  children?: React.ReactNode;
42
42
  style?: React.CSSProperties;
43
43
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
@@ -66,13 +66,11 @@ function Button(_a) {
66
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"]);
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, outlineSize: outlineSize, isLoading: isLoading, status: status, bold: bold, stringPrefix: stringPrefix, // Include stringPrefix in local props
70
- 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, outlineSize: outlineSize, isLoading: isLoading, status: status, bold: bold, stringPrefix: stringPrefix, stringSuffix: stringSuffix }, rest);
71
70
  // Merge with config - LOCAL PROPS OVERRIDE CONFIG
72
71
  var mergedProps = mergeWithLocal(localProps).props;
73
72
  // Extract final values - local props take precedence
74
73
  var final = {
75
- // Use local props first, fallback to merged props
76
74
  isLoading: isLoading !== null && isLoading !== void 0 ? isLoading : mergedProps.isLoading,
77
75
  status: status !== null && status !== void 0 ? status : mergedProps.status,
78
76
  text: text !== null && text !== void 0 ? text : mergedProps.text,
@@ -97,34 +95,78 @@ function Button(_a) {
97
95
  fillTextColor: fillTextColor !== null && fillTextColor !== void 0 ? fillTextColor : mergedProps.fillTextColor,
98
96
  funcss: funcss !== null && funcss !== void 0 ? funcss : mergedProps.funcss,
99
97
  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
98
+ stringPrefix: stringPrefix !== null && stringPrefix !== void 0 ? stringPrefix : mergedProps.stringPrefix,
99
+ stringSuffix: stringSuffix !== null && stringSuffix !== void 0 ? stringSuffix : mergedProps.stringSuffix,
102
100
  };
103
101
  var _f = (0, react_1.useState)(null), prefixNode = _f[0], setPrefixNode = _f[1];
104
102
  var _g = (0, react_1.useState)(null), suffixNode = _g[0], setSuffixNode = _g[1];
103
+ var _h = (0, react_1.useState)(false), hasValidStringPrefix = _h[0], setHasValidStringPrefix = _h[1];
104
+ var _j = (0, react_1.useState)(false), hasValidStringSuffix = _j[0], setHasValidStringSuffix = _j[1];
105
105
  function isReactElement(node) {
106
106
  return react_1.default.isValidElement(node);
107
107
  }
108
- // Handle both local and config stringPrefix
108
+ // Handle stringPrefix - only load if we have a valid string
109
109
  (0, react_1.useEffect)(function () {
110
110
  var effectiveStringPrefix = final.stringPrefix;
111
- if (effectiveStringPrefix) {
112
- (0, getDynamicIcon_1.getDynamicIcon)(effectiveStringPrefix).then(function (node) { return setPrefixNode(node); });
113
- }
114
- else {
115
- setPrefixNode(null); // Clear when empty
111
+ if (!effectiveStringPrefix || effectiveStringPrefix.trim() === '') {
112
+ setPrefixNode(null);
113
+ setHasValidStringPrefix(false);
114
+ return;
116
115
  }
116
+ (0, getDynamicIcon_1.getDynamicIcon)(effectiveStringPrefix).then(function (node) {
117
+ if (node) {
118
+ setPrefixNode(node);
119
+ setHasValidStringPrefix(true);
120
+ }
121
+ else {
122
+ setPrefixNode(null);
123
+ setHasValidStringPrefix(false);
124
+ }
125
+ });
117
126
  }, [final.stringPrefix]);
118
- // Handle both local and config stringSuffix
127
+ // Handle stringSuffix - only load if we have a valid string
119
128
  (0, react_1.useEffect)(function () {
120
129
  var effectiveStringSuffix = final.stringSuffix;
121
- if (effectiveStringSuffix) {
122
- (0, getDynamicIcon_1.getDynamicIcon)(effectiveStringSuffix).then(function (node) { return setSuffixNode(node); });
123
- }
124
- else {
125
- setSuffixNode(null); // Clear when empty
130
+ if (!effectiveStringSuffix || effectiveStringSuffix.trim() === '') {
131
+ setSuffixNode(null);
132
+ setHasValidStringSuffix(false);
133
+ return;
126
134
  }
135
+ (0, getDynamicIcon_1.getDynamicIcon)(effectiveStringSuffix).then(function (node) {
136
+ if (node) {
137
+ setSuffixNode(node);
138
+ setHasValidStringSuffix(true);
139
+ }
140
+ else {
141
+ setSuffixNode(null);
142
+ setHasValidStringSuffix(false);
143
+ }
144
+ });
127
145
  }, [final.stringSuffix]);
146
+ // Determine which prefix to show with proper priority
147
+ var showPrefix = react_1.default.useMemo(function () {
148
+ // Priority order: status > startIcon (local) > prefix (local) > stringPrefix (dynamic)
149
+ if (final.status)
150
+ return true;
151
+ if (startIcon)
152
+ return true;
153
+ if (prefix)
154
+ return true;
155
+ if (hasValidStringPrefix && prefixNode)
156
+ return true;
157
+ return false;
158
+ }, [final.status, startIcon, prefix, hasValidStringPrefix, prefixNode]);
159
+ // Determine which suffix to show with proper priority
160
+ var showSuffix = react_1.default.useMemo(function () {
161
+ // Priority order: endIcon (local) > suffix (local) > stringSuffix (dynamic)
162
+ if (endIcon)
163
+ return true;
164
+ if (suffix)
165
+ return true;
166
+ if (hasValidStringSuffix && suffixNode)
167
+ return true;
168
+ return false;
169
+ }, [endIcon, suffix, hasValidStringSuffix, suffixNode]);
128
170
  var textColorClass = final.bg
129
171
  ? final.color
130
172
  ? final.color
@@ -155,7 +197,7 @@ function Button(_a) {
155
197
  final.outlined
156
198
  ? "outlined outline-".concat(effectiveBg || '', " text-").concat(final.color ? final.color : effectiveBg === null || effectiveBg === void 0 ? void 0 : effectiveBg.replace(/[0-9]/g, ''))
157
199
  : effectiveBg || '',
158
- "".concat(final.fillAnimation ? "".concat(final.fillTextColor ? "hover-text-".concat(final.fillTextColor) : '', " button-fill fill-").concat(final.fillDirection || 'left') : ''),
200
+ "".concat(final.fillAnimation ? "".concat(final.fillTextColor ? "hover-text-".concat(final.fillTextColor) : "hover-text-white", " button-fill fill-").concat(final.fillDirection || 'left') : ''),
159
201
  ].join(' ');
160
202
  var iconWrapperStyle = {
161
203
  lineHeight: iconLineHeight,
@@ -163,27 +205,29 @@ function Button(_a) {
163
205
  alignItems: 'center',
164
206
  justifyContent: 'center',
165
207
  };
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;
208
+ // Helper function to render icon with proper size
209
+ var renderIcon = function (icon, className) {
210
+ if (className === void 0) { className = ''; }
211
+ if (!icon)
212
+ return null;
213
+ return (react_1.default.createElement("span", { className: className, style: iconWrapperStyle }, isReactElement(icon) ? react_1.default.cloneElement(icon, { size: iconSize }) : icon));
214
+ };
170
215
  return (react_1.default.createElement("span", null,
171
216
  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),
172
- final.isLoading ? (react_1.default.createElement("span", { className: "btn_left_icon rotate", style: iconWrapperStyle },
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 },
174
- final.status === 'success' && react_1.default.createElement(pi_1.PiCheck, { size: iconSize }),
175
- final.status === 'info' && react_1.default.createElement(pi_1.PiInfo, { size: iconSize }),
176
- final.status === 'warning' && react_1.default.createElement(pi_1.PiWarning, { size: iconSize }),
177
- final.status === 'danger' && react_1.default.createElement(pi_1.PiX, { size: iconSize }))) : (
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 })
180
- : isReactElement(prefix) ? react_1.default.cloneElement(prefix, { size: iconSize })
181
- : isReactElement(prefixNode) ? react_1.default.cloneElement(prefixNode, { size: iconSize })
182
- : prefix || startIcon || prefixNode))))),
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'))))),
183
227
  final.fillAnimation && react_1.default.createElement("span", { className: "button_fill_span ".concat(effectiveBg) }),
184
228
  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 })
186
- : isReactElement(suffix) ? react_1.default.cloneElement(suffix, { size: iconSize })
187
- : isReactElement(suffixNode) ? react_1.default.cloneElement(suffixNode, { size: iconSize })
188
- : suffix || endIcon || suffixNode)))));
229
+ showSuffix && (react_1.default.createElement(react_1.default.Fragment, null,
230
+ endIcon && renderIcon(endIcon, 'btn_right_icon'),
231
+ !endIcon && suffix && renderIcon(suffix, 'btn_right_icon'),
232
+ !endIcon && !suffix && hasValidStringSuffix && renderIcon(suffixNode, 'btn_right_icon'))))));
189
233
  }
package/ui/chart/Bar.js CHANGED
@@ -229,38 +229,42 @@ var Bars = function (localProps) {
229
229
  react_1.default.createElement("div", { className: "text-lg mb-2" }, "\uD83D\uDCCA"),
230
230
  react_1.default.createElement("div", null, "No chart data available"))));
231
231
  }
232
- return (react_1.default.createElement(recharts_1.ResponsiveContainer, { width: final.width, height: smartHeight, aspect: final.aspect, className: final.funcss, style: containerStyle },
233
- react_1.default.createElement(recharts_1.BarChart, { data: parsedData, layout: final.layout, margin: smartMargin, barGap: final.barGap, barCategoryGap: final.barCategoryGap, stackOffset: final.stackOffset, syncId: final.syncId },
234
- final.showGrid && (react_1.default.createElement(recharts_1.CartesianGrid, { strokeDasharray: final.gridStrokeDasharray, stroke: final.gridStroke || getCssVar('border-color') || '#e2e8f0', horizontal: final.horizontalLines !== false, vertical: final.verticalLines !== false })),
235
- final.showXAxis && (react_1.default.createElement(recharts_1.XAxis, __assign({ type: isVertical ? 'number' : 'category', dataKey: isVertical ? undefined : 'label', interval: final.xInterval, padding: { left: 10, right: 10 }, fontSize: final.xLabelSize, strokeWidth: 0.2, angle: final.rotateLabel || (isVertical ? 0 : -35), dy: (_a = final.dy) !== null && _a !== void 0 ? _a : (isVertical ? 0 : 10), tickLine: final.tickLine, axisLine: final.axisLine, label: final.xAxisLabel ? {
236
- value: final.xAxisLabel,
237
- position: isVertical ? 'insideBottom' : 'insideBottom',
238
- offset: isVertical ? -10 : -30
239
- } : undefined }, final.xAxisProps))),
240
- final.showYAxis && (react_1.default.createElement(recharts_1.YAxis, __assign({ type: isVertical ? 'category' : 'number', dataKey: isVertical ? 'label' : undefined, interval: final.yInterval, strokeWidth: 0.2, fontSize: final.yLabelSize, tickLine: final.tickLine, axisLine: final.axisLine, label: final.yAxisLabel ? {
241
- value: final.yAxisLabel,
242
- angle: isVertical ? 0 : -90,
243
- position: isVertical ? 'insideLeft' : 'insideLeft'
244
- } : undefined }, final.yAxisProps))),
245
- final.showTooltip && (react_1.default.createElement(recharts_1.Tooltip, __assign({ content: react_1.default.createElement(TooltipComponent, { formatter: final.tooltipFormatter }), formatter: final.tooltipFormatter }, final.tooltipProps))),
246
- final.showLegend && react_1.default.createElement(recharts_1.Legend, __assign({}, final.legendProps)),
247
- parsedSeries.map(function (s, index) {
248
- if (!s || !s.dataKey) {
249
- console.warn('Invalid series configuration at index:', index);
250
- return null;
251
- }
252
- try {
253
- return (react_1.default.createElement(recharts_1.Bar, { key: s.dataKey || "series-".concat(index), dataKey: s.dataKey, name: s.label || s.dataKey, fill: resolveColor(s.color), stroke: s.stroke ? resolveColor(s.stroke) : undefined, strokeWidth: s.strokeWidth || 0, fillOpacity: s.fillOpacity !== undefined ? s.fillOpacity : 0.8, barSize: s.barSize || final.barSize, maxBarSize: s.maxBarSize || final.maxBarSize, stackId: s.stackId, background: s.background || false, minPointSize: s.minPointSize, isAnimationActive: final.isAnimationActive, animationDuration: final.animationDuration, onClick: final.onBarClick, onMouseEnter: final.onBarMouseEnter, onMouseLeave: final.onBarMouseLeave, activeBar: s.activeBar !== false ? (typeof s.activeBar === 'object' ? s.activeBar : {
254
- fill: resolveColor(s.color),
255
- stroke: resolveColor(s.stroke),
256
- strokeWidth: 2,
257
- fillOpacity: 1
258
- }) : false }));
259
- }
260
- catch (error) {
261
- console.error('Error rendering bar series:', error);
262
- return null;
263
- }
264
- }))));
232
+ return (react_1.default.createElement("div", { style: {
233
+ height: final.height || "400px",
234
+ width: final.width || "100%"
235
+ } },
236
+ react_1.default.createElement(recharts_1.ResponsiveContainer, { aspect: final.aspect, className: final.funcss, style: containerStyle },
237
+ react_1.default.createElement(recharts_1.BarChart, { data: parsedData, layout: final.layout, margin: smartMargin, barGap: final.barGap, barCategoryGap: final.barCategoryGap, stackOffset: final.stackOffset, syncId: final.syncId },
238
+ final.showGrid && (react_1.default.createElement(recharts_1.CartesianGrid, { strokeDasharray: final.gridStrokeDasharray, stroke: final.gridStroke || getCssVar('border-color') || '#e2e8f0', horizontal: final.horizontalLines !== false, vertical: final.verticalLines !== false })),
239
+ final.showXAxis && (react_1.default.createElement(recharts_1.XAxis, __assign({ type: isVertical ? 'number' : 'category', dataKey: isVertical ? undefined : 'label', interval: final.xInterval, padding: { left: 10, right: 10 }, fontSize: final.xLabelSize, strokeWidth: 0.2, angle: final.rotateLabel || (isVertical ? 0 : -35), dy: (_a = final.dy) !== null && _a !== void 0 ? _a : (isVertical ? 0 : 10), tickLine: final.tickLine, axisLine: final.axisLine, label: final.xAxisLabel ? {
240
+ value: final.xAxisLabel,
241
+ position: isVertical ? 'insideBottom' : 'insideBottom',
242
+ offset: isVertical ? -10 : -30
243
+ } : undefined }, final.xAxisProps))),
244
+ final.showYAxis && (react_1.default.createElement(recharts_1.YAxis, __assign({ type: isVertical ? 'category' : 'number', dataKey: isVertical ? 'label' : undefined, interval: final.yInterval, strokeWidth: 0.2, fontSize: final.yLabelSize, tickLine: final.tickLine, axisLine: final.axisLine, label: final.yAxisLabel ? {
245
+ value: final.yAxisLabel,
246
+ angle: isVertical ? 0 : -90,
247
+ position: isVertical ? 'insideLeft' : 'insideLeft'
248
+ } : undefined }, final.yAxisProps))),
249
+ final.showTooltip && (react_1.default.createElement(recharts_1.Tooltip, __assign({ content: react_1.default.createElement(TooltipComponent, { formatter: final.tooltipFormatter }), formatter: final.tooltipFormatter }, final.tooltipProps))),
250
+ final.showLegend && react_1.default.createElement(recharts_1.Legend, __assign({}, final.legendProps)),
251
+ parsedSeries.map(function (s, index) {
252
+ if (!s || !s.dataKey) {
253
+ console.warn('Invalid series configuration at index:', index);
254
+ return null;
255
+ }
256
+ try {
257
+ return (react_1.default.createElement(recharts_1.Bar, { key: s.dataKey || "series-".concat(index), dataKey: s.dataKey, name: s.label || s.dataKey, fill: resolveColor(s.color), stroke: s.stroke ? resolveColor(s.stroke) : undefined, strokeWidth: s.strokeWidth || 0, fillOpacity: s.fillOpacity !== undefined ? s.fillOpacity : 0.8, barSize: s.barSize || final.barSize, maxBarSize: s.maxBarSize || final.maxBarSize, stackId: s.stackId, background: s.background || false, minPointSize: s.minPointSize, isAnimationActive: final.isAnimationActive, animationDuration: final.animationDuration, onClick: final.onBarClick, onMouseEnter: final.onBarMouseEnter, onMouseLeave: final.onBarMouseLeave, activeBar: s.activeBar !== false ? (typeof s.activeBar === 'object' ? s.activeBar : {
258
+ fill: resolveColor(s.color),
259
+ stroke: resolveColor(s.stroke),
260
+ strokeWidth: 2,
261
+ fillOpacity: 1
262
+ }) : false }));
263
+ }
264
+ catch (error) {
265
+ console.error('Error rendering bar series:', error);
266
+ return null;
267
+ }
268
+ })))));
265
269
  };
266
270
  exports.default = Bars;
package/ui/chart/Line.js CHANGED
@@ -226,33 +226,37 @@ var Lines = function (localProps) {
226
226
  react_1.default.createElement("div", { className: "text-lg mb-2" }, "\uD83D\uDCCA"),
227
227
  react_1.default.createElement("div", null, "No chart data available"))));
228
228
  }
229
- return (react_1.default.createElement(recharts_1.ResponsiveContainer, { width: final.width, height: final.height, aspect: final.aspect, className: final.funcss, style: containerStyle },
230
- react_1.default.createElement(recharts_1.AreaChart, { data: parsedData, margin: final.margin, syncId: final.syncId },
231
- react_1.default.createElement("defs", null,
232
- defaultGradient,
233
- gradients),
234
- final.showGrid && (react_1.default.createElement(recharts_1.CartesianGrid, { strokeDasharray: final.gridStrokeDasharray, stroke: final.gridStroke || getCssVar('border-color') || '#e2e8f0' })),
235
- !final.showGrid && final.horizontalLines && (react_1.default.createElement(recharts_1.CartesianGrid, { strokeDasharray: final.gridStrokeDasharray, horizontal: true, vertical: false, stroke: final.gridStroke || getCssVar('border-color') || '#e2e8f0' })),
236
- final.showXAxis && (react_1.default.createElement(recharts_1.XAxis, __assign({ interval: final.xInterval, padding: { left: 10, right: 10 }, fontSize: final.xLabelSize || "0.8rem", strokeWidth: final.horizontalLines ? 0 : 0.2, dataKey: "label", angle: final.rotateLabel || -35, dy: (_a = final.dy) !== null && _a !== void 0 ? _a : 10, tickLine: final.tickLine, axisLine: final.axisLine, label: final.xAxisLabel ? { value: final.xAxisLabel, position: 'insideBottom', offset: -10 } : undefined }, final.xAxisProps))),
237
- final.showYAxis && (react_1.default.createElement(recharts_1.YAxis, __assign({ interval: final.yInterval, strokeWidth: final.horizontalLines ? 0 : 0.2, fontSize: final.yLabelSize || "0.8rem", tickLine: final.tickLine, axisLine: final.axisLine, label: final.yAxisLabel ? { value: final.yAxisLabel, angle: -90, position: 'insideLeft' } : undefined }, final.yAxisProps))),
238
- final.showTooltip && (react_1.default.createElement(recharts_1.Tooltip, __assign({ content: react_1.default.createElement(TooltipComponent, { formatter: final.tooltipFormatter }), formatter: final.tooltipFormatter }, final.tooltipProps))),
239
- final.showLegend && react_1.default.createElement(recharts_1.Legend, __assign({}, final.legendProps)),
240
- parsedSeries.map(function (s, index) {
241
- if (!s || !s.dataKey) {
242
- console.warn('Invalid series configuration at index:', index);
243
- return null;
244
- }
245
- try {
246
- var hasCustomGradient = s.fromColor || s.toColor;
247
- var gradientId = hasCustomGradient
248
- ? "".concat(baseGradientId, "-").concat(index)
249
- : baseGradientId;
250
- return (react_1.default.createElement(recharts_1.Area, { key: s.dataKey || "series-".concat(index), type: final.curveType, dataKey: s.dataKey, name: s.label || s.dataKey, stroke: resolveStrokeColor(s.color), fill: hasCustomGradient || final.fromColor ? "url(#".concat(gradientId, ")") : resolveStrokeColor(s.color), fillOpacity: s.fillOpacity !== undefined ? s.fillOpacity : 0.6, strokeWidth: s.strokeWidth || 2, strokeDasharray: s.strokeDasharray, dot: s.dot !== false ? { r: 4 } : false, activeDot: s.activeDot !== false ? (typeof s.activeDot === 'object' ? s.activeDot : { r: 6, strokeWidth: 2 }) : false, isAnimationActive: final.isAnimationActive, animationDuration: final.animationDuration }));
251
- }
252
- catch (error) {
253
- console.error('Error rendering area series:', error);
254
- return null;
255
- }
256
- }))));
229
+ return (react_1.default.createElement("div", { style: {
230
+ height: final.height || "400px",
231
+ width: final.width || "100%",
232
+ } },
233
+ react_1.default.createElement(recharts_1.ResponsiveContainer, { aspect: final.aspect, className: final.funcss, style: containerStyle },
234
+ react_1.default.createElement(recharts_1.AreaChart, { data: parsedData, margin: final.margin, syncId: final.syncId },
235
+ react_1.default.createElement("defs", null,
236
+ defaultGradient,
237
+ gradients),
238
+ final.showGrid && (react_1.default.createElement(recharts_1.CartesianGrid, { strokeDasharray: final.gridStrokeDasharray, stroke: final.gridStroke || getCssVar('border-color') || '#e2e8f0' })),
239
+ !final.showGrid && final.horizontalLines && (react_1.default.createElement(recharts_1.CartesianGrid, { strokeDasharray: final.gridStrokeDasharray, horizontal: true, vertical: false, stroke: final.gridStroke || getCssVar('border-color') || '#e2e8f0' })),
240
+ final.showXAxis && (react_1.default.createElement(recharts_1.XAxis, __assign({ interval: final.xInterval, padding: { left: 10, right: 10 }, fontSize: final.xLabelSize || "0.8rem", strokeWidth: final.horizontalLines ? 0 : 0.2, dataKey: "label", angle: final.rotateLabel || -35, dy: (_a = final.dy) !== null && _a !== void 0 ? _a : 10, tickLine: final.tickLine, axisLine: final.axisLine, label: final.xAxisLabel ? { value: final.xAxisLabel, position: 'insideBottom', offset: -10 } : undefined }, final.xAxisProps))),
241
+ final.showYAxis && (react_1.default.createElement(recharts_1.YAxis, __assign({ interval: final.yInterval, strokeWidth: final.horizontalLines ? 0 : 0.2, fontSize: final.yLabelSize || "0.8rem", tickLine: final.tickLine, axisLine: final.axisLine, label: final.yAxisLabel ? { value: final.yAxisLabel, angle: -90, position: 'insideLeft' } : undefined }, final.yAxisProps))),
242
+ final.showTooltip && (react_1.default.createElement(recharts_1.Tooltip, __assign({ content: react_1.default.createElement(TooltipComponent, { formatter: final.tooltipFormatter }), formatter: final.tooltipFormatter }, final.tooltipProps))),
243
+ final.showLegend && react_1.default.createElement(recharts_1.Legend, __assign({}, final.legendProps)),
244
+ parsedSeries.map(function (s, index) {
245
+ if (!s || !s.dataKey) {
246
+ console.warn('Invalid series configuration at index:', index);
247
+ return null;
248
+ }
249
+ try {
250
+ var hasCustomGradient = s.fromColor || s.toColor;
251
+ var gradientId = hasCustomGradient
252
+ ? "".concat(baseGradientId, "-").concat(index)
253
+ : baseGradientId;
254
+ return (react_1.default.createElement(recharts_1.Area, { key: s.dataKey || "series-".concat(index), type: final.curveType, dataKey: s.dataKey, name: s.label || s.dataKey, stroke: resolveStrokeColor(s.color), fill: hasCustomGradient || final.fromColor ? "url(#".concat(gradientId, ")") : resolveStrokeColor(s.color), fillOpacity: s.fillOpacity !== undefined ? s.fillOpacity : 0.6, strokeWidth: s.strokeWidth || 2, strokeDasharray: s.strokeDasharray, dot: s.dot !== false ? { r: 4 } : false, activeDot: s.activeDot !== false ? (typeof s.activeDot === 'object' ? s.activeDot : { r: 6, strokeWidth: 2 }) : false, isAnimationActive: final.isAnimationActive, animationDuration: final.animationDuration }));
255
+ }
256
+ catch (error) {
257
+ console.error('Error rendering area series:', error);
258
+ return null;
259
+ }
260
+ })))));
257
261
  };
258
262
  exports.default = Lines;
package/ui/chart/Pie.js CHANGED
@@ -221,6 +221,10 @@ var ChartPie = function (localProps) {
221
221
  final.showLegend && (react_1.default.createElement(recharts_1.Legend, __assign({}, legendConfig, { className: final.legendCss }))),
222
222
  react_1.default.createElement(recharts_1.Pie, { data: parsedData, dataKey: "value", nameKey: "label", cx: "50%", cy: "50%", outerRadius: final.outerRadius, innerRadius: innerRadius, paddingAngle: final.paddingAngle, cornerRadius: final.cornerRadius, startAngle: final.startAngle, endAngle: final.endAngle, minAngle: final.minAngle, label: LabelComponent ? react_1.default.createElement(LabelComponent, null) : final.showLabels, labelLine: final.showLabelLine, isAnimationActive: final.isAnimationActive, animationDuration: final.animationDuration, onClick: final.onPieClick, onMouseEnter: final.onPieEnter, onMouseLeave: final.onPieLeave, activeShape: final.activeShape, inactiveShape: final.inactiveShape }, parsedData.map(function (entry, index) { return (react_1.default.createElement(recharts_1.Cell, { key: "cell-".concat(index), fill: resolveColor(entry.color) || defaultColors[index % defaultColors.length], stroke: resolveColor(final.strokeColor), strokeWidth: final.strokeWidth })); }))));
223
223
  // Use ResponsiveContainer for automatic sizing
224
- return (react_1.default.createElement(recharts_1.ResponsiveContainer, { width: final.width, height: final.height, aspect: final.aspect, className: final.funcss, style: containerStyle }, chartContent));
224
+ return (react_1.default.createElement("div", { style: {
225
+ height: final.height || "300px",
226
+ width: final.width || "300px"
227
+ } },
228
+ react_1.default.createElement(recharts_1.ResponsiveContainer, { width: final.width, height: final.height, aspect: final.aspect, className: final.funcss, style: containerStyle }, chartContent)));
225
229
  };
226
230
  exports.default = ChartPie;