@powerhousedao/design-system 1.39.15-dev.3 → 1.39.15-dev.5
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/src/connect/components/modal/confirmation-modal.js +1 -1
- package/dist/src/connect/components/modal/delete-drive-modal.js +1 -1
- package/dist/src/connect/components/modal/read-required-modal.js +1 -1
- package/dist/src/connect/components/modal/upgrade-drive-modal.js +1 -1
- package/dist/src/scalars/components/form/form.d.ts +7 -1
- package/dist/src/scalars/components/form/form.d.ts.map +1 -1
- package/dist/src/scalars/components/form/form.js +3 -2
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -10,5 +10,5 @@ export function ConnectConfirmationModal(props) {
|
|
|
10
10
|
}, onOpenChange: onOpenChange, overlayProps: {
|
|
11
11
|
...overlayProps,
|
|
12
12
|
className: overlayProps?.className,
|
|
13
|
-
}, ...restProps, children: _jsxs("div", { ...mergeClassNameProps(containerProps, "w-[400px] p-6 text-slate-300"), children: [_jsx("div", { ...mergeClassNameProps(headerProps, "border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"), children: header }), _jsxs("div", { ...mergeClassNameProps(bodyProps, "my-6 rounded-md bg-slate-50 p-4 text-center
|
|
13
|
+
}, ...restProps, children: _jsxs("div", { ...mergeClassNameProps(containerProps, "w-[400px] p-6 text-slate-300"), children: [_jsx("div", { ...mergeClassNameProps(headerProps, "border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"), children: header }), _jsxs("div", { ...mergeClassNameProps(bodyProps, "my-6 rounded-md bg-slate-50 p-4 text-center"), children: [body, children] }), _jsxs("div", { ...mergeClassNameProps(buttonContainerProps, "mt-8 flex justify-between gap-3"), children: [_jsx("button", { onClick: onCancel, ...mergeClassNameProps(cancelButtonProps, twMerge(buttonStyles, "flex-1 bg-slate-50 text-slate-800")), children: cancelLabel }), _jsx("button", { onClick: onContinue, ...mergeClassNameProps(continueButtonProps, twMerge(buttonStyles, "flex-1 bg-gray-800 text-gray-50")), children: continueLabel })] })] }) }));
|
|
14
14
|
}
|
|
@@ -11,5 +11,5 @@ export const ConnectDeleteDriveModal = (props) => {
|
|
|
11
11
|
className: inputName !== driveName
|
|
12
12
|
? "bg-red-600 hover:scale-100 cursor-not-allowed active:opacity-100"
|
|
13
13
|
: "bg-red-900",
|
|
14
|
-
}, ...confirmationModalProps, children: _jsxs("div", { children: [_jsx("div", { className: "my-6 rounded-md bg-slate-50 p-4 text-center
|
|
14
|
+
}, ...confirmationModalProps, children: _jsxs("div", { children: [_jsx("div", { className: "my-6 rounded-md bg-slate-50 p-4 text-center", children: body }), _jsx("div", { children: _jsx(FormInput, { hideErrors: true, icon: _jsx(Icon, { name: "Lock" }), onChange: (e) => setInputName(e.target.value), placeholder: inputPlaceholder, value: inputName }) })] }) }));
|
|
15
15
|
};
|
|
@@ -42,6 +42,6 @@ export function ReadRequiredModal(props) {
|
|
|
42
42
|
}, onOpenChange: onOpenChange, overlayProps: {
|
|
43
43
|
...overlayProps,
|
|
44
44
|
className: overlayProps?.className,
|
|
45
|
-
}, ...restProps, children: _jsxs("div", { ...mergeClassNameProps(containerProps, "w-[500px] p-6 text-slate-300"), children: [_jsx("div", { ...mergeClassNameProps(headerProps, "border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"), children: header }), _jsxs("div", { ref: contentRef, ...mergeClassNameProps(bodyProps, "my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center
|
|
45
|
+
}, ...restProps, children: _jsxs("div", { ...mergeClassNameProps(containerProps, "w-[500px] p-6 text-slate-300"), children: [_jsx("div", { ...mergeClassNameProps(headerProps, "border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"), children: header }), _jsxs("div", { ref: contentRef, ...mergeClassNameProps(bodyProps, "my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center"), children: [body, children] }), _jsx("div", { ...mergeClassNameProps(buttonContainerProps, "mt-8 flex justify-between gap-3"), children: _jsx("button", { disabled: disableClose, onClick: onContinue, ...mergeClassNameProps(continueButtonProps, twMerge(buttonStyles, "flex-1 bg-gray-800 text-gray-50", disableClose &&
|
|
46
46
|
"cursor-not-allowed bg-gray-300 hover:scale-100")), children: closeLabel }) })] }) }));
|
|
47
47
|
}
|
|
@@ -10,5 +10,5 @@ export function ConnectUpgradeDriveModal(props) {
|
|
|
10
10
|
}, onOpenChange: onOpenChange, overlayProps: {
|
|
11
11
|
...overlayProps,
|
|
12
12
|
className: overlayProps?.className,
|
|
13
|
-
}, ...restProps, children: _jsxs("div", { className: "w-[400px] p-6 text-slate-300", children: [_jsx("div", { className: "border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800", children: header }), _jsx("div", { className: "my-6 rounded-md bg-slate-50 p-4 text-center
|
|
13
|
+
}, ...restProps, children: _jsxs("div", { className: "w-[400px] p-6 text-slate-300", children: [_jsx("div", { className: "border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800", children: header }), _jsx("div", { className: "my-6 rounded-md bg-slate-50 p-4 text-center", children: body }), _jsxs("div", { className: "mt-8 flex justify-between gap-3", children: [_jsx("button", { className: twMerge(buttonStyles, "flex-1 bg-slate-50 text-slate-800"), onClick: () => onOpenChange?.(false), children: cancelLabel }), _jsx("button", { className: twMerge(buttonStyles, "flex-1 bg-gray-800 text-gray-50"), onClick: onContinue, children: continueLabel })] })] }) }));
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type UseFormReturn } from "react-hook-form";
|
|
1
|
+
import { type UseFormProps, type UseFormReturn } from "react-hook-form";
|
|
2
2
|
type FormMethods = UseFormReturn & {
|
|
3
3
|
/**
|
|
4
4
|
* Trigger the form submit event
|
|
@@ -50,6 +50,12 @@ interface FormProps {
|
|
|
50
50
|
* @default false The errors will be rendered automatically on top of the form.
|
|
51
51
|
*/
|
|
52
52
|
renderSubmitErrorsManually?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Additional props to pass to the form config from react-hook-form.
|
|
55
|
+
*
|
|
56
|
+
* Note: this could affect the form behavior, use with caution.
|
|
57
|
+
*/
|
|
58
|
+
extraFormProps?: UseFormProps;
|
|
53
59
|
/**
|
|
54
60
|
* Callback to match a submission error with one or more form fields or form level errors.
|
|
55
61
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/form/form.tsx"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/form/form.tsx"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAIzB,KAAK,WAAW,GAAG,aAAa,GAAG;IACjC;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,UAAU,SAAS;IACjB;;;;OAIG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,WAAW,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAExE;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;OAIG;IACH,cAAc,CAAC,EAAE,YAAY,CAAC;IAE9B;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,EAAE,CACvB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,MAAM,EAAE,KACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,IAAI,qGAuJhB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { castValue, deepEqual, isEmpty } from "#scalars";
|
|
3
3
|
import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, } from "react";
|
|
4
|
-
import { FormProvider, useForm } from "react-hook-form";
|
|
4
|
+
import { FormProvider, useForm, } from "react-hook-form";
|
|
5
5
|
import { FormServerErrorMessage } from "../fragments/form-message/form-server-error-message.js";
|
|
6
6
|
import { defaultOnError } from "./utils.js";
|
|
7
7
|
/**
|
|
@@ -38,11 +38,12 @@ import { defaultOnError } from "./utils.js";
|
|
|
38
38
|
* </Form>
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
|
-
export const Form = forwardRef(({ children, onSubmit, resetOnSuccessfulSubmit = false, submitChangesOnly = false, defaultValues, renderSubmitErrorsManually = false, submissionErrorMatcher = defaultOnError, className, }, ref) => {
|
|
41
|
+
export const Form = forwardRef(({ children, onSubmit, resetOnSuccessfulSubmit = false, submitChangesOnly = false, defaultValues, renderSubmitErrorsManually = false, submissionErrorMatcher = defaultOnError, className, extraFormProps, }, ref) => {
|
|
42
42
|
const formId = useId();
|
|
43
43
|
const methods = useForm({
|
|
44
44
|
defaultValues,
|
|
45
45
|
criteriaMode: "all", // display all errors at once
|
|
46
|
+
...extraFormProps,
|
|
46
47
|
});
|
|
47
48
|
useImperativeHandle(ref, () => methods, [methods]);
|
|
48
49
|
useEffect(() => {
|