funuicss 3.8.13 → 3.8.14
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 +0 -152
- package/package.json +1 -1
- package/ui/feature/Feature.d.ts +40 -70
- package/ui/feature/Feature.js +913 -175
- package/ui/text/Text.d.ts +3 -0
- package/ui/text/Text.js +15 -2
- package/utils/componentUtils.d.ts +2 -2
- package/utils/componentUtils.js +361 -310
package/ui/text/Text.d.ts
CHANGED
|
@@ -42,6 +42,9 @@ type TypographyProps = {
|
|
|
42
42
|
variant?: string;
|
|
43
43
|
margin?: string;
|
|
44
44
|
padding?: string;
|
|
45
|
+
dangerouslySetInnerHTML?: {
|
|
46
|
+
__html: string;
|
|
47
|
+
} | boolean;
|
|
45
48
|
style?: React.CSSProperties;
|
|
46
49
|
size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | string;
|
|
47
50
|
};
|
package/ui/text/Text.js
CHANGED
|
@@ -31,11 +31,11 @@ var pi_1 = require("react-icons/pi");
|
|
|
31
31
|
var componentUtils_1 = require("../../utils/componentUtils");
|
|
32
32
|
var Text = function (_a) {
|
|
33
33
|
var _b;
|
|
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, _c = _a.variant, variant = _c === void 0 ? '' : _c, size = _a.size, margin = _a.margin, style = _a.style, 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", "style", "padding"]);
|
|
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, _c = _a.variant, variant = _c === void 0 ? '' : _c, size = _a.size, margin = _a.margin, style = _a.style, dangerouslySetInnerHTML = _a.dangerouslySetInnerHTML, 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", "style", "dangerouslySetInnerHTML", "padding"]);
|
|
35
35
|
// Use component configuration (simplified - let the hook handle empty variant)
|
|
36
36
|
var mergeWithLocal = (0, componentUtils_1.useComponentConfiguration)('Text', variant).mergeWithLocal;
|
|
37
37
|
// Create local props object - include ALL props
|
|
38
|
-
var localProps = __assign({ bg: bg, color: color, hoverBg: hoverBg, hoverText: hoverText, 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);
|
|
38
|
+
var localProps = __assign({ bg: bg, color: color, hoverBg: hoverBg, hoverText: hoverText, 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, style: style, dangerouslySetInnerHTML: dangerouslySetInnerHTML, padding: padding }, rest);
|
|
39
39
|
// Merge with config - LOCAL PROPS OVERRIDE CONFIG (consistent with Button)
|
|
40
40
|
var mergedProps = mergeWithLocal(localProps).props;
|
|
41
41
|
// Extract final values - use NULLISH COALESCING like Button component
|
|
@@ -77,6 +77,7 @@ var Text = function (_a) {
|
|
|
77
77
|
margin: margin !== null && margin !== void 0 ? margin : mergedProps.margin,
|
|
78
78
|
text: text !== null && text !== void 0 ? text : mergedProps.text,
|
|
79
79
|
padding: padding !== null && padding !== void 0 ? padding : mergedProps.padding,
|
|
80
|
+
dangerouslySetInnerHTML: dangerouslySetInnerHTML !== null && dangerouslySetInnerHTML !== void 0 ? dangerouslySetInnerHTML : mergedProps.dangerouslySetInnerHTML,
|
|
80
81
|
};
|
|
81
82
|
// If margin is provided, force block display
|
|
82
83
|
var shouldBeBlock = final.block || !!final.margin;
|
|
@@ -120,6 +121,18 @@ var Text = function (_a) {
|
|
|
120
121
|
]
|
|
121
122
|
.filter(Boolean)
|
|
122
123
|
.join(' ');
|
|
124
|
+
// Handle dangerouslySetInnerHTML
|
|
125
|
+
var hasDangerousHTML = Boolean(final.dangerouslySetInnerHTML);
|
|
126
|
+
var dangerousHTMLContent = hasDangerousHTML
|
|
127
|
+
? (typeof final.dangerouslySetInnerHTML === 'boolean'
|
|
128
|
+
? { __html: String(final.text || '') }
|
|
129
|
+
: final.dangerouslySetInnerHTML)
|
|
130
|
+
: null;
|
|
131
|
+
// KEY FIX: Don't pass children when using dangerouslySetInnerHTML
|
|
132
|
+
if (hasDangerousHTML) {
|
|
133
|
+
return (react_1.default.createElement(Tag, __assign({ id: id, className: classNames, style: mergedStyles, dangerouslySetInnerHTML: dangerousHTMLContent }, rest)));
|
|
134
|
+
}
|
|
135
|
+
// Normal render without dangerouslySetInnerHTML
|
|
123
136
|
return (react_1.default.createElement(Tag, __assign({ id: id, className: classNames, style: mergedStyles }, rest),
|
|
124
137
|
final.quote && (react_1.default.createElement("div", null,
|
|
125
138
|
react_1.default.createElement(pi_1.PiQuotesLight, null))),
|
|
@@ -57,7 +57,7 @@ export declare const getComponentConfig: (projectData: ProjectData | null | unde
|
|
|
57
57
|
/**
|
|
58
58
|
* Merge component config with local props
|
|
59
59
|
*/
|
|
60
|
-
export declare const mergeComponentConfig: (config: ComponentConfig, localProps: ComponentProps | undefined, projectData: ProjectData | null | undefined) => MergedConfig;
|
|
60
|
+
export declare const mergeComponentConfig: (config: ComponentConfig, localProps: ComponentProps | undefined, projectData: ProjectData | null | undefined, componentName?: string) => MergedConfig;
|
|
61
61
|
/**
|
|
62
62
|
* Hook for easy component config usage
|
|
63
63
|
*/
|
|
@@ -148,7 +148,7 @@ export declare const getVariableByName: (variableName: string, projectData: Proj
|
|
|
148
148
|
} | null;
|
|
149
149
|
declare const _default: {
|
|
150
150
|
getComponentConfig: (projectData: ProjectData | null | undefined, componentName: string, variantName?: string) => ComponentConfig;
|
|
151
|
-
mergeComponentConfig: (config: ComponentConfig, localProps: ComponentProps | undefined, projectData: ProjectData | null | undefined) => MergedConfig;
|
|
151
|
+
mergeComponentConfig: (config: ComponentConfig, localProps: ComponentProps | undefined, projectData: ProjectData | null | undefined, componentName?: string) => MergedConfig;
|
|
152
152
|
useComponentConfiguration: (componentName: string, variantName?: string) => UseComponentConfigReturn;
|
|
153
153
|
useComponentProps: (componentName: string, variantName?: string, localProps?: ComponentProps) => ComponentProps;
|
|
154
154
|
hasComponentVariant: (projectData: ProjectData | null | undefined, componentName: string, variantName: string) => boolean;
|