@emeraldemperaur/vector-sigma 1.4.14 → 1.4.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/lib/index.cjs +10 -10
- package/lib/index.esm.js +10 -10
- package/lib/types/components/input/uuidInput.d.ts +5 -6
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -45691,7 +45691,7 @@ const safeParseUuidFormat = (typeString) => {
|
|
|
45691
45691
|
}
|
|
45692
45692
|
};
|
|
45693
45693
|
const UUIDInput = (_a) => {
|
|
45694
|
-
var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = '
|
|
45694
|
+
var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = 'uuid-outline', size = "2", className } = _a; __rest$1(_a, ["alias", "type", "inputLabel", "width", "delimiter", "format", "placeholder", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "readOnly", "inputVariant", "size", "className"]);
|
|
45695
45695
|
const { setFieldValue, setFieldTouched } = formik.useFormikContext();
|
|
45696
45696
|
const [field, meta] = formik.useField(alias);
|
|
45697
45697
|
const hasError = Boolean(meta.touched && meta.error);
|
|
@@ -45702,7 +45702,7 @@ const UUIDInput = (_a) => {
|
|
|
45702
45702
|
return parsed || format;
|
|
45703
45703
|
}, [type, format]);
|
|
45704
45704
|
const maskPattern = React.useMemo(() => {
|
|
45705
|
-
return activeFormat.map(len => '
|
|
45705
|
+
return activeFormat.map(len => '#'.repeat(len)).join(delimiter);
|
|
45706
45706
|
}, [activeFormat, delimiter]);
|
|
45707
45707
|
const handleCopy = () => {
|
|
45708
45708
|
if (field.value) {
|
|
@@ -45711,23 +45711,23 @@ const UUIDInput = (_a) => {
|
|
|
45711
45711
|
setTimeout(() => setCopied(false), 2000);
|
|
45712
45712
|
}
|
|
45713
45713
|
};
|
|
45714
|
-
const variantClass = inputVariant !== '
|
|
45714
|
+
const variantClass = inputVariant !== 'uuid-outline' ? `input-${inputVariant}` : '';
|
|
45715
45715
|
return (React.createElement(Column, { span: width, newLine: newRow },
|
|
45716
45716
|
React.createElement(p$5, { direction: "column", gap: "2", style: { width: '100%' } },
|
|
45717
|
-
React.createElement(u,
|
|
45717
|
+
React.createElement(u, { size: size, variant: "surface", color: hasError ? 'red' : undefined, className: `${variantClass} ${className || ''}`, style: { cursor: readOnly ? 'default' : 'text' } },
|
|
45718
45718
|
React.createElement(IMaskInput, { mask: maskPattern, definitions: {
|
|
45719
|
-
'
|
|
45720
|
-
}, prepare: (str) => str.toUpperCase(), value: field.value || '', onAccept: (
|
|
45721
|
-
setFieldValue(alias,
|
|
45719
|
+
'#': /[0-9a-fA-F]/
|
|
45720
|
+
}, prepare: (str) => str.toUpperCase(), value: field.value || '', unmask: false, onAccept: (value) => {
|
|
45721
|
+
setFieldValue(alias, value);
|
|
45722
45722
|
}, onBlur: () => setFieldTouched(alias, true), id: `${alias}FormInput`, placeholder: placeholder, readOnly: readOnly, style: {
|
|
45723
45723
|
flex: 1,
|
|
45724
45724
|
border: 'none',
|
|
45725
45725
|
outline: 'none',
|
|
45726
45726
|
backgroundColor: 'transparent',
|
|
45727
45727
|
height: '100%',
|
|
45728
|
-
paddingLeft: '
|
|
45728
|
+
paddingLeft: 'var(--space-2)',
|
|
45729
45729
|
color: 'var(--gray-12)',
|
|
45730
|
-
fontFamily: 'var(--code-font-family)',
|
|
45730
|
+
fontFamily: 'var(--code-font-family, monospace)',
|
|
45731
45731
|
fontSize: 'var(--font-size-2)',
|
|
45732
45732
|
textTransform: 'uppercase',
|
|
45733
45733
|
width: '100%'
|
|
@@ -45741,7 +45741,7 @@ const UUIDInput = (_a) => {
|
|
|
45741
45741
|
isHinted && (React.createElement(e, { content: hintText || "No hint available" },
|
|
45742
45742
|
React.createElement("a", { href: hintUrl || "", target: "_blank", rel: "noopener noreferrer" },
|
|
45743
45743
|
React.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray', marginLeft: 4 } })))),
|
|
45744
|
-
hasError && (React.createElement(p$d, { id: errorId, size: "1", color: "red", style: { display: 'block', marginTop: 2 } }, errorText || meta.error ||
|
|
45744
|
+
hasError && (React.createElement(p$d, { id: errorId, size: "1", color: "red", style: { display: 'block', marginTop: 2 } }, errorText || meta.error || "Required field"))))));
|
|
45745
45745
|
};
|
|
45746
45746
|
|
|
45747
45747
|
var FaCcVisa = {};
|
package/lib/index.esm.js
CHANGED
|
@@ -45671,7 +45671,7 @@ const safeParseUuidFormat = (typeString) => {
|
|
|
45671
45671
|
}
|
|
45672
45672
|
};
|
|
45673
45673
|
const UUIDInput = (_a) => {
|
|
45674
|
-
var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = '
|
|
45674
|
+
var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = 'uuid-outline', size = "2", className } = _a; __rest$1(_a, ["alias", "type", "inputLabel", "width", "delimiter", "format", "placeholder", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "readOnly", "inputVariant", "size", "className"]);
|
|
45675
45675
|
const { setFieldValue, setFieldTouched } = useFormikContext();
|
|
45676
45676
|
const [field, meta] = useField(alias);
|
|
45677
45677
|
const hasError = Boolean(meta.touched && meta.error);
|
|
@@ -45682,7 +45682,7 @@ const UUIDInput = (_a) => {
|
|
|
45682
45682
|
return parsed || format;
|
|
45683
45683
|
}, [type, format]);
|
|
45684
45684
|
const maskPattern = useMemo(() => {
|
|
45685
|
-
return activeFormat.map(len => '
|
|
45685
|
+
return activeFormat.map(len => '#'.repeat(len)).join(delimiter);
|
|
45686
45686
|
}, [activeFormat, delimiter]);
|
|
45687
45687
|
const handleCopy = () => {
|
|
45688
45688
|
if (field.value) {
|
|
@@ -45691,23 +45691,23 @@ const UUIDInput = (_a) => {
|
|
|
45691
45691
|
setTimeout(() => setCopied(false), 2000);
|
|
45692
45692
|
}
|
|
45693
45693
|
};
|
|
45694
|
-
const variantClass = inputVariant !== '
|
|
45694
|
+
const variantClass = inputVariant !== 'uuid-outline' ? `input-${inputVariant}` : '';
|
|
45695
45695
|
return (React__default.createElement(Column, { span: width, newLine: newRow },
|
|
45696
45696
|
React__default.createElement(p$5, { direction: "column", gap: "2", style: { width: '100%' } },
|
|
45697
|
-
React__default.createElement(u,
|
|
45697
|
+
React__default.createElement(u, { size: size, variant: "surface", color: hasError ? 'red' : undefined, className: `${variantClass} ${className || ''}`, style: { cursor: readOnly ? 'default' : 'text' } },
|
|
45698
45698
|
React__default.createElement(IMaskInput, { mask: maskPattern, definitions: {
|
|
45699
|
-
'
|
|
45700
|
-
}, prepare: (str) => str.toUpperCase(), value: field.value || '', onAccept: (
|
|
45701
|
-
setFieldValue(alias,
|
|
45699
|
+
'#': /[0-9a-fA-F]/
|
|
45700
|
+
}, prepare: (str) => str.toUpperCase(), value: field.value || '', unmask: false, onAccept: (value) => {
|
|
45701
|
+
setFieldValue(alias, value);
|
|
45702
45702
|
}, onBlur: () => setFieldTouched(alias, true), id: `${alias}FormInput`, placeholder: placeholder, readOnly: readOnly, style: {
|
|
45703
45703
|
flex: 1,
|
|
45704
45704
|
border: 'none',
|
|
45705
45705
|
outline: 'none',
|
|
45706
45706
|
backgroundColor: 'transparent',
|
|
45707
45707
|
height: '100%',
|
|
45708
|
-
paddingLeft: '
|
|
45708
|
+
paddingLeft: 'var(--space-2)',
|
|
45709
45709
|
color: 'var(--gray-12)',
|
|
45710
|
-
fontFamily: 'var(--code-font-family)',
|
|
45710
|
+
fontFamily: 'var(--code-font-family, monospace)',
|
|
45711
45711
|
fontSize: 'var(--font-size-2)',
|
|
45712
45712
|
textTransform: 'uppercase',
|
|
45713
45713
|
width: '100%'
|
|
@@ -45721,7 +45721,7 @@ const UUIDInput = (_a) => {
|
|
|
45721
45721
|
isHinted && (React__default.createElement(e, { content: hintText || "No hint available" },
|
|
45722
45722
|
React__default.createElement("a", { href: hintUrl || "", target: "_blank", rel: "noopener noreferrer" },
|
|
45723
45723
|
React__default.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray', marginLeft: 4 } })))),
|
|
45724
|
-
hasError && (React__default.createElement(p$d, { id: errorId, size: "1", color: "red", style: { display: 'block', marginTop: 2 } }, errorText || meta.error ||
|
|
45724
|
+
hasError && (React__default.createElement(p$d, { id: errorId, size: "1", color: "red", style: { display: 'block', marginTop: 2 } }, errorText || meta.error || "Required field"))))));
|
|
45725
45725
|
};
|
|
45726
45726
|
|
|
45727
45727
|
var FaCcVisa = {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { InputDesign } from "./input";
|
|
1
|
+
import React from "react";
|
|
3
2
|
import '../../styles/main.scss';
|
|
4
3
|
type startsWithUuid = `uuid${string}`;
|
|
5
|
-
|
|
4
|
+
interface UUIDInputProps {
|
|
6
5
|
alias: string;
|
|
7
6
|
type?: startsWithUuid | string;
|
|
8
7
|
inputLabel?: string;
|
|
@@ -14,11 +13,11 @@ type UUIDInputProps = {
|
|
|
14
13
|
hintText?: string;
|
|
15
14
|
hintUrl?: string;
|
|
16
15
|
placeholder?: string;
|
|
17
|
-
errorText?: ReactNode | string | null;
|
|
16
|
+
errorText?: React.ReactNode | string | null;
|
|
18
17
|
className?: string;
|
|
19
|
-
inputVariant?:
|
|
18
|
+
inputVariant?: 'uuid' | 'uuid-outline' | 'uuid-material' | 'uuid-neumorphic';
|
|
20
19
|
readOnly?: boolean;
|
|
21
20
|
size?: "1" | "2" | "3";
|
|
22
|
-
}
|
|
21
|
+
}
|
|
23
22
|
export declare const UUIDInput: ({ alias, type, inputLabel, width, delimiter, format, placeholder, newRow, isHinted, hintText, hintUrl, errorText, readOnly, inputVariant, size, className, ...props }: UUIDInputProps) => React.JSX.Element;
|
|
24
23
|
export {};
|