@godxjp/ui 8.3.0 → 9.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/{chunk-CLU46QR2.js → chunk-442ULAA6.js} +12 -4
- package/dist/{chunk-P4HFJQID.js → chunk-5D42MFB4.js} +54 -92
- package/dist/{chunk-PIQXAOWS.js → chunk-KXOAZGPA.js} +2 -2
- package/dist/{chunk-ZY5NUG4B.js → chunk-VN72SWHX.js} +17 -3
- package/dist/{chunk-6PA2YHRE.js → chunk-XQMPK4GM.js} +0 -15
- package/dist/components/admin/index.d.ts +5 -10
- package/dist/components/admin/index.js +13 -14
- package/dist/components/data-display/card.d.ts +2 -2
- package/dist/components/data-entry/command.d.ts +1 -1
- package/dist/components/data-entry/index.js +7 -7
- package/dist/components/data-entry/upload.js +3 -3
- package/dist/components/feedback/alert.d.ts +2 -2
- package/dist/components/feedback/dialog.d.ts +5 -13
- package/dist/components/feedback/dialog.js +1 -1
- package/dist/components/feedback/index.d.ts +2 -2
- package/dist/components/feedback/index.js +2 -2
- package/dist/components/layout/index.d.ts +7 -6
- package/dist/components/layout/index.js +2 -2
- package/dist/components/navigation/index.d.ts +2 -2
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/query/index.d.ts +2 -2
- package/dist/components/query/index.js +193 -4
- package/dist/components/ui/index.d.ts +2 -2
- package/dist/components/ui/index.js +12 -12
- package/dist/{feedback.prop-BR5JOpPl.d.ts → feedback.prop-Nc9Aa8SV.d.ts} +1 -3
- package/dist/{filter-bar-WjnQOs2C.d.ts → filter-bar-BycYH10i.d.ts} +2 -2
- package/dist/form/index.js +71 -3
- package/dist/index.d.ts +5 -14
- package/dist/index.js +18 -20
- package/dist/{inline-DqfYlGKj.d.ts → inline-DCqn4O29.d.ts} +2 -2
- package/dist/{layout.prop-Baq9muDN.d.ts → layout.prop-DwJKI6ka.d.ts} +2 -0
- package/dist/props/components/index.d.ts +3 -3
- package/dist/props/index.d.ts +3 -3
- package/dist/props/index.js +1 -1
- package/dist/props/registry.d.ts +0 -5
- package/dist/props/registry.js +1 -1
- package/dist/{query.prop-DuODxsiU.d.ts → query.prop-BDdz9L1G.d.ts} +1 -1
- package/package.json +4 -3
- package/dist/chunk-7WRZG2IG.js +0 -71
- package/dist/chunk-GLEEJYGQ.js +0 -193
- /package/dist/{chunk-HKD6ERY7.js → chunk-LDSLS6HE.js} +0 -0
package/dist/props/registry.d.ts
CHANGED
|
@@ -672,11 +672,6 @@ declare const COMPONENT_PROP_REGISTRY: {
|
|
|
672
672
|
readonly file: "components/data-display.prop.ts";
|
|
673
673
|
readonly vocabulary: readonly ["ColumnDefProp", "DensityProp", "SortStateProp", "SelectedIdsProp"];
|
|
674
674
|
};
|
|
675
|
-
readonly DialogConfirmProp: {
|
|
676
|
-
readonly group: "feedback";
|
|
677
|
-
readonly file: "components/feedback.prop.ts";
|
|
678
|
-
readonly vocabulary: readonly ["OpenProp", "OnOpenChangeProp", "TitleProp", "DescriptionProp", "ConfirmLabelProp", "CancelLabelProp", "ConfirmVariantProp", "OnValueChangeProp", "PendingProp"];
|
|
679
|
-
};
|
|
680
675
|
readonly AlertDialogProp: {
|
|
681
676
|
readonly group: "feedback";
|
|
682
677
|
readonly file: "components/feedback.prop.ts";
|
package/dist/props/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { COMPONENT_PROP_REGISTRY, PROP_ALIASES_FORBIDDEN, VOCABULARY_REGISTRY } from '../chunk-
|
|
1
|
+
export { COMPONENT_PROP_REGISTRY, PROP_ALIASES_FORBIDDEN, VOCABULARY_REGISTRY } from '../chunk-XQMPK4GM.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { UseQueryResult, UseInfiniteQueryResult, InfiniteData, UseMutationResult, QueryKey } from '@tanstack/react-query';
|
|
3
3
|
import { LinkProps } from 'react-router-dom';
|
|
4
4
|
import { B as ButtonProp } from './general.prop-DoHDCRmL.js';
|
|
5
5
|
import { H as HandlerProp, a as ClassNameProp } from './shared.prop-BsNSXeqD.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godxjp/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "@godxjp/ui — shared React UI framework (shadcn + Radix + Tailwind v4).",
|
|
6
6
|
"files": [
|
|
@@ -267,12 +267,13 @@
|
|
|
267
267
|
"test": "vitest run",
|
|
268
268
|
"test:watch": "vitest",
|
|
269
269
|
"test:coverage": "vitest run --coverage",
|
|
270
|
-
"verify": "pnpm typecheck && pnpm lint && pnpm format && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:mcp-sync && pnpm check:mcp-orphans && pnpm test",
|
|
271
|
-
"verify:release": "pnpm typecheck && pnpm lint && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:mcp-sync && pnpm check:mcp-orphans && pnpm
|
|
270
|
+
"verify": "pnpm typecheck && pnpm lint && pnpm format && pnpm build && pnpm check:core-isolation && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:mcp-sync && pnpm check:mcp-orphans && pnpm test",
|
|
271
|
+
"verify:release": "pnpm typecheck && pnpm lint && pnpm build && pnpm check:core-isolation && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:mcp-sync && pnpm check:mcp-orphans && pnpm test",
|
|
272
272
|
"check:mcp-sync": "node scripts/check-mcp-sync.mjs",
|
|
273
273
|
"check:mcp-orphans": "node scripts/check-mcp-orphans.mjs",
|
|
274
274
|
"check:prop-vocabulary": "node scripts/check-prop-vocabulary.mjs",
|
|
275
275
|
"check:token-tiers": "node scripts/check-token-tiers.mjs",
|
|
276
|
+
"check:core-isolation": "node scripts/check-core-isolation.mjs",
|
|
276
277
|
"release": "node scripts/release.mjs",
|
|
277
278
|
"preview": "node preview/scripts/kill-port.mjs && vite --config preview/vite.config.ts --port 6008 --strictPort",
|
|
278
279
|
"preview:build": "vite build --config preview/vite.config.ts",
|
package/dist/chunk-7WRZG2IG.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { FormField } from './chunk-F7PG4OEV.js';
|
|
2
|
-
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
-
import { useForm, FormProvider, useFormContext, Controller } from 'react-hook-form';
|
|
4
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function useZodForm(schema, options) {
|
|
8
|
-
return useForm({
|
|
9
|
-
...options,
|
|
10
|
-
// zodResolver + Zod 4 inference gap — runtime types are correct.
|
|
11
|
-
resolver: zodResolver(schema)
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
function FormRoot({
|
|
15
|
-
form,
|
|
16
|
-
onSubmit,
|
|
17
|
-
children,
|
|
18
|
-
className,
|
|
19
|
-
id
|
|
20
|
-
}) {
|
|
21
|
-
return /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsx(
|
|
22
|
-
"form",
|
|
23
|
-
{
|
|
24
|
-
id,
|
|
25
|
-
className: cn("ui-stack-md", className),
|
|
26
|
-
onSubmit: (event) => {
|
|
27
|
-
void form.handleSubmit((values) => onSubmit(values))(event);
|
|
28
|
-
},
|
|
29
|
-
noValidate: true,
|
|
30
|
-
children
|
|
31
|
-
}
|
|
32
|
-
) });
|
|
33
|
-
}
|
|
34
|
-
function FormFieldControl({
|
|
35
|
-
name,
|
|
36
|
-
label,
|
|
37
|
-
required,
|
|
38
|
-
helper,
|
|
39
|
-
className,
|
|
40
|
-
children
|
|
41
|
-
}) {
|
|
42
|
-
const { control } = useFormContext();
|
|
43
|
-
return /* @__PURE__ */ jsx(
|
|
44
|
-
Controller,
|
|
45
|
-
{
|
|
46
|
-
name,
|
|
47
|
-
control,
|
|
48
|
-
render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
|
|
49
|
-
FormField,
|
|
50
|
-
{
|
|
51
|
-
id: String(name),
|
|
52
|
-
label,
|
|
53
|
-
required,
|
|
54
|
-
helper,
|
|
55
|
-
error: fieldState.error?.message,
|
|
56
|
-
className,
|
|
57
|
-
children: children({
|
|
58
|
-
id: String(name),
|
|
59
|
-
name: field.name,
|
|
60
|
-
value: field.value,
|
|
61
|
-
onChange: field.onChange,
|
|
62
|
-
onBlur: field.onBlur,
|
|
63
|
-
ref: field.ref
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export { FormFieldControl, FormRoot, useZodForm };
|
package/dist/chunk-GLEEJYGQ.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { AlertQueryError } from './chunk-ZRRLOOBX.js';
|
|
2
|
-
import { Button } from './chunk-M4PZNAMV.js';
|
|
3
|
-
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import { RefreshCw } from 'lucide-react';
|
|
7
|
-
import { Link } from 'react-router-dom';
|
|
8
|
-
import { useQueryClient } from '@tanstack/react-query';
|
|
9
|
-
|
|
10
|
-
function defaultIsEmpty(data) {
|
|
11
|
-
if (!data) return true;
|
|
12
|
-
if (Array.isArray(data)) return data.length === 0;
|
|
13
|
-
if (typeof data === "object" && data !== null) {
|
|
14
|
-
const obj = data;
|
|
15
|
-
if (Array.isArray(obj.items)) return obj.items.length === 0;
|
|
16
|
-
if (typeof obj.length === "number") return obj.length === 0;
|
|
17
|
-
}
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
function DataState({
|
|
21
|
-
query,
|
|
22
|
-
skeleton,
|
|
23
|
-
empty,
|
|
24
|
-
isEmpty = defaultIsEmpty,
|
|
25
|
-
errorRenderer,
|
|
26
|
-
showRetry = true,
|
|
27
|
-
onRetry,
|
|
28
|
-
children
|
|
29
|
-
}) {
|
|
30
|
-
const retry = React.useCallback(() => {
|
|
31
|
-
if (onRetry) {
|
|
32
|
-
void onRetry();
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
void query.refetch();
|
|
36
|
-
}, [onRetry, query]);
|
|
37
|
-
if (query.isPending) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
38
|
-
if (query.isError) {
|
|
39
|
-
if (query.isFetching) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
40
|
-
if (errorRenderer) return /* @__PURE__ */ jsx(Fragment, { children: errorRenderer(query.error, retry) });
|
|
41
|
-
return /* @__PURE__ */ jsx(AlertQueryError, { error: query.error, onRetry: showRetry ? retry : void 0 });
|
|
42
|
-
}
|
|
43
|
-
const data = query.data;
|
|
44
|
-
if (data === void 0) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
45
|
-
if (empty && (data === null || isEmpty(data))) return /* @__PURE__ */ jsx(Fragment, { children: empty });
|
|
46
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
47
|
-
}
|
|
48
|
-
function AlertMutationFeedback({
|
|
49
|
-
mutation,
|
|
50
|
-
onRetry,
|
|
51
|
-
showRetry = true,
|
|
52
|
-
pending,
|
|
53
|
-
className
|
|
54
|
-
}) {
|
|
55
|
-
if (mutation.isPending && pending) return /* @__PURE__ */ jsx(Fragment, { children: pending });
|
|
56
|
-
if (!mutation.isError || mutation.error == null) return null;
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
AlertQueryError,
|
|
59
|
-
{
|
|
60
|
-
className,
|
|
61
|
-
error: mutation.error,
|
|
62
|
-
onRetry: showRetry ? onRetry : void 0
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
var MutationFeedback = AlertMutationFeedback;
|
|
67
|
-
function ButtonRefetch({
|
|
68
|
-
query,
|
|
69
|
-
label = "Refresh",
|
|
70
|
-
children,
|
|
71
|
-
variant = "outline",
|
|
72
|
-
size = "sm",
|
|
73
|
-
className,
|
|
74
|
-
...props
|
|
75
|
-
}) {
|
|
76
|
-
const text = children ?? label;
|
|
77
|
-
return /* @__PURE__ */ jsxs(
|
|
78
|
-
Button,
|
|
79
|
-
{
|
|
80
|
-
type: "button",
|
|
81
|
-
variant,
|
|
82
|
-
size,
|
|
83
|
-
className,
|
|
84
|
-
onClick: () => void query.refetch(),
|
|
85
|
-
disabled: query.isFetching,
|
|
86
|
-
...props,
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
89
|
-
RefreshCw,
|
|
90
|
-
{
|
|
91
|
-
className: "ui-query-refetch-icon",
|
|
92
|
-
"data-fetching": query.isFetching,
|
|
93
|
-
"aria-hidden": "true"
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
text
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
var QueryRefetchButton = ButtonRefetch;
|
|
102
|
-
function flattenItemPages(data) {
|
|
103
|
-
if (!data) return [];
|
|
104
|
-
return data.pages.flatMap((page) => page.items);
|
|
105
|
-
}
|
|
106
|
-
function defaultIsEmptyFlat(flat) {
|
|
107
|
-
if (Array.isArray(flat)) return flat.length === 0;
|
|
108
|
-
return !flat;
|
|
109
|
-
}
|
|
110
|
-
function InfiniteQueryState({
|
|
111
|
-
query,
|
|
112
|
-
skeleton,
|
|
113
|
-
empty,
|
|
114
|
-
flatten,
|
|
115
|
-
isEmpty = defaultIsEmptyFlat,
|
|
116
|
-
errorRenderer,
|
|
117
|
-
showRetry = true,
|
|
118
|
-
onRetry,
|
|
119
|
-
loadingMore,
|
|
120
|
-
loadMore,
|
|
121
|
-
showLoadMore = true,
|
|
122
|
-
children
|
|
123
|
-
}) {
|
|
124
|
-
const { t } = useTranslation();
|
|
125
|
-
const retry = React.useCallback(() => {
|
|
126
|
-
if (onRetry) {
|
|
127
|
-
void onRetry();
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
void query.refetch();
|
|
131
|
-
}, [onRetry, query]);
|
|
132
|
-
if (query.isPending) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
133
|
-
if (query.isError) {
|
|
134
|
-
if (query.isFetching && !query.isFetchingNextPage) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
135
|
-
if (errorRenderer) return /* @__PURE__ */ jsx(Fragment, { children: errorRenderer(query.error, retry) });
|
|
136
|
-
return /* @__PURE__ */ jsx(AlertQueryError, { error: query.error, onRetry: showRetry ? retry : void 0 });
|
|
137
|
-
}
|
|
138
|
-
const data = query.data;
|
|
139
|
-
if (!data) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
140
|
-
const flat = flatten(data);
|
|
141
|
-
if (empty && isEmpty(flat)) return /* @__PURE__ */ jsx(Fragment, { children: empty });
|
|
142
|
-
const footer = showLoadMore && query.hasNextPage ? loadMore ?? /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ jsx(
|
|
143
|
-
Button,
|
|
144
|
-
{
|
|
145
|
-
type: "button",
|
|
146
|
-
variant: "outline",
|
|
147
|
-
size: "sm",
|
|
148
|
-
disabled: query.isFetchingNextPage,
|
|
149
|
-
onClick: () => void query.fetchNextPage(),
|
|
150
|
-
children: query.isFetchingNextPage ? t("common.working") : t("query.loadMore")
|
|
151
|
-
}
|
|
152
|
-
) }) : null;
|
|
153
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
154
|
-
children(flat, {
|
|
155
|
-
fetchNextPage: () => void query.fetchNextPage(),
|
|
156
|
-
hasNextPage: !!query.hasNextPage,
|
|
157
|
-
isFetchingNextPage: query.isFetchingNextPage
|
|
158
|
-
}),
|
|
159
|
-
query.isFetchingNextPage && (loadingMore ?? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground pt-2 text-center text-xs", children: t("common.working") })),
|
|
160
|
-
footer
|
|
161
|
-
] });
|
|
162
|
-
}
|
|
163
|
-
function PrefetchLink({
|
|
164
|
-
queryKey,
|
|
165
|
-
queryFn,
|
|
166
|
-
prefetchOn = "both",
|
|
167
|
-
staleTime = 3e4,
|
|
168
|
-
onMouseEnter,
|
|
169
|
-
onFocus,
|
|
170
|
-
...linkProps
|
|
171
|
-
}) {
|
|
172
|
-
const queryClient = useQueryClient();
|
|
173
|
-
const prefetch = React.useCallback(() => {
|
|
174
|
-
if (prefetchOn === "none") return;
|
|
175
|
-
void queryClient.prefetchQuery({ queryKey, queryFn, staleTime });
|
|
176
|
-
}, [prefetchOn, queryClient, queryFn, queryKey, staleTime]);
|
|
177
|
-
return /* @__PURE__ */ jsx(
|
|
178
|
-
Link,
|
|
179
|
-
{
|
|
180
|
-
...linkProps,
|
|
181
|
-
onMouseEnter: (event) => {
|
|
182
|
-
if (prefetchOn === "hover" || prefetchOn === "both") prefetch();
|
|
183
|
-
onMouseEnter?.(event);
|
|
184
|
-
},
|
|
185
|
-
onFocus: (event) => {
|
|
186
|
-
if (prefetchOn === "focus" || prefetchOn === "both") prefetch();
|
|
187
|
-
onFocus?.(event);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export { AlertMutationFeedback, ButtonRefetch, DataState, InfiniteQueryState, MutationFeedback, PrefetchLink, QueryRefetchButton, flattenItemPages };
|
|
File without changes
|