funuicss 3.6.14 → 3.6.15
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 +6677 -6679
- package/package.json +1 -1
- package/ui/button/Button.d.ts +8 -2
- package/ui/button/Button.js +123 -86
- package/ui/card/Card.d.ts +51 -1
- package/ui/card/Card.js +184 -16
- package/ui/richtext/RichText.d.ts +0 -1
- package/ui/richtext/RichText.js +20 -15
- package/ui/select/Select.d.ts +2 -0
- package/ui/select/Select.js +12 -2
- package/ui/text/Text.d.ts +2 -0
- package/ui/text/Text.js +6 -4
- package/ui/vista/Vista.d.ts +15 -0
- package/ui/vista/Vista.js +20 -5
- package/utils/getDynamicIcon.d.ts +2 -0
- package/utils/getDynamicIcon.js +112 -0
package/ui/richtext/RichText.js
CHANGED
|
@@ -66,19 +66,21 @@ var RichText = function (_a) {
|
|
|
66
66
|
savedRange.current = range;
|
|
67
67
|
};
|
|
68
68
|
var handleTextChange = function () {
|
|
69
|
+
var _a, _b, _c;
|
|
69
70
|
if (!quill)
|
|
70
71
|
return;
|
|
71
|
-
var plainText = quill.getText();
|
|
72
|
-
|
|
73
|
-
if (maxValue &&
|
|
74
|
-
var truncated =
|
|
72
|
+
var plainText = quill.getText().trim();
|
|
73
|
+
// --- Enforce maxValue if needed ---
|
|
74
|
+
if (maxValue && plainText.length > maxValue) {
|
|
75
|
+
var truncated = plainText.slice(0, maxValue);
|
|
75
76
|
quill.setText(truncated);
|
|
76
77
|
quill.setSelection(truncated.length);
|
|
77
|
-
onChange(quill.root.innerHTML);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
onChange(quill.root.innerHTML);
|
|
81
78
|
}
|
|
79
|
+
// --- Clean the HTML output ---
|
|
80
|
+
var cleanedHTML = (_c = (_b = (_a = quill.root.innerHTML) === null || _a === void 0 ? void 0 : _a.replace(/<p><br><\/p>/g, '') // remove empty paragraphs
|
|
81
|
+
) === null || _b === void 0 ? void 0 : _b.replace(/\s+/g, ' ') // collapse multiple spaces
|
|
82
|
+
) === null || _c === void 0 ? void 0 : _c.trim(); // remove leading/trailing spaces
|
|
83
|
+
onChange(cleanedHTML || '');
|
|
82
84
|
};
|
|
83
85
|
quill.on('selection-change', handleSelectionChange);
|
|
84
86
|
quill.on('text-change', handleTextChange);
|
|
@@ -88,8 +90,11 @@ var RichText = function (_a) {
|
|
|
88
90
|
};
|
|
89
91
|
}, [quill, onChange, maxValue]);
|
|
90
92
|
(0, react_1.useEffect)(function () {
|
|
93
|
+
var _a, _b;
|
|
91
94
|
if (quill && value !== quill.root.innerHTML) {
|
|
92
|
-
|
|
95
|
+
// clean before setting editor value
|
|
96
|
+
var cleanedValue = (_b = (_a = value === null || value === void 0 ? void 0 : value.replace(/<p><br><\/p>/g, '')) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, ' ')) === null || _b === void 0 ? void 0 : _b.trim();
|
|
97
|
+
quill.root.innerHTML = cleanedValue || '';
|
|
93
98
|
}
|
|
94
99
|
}, [quill, value]);
|
|
95
100
|
var insertEmoji = function (emoji) {
|
|
@@ -104,15 +109,15 @@ var RichText = function (_a) {
|
|
|
104
109
|
var renderEmojiSection = function (title, emojis) { return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
105
110
|
react_1.default.createElement("div", { className: "mb-2 mt-2 text-sm" }, title),
|
|
106
111
|
react_1.default.createElement(RowFlex_1.default, { gap: 0.3 }, emojis.map(function (emoji, i) { return (react_1.default.createElement("span", { key: i, className: "h6 pointer", onClick: function () { return insertEmoji(emoji); } }, emoji)); })))); };
|
|
107
|
-
return (react_1.default.createElement("div", { className: "fit round-edge ".concat(funcss), style: { position:
|
|
112
|
+
return (react_1.default.createElement("div", { className: "fit round-edge ".concat(funcss), style: { position: 'relative', overflow: 'visible' } },
|
|
108
113
|
react_1.default.createElement("div", { id: "editor-container", className: "bubble-editor-container p-0" },
|
|
109
114
|
react_1.default.createElement("div", { ref: quillRef, className: theme === 'bubble' ? 'bubble-editor' : 'snow-editor', style: {
|
|
110
115
|
fontFamily: fontFamily || 'inherit',
|
|
111
116
|
} })),
|
|
112
|
-
(showEmojis || maxValue) && (react_1.default.createElement("div", { className:
|
|
113
|
-
react_1.default.createElement(Flex_1.default, { justify:
|
|
117
|
+
(showEmojis || maxValue) && (react_1.default.createElement("div", { className: "p-1", style: { height: 'fit-content', top: "calc(100%)", width: '100%' } },
|
|
118
|
+
react_1.default.createElement(Flex_1.default, { justify: "space-between", gap: 1, alignItems: "center", width: "100%" },
|
|
114
119
|
(showEmojis || afterEmoji) ? (react_1.default.createElement("div", null,
|
|
115
|
-
react_1.default.createElement(Flex_1.default, { width:
|
|
120
|
+
react_1.default.createElement(Flex_1.default, { width: "100%", gap: 0.5, alignItems: "center" },
|
|
116
121
|
showEmojis && (react_1.default.createElement(Dropdown_1.default, { closableOnlyOutside: true, direction: "dropdown", openOnHover: false, button: react_1.default.createElement(ToolTip_1.default, null,
|
|
117
122
|
react_1.default.createElement(Circle_1.default, { size: 2, funcss: "bg border" },
|
|
118
123
|
react_1.default.createElement(md_1.MdOutlineEmojiEmotions, null)),
|
|
@@ -128,9 +133,9 @@ var RichText = function (_a) {
|
|
|
128
133
|
},
|
|
129
134
|
] })),
|
|
130
135
|
afterEmoji))) : (react_1.default.createElement("div", null)),
|
|
131
|
-
|
|
136
|
+
maxValue && quill ? (react_1.default.createElement("div", { className: "text-xs text-right" },
|
|
132
137
|
react_1.default.createElement("span", { className: "text-primary" }, quill.getText().trim().length),
|
|
133
|
-
"
|
|
138
|
+
"/",
|
|
134
139
|
maxValue)) : (react_1.default.createElement("div", null)))))));
|
|
135
140
|
};
|
|
136
141
|
exports.default = RichText;
|
package/ui/select/Select.d.ts
CHANGED
package/ui/select/Select.js
CHANGED
|
@@ -32,9 +32,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
39
|
var react_1 = __importStar(require("react"));
|
|
37
40
|
var theme_1 = require("../theme/theme");
|
|
41
|
+
var Flex_1 = __importDefault(require("../flex/Flex"));
|
|
38
42
|
var Select = function (_a) {
|
|
39
43
|
var id = _a.id, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, _b = _a.label, label = _b === void 0 ? 'Select an option' : _b, _c = _a.options, options = _c === void 0 ? [] : _c, onChange = _a.onChange, onBlur = _a.onBlur, _d = _a.searchable, searchable = _d === void 0 ? true : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? false : _f, _g = _a.borderless, borderless = _g === void 0 ? false : _g, _h = _a.rounded, rounded = _h === void 0 ? false : _h, _j = _a.flat, flat = _j === void 0 ? false : _j, _k = _a.fullWidth, fullWidth = _k === void 0 ? false : _k, _l = _a.status, status = _l === void 0 ? '' : _l, _m = _a.className, className = _m === void 0 ? '' : _m, _o = _a.funcss, funcss = _o === void 0 ? '' : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.searchAutoFocus, searchAutoFocus = _q === void 0 ? false : _q, _r = _a.required, required = _r === void 0 ? false : _r;
|
|
40
44
|
var _s = (0, react_1.useState)(false), isOpen = _s[0], setIsOpen = _s[1];
|
|
@@ -211,7 +215,13 @@ var Select = function (_a) {
|
|
|
211
215
|
react_1.default.createElement("svg", { width: "16", height: "16", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
|
|
212
216
|
react_1.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M19 9l-7 7-7-7" })))),
|
|
213
217
|
react_1.default.createElement("div", { className: "select-dropdown ".concat(isOpen ? 'open' : '', " ") },
|
|
214
|
-
searchable && (react_1.default.createElement("input", { ref: searchInputRef, type: "text", className: "select-search", placeholder: "Search options...", value: searchQuery, onChange: function (e) { return setSearchQuery(e.target.value); }, onKeyDown: handleSearchKeyDown })),
|
|
215
|
-
react_1.default.createElement("div", { className: "select-options", role: "listbox" }, filteredOptions.length === 0 ? (react_1.default.createElement("div", { className: "select-option no-results" }, "No options found")) : (filteredOptions.map(function (option, index) { return (react_1.default.createElement("button", { key: option.value, type: "button", className: "select-option ".concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value ? 'selected' : '', " ").concat(index === focusedIndex ? 'focused' : ''), onClick: function () { return selectOption(option); }, role: "option", "aria-selected": (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value },
|
|
218
|
+
searchable && (react_1.default.createElement("input", { ref: searchInputRef, type: "text", className: "select-search", placeholder: "Search options...", style: { borderRadius: 0 }, value: searchQuery, onChange: function (e) { return setSearchQuery(e.target.value); }, onKeyDown: handleSearchKeyDown })),
|
|
219
|
+
react_1.default.createElement("div", { className: "select-options", role: "listbox" }, filteredOptions.length === 0 ? (react_1.default.createElement("div", { className: "select-option no-results" }, "No options found")) : (filteredOptions.map(function (option, index) { return (react_1.default.createElement("button", { style: { borderRadius: 0 }, key: option.value, type: "button", className: "select-option ".concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value ? 'selected' : '', " ").concat(index === focusedIndex ? 'focused' : ''), onClick: function () { return selectOption(option); }, role: "option", "aria-selected": (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value },
|
|
220
|
+
react_1.default.createElement(Flex_1.default, { width: '100%', gap: 0.5 }, option === null || option === void 0 ? void 0 :
|
|
221
|
+
option.prefix,
|
|
222
|
+
" ",
|
|
223
|
+
option.text,
|
|
224
|
+
" ", option === null || option === void 0 ? void 0 :
|
|
225
|
+
option.suffix))); }))))));
|
|
216
226
|
};
|
|
217
227
|
exports.default = Select;
|
package/ui/text/Text.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ type TypographyProps = {
|
|
|
40
40
|
onClick?: () => void;
|
|
41
41
|
children?: React.ReactNode;
|
|
42
42
|
variant?: string;
|
|
43
|
+
margin?: string;
|
|
44
|
+
padding?: string;
|
|
43
45
|
size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
44
46
|
};
|
|
45
47
|
declare const Text: React.FC<TypographyProps>;
|
package/ui/text/Text.js
CHANGED
|
@@ -31,12 +31,14 @@ var pi_1 = require("react-icons/pi");
|
|
|
31
31
|
var getCssVariable_1 = require("../../utils/getCssVariable");
|
|
32
32
|
var componentUtils_1 = require("../../utils/componentUtils");
|
|
33
33
|
var Text = function (_a) {
|
|
34
|
-
var id = _a.id, bg = _a.bg, color = _a.color, children = _a.children, hoverBg = _a.hoverBg, hoverText = _a.hoverText, text = _a.text, funcss = _a.funcss, emp = _a.emp, bold = _a.bold, block = _a.block, body = _a.body, article = _a.article, light = _a.light, lighter = _a.lighter, italic = _a.italic, weight = _a.weight, underline = _a.underline, align = _a.align, lineHeight = _a.lineHeight, letterSpacing = _a.letterSpacing, uppercase = _a.uppercase, lowercase = _a.lowercase, capitalize = _a.capitalize, textDecoration = _a.textDecoration, textTransform = _a.textTransform, whiteSpace = _a.whiteSpace, wordBreak = _a.wordBreak, fontFamily = _a.fontFamily, truncate = _a.truncate, textShadow = _a.textShadow, textAlign = _a.textAlign, customStyles = _a.customStyles, monospace = _a.monospace, quote = _a.quote, opacity = _a.opacity, _b = _a.variant, variant = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'base' : _c, rest = __rest(_a, ["id", "bg", "color", "children", "hoverBg", "hoverText", "text", "funcss", "emp", "bold", "block", "body", "article", "light", "lighter", "italic", "weight", "underline", "align", "lineHeight", "letterSpacing", "uppercase", "lowercase", "capitalize", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "fontFamily", "truncate", "textShadow", "textAlign", "customStyles", "monospace", "quote", "opacity", "variant", "size"]);
|
|
34
|
+
var id = _a.id, bg = _a.bg, color = _a.color, children = _a.children, hoverBg = _a.hoverBg, hoverText = _a.hoverText, text = _a.text, funcss = _a.funcss, emp = _a.emp, bold = _a.bold, block = _a.block, body = _a.body, article = _a.article, light = _a.light, lighter = _a.lighter, italic = _a.italic, weight = _a.weight, underline = _a.underline, align = _a.align, lineHeight = _a.lineHeight, letterSpacing = _a.letterSpacing, uppercase = _a.uppercase, lowercase = _a.lowercase, capitalize = _a.capitalize, textDecoration = _a.textDecoration, textTransform = _a.textTransform, whiteSpace = _a.whiteSpace, wordBreak = _a.wordBreak, fontFamily = _a.fontFamily, truncate = _a.truncate, textShadow = _a.textShadow, textAlign = _a.textAlign, customStyles = _a.customStyles, monospace = _a.monospace, quote = _a.quote, opacity = _a.opacity, _b = _a.variant, variant = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'base' : _c, margin = _a.margin, padding = _a.padding, rest = __rest(_a, ["id", "bg", "color", "children", "hoverBg", "hoverText", "text", "funcss", "emp", "bold", "block", "body", "article", "light", "lighter", "italic", "weight", "underline", "align", "lineHeight", "letterSpacing", "uppercase", "lowercase", "capitalize", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "fontFamily", "truncate", "textShadow", "textAlign", "customStyles", "monospace", "quote", "opacity", "variant", "size", "margin", "padding"]);
|
|
35
35
|
// Use the component config hook
|
|
36
36
|
var mergeWithLocal = (0, componentUtils_1.useComponentConfiguration)('Text', variant).mergeWithLocal;
|
|
37
37
|
// Merge config with local props - local props override config
|
|
38
|
-
var mergedProps = mergeWithLocal(__assign({ bg: bg, color: color, funcss: funcss, emp: emp, bold: bold, block: block, body: body, article: article, light: light, lighter: lighter, italic: italic, weight: weight, underline: underline, align: align, lineHeight: lineHeight, letterSpacing: letterSpacing, uppercase: uppercase, lowercase: lowercase, capitalize: capitalize, textDecoration: textDecoration, textTransform: textTransform, whiteSpace: whiteSpace, wordBreak: wordBreak, fontFamily: fontFamily, truncate: truncate, textShadow: textShadow, textAlign: textAlign, monospace: monospace, quote: quote, opacity: opacity, size: size }, rest)).props;
|
|
39
|
-
|
|
38
|
+
var mergedProps = mergeWithLocal(__assign({ bg: bg, color: color, funcss: funcss, emp: emp, bold: bold, block: block, body: body, article: article, light: light, lighter: lighter, italic: italic, weight: weight, underline: underline, align: align, lineHeight: lineHeight, letterSpacing: letterSpacing, uppercase: uppercase, lowercase: lowercase, capitalize: capitalize, textDecoration: textDecoration, textTransform: textTransform, whiteSpace: whiteSpace, wordBreak: wordBreak, fontFamily: fontFamily, truncate: truncate, textShadow: textShadow, textAlign: textAlign, monospace: monospace, quote: quote, opacity: opacity, size: size, margin: margin, padding: padding }, rest)).props;
|
|
39
|
+
// If margin is provided, force block display
|
|
40
|
+
var shouldBeBlock = mergedProps.block || !!mergedProps.margin;
|
|
41
|
+
var Tag = shouldBeBlock ? 'div' : 'span';
|
|
40
42
|
var sizeClass = "".concat(mergedProps.size === 'h1' ? "h1" :
|
|
41
43
|
mergedProps.size === 'h2' ? "h2" :
|
|
42
44
|
mergedProps.size === 'h3' ? "h3" :
|
|
@@ -45,7 +47,7 @@ var Text = function (_a) {
|
|
|
45
47
|
mergedProps.size === 'h6' ? "h6" :
|
|
46
48
|
"text-".concat(mergedProps.size));
|
|
47
49
|
var bdFontWeight = (0, getCssVariable_1.getCssVariableValue)('bd-font-weight');
|
|
48
|
-
var mergedStyles = __assign(__assign({ display:
|
|
50
|
+
var mergedStyles = __assign(__assign({ display: shouldBeBlock ? 'block' : undefined, fontWeight: mergedProps.bold ? 'bold' : mergedProps.weight ? mergedProps.weight : Number(bdFontWeight), lineHeight: mergedProps.lineHeight, letterSpacing: mergedProps.letterSpacing, textTransform: mergedProps.textTransform, textDecoration: mergedProps.textDecoration, fontFamily: mergedProps.fontFamily, textShadow: mergedProps.textShadow, textAlign: mergedProps.textAlign, whiteSpace: mergedProps.whiteSpace, wordBreak: mergedProps.wordBreak, transform: mergedProps.transform, margin: mergedProps.margin, padding: mergedProps.padding }, customStyles), (mergedProps.truncate
|
|
49
51
|
? {
|
|
50
52
|
display: '-webkit-box',
|
|
51
53
|
WebkitBoxOrient: 'vertical',
|
package/ui/vista/Vista.d.ts
CHANGED
|
@@ -61,6 +61,21 @@ type VistaProps = {
|
|
|
61
61
|
ctaPrimaryText?: string;
|
|
62
62
|
ctaSecondaryText?: string;
|
|
63
63
|
ctaAccentText?: string;
|
|
64
|
+
ctaPrimaryRounded?: boolean;
|
|
65
|
+
ctaPrimaryFlat?: boolean;
|
|
66
|
+
ctaPrimaryPrefix?: string;
|
|
67
|
+
ctaPrimarySuffix?: string;
|
|
68
|
+
primaryIconSize?: number;
|
|
69
|
+
ctaSecondaryRounded?: boolean;
|
|
70
|
+
ctaSecondaryFlat?: boolean;
|
|
71
|
+
ctaSecondaryPrefix?: string;
|
|
72
|
+
ctaSecondarySuffix?: string;
|
|
73
|
+
secondaryIconSize?: number;
|
|
74
|
+
ctaAccentRounded?: boolean;
|
|
75
|
+
ctaAccentFlat?: boolean;
|
|
76
|
+
ctaAccentPrefix?: string;
|
|
77
|
+
ctaAccentSuffix?: string;
|
|
78
|
+
accentIconSize?: number;
|
|
64
79
|
ctaGap?: number;
|
|
65
80
|
ctaFlexJustify?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around';
|
|
66
81
|
};
|
package/ui/vista/Vista.js
CHANGED
|
@@ -34,7 +34,7 @@ var Vista = function (_a) {
|
|
|
34
34
|
// New CTA Button Props
|
|
35
35
|
_19 = _a.showPrimaryCTA,
|
|
36
36
|
// New CTA Button Props
|
|
37
|
-
showPrimaryCTA = _19 === void 0 ? false : _19, _20 = _a.showSecondaryCTA, showSecondaryCTA = _20 === void 0 ? false : _20, _21 = _a.showAccentCTA, showAccentCTA = _21 === void 0 ? false : _21, _22 = _a.primaryButtonOutlined, primaryButtonOutlined = _22 === void 0 ? false : _22, _23 = _a.secondaryButtonOutlined, secondaryButtonOutlined = _23 === void 0 ? false : _23, _24 = _a.accentButtonOutlined, accentButtonOutlined = _24 === void 0 ? false : _24, _25 = _a.ctaPrimaryUrl, ctaPrimaryUrl = _25 === void 0 ? '' : _25, _26 = _a.ctaSecondaryUrl, ctaSecondaryUrl = _26 === void 0 ? '' : _26, _27 = _a.ctaAccentUrl, ctaAccentUrl = _27 === void 0 ? '' : _27, _28 = _a.ctaPrimaryText, ctaPrimaryText = _28 === void 0 ? 'Primary Action' : _28, _29 = _a.ctaSecondaryText, ctaSecondaryText = _29 === void 0 ? 'Secondary Action' : _29, _30 = _a.ctaAccentText, ctaAccentText = _30 === void 0 ? 'Accent Action' : _30, _31 = _a.ctaGap, ctaGap = _31 === void 0 ? 1 : _31, _32 = _a.ctaFlexJustify, ctaFlexJustify = _32 === void 0 ? 'center' : _32;
|
|
37
|
+
showPrimaryCTA = _19 === void 0 ? false : _19, _20 = _a.showSecondaryCTA, showSecondaryCTA = _20 === void 0 ? false : _20, _21 = _a.showAccentCTA, showAccentCTA = _21 === void 0 ? false : _21, _22 = _a.primaryButtonOutlined, primaryButtonOutlined = _22 === void 0 ? false : _22, _23 = _a.secondaryButtonOutlined, secondaryButtonOutlined = _23 === void 0 ? false : _23, _24 = _a.accentButtonOutlined, accentButtonOutlined = _24 === void 0 ? false : _24, _25 = _a.ctaPrimaryUrl, ctaPrimaryUrl = _25 === void 0 ? '' : _25, _26 = _a.ctaSecondaryUrl, ctaSecondaryUrl = _26 === void 0 ? '' : _26, _27 = _a.ctaAccentUrl, ctaAccentUrl = _27 === void 0 ? '' : _27, _28 = _a.ctaPrimaryText, ctaPrimaryText = _28 === void 0 ? 'Primary Action' : _28, _29 = _a.ctaSecondaryText, ctaSecondaryText = _29 === void 0 ? 'Secondary Action' : _29, _30 = _a.ctaAccentText, ctaAccentText = _30 === void 0 ? 'Accent Action' : _30, _31 = _a.ctaGap, ctaGap = _31 === void 0 ? 1 : _31, _32 = _a.ctaFlexJustify, ctaFlexJustify = _32 === void 0 ? 'center' : _32, _33 = _a.ctaPrimaryRounded, ctaPrimaryRounded = _33 === void 0 ? false : _33, _34 = _a.ctaPrimaryFlat, ctaPrimaryFlat = _34 === void 0 ? false : _34, _35 = _a.ctaPrimaryPrefix, ctaPrimaryPrefix = _35 === void 0 ? '' : _35, _36 = _a.ctaPrimarySuffix, ctaPrimarySuffix = _36 === void 0 ? '' : _36, _37 = _a.ctaSecondaryRounded, ctaSecondaryRounded = _37 === void 0 ? false : _37, _38 = _a.ctaSecondaryFlat, ctaSecondaryFlat = _38 === void 0 ? false : _38, _39 = _a.ctaSecondaryPrefix, ctaSecondaryPrefix = _39 === void 0 ? '' : _39, _40 = _a.ctaSecondarySuffix, ctaSecondarySuffix = _40 === void 0 ? '' : _40, _41 = _a.ctaAccentRounded, ctaAccentRounded = _41 === void 0 ? false : _41, _42 = _a.ctaAccentFlat, ctaAccentFlat = _42 === void 0 ? false : _42, _43 = _a.ctaAccentPrefix, ctaAccentPrefix = _43 === void 0 ? '' : _43, _44 = _a.ctaAccentSuffix, ctaAccentSuffix = _44 === void 0 ? '' : _44, primaryIconSize = _a.primaryIconSize, secondaryIconSize = _a.secondaryIconSize, accentIconSize = _a.accentIconSize;
|
|
38
38
|
// Use the component config hook
|
|
39
39
|
var mergeWithLocal = (0, componentUtils_1.useComponentConfiguration)('Vista', variant).mergeWithLocal;
|
|
40
40
|
// Merge config with local props - local props should override config
|
|
@@ -102,6 +102,21 @@ var Vista = function (_a) {
|
|
|
102
102
|
ctaAccentText: ctaAccentText,
|
|
103
103
|
ctaGap: ctaGap,
|
|
104
104
|
ctaFlexJustify: ctaFlexJustify,
|
|
105
|
+
ctaPrimaryRounded: ctaPrimaryRounded,
|
|
106
|
+
ctaPrimaryFlat: ctaPrimaryFlat,
|
|
107
|
+
ctaPrimaryPrefix: ctaPrimaryPrefix,
|
|
108
|
+
ctaPrimarySuffix: ctaPrimarySuffix,
|
|
109
|
+
ctaSecondaryRounded: ctaSecondaryRounded,
|
|
110
|
+
ctaSecondaryFlat: ctaSecondaryFlat,
|
|
111
|
+
ctaSecondaryPrefix: ctaSecondaryPrefix,
|
|
112
|
+
ctaSecondarySuffix: ctaSecondarySuffix,
|
|
113
|
+
ctaAccentRounded: ctaAccentRounded,
|
|
114
|
+
ctaAccentFlat: ctaAccentFlat,
|
|
115
|
+
ctaAccentPrefix: ctaAccentPrefix,
|
|
116
|
+
ctaAccentSuffix: ctaAccentSuffix,
|
|
117
|
+
primaryIconSize: primaryIconSize,
|
|
118
|
+
secondaryIconSize: secondaryIconSize,
|
|
119
|
+
accentIconSize: accentIconSize,
|
|
105
120
|
}).props;
|
|
106
121
|
var layoutClass = [
|
|
107
122
|
mergedProps.layout,
|
|
@@ -116,15 +131,15 @@ var Vista = function (_a) {
|
|
|
116
131
|
if (!hasCTAs)
|
|
117
132
|
return null;
|
|
118
133
|
return (react_1.default.createElement(Flex_1.default, { gap: mergedProps.ctaGap, justify: mergedProps.ctaFlexJustify, className: "mt-6 ".concat(mergedProps.ctaClass), wrap: "wrap", width: '100%' },
|
|
119
|
-
mergedProps.showPrimaryCTA && (react_1.default.createElement(Button_1.default, { bg: "primary", outlined: mergedProps.primaryButtonOutlined, onClick: function () { return window.location.href = mergedProps.ctaPrimaryUrl; } }, mergedProps.ctaPrimaryText)),
|
|
120
|
-
mergedProps.showSecondaryCTA && (react_1.default.createElement(Button_1.default, { bg: "secondary", outlined: mergedProps.secondaryButtonOutlined, onClick: function () { return window.location.href = mergedProps.ctaSecondaryUrl; } }, mergedProps.ctaSecondaryText)),
|
|
121
|
-
mergedProps.showAccentCTA && (react_1.default.createElement(Button_1.default, { bg: "accent", outlined: mergedProps.accentButtonOutlined, onClick: function () { return window.location.href = mergedProps.ctaAccentUrl; } }, mergedProps.ctaAccentText))));
|
|
134
|
+
mergedProps.showPrimaryCTA && (react_1.default.createElement(Button_1.default, { bg: "primary", outlined: mergedProps.primaryButtonOutlined, onClick: function () { return window.location.href = mergedProps.ctaPrimaryUrl; }, rounded: mergedProps.ctaPrimaryRounded, flat: mergedProps.ctaPrimaryFlat, stringPrefix: mergedProps.ctaPrimaryPrefix, stringSuffix: mergedProps.ctaPrimarySuffix, iconSize: mergedProps.primaryIconSize }, mergedProps.ctaPrimaryText)),
|
|
135
|
+
mergedProps.showSecondaryCTA && (react_1.default.createElement(Button_1.default, { bg: "secondary", outlined: mergedProps.secondaryButtonOutlined, onClick: function () { return window.location.href = mergedProps.ctaSecondaryUrl; }, rounded: mergedProps.ctaSecondaryRounded, flat: mergedProps.ctaSecondaryFlat, stringPrefix: mergedProps.ctaSecondaryPrefix, stringSuffix: mergedProps.ctaSecondarySuffix, iconSize: mergedProps.secondaryIconSize }, mergedProps.ctaSecondaryText)),
|
|
136
|
+
mergedProps.showAccentCTA && (react_1.default.createElement(Button_1.default, { bg: "accent", outlined: mergedProps.accentButtonOutlined, onClick: function () { return window.location.href = mergedProps.ctaAccentUrl; }, rounded: mergedProps.ctaAccentRounded, flat: mergedProps.ctaAccentFlat, stringPrefix: mergedProps.ctaAccentPrefix, stringSuffix: mergedProps.ctaAccentSuffix, iconSize: mergedProps.accentIconSize }, mergedProps.ctaAccentText))));
|
|
122
137
|
};
|
|
123
138
|
// Enhanced Text Content with flexible styling
|
|
124
139
|
var TextContent = (react_1.default.createElement("div", { className: "vista-text ".concat(mergedProps.layout === 'centered' ? "text-center" : "", " ").concat(mergedProps.textWrapperClass) },
|
|
125
140
|
mergedProps.heading && (react_1.default.createElement(Text_1.default, { block: true, size: mergedProps.headingSize, weight: mergedProps.headingWeight, color: mergedProps.headingColor, funcss: mergedProps.headingClass }, mergedProps.heading)),
|
|
126
141
|
mergedProps.subheading && (react_1.default.createElement(Text_1.default, { block: true, size: mergedProps.subheadingSize, weight: mergedProps.subheadingWeight, color: mergedProps.subheadingColor, funcss: "mt-2 ".concat(mergedProps.subheadingClass) }, mergedProps.subheading)),
|
|
127
|
-
mergedProps.content && (react_1.default.createElement(Text_1.default, { block: true, size: mergedProps.contentSize, weight: mergedProps.contentWeight, color: mergedProps.contentColor, funcss: "mt-4 ".concat(mergedProps.contentClass), article: true }, mergedProps.content
|
|
142
|
+
mergedProps.content && (react_1.default.createElement(Text_1.default, { block: true, size: mergedProps.contentSize, weight: mergedProps.contentWeight, color: mergedProps.contentColor, funcss: "mt-4 ".concat(mergedProps.contentClass), article: true }, children || (typeof mergedProps.content === 'string' ? react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: mergedProps.content } }) : mergedProps.content))),
|
|
128
143
|
mergedProps.cta ? (react_1.default.createElement("div", { className: "mt-6 ".concat(mergedProps.ctaClass) }, mergedProps.cta)) : (react_1.default.createElement(CTAButtons, null))));
|
|
129
144
|
// Enhanced Image Content - uses imageUrl if no image component provided
|
|
130
145
|
var ImageContent = (mergedProps.image || mergedProps.imageUrl) && (react_1.default.createElement("div", { className: "vista-image ".concat(mergedProps.imageWrapperClass) }, mergedProps.image ? (mergedProps.image) : (react_1.default.createElement("img", { src: mergedProps.imageUrl, alt: mergedProps.imageAlt || 'Vista image', className: "".concat(mergedProps.imageClass), style: {
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
+
function step(op) {
|
|
49
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
+
switch (op[0]) {
|
|
54
|
+
case 0: case 1: t = op; break;
|
|
55
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
+
default:
|
|
59
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
+
if (t[2]) _.ops.pop();
|
|
64
|
+
_.trys.pop(); continue;
|
|
65
|
+
}
|
|
66
|
+
op = body.call(thisArg, _);
|
|
67
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
72
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
73
|
+
};
|
|
74
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
+
exports.getDynamicIcon = getDynamicIcon;
|
|
76
|
+
// utils/getDynamicIcon.ts
|
|
77
|
+
var react_1 = __importDefault(require("react"));
|
|
78
|
+
var iconPacks = {
|
|
79
|
+
fa: function () { return Promise.resolve().then(function () { return __importStar(require("react-icons/fa")); }); },
|
|
80
|
+
pi: function () { return Promise.resolve().then(function () { return __importStar(require("react-icons/pi")); }); },
|
|
81
|
+
md: function () { return Promise.resolve().then(function () { return __importStar(require("react-icons/md")); }); },
|
|
82
|
+
io: function () { return Promise.resolve().then(function () { return __importStar(require("react-icons/io5")); }); },
|
|
83
|
+
bi: function () { return Promise.resolve().then(function () { return __importStar(require("react-icons/bi")); }); },
|
|
84
|
+
ai: function () { return Promise.resolve().then(function () { return __importStar(require("react-icons/ai")); }); },
|
|
85
|
+
};
|
|
86
|
+
function getDynamicIcon(iconName) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
+
var prefix, loader, pack, Icon, err_1;
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0:
|
|
92
|
+
_a.trys.push([0, 2, , 3]);
|
|
93
|
+
prefix = iconName.slice(0, 2).toLowerCase();
|
|
94
|
+
loader = iconPacks[prefix];
|
|
95
|
+
if (!loader)
|
|
96
|
+
return [2 /*return*/, null];
|
|
97
|
+
return [4 /*yield*/, loader()];
|
|
98
|
+
case 1:
|
|
99
|
+
pack = _a.sent();
|
|
100
|
+
Icon = pack[iconName];
|
|
101
|
+
if (!Icon)
|
|
102
|
+
return [2 /*return*/, null];
|
|
103
|
+
return [2 /*return*/, react_1.default.createElement(Icon, null)];
|
|
104
|
+
case 2:
|
|
105
|
+
err_1 = _a.sent();
|
|
106
|
+
console.error("Failed to load icon: ".concat(iconName), err_1);
|
|
107
|
+
return [2 /*return*/, null];
|
|
108
|
+
case 3: return [2 /*return*/];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|