@deftui/addons 0.0.5 → 0.1.0
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/form.d.mts +13 -2
- package/dist/form.mjs +13 -2
- package/dist/modal-manager/host.mjs +42 -0
- package/dist/modal-manager/manager.d.mts +15 -0
- package/dist/modal-manager/manager.mjs +177 -0
- package/dist/modal-manager/types.d.mts +55 -0
- package/dist/modal.d.mts +3 -0
- package/dist/modal.mjs +1 -0
- package/dist/react-hook-form/field.d.mts +8 -2
- package/dist/react-hook-form/field.mjs +33 -7
- package/dist/react-hook-form/form.d.mts +1 -1
- package/dist/react-hook-form/form.mjs +1 -1
- package/package.json +7 -3
package/dist/form.d.mts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { RHFField } from "./react-hook-form/field.mjs";
|
|
2
2
|
import { RHFForm } from "./react-hook-form/form.mjs";
|
|
3
3
|
export declare const RHF: {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Thin wrapper for BaseUI's FormPrimitive.
|
|
6
|
+
*
|
|
7
|
+
* - `className` defaults to `"grid gap-4"`.
|
|
8
|
+
*/
|
|
5
9
|
Form: typeof RHFForm;
|
|
6
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* `useController` wrapper with label, description, and error.
|
|
12
|
+
*
|
|
13
|
+
* - Injects `id`, `aria-invalid`, and `aria-describedby` into a single child element.
|
|
14
|
+
* - For arrays/fragments, spread the second callback argument onto the control.
|
|
15
|
+
* - Syncs `data-disabled` with the field's disabled state.
|
|
16
|
+
* - Custom components must forward these props.
|
|
17
|
+
*/
|
|
7
18
|
Field: typeof RHFField;
|
|
8
19
|
};
|
package/dist/form.mjs
CHANGED
|
@@ -2,9 +2,20 @@ import { RHFField } from "./react-hook-form/field.mjs";
|
|
|
2
2
|
import { RHFForm } from "./react-hook-form/form.mjs";
|
|
3
3
|
// src/react-hook-form/index.ts
|
|
4
4
|
const RHF = {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Thin wrapper for BaseUI's FormPrimitive.
|
|
7
|
+
*
|
|
8
|
+
* - `className` defaults to `"grid gap-4"`.
|
|
9
|
+
*/
|
|
6
10
|
Form: RHFForm,
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* `useController` wrapper with label, description, and error.
|
|
13
|
+
*
|
|
14
|
+
* - Injects `id`, `aria-invalid`, and `aria-describedby` into a single child element.
|
|
15
|
+
* - For arrays/fragments, spread the second callback argument onto the control.
|
|
16
|
+
* - Syncs `data-disabled` with the field's disabled state.
|
|
17
|
+
* - Custom components must forward these props.
|
|
18
|
+
*/
|
|
8
19
|
Field: RHFField
|
|
9
20
|
};
|
|
10
21
|
export { RHF };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Component, Suspense, memo, useLayoutEffect } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/modal-manager/host.tsx
|
|
5
|
+
function ModalRenderer({ view, onPresent }) {
|
|
6
|
+
useLayoutEffect(() => onPresent(view.id, view.component), [
|
|
7
|
+
onPresent,
|
|
8
|
+
view.id,
|
|
9
|
+
view.component
|
|
10
|
+
]);
|
|
11
|
+
const Content = view.component;
|
|
12
|
+
return /* @__PURE__ */ jsx(Content, {
|
|
13
|
+
...view.props,
|
|
14
|
+
modal: view.modal
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
var ModalErrorBoundary = class extends Component {
|
|
18
|
+
state = { failed: false };
|
|
19
|
+
static getDerivedStateFromError() {
|
|
20
|
+
return { failed: true };
|
|
21
|
+
}
|
|
22
|
+
componentDidCatch(error) {
|
|
23
|
+
this.props.onError(error);
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return this.state.failed ? null : this.props.children;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/** Unchanged instances do not rerender when another instance opens or closes. */
|
|
30
|
+
const ModalEntry = memo(function ModalEntry({ view, onPresent, onError }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(ModalErrorBoundary, {
|
|
32
|
+
onError: (error) => onError(view.id, error),
|
|
33
|
+
children: /* @__PURE__ */ jsx(Suspense, {
|
|
34
|
+
fallback: null,
|
|
35
|
+
children: /* @__PURE__ */ jsx(ModalRenderer, {
|
|
36
|
+
view,
|
|
37
|
+
onPresent
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
export { ModalEntry };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModalManager, ModalManagerOptions, ModalProps, ModalRegistry } from "./types.mjs";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Create once outside rendering; accepts regular, memo, and lazy components.
|
|
5
|
+
*
|
|
6
|
+
* Call `open` on the client, outside rendering. The Host renders nothing during SSR.
|
|
7
|
+
*
|
|
8
|
+
* Pass the caller's `hot` and a stable `key` to retain instances and promises during HMR.
|
|
9
|
+
* Reload the page when the manager implementation changes.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* export const modals = createModalManager({ edit: EditModal }, { hot: import.meta.hot, key: "modals" });
|
|
13
|
+
* if (import.meta.hot) import.meta.hot.accept();
|
|
14
|
+
*/
|
|
15
|
+
export declare function createModalManager<Registry extends ModalRegistry>(registry: Registry & { [Key in keyof Registry]: Registry[Key] extends ComponentType<infer Props> ? (Props extends ModalProps<never> ? unknown : never) : never; }, options?: ModalManagerOptions): ModalManager<Registry>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ModalEntry } from "./host.mjs";
|
|
3
|
+
import { useEffect, useSyncExternalStore } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/modal-manager/manager.tsx
|
|
6
|
+
const EMPTY = [];
|
|
7
|
+
/**
|
|
8
|
+
* Create once outside rendering; accepts regular, memo, and lazy components.
|
|
9
|
+
*
|
|
10
|
+
* Call `open` on the client, outside rendering. The Host renders nothing during SSR.
|
|
11
|
+
*
|
|
12
|
+
* Pass the caller's `hot` and a stable `key` to retain instances and promises during HMR.
|
|
13
|
+
* Reload the page when the manager implementation changes.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* export const modals = createModalManager({ edit: EditModal }, { hot: import.meta.hot, key: "modals" });
|
|
17
|
+
* if (import.meta.hot) import.meta.hot.accept();
|
|
18
|
+
*/
|
|
19
|
+
function createModalManager(registry, options) {
|
|
20
|
+
const cache = options?.hot ? options.hot.data.__deftuiModalManagers ??= /* @__PURE__ */ new Map() : void 0;
|
|
21
|
+
const cached = options && cache?.get(options.key);
|
|
22
|
+
if (cached) {
|
|
23
|
+
cached.setRegistry(registry);
|
|
24
|
+
return cached;
|
|
25
|
+
}
|
|
26
|
+
let definitions = registry;
|
|
27
|
+
let snapshot = EMPTY;
|
|
28
|
+
let nextId = 0;
|
|
29
|
+
let hostAttached = false;
|
|
30
|
+
const instances = /* @__PURE__ */ new Map();
|
|
31
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
32
|
+
function publish() {
|
|
33
|
+
snapshot = Array.from(instances.values(), (instance) => instance.view);
|
|
34
|
+
listeners.forEach((listener) => listener());
|
|
35
|
+
}
|
|
36
|
+
function subscribe(listener) {
|
|
37
|
+
listeners.add(listener);
|
|
38
|
+
return () => {
|
|
39
|
+
listeners.delete(listener);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function getSnapshot() {
|
|
43
|
+
return snapshot;
|
|
44
|
+
}
|
|
45
|
+
function getServerSnapshot() {
|
|
46
|
+
return EMPTY;
|
|
47
|
+
}
|
|
48
|
+
function remove(id) {
|
|
49
|
+
if (instances.delete(id)) publish();
|
|
50
|
+
}
|
|
51
|
+
function finish(instance, result) {
|
|
52
|
+
if (instance.settled) return;
|
|
53
|
+
instance.settled = true;
|
|
54
|
+
if (instance.presented) {
|
|
55
|
+
instance.view = {
|
|
56
|
+
...instance.view,
|
|
57
|
+
modal: {
|
|
58
|
+
...instance.view.modal,
|
|
59
|
+
rootProps: {
|
|
60
|
+
...instance.view.modal.rootProps,
|
|
61
|
+
open: false
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
publish();
|
|
66
|
+
} else remove(instance.view.id);
|
|
67
|
+
instance.resolve(result);
|
|
68
|
+
}
|
|
69
|
+
function onPresent(id, component) {
|
|
70
|
+
const instance = instances.get(id);
|
|
71
|
+
if (instance?.view.component === component) instance.presented = true;
|
|
72
|
+
}
|
|
73
|
+
function onError(id, error) {
|
|
74
|
+
const instance = instances.get(id);
|
|
75
|
+
if (!instance) return;
|
|
76
|
+
remove(id);
|
|
77
|
+
if (!instance.settled) {
|
|
78
|
+
instance.settled = true;
|
|
79
|
+
instance.reject(error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function attachHost() {
|
|
83
|
+
if (hostAttached) throw new Error("A modal manager can only have one mounted Host.");
|
|
84
|
+
hostAttached = true;
|
|
85
|
+
return () => {
|
|
86
|
+
hostAttached = false;
|
|
87
|
+
queueMicrotask(() => {
|
|
88
|
+
if (hostAttached) return;
|
|
89
|
+
const remaining = Array.from(instances.values());
|
|
90
|
+
instances.clear();
|
|
91
|
+
publish();
|
|
92
|
+
for (const instance of remaining) {
|
|
93
|
+
if (instance.settled) continue;
|
|
94
|
+
instance.settled = true;
|
|
95
|
+
instance.resolve({ status: "dismissed" });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function Host() {
|
|
101
|
+
const views = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
102
|
+
useEffect(attachHost, []);
|
|
103
|
+
return views.map((view) => /* @__PURE__ */ jsx(ModalEntry, {
|
|
104
|
+
view,
|
|
105
|
+
onPresent,
|
|
106
|
+
onError
|
|
107
|
+
}, view.id));
|
|
108
|
+
}
|
|
109
|
+
function open(key, props = {}) {
|
|
110
|
+
const definition = definitions[key];
|
|
111
|
+
if (!definition) throw new Error(`Unknown modal: ${key}`);
|
|
112
|
+
return new Promise((resolve, reject) => {
|
|
113
|
+
const id = nextId++;
|
|
114
|
+
const instance = {
|
|
115
|
+
key,
|
|
116
|
+
presented: false,
|
|
117
|
+
settled: false,
|
|
118
|
+
resolve,
|
|
119
|
+
reject,
|
|
120
|
+
view: {
|
|
121
|
+
id,
|
|
122
|
+
component: definition,
|
|
123
|
+
props,
|
|
124
|
+
modal: {
|
|
125
|
+
resolve: (value) => finish(instance, {
|
|
126
|
+
status: "resolved",
|
|
127
|
+
value
|
|
128
|
+
}),
|
|
129
|
+
dismiss: () => finish(instance, { status: "dismissed" }),
|
|
130
|
+
rootProps: {
|
|
131
|
+
open: true,
|
|
132
|
+
onOpenChange: (isOpen) => {
|
|
133
|
+
if (!isOpen) finish(instance, { status: "dismissed" });
|
|
134
|
+
},
|
|
135
|
+
onOpenChangeComplete: (isOpen) => {
|
|
136
|
+
if (!isOpen && instance.settled) remove(id);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
instances.set(id, instance);
|
|
143
|
+
publish();
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function dismissAll() {
|
|
147
|
+
for (const instance of instances.values()) finish(instance, { status: "dismissed" });
|
|
148
|
+
}
|
|
149
|
+
function setRegistry(nextRegistry) {
|
|
150
|
+
definitions = nextRegistry;
|
|
151
|
+
for (const instance of instances.values()) {
|
|
152
|
+
if (instance.settled) continue;
|
|
153
|
+
const definition = definitions[instance.key];
|
|
154
|
+
if (!definition) {
|
|
155
|
+
finish(instance, { status: "dismissed" });
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
const component = definition;
|
|
159
|
+
if (component === instance.view.component) continue;
|
|
160
|
+
instance.presented = false;
|
|
161
|
+
instance.view = {
|
|
162
|
+
...instance.view,
|
|
163
|
+
component
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
publish();
|
|
167
|
+
}
|
|
168
|
+
const manager = {
|
|
169
|
+
Host,
|
|
170
|
+
open,
|
|
171
|
+
dismissAll,
|
|
172
|
+
setRegistry
|
|
173
|
+
};
|
|
174
|
+
if (options) cache?.set(options.key, manager);
|
|
175
|
+
return manager;
|
|
176
|
+
}
|
|
177
|
+
export { createModalManager };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
/** Spread onto a controlled Dialog, AlertDialog, or Sheet root. */
|
|
3
|
+
export interface ModalRootProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
onOpenChangeComplete: (open: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface ModalController<Value> {
|
|
9
|
+
/** Spread all three props onto the Root; forward callbacks when overriding them. */
|
|
10
|
+
rootProps: ModalRootProps;
|
|
11
|
+
/** Resolve the result and start closing. The first resolution or dismissal wins. */
|
|
12
|
+
resolve: (value: Value) => void;
|
|
13
|
+
/** Dismiss normally, without rejecting the returned promise. */
|
|
14
|
+
dismiss: () => void;
|
|
15
|
+
}
|
|
16
|
+
/** Intersect with the business component's props. The manager supplies `modal`. */
|
|
17
|
+
export interface ModalProps<Value = void> {
|
|
18
|
+
modal: ModalController<Value>;
|
|
19
|
+
}
|
|
20
|
+
export type ModalRegistry = Record<string, ComponentType<never>>;
|
|
21
|
+
type ModalComponentProps<T extends ComponentType<never>> = T extends ComponentType<infer Props> ? Props : never;
|
|
22
|
+
type ModalArguments<Props> = {} extends Props ? [props?: Props] : [props: Props];
|
|
23
|
+
export type ModalInput<T extends ComponentType<never>> = Omit<ModalComponentProps<T>, "modal">;
|
|
24
|
+
export type ModalValue<T extends ComponentType<never>> = ModalComponentProps<T> extends ModalProps<infer Value> ? Value : never;
|
|
25
|
+
export type ModalResult<Value> = {
|
|
26
|
+
status: "resolved";
|
|
27
|
+
value: Value;
|
|
28
|
+
} | {
|
|
29
|
+
status: "dismissed";
|
|
30
|
+
};
|
|
31
|
+
export interface ModalManagerOptions {
|
|
32
|
+
/** The registration module's `import.meta.hot`. No HMR callbacks are registered. */
|
|
33
|
+
hot?: {
|
|
34
|
+
data: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
/** Stable across updates and unique among managers in the same module. */
|
|
37
|
+
key: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ModalManager<Registry extends ModalRegistry> {
|
|
40
|
+
/** Mount once inside the required contexts. Unmounting dismisses pending calls. */
|
|
41
|
+
Host: ComponentType;
|
|
42
|
+
/**
|
|
43
|
+
* Each call creates an independent instance.
|
|
44
|
+
*
|
|
45
|
+
* Resolves when closing starts; unmounts after exit.
|
|
46
|
+
*
|
|
47
|
+
* Loading/rendering failures reject; normal dismissal resolves with `status: "dismissed"`.
|
|
48
|
+
*/
|
|
49
|
+
open: <Key extends Extract<keyof Registry, string>>(key: Key, ...args: ModalArguments<ModalInput<Registry[Key]>>) => Promise<ModalResult<ModalValue<Registry[Key]>>>;
|
|
50
|
+
/** Dismiss all current instances, preserving their exit animations. */
|
|
51
|
+
dismissAll: () => void;
|
|
52
|
+
/** Replace definitions, retaining promises. Removed entries dismiss; new components may reset local state. */
|
|
53
|
+
setRegistry: (registry: Registry) => void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
package/dist/modal.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ModalController, ModalInput, ModalManager, ModalManagerOptions, ModalProps, ModalRegistry, ModalResult, ModalRootProps, ModalValue } from "./modal-manager/types.mjs";
|
|
2
|
+
import { createModalManager } from "./modal-manager/manager.mjs";
|
|
3
|
+
export { type ModalController, type ModalInput, type ModalManager, type ModalManagerOptions, type ModalProps, type ModalRegistry, type ModalResult, type ModalRootProps, type ModalValue, createModalManager };
|
package/dist/modal.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createModalManager } from "./modal-manager/manager.mjs";
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { Field } from "@deftui/react";
|
|
2
3
|
import { FieldPath, FieldValues, UseControllerProps, UseControllerReturn } from "react-hook-form";
|
|
3
|
-
import React from "react";
|
|
4
4
|
type FieldStateKeys = "name" | "disabled" | "invalid" | "dirty" | "touched";
|
|
5
5
|
type FieldValidKeys = "validate" | "validationMode" | "validationDebounceTime";
|
|
6
6
|
type FieldRootProps = Omit<React.ComponentProps<typeof Field>, FieldStateKeys | FieldValidKeys | "children">;
|
|
7
|
+
interface ControlProps {
|
|
8
|
+
"id": string;
|
|
9
|
+
"aria-invalid": boolean;
|
|
10
|
+
"aria-describedby": string | undefined;
|
|
11
|
+
}
|
|
7
12
|
interface RHFFieldProps<Values extends FieldValues, Name extends FieldPath<Values> = FieldPath<Values>, Output = Values> extends UseControllerProps<Values, Name, Output> {
|
|
8
13
|
label?: React.ReactNode;
|
|
9
14
|
description?: React.ReactNode;
|
|
10
15
|
fieldProps?: FieldRootProps;
|
|
11
|
-
|
|
16
|
+
/** A single non-fragment element receives control props automatically; spread them manually for nested controls. */
|
|
17
|
+
children: (state: UseControllerReturn<Values, Name>, controlProps: ControlProps) => React.ReactNode;
|
|
12
18
|
}
|
|
13
19
|
export declare function RHFField<T extends FieldValues, Name extends FieldPath<T>, Output = T>(props: RHFFieldProps<T, Name, Output>): React.JSX.Element;
|
|
14
20
|
export {};
|
|
@@ -1,19 +1,45 @@
|
|
|
1
|
+
import { Fragment, cloneElement, isValidElement, useId } from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
3
|
import { Field } from "@deftui/react";
|
|
2
4
|
import { useController } from "react-hook-form";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
// src/react-hook-form/field.tsx
|
|
5
6
|
function RHFField(props) {
|
|
6
7
|
const { label, description, fieldProps, children, ...controllerProps } = props;
|
|
8
|
+
const id = useId();
|
|
7
9
|
const controller = useController(controllerProps);
|
|
8
|
-
const
|
|
10
|
+
const hasError = Boolean(controller.fieldState.error?.message);
|
|
11
|
+
const controlProps = {
|
|
12
|
+
id,
|
|
13
|
+
"aria-invalid": controller.fieldState.invalid,
|
|
14
|
+
"aria-describedby": [description != null && `${id}-description`, hasError && `${id}-error`].filter(Boolean).join(" ") || void 0
|
|
15
|
+
};
|
|
16
|
+
const child = children(controller, controlProps);
|
|
17
|
+
const control = isValidElement(child) && child.type !== Fragment ? child : null;
|
|
18
|
+
const controlId = control?.props.id ?? id;
|
|
19
|
+
const descriptionIds = [control?.props["aria-describedby"], controlProps["aria-describedby"]].join(" ").split(/\s+/).filter(Boolean);
|
|
20
|
+
const describedBy = [...new Set(descriptionIds)].join(" ") || void 0;
|
|
9
21
|
return /* @__PURE__ */ jsxs(Field, {
|
|
10
22
|
...fieldProps,
|
|
11
|
-
"data-invalid": fieldState.invalid,
|
|
23
|
+
"data-invalid": controller.fieldState.invalid,
|
|
24
|
+
"data-disabled": controller.field.disabled,
|
|
12
25
|
children: [
|
|
13
|
-
label != null && /* @__PURE__ */ jsx(Field.Label, {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
label != null && /* @__PURE__ */ jsx(Field.Label, {
|
|
27
|
+
htmlFor: controlId,
|
|
28
|
+
children: label
|
|
29
|
+
}),
|
|
30
|
+
control ? cloneElement(control, {
|
|
31
|
+
"id": controlId,
|
|
32
|
+
"aria-invalid": control.props["aria-invalid"] ?? controlProps["aria-invalid"],
|
|
33
|
+
"aria-describedby": describedBy
|
|
34
|
+
}) : child,
|
|
35
|
+
description != null && /* @__PURE__ */ jsx(Field.Description, {
|
|
36
|
+
id: `${id}-description`,
|
|
37
|
+
children: description
|
|
38
|
+
}),
|
|
39
|
+
hasError && /* @__PURE__ */ jsx(Field.Error, {
|
|
40
|
+
id: `${id}-error`,
|
|
41
|
+
errors: [controller.fieldState.error]
|
|
42
|
+
})
|
|
17
43
|
]
|
|
18
44
|
});
|
|
19
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftui/addons",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/KiriRainCat/deftui.git",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"**/*.css"
|
|
15
15
|
],
|
|
16
16
|
"exports": {
|
|
17
|
+
"./modal": {
|
|
18
|
+
"types": "./dist/modal.d.mts",
|
|
19
|
+
"import": "./dist/modal.mjs"
|
|
20
|
+
},
|
|
17
21
|
"./form": {
|
|
18
22
|
"types": "./dist/form.d.mts",
|
|
19
23
|
"import": "./dist/form.mjs"
|
|
@@ -36,14 +40,14 @@
|
|
|
36
40
|
"fix": "vp check --fix"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"@deftui/react": "^0.0
|
|
43
|
+
"@deftui/react": "^0.1.0",
|
|
40
44
|
"@tanstack/react-router": "^1.170.46",
|
|
41
45
|
"@types/react": "^19.3.0",
|
|
42
46
|
"react-hook-form": "^7.91.0",
|
|
43
47
|
"vite-plus": "catalog:"
|
|
44
48
|
},
|
|
45
49
|
"peerDependencies": {
|
|
46
|
-
"@deftui/react": "^0.0
|
|
50
|
+
"@deftui/react": "^0.1.0",
|
|
47
51
|
"@tanstack/react-router": "^1",
|
|
48
52
|
"react": "^19",
|
|
49
53
|
"react-hook-form": "^7"
|