@sonamu-kit/react-components 0.4.1 → 0.4.3
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/components/index.d.ts +0 -1
- package/dist/components/ui/file-input.d.ts +2 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/sonamu-context.d.ts +2 -2
- package/dist/contexts/types.d.ts +15 -1
- package/dist/react-components.es.js +790 -768
- package/dist/react-components.es.js.map +1 -1
- package/package.json +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { SonamuFile } from '../../contexts';
|
|
2
|
+
import { SonamuFile, UploadParams } from '../../contexts';
|
|
3
3
|
export type PreviewSize = "sm" | "md" | "lg" | "xl";
|
|
4
4
|
type BaseProps = {
|
|
5
5
|
uploadMode: "eager" | "lazy";
|
|
@@ -9,6 +9,7 @@ type BaseProps = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
className?: string;
|
|
11
11
|
previewSize?: PreviewSize;
|
|
12
|
+
uploadParams?: UploadParams;
|
|
12
13
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
13
14
|
};
|
|
14
15
|
type SingleModeProps = BaseProps & {
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { type SonamuAuthClient, type SonamuContextValue, SonamuProvider, useSonamuBaseContext, } from './sonamu-context';
|
|
2
|
-
export type { Dictionary, SDReturnType, SonamuFile } from './types';
|
|
2
|
+
export type { Dictionary, SDReturnType, SonamuFile, UploadParams } from './types';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BetterAuthClientOptions } from 'better-auth/client';
|
|
2
2
|
import { createAuthClient } from 'better-auth/react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { Dictionary, SDReturnType, SonamuFile } from './types';
|
|
4
|
+
import { Dictionary, SDReturnType, SonamuFile, UploadParams } from './types';
|
|
5
5
|
/** createAuthClient의 반환 타입을 옵션으로부터 추론하는 유틸리티 타입 */
|
|
6
6
|
export type SonamuAuthClient<O extends BetterAuthClientOptions> = ReturnType<typeof createAuthClient<O>>;
|
|
7
7
|
export interface SonamuContextValue<D extends Dictionary = Dictionary, O extends BetterAuthClientOptions = BetterAuthClientOptions> {
|
|
8
|
-
uploader?: (files: File[]) => Promise<SonamuFile[]>;
|
|
8
|
+
uploader?: (files: File[], params?: UploadParams) => Promise<SonamuFile[]>;
|
|
9
9
|
auth?: SonamuAuthClient<O>;
|
|
10
10
|
SD?: <K extends keyof D>(key: K) => SDReturnType<D, K>;
|
|
11
11
|
}
|
package/dist/contexts/types.d.ts
CHANGED
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* ⚠️ 이 타입은 sonamu/types.ts와 동기화되어야 함
|
|
4
|
+
*
|
|
5
|
+
* 프로젝트별 도메인 필드를 추가하려면 `SonamuFileExtend`를 확장합니다.
|
|
6
|
+
* (`declare module "@sonamu-kit/react-components"`)
|
|
4
7
|
*/
|
|
5
|
-
export
|
|
8
|
+
export interface SonamuFileExtend {
|
|
9
|
+
}
|
|
10
|
+
export type SonamuFileBase = {
|
|
6
11
|
name: string;
|
|
7
12
|
url: string;
|
|
8
13
|
mime_type: string;
|
|
9
14
|
size: number;
|
|
10
15
|
};
|
|
16
|
+
export type SonamuFile = SonamuFileBase & SonamuFileExtend;
|
|
17
|
+
/**
|
|
18
|
+
* ⚠️ 이 타입은 sonamu/types.ts와 동기화되어야 함
|
|
19
|
+
*
|
|
20
|
+
* 프로젝트별 업로드 파라미터를 추가하려면 `UploadParams`를 확장합니다.
|
|
21
|
+
* (`declare module "@sonamu-kit/react-components"`)
|
|
22
|
+
*/
|
|
23
|
+
export interface UploadParams {
|
|
24
|
+
}
|
|
11
25
|
export type Dictionary = Record<string, string | ((...args: any[]) => string)>;
|
|
12
26
|
/**
|
|
13
27
|
* SD 반환 타입 - 제네릭으로 키에 따라 정확한 타입 반환
|