@sonamu-kit/react-components 0.1.4 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonamu-kit/react-components",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "author": "CartaNova <dev@cartanova.ai>",
6
6
  "repository": {
@@ -22,6 +22,10 @@
22
22
  "types": "./dist/components/index.d.ts",
23
23
  "import": "./dist/react-components.es.js"
24
24
  },
25
+ "./contexts": {
26
+ "types": "./dist/contexts/index.d.ts",
27
+ "import": "./dist/react-components.es.js"
28
+ },
25
29
  "./hooks": {
26
30
  "types": "./dist/hooks/index.d.ts",
27
31
  "import": "./dist/react-components.es.js"
@@ -65,7 +69,7 @@
65
69
  "@radix-ui/react-toggle": "^1.1.10",
66
70
  "@radix-ui/react-toggle-group": "^1.1.11",
67
71
  "@radix-ui/react-tooltip": "^1.2.8",
68
- "@types/qs": "^6.9.7",
72
+ "@types/qs": "^6.14.0",
69
73
  "class-variance-authority": "^0.7.1",
70
74
  "clsx": "^2.1.1",
71
75
  "cmdk": "^1.1.1",
@@ -76,7 +80,7 @@
76
80
  "input-otp": "^1.4.2",
77
81
  "jotai": "^2.14.0",
78
82
  "next-themes": "^0.4.6",
79
- "qs": "^6.11.0",
83
+ "qs": "^6.14.1",
80
84
  "radashi": "^12.2.0",
81
85
  "react-day-picker": "^8.10.1",
82
86
  "react-hook-form": "^7.66.1",
@@ -1,14 +0,0 @@
1
- import { default as React } from 'react';
2
- export type ImageUploaderProps = {
3
- value?: string | null;
4
- onValueChange?: (value: string | null) => void;
5
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
6
- uploader?: (file: File) => Promise<string>;
7
- placeholder?: string;
8
- accept?: string;
9
- disabled?: boolean;
10
- className?: string;
11
- previewSize?: "sm" | "md" | "lg";
12
- mode?: "eager" | "lazy";
13
- };
14
- export declare function ImageUploader({ value, onValueChange, onBlur, uploader, placeholder, accept, disabled, className, previewSize, mode, }: ImageUploaderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +0,0 @@
1
- import { default as React } from 'react';
2
- export type MultiImageUploaderProps = {
3
- value?: string[];
4
- onValueChange?: (value: string[]) => void;
5
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
6
- uploader?: (file: File) => Promise<string>;
7
- placeholder?: string;
8
- accept?: string;
9
- disabled?: boolean;
10
- className?: string;
11
- previewSize?: "sm" | "md" | "lg";
12
- maxImages?: number;
13
- mode?: "eager" | "lazy";
14
- };
15
- export declare function MultiImageUploader({ value, onValueChange, onBlur, uploader, placeholder, accept, disabled, className, previewSize, maxImages, mode, }: MultiImageUploaderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,72 +0,0 @@
1
- import { default as React, ReactElement } from 'react';
2
- import { z } from 'zod';
3
- export type PaginationProps = {
4
- activePage?: number;
5
- totalPages?: number;
6
- };
7
- export type TableColumnWidth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
8
- export declare function hidden(condition: boolean | undefined): string;
9
- export declare function searchParamsToParams<T extends z.ZodType<any>>(searchParams: URLSearchParams, paramsSchema: T): z.infer<T>;
10
- export declare function paramsToSearchParams<T>(params: T): {
11
- [key in string]: string | string[];
12
- };
13
- export type ErrorObj = {
14
- content: string;
15
- pointing?: "above" | "below" | "left" | "right";
16
- };
17
- export declare function useTypeForm<T extends z.ZodObject<any> | z.ZodArray<any>, U extends z.infer<T>>(zType: T, defaultValue: U): {
18
- form: z.core.output<T>;
19
- setForm: React.Dispatch<React.SetStateAction<z.core.output<T>>>;
20
- register: (objPath: string, _emptyStringTo?: "normal" | "nullable" | "optional") => any;
21
- addError: (objPath: string, errorMessage: string | ErrorObj) => void;
22
- removeError: (objPath: string) => void;
23
- clearError: () => void;
24
- reset: () => void;
25
- };
26
- type ZodKeys<T extends z.ZodType<any>> = keyof z.infer<T>;
27
- export declare function useListParams<U extends z.ZodType<any>, T extends Partial<z.infer<U>>>(zType: U, defaultValue: T, options?: {
28
- disableSearchParams?: boolean;
29
- }): {
30
- listParams: T;
31
- setListParams: (newParams: T) => void;
32
- register: (name: ZodKeys<U>) => any;
33
- };
34
- export declare function useSelection<T>(allKeys: T[], defaultSelectedKeys?: T[]): {
35
- getSelected: (key: T) => boolean;
36
- toggle: (key: T) => void;
37
- selectedKeys: T[];
38
- deselectAll: () => void;
39
- selectAll: () => void;
40
- isAllSelected: boolean;
41
- handleCheckboxClick: (e: React.MouseEvent<HTMLInputElement, MouseEvent>, index: number) => void;
42
- };
43
- export declare function sqlDateToDateString(sqlDateString: string | null): string | null;
44
- export declare function numF(num: number | null | undefined): string | number | undefined | null;
45
- export declare function dateF(dateValue: string | Date | null | undefined): string | null;
46
- export declare function datetimeF(dateValue: string | Date | null | undefined): string | null;
47
- export declare function arrayableToArray<T extends number | string | boolean>(val: T | T[] | undefined): T[];
48
- export type ControlledModalProps = {
49
- open: boolean;
50
- close: () => void;
51
- };
52
- export declare function useModal<T extends object>(ModalComponent: (props: T & ControlledModalProps) => React.ReactElement, defaultProps: T): {
53
- open: (newProps: T) => void;
54
- modal: React.FunctionComponentElement<T & ControlledModalProps>;
55
- };
56
- export declare function caller<T extends Function>(): {
57
- set: (func: T) => void;
58
- call: T;
59
- };
60
- export type SonamuCol<T> = {
61
- label: string;
62
- th?: ReactElement;
63
- tc: (row: T, index: number) => ReactElement;
64
- className?: string;
65
- collapsing?: boolean;
66
- width?: TableColumnWidth;
67
- hidden?: boolean;
68
- parentLabel?: string;
69
- };
70
- export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
71
- export type Override<T, U> = Omit<T, keyof U> & U;
72
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * Lazy 모드의 모든 ImageUploader/MultiImageUploader 컴포넌트의 업로드를 실행합니다.
3
- *
4
- * Lazy 모드에서는 파일을 선택해도 즉시 업로드되지 않습니다.
5
- * 대기 중인 모든 파일을 업로드할 준비가 되었을 때 이 함수를 호출하세요.
6
- *
7
- * @returns 업로드된 URL 배열을 반환하는 Promise
8
- */
9
- export declare function lazyUpload(): Promise<string[]>;