funuicss 3.8.6 → 3.8.8

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.
@@ -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,10 +99,10 @@ 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
- var _f = (0, react_1.useState)(null), prefixNode = _f[0], setPrefixNode = _f[1];
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];
102
+ var _g = (0, react_1.useState)(null), prefixNode = _g[0], setPrefixNode = _g[1];
103
+ var _h = (0, react_1.useState)(null), suffixNode = _h[0], setSuffixNode = _h[1];
104
+ var _j = (0, react_1.useState)(false), hasValidStringPrefix = _j[0], setHasValidStringPrefix = _j[1];
105
+ var _k = (0, react_1.useState)(false), hasValidStringSuffix = _k[0], setHasValidStringSuffix = _k[1];
105
106
  function isReactElement(node) {
106
107
  return react_1.default.isValidElement(node);
107
108
  }
@@ -213,7 +214,7 @@ function Button(_a) {
213
214
  return (react_1.default.createElement("span", { className: className, style: iconWrapperStyle }, isReactElement(icon) ? react_1.default.cloneElement(icon, { size: iconSize }) : icon));
214
215
  };
215
216
  return (react_1.default.createElement("span", null,
216
- react_1.default.createElement("button", __assign({ disabled: disabled || final.isLoading || false, 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),
217
+ react_1.default.createElement("button", __assign({ type: final.type || 'button', disabled: disabled || final.isLoading || false, 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),
217
218
  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
219
  final.status && (react_1.default.createElement("span", { className: "btn_left_icon", style: iconWrapperStyle },
219
220
  final.status === 'success' && react_1.default.createElement(pi_1.PiCheck, { size: iconSize }),
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;
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ export type InputType = 'text' | 'email' | 'number' | 'tel' | 'textarea' | 'password' | 'date' | 'select' | 'checkbox' | 'radio' | 'file';
3
+ export interface FieldOption {
4
+ label: string;
5
+ value: string;
6
+ disabled?: boolean;
7
+ }
8
+ export interface FormField {
9
+ name: string;
10
+ label?: string;
11
+ type: InputType;
12
+ required?: boolean;
13
+ placeholder?: string;
14
+ options?: FieldOption[];
15
+ multiple?: boolean;
16
+ value?: any;
17
+ disabled?: boolean;
18
+ helperText?: string;
19
+ column?: string;
20
+ inputProps?: {
21
+ startIcon?: React.ReactNode;
22
+ endIcon?: React.ReactNode;
23
+ prefix?: React.ReactNode;
24
+ suffix?: React.ReactNode;
25
+ stringPrefix?: string;
26
+ stringSuffix?: string;
27
+ iconicBg?: string;
28
+ funcss?: string;
29
+ bg?: string;
30
+ flat?: boolean;
31
+ bordered?: boolean;
32
+ borderless?: boolean;
33
+ rounded?: boolean;
34
+ leftRounded?: boolean;
35
+ rightRounded?: boolean;
36
+ rows?: number;
37
+ noBorder?: boolean;
38
+ variant?: string;
39
+ id?: string;
40
+ autocomplete?: string;
41
+ pattern?: string;
42
+ min?: string | number;
43
+ max?: string | number;
44
+ minLength?: number;
45
+ maxLength?: number;
46
+ step?: string | number;
47
+ };
48
+ }
49
+ export interface FormProps {
50
+ fields: FormField[];
51
+ onSubmit: (values: Record<string, any>) => void;
52
+ defaultValues?: Record<string, any>;
53
+ submitText?: string;
54
+ resetText?: string;
55
+ showReset?: boolean;
56
+ isLoading?: boolean;
57
+ className?: string;
58
+ layout?: 'vertical' | 'horizontal' | 'grid';
59
+ gap?: string;
60
+ whatsappIntegration?: {
61
+ enabled: boolean;
62
+ phoneNumber?: string;
63
+ headerMessage?: string;
64
+ footerMessage?: string;
65
+ };
66
+ }
67
+ declare const Form: React.FC<FormProps>;
68
+ export default Form;