@descope/flow-components 2.0.139 → 2.0.141
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/dist/index.cjs.js +9 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +9 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -101,8 +101,16 @@ var icons = /*#__PURE__*/Object.freeze({
|
|
|
101
101
|
sso: sso
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
+
const isImageSource = (src) => src.startsWith('data:image') || src.startsWith('http');
|
|
105
|
+
|
|
104
106
|
const Button = React__default.default.forwardRef(({ children, startIcon, startIconColorText, color, ...props }, ref) => {
|
|
105
|
-
const icon = React.useMemo(() =>
|
|
107
|
+
const icon = React.useMemo(() => {
|
|
108
|
+
if (!startIcon)
|
|
109
|
+
return undefined;
|
|
110
|
+
if (isImageSource(startIcon))
|
|
111
|
+
return (React__default.default.createElement("img", { src: startIcon, alt: props.name, style: { height: '1.5em', width: '1.5em' } }));
|
|
112
|
+
return icons[startIcon]?.({ noColor: startIconColorText });
|
|
113
|
+
}, [startIcon, props.name, startIconColorText]);
|
|
106
114
|
const isSquare = React.useMemo(() => !!(icon && !children), [icon, children]);
|
|
107
115
|
return (React__default.default.createElement("descope-button", { ...props, mode: color, ref: ref, square: isSquare },
|
|
108
116
|
icon,
|
package/dist/index.d.ts
CHANGED
|
@@ -372,7 +372,7 @@ declare global {
|
|
|
372
372
|
declare const UploadFile: React.ForwardRefExoticComponent<Props$3 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
373
373
|
|
|
374
374
|
type Props$2 = {
|
|
375
|
-
|
|
375
|
+
enabled?: boolean;
|
|
376
376
|
'site-key'?: string;
|
|
377
377
|
enterprise?: boolean;
|
|
378
378
|
action?: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -95,8 +95,16 @@ var icons = /*#__PURE__*/Object.freeze({
|
|
|
95
95
|
sso: sso
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
+
const isImageSource = (src) => src.startsWith('data:image') || src.startsWith('http');
|
|
99
|
+
|
|
98
100
|
const Button = React.forwardRef(({ children, startIcon, startIconColorText, color, ...props }, ref) => {
|
|
99
|
-
const icon = useMemo(() =>
|
|
101
|
+
const icon = useMemo(() => {
|
|
102
|
+
if (!startIcon)
|
|
103
|
+
return undefined;
|
|
104
|
+
if (isImageSource(startIcon))
|
|
105
|
+
return (React.createElement("img", { src: startIcon, alt: props.name, style: { height: '1.5em', width: '1.5em' } }));
|
|
106
|
+
return icons[startIcon]?.({ noColor: startIconColorText });
|
|
107
|
+
}, [startIcon, props.name, startIconColorText]);
|
|
100
108
|
const isSquare = useMemo(() => !!(icon && !children), [icon, children]);
|
|
101
109
|
return (React.createElement("descope-button", { ...props, mode: color, ref: ref, square: isSquare },
|
|
102
110
|
icon,
|