@matchain/matchid-sdk-react 0.1.14 → 0.1.16
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.css +9 -1
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -57,6 +57,7 @@ body {
|
|
|
57
57
|
/**field component**/
|
|
58
58
|
--matchid-field-color: var(--matchid-text-color);
|
|
59
59
|
--matchid-field-error-color: var(--matchid-red-600);
|
|
60
|
+
--matchid-field-required-color:#E60808;
|
|
60
61
|
/**button component**/
|
|
61
62
|
--matchid-btn-border-color: var(--matchid-black);
|
|
62
63
|
--matchid-btn-color: var(--matchid-black);
|
|
@@ -185,13 +186,16 @@ body {
|
|
|
185
186
|
.matchid-modal-header {
|
|
186
187
|
padding-bottom: 24px;
|
|
187
188
|
margin-bottom: 24px;
|
|
188
|
-
border-bottom: 1px solid var(--matchid-modal-header-border-color, #E3E3E3);
|
|
189
189
|
height: 54px;
|
|
190
190
|
display: flex;
|
|
191
191
|
align-items: center;
|
|
192
192
|
justify-content: space-between;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
.matchid-modal-header-border{
|
|
196
|
+
border-bottom: 1px solid var(--matchid-modal-header-border-color, #E3E3E3);
|
|
197
|
+
}
|
|
198
|
+
|
|
195
199
|
.matchid-modal-header-content {
|
|
196
200
|
display: flex;
|
|
197
201
|
align-items: center;
|
|
@@ -272,6 +276,10 @@ body {
|
|
|
272
276
|
font-weight: 600;
|
|
273
277
|
}
|
|
274
278
|
|
|
279
|
+
.matchid-field-required{
|
|
280
|
+
color: var(--matchid-field-required-color);
|
|
281
|
+
}
|
|
282
|
+
|
|
275
283
|
.matchid-field-error{
|
|
276
284
|
font-size: 14px;
|
|
277
285
|
font-weight: 600;
|
package/dist/index.d.mts
CHANGED
|
@@ -43,6 +43,7 @@ type OverviewInfo = {
|
|
|
43
43
|
type ModalProps = PropsWithChildren & {
|
|
44
44
|
isOpen: boolean,
|
|
45
45
|
width?: number
|
|
46
|
+
className?: string
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
type ModalWithHeaderProps = ModalProps & {
|
|
@@ -50,6 +51,7 @@ type ModalWithHeaderProps = ModalProps & {
|
|
|
50
51
|
onClose?: () => void,
|
|
51
52
|
title?: string
|
|
52
53
|
showClose?: boolean
|
|
54
|
+
showBorder?: boolean
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
type InputProps = {
|
|
@@ -60,6 +62,7 @@ type InputProps = {
|
|
|
60
62
|
readonly?: boolean
|
|
61
63
|
type?: string
|
|
62
64
|
maxLength?: number
|
|
65
|
+
className?: string
|
|
63
66
|
after?: React.ReactNode
|
|
64
67
|
}
|
|
65
68
|
|
|
@@ -158,19 +161,21 @@ declare const useMatch: () => MatchContextType;
|
|
|
158
161
|
|
|
159
162
|
declare function EmailModal({ isOpen, width, onClose, onBack, onLogin }: EmailModalProps): react_jsx_runtime.JSX.Element;
|
|
160
163
|
|
|
161
|
-
declare function Field({ label, children, error }: {
|
|
164
|
+
declare function Field({ label, children, error, required, className }: {
|
|
162
165
|
label: ReactNode;
|
|
163
166
|
error?: ReactNode;
|
|
167
|
+
required?: boolean;
|
|
168
|
+
className?: string;
|
|
164
169
|
} & PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
165
170
|
|
|
166
|
-
declare function Input({ onChange, type, after, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
171
|
+
declare function Input({ onChange, type, after, className, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
167
172
|
|
|
168
173
|
declare function Button({ size, disabled, loading, children, onClick, highlight, block, type, rounded, className, style }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
169
174
|
|
|
170
175
|
declare function LoginBox({ methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
171
176
|
|
|
172
|
-
declare function Modal({ children, isOpen, width }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
173
|
-
declare function ModalWithHeader({ children, onBack, onClose, title, showClose, ...props }: ModalWithHeaderProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
declare function Modal({ children, isOpen, width, className }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
178
|
+
declare function ModalWithHeader({ children, onBack, onClose, title, showBorder, showClose, ...props }: ModalWithHeaderProps): react_jsx_runtime.JSX.Element;
|
|
174
179
|
|
|
175
180
|
declare function LoginButton({ loginRender, methods, onLoginClick, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
176
181
|
loginRender?: () => JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ type OverviewInfo = {
|
|
|
43
43
|
type ModalProps = PropsWithChildren & {
|
|
44
44
|
isOpen: boolean,
|
|
45
45
|
width?: number
|
|
46
|
+
className?: string
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
type ModalWithHeaderProps = ModalProps & {
|
|
@@ -50,6 +51,7 @@ type ModalWithHeaderProps = ModalProps & {
|
|
|
50
51
|
onClose?: () => void,
|
|
51
52
|
title?: string
|
|
52
53
|
showClose?: boolean
|
|
54
|
+
showBorder?: boolean
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
type InputProps = {
|
|
@@ -60,6 +62,7 @@ type InputProps = {
|
|
|
60
62
|
readonly?: boolean
|
|
61
63
|
type?: string
|
|
62
64
|
maxLength?: number
|
|
65
|
+
className?: string
|
|
63
66
|
after?: React.ReactNode
|
|
64
67
|
}
|
|
65
68
|
|
|
@@ -158,19 +161,21 @@ declare const useMatch: () => MatchContextType;
|
|
|
158
161
|
|
|
159
162
|
declare function EmailModal({ isOpen, width, onClose, onBack, onLogin }: EmailModalProps): react_jsx_runtime.JSX.Element;
|
|
160
163
|
|
|
161
|
-
declare function Field({ label, children, error }: {
|
|
164
|
+
declare function Field({ label, children, error, required, className }: {
|
|
162
165
|
label: ReactNode;
|
|
163
166
|
error?: ReactNode;
|
|
167
|
+
required?: boolean;
|
|
168
|
+
className?: string;
|
|
164
169
|
} & PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
165
170
|
|
|
166
|
-
declare function Input({ onChange, type, after, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
171
|
+
declare function Input({ onChange, type, after, className, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
167
172
|
|
|
168
173
|
declare function Button({ size, disabled, loading, children, onClick, highlight, block, type, rounded, className, style }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
169
174
|
|
|
170
175
|
declare function LoginBox({ methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
171
176
|
|
|
172
|
-
declare function Modal({ children, isOpen, width }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
173
|
-
declare function ModalWithHeader({ children, onBack, onClose, title, showClose, ...props }: ModalWithHeaderProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
declare function Modal({ children, isOpen, width, className }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
178
|
+
declare function ModalWithHeader({ children, onBack, onClose, title, showBorder, showClose, ...props }: ModalWithHeaderProps): react_jsx_runtime.JSX.Element;
|
|
174
179
|
|
|
175
180
|
declare function LoginButton({ loginRender, methods, onLoginClick, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
176
181
|
loginRender?: () => JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -397,13 +397,14 @@ var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
|
397
397
|
function Modal({
|
|
398
398
|
children,
|
|
399
399
|
isOpen,
|
|
400
|
-
width = 480
|
|
400
|
+
width = 480,
|
|
401
|
+
className = ""
|
|
401
402
|
}) {
|
|
402
403
|
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
403
404
|
"div",
|
|
404
405
|
{
|
|
405
406
|
className: "matchid-overlay",
|
|
406
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className:
|
|
407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `matchid-modal ${className}`, style: {
|
|
407
408
|
width
|
|
408
409
|
}, children })
|
|
409
410
|
}
|
|
@@ -414,11 +415,12 @@ function ModalWithHeader({
|
|
|
414
415
|
onBack,
|
|
415
416
|
onClose,
|
|
416
417
|
title,
|
|
418
|
+
showBorder = true,
|
|
417
419
|
showClose = true,
|
|
418
420
|
...props
|
|
419
421
|
}) {
|
|
420
422
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Modal, { ...props, children: [
|
|
421
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: `matchid-modal-header`, children: [
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: `matchid-modal-header ${showBorder ? "matchid-modal-header-border" : ""}`, children: [
|
|
422
424
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "matchid-modal-header-content", children: [
|
|
423
425
|
onBack && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeftIcon, { className: "matchid-modal-header-back", onClick: onBack }),
|
|
424
426
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "matchid-modal-header-title", children: title })
|
|
@@ -439,10 +441,11 @@ function Input({
|
|
|
439
441
|
onChange,
|
|
440
442
|
type,
|
|
441
443
|
after,
|
|
444
|
+
className = "",
|
|
442
445
|
...props
|
|
443
446
|
}) {
|
|
444
447
|
const [inputType, setInputType] = (0, import_react.useState)(type);
|
|
445
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `matchid-input-box ${props.value.length > 0 ? "matchid-input-has-content" : ""}`, children: [
|
|
448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `matchid-input-box ${props.value.length > 0 ? "matchid-input-has-content" : ""} ${className}`, children: [
|
|
446
449
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: inputType, onChange, ...props, className: "matchid-input-field" }),
|
|
447
450
|
props.value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DeleteRoundIcon, { onClick: (e) => {
|
|
448
451
|
if (onChange) {
|
|
@@ -461,10 +464,15 @@ var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
|
461
464
|
function Field({
|
|
462
465
|
label,
|
|
463
466
|
children,
|
|
464
|
-
error
|
|
467
|
+
error,
|
|
468
|
+
required,
|
|
469
|
+
className = ""
|
|
465
470
|
}) {
|
|
466
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className:
|
|
467
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.
|
|
471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: `matchid-field-box ${className}`, children: [
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "matchid-field-label", children: [
|
|
473
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "matchid-field-required", children: "*" }),
|
|
474
|
+
label
|
|
475
|
+
] }),
|
|
468
476
|
children,
|
|
469
477
|
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "matchid-field-error", children: error })
|
|
470
478
|
] });
|