@pop-ui/core 0.0.41 → 0.0.42

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.
@@ -1,28 +1,28 @@
1
1
  import { AutocompleteProps } from '@mantine/core';
2
2
  import { ButtonProps } from '@mantine/core';
3
3
  import { CheckboxProps } from '@mantine/core';
4
- import { DatePickerInputProps } from '@mantine/dates';
5
4
  import { DatePickerProps } from '@mantine/dates';
6
5
  import { DateValue } from '@mantine/dates';
7
6
  import { default as default_2 } from 'react';
8
- import { DropzoneProps } from '@mantine/dropzone';
9
- import { FileWithPath } from '@mantine/dropzone';
10
7
  import { HTMLAttributes } from 'react';
11
8
  import { InputProps } from '@mantine/core';
12
9
  import { JSX } from 'react/jsx-runtime';
13
10
  import { ModalProps } from '@mantine/core';
11
+ import { MouseEventHandler } from 'react';
14
12
  import { NotificationsProps } from '@mantine/notifications';
13
+ import { PopoverProps } from '@mantine/core';
15
14
  import { RadioProps } from '@mantine/core';
16
15
  import { ReactNode } from 'react';
17
16
  import { SegmentedControlProps } from '@mantine/core';
18
17
  import { SelectProps } from '@mantine/core';
19
18
  import { SwitchProps } from '@mantine/core';
20
19
  import { TabsProps } from '@mantine/core';
20
+ import { TDateDisplayType } from '@pop-ui/foundation';
21
21
  import { TextareaProps } from '@mantine/core';
22
22
  import { TimeInputProps } from '@mantine/dates';
23
23
  import { TooltipProps } from '@mantine/core';
24
24
 
25
- export declare function Button({ children, size, variant, isLoading, disabled, ...props }: IButtonProps): JSX.Element;
25
+ export declare function Button({ children, size, variant, type, isLoading, hideLabelOnLoading, disabled, className, classNames, loaderProps, ...props }: IButtonProps): JSX.Element;
26
26
 
27
27
  /**
28
28
  * CalendarDatePicker
@@ -36,7 +36,7 @@ export declare const CalendarDatePicker: ({ excludedDates, excludedDays, type, v
36
36
 
37
37
  export declare const Checkbox: ({ size, ...props }: ICheckboxProps) => JSX.Element;
38
38
 
39
- export declare const DatePicker: ({ size, type, withTime, ...props }: IDatePickerProps) => JSX.Element;
39
+ export declare const DatePicker: ({ size, type, withTime, className, popoverProps, rightSection, rightSectionWidth, value, defaultValue, onChange, placeholder, disabled, minDate, maxDate, displayValueFormat, valueFormat, excludedDates, excludedDays, highlightToday, }: IDatePickerProps) => JSX.Element;
40
40
 
41
41
  export declare const Dropdown: ({ label, labelPosition, size, required, tooltip, tooltipPosition, errorMsg, description, ...props }: IDropdownProps) => JSX.Element;
42
42
 
@@ -50,10 +50,12 @@ export declare interface IBaseMarkerData {
50
50
  }
51
51
 
52
52
  declare interface IButtonProps extends Omit<ButtonProps, 'variant' | 'styles'> {
53
- onClick?: () => void;
53
+ type?: 'button' | 'submit' | 'reset';
54
+ onClick?: MouseEventHandler<HTMLButtonElement>;
54
55
  size?: TButtonSize;
55
56
  variant?: TButtonVariant;
56
57
  isLoading?: boolean;
58
+ hideLabelOnLoading?: boolean;
57
59
  }
58
60
 
59
61
  /**
@@ -116,10 +118,30 @@ export declare interface ICoord {
116
118
  longitude: number;
117
119
  }
118
120
 
119
- declare interface IDatePickerProps extends DatePickerInputProps {
121
+ declare interface IDatePickerProps {
120
122
  size?: 'sm' | 'md' | 'lg';
121
- type?: 'default' | 'multiple' | 'range';
123
+ type?: TDateDisplayType;
122
124
  withTime?: boolean;
125
+ value?: string | null | string[] | [string | null, string | null];
126
+ defaultValue?: string | null | string[] | [string | null, string | null];
127
+ onChange?: (value: string | null | string[] | [string | null, string | null]) => void;
128
+ placeholder?: string;
129
+ label?: React.ReactNode;
130
+ description?: React.ReactNode;
131
+ error?: React.ReactNode;
132
+ disabled?: boolean;
133
+ clearable?: boolean;
134
+ minDate?: Date;
135
+ maxDate?: Date;
136
+ displayValueFormat?: string;
137
+ valueFormat?: string;
138
+ excludedDates?: (string | [string, string])[];
139
+ excludedDays?: TDayOfWeek[];
140
+ highlightToday?: boolean;
141
+ className?: string;
142
+ popoverProps?: PopoverProps;
143
+ rightSection?: React.ReactNode;
144
+ rightSectionWidth?: number;
123
145
  }
124
146
 
125
147
  declare interface IDropdownProps extends SelectProps {
@@ -132,21 +154,53 @@ declare interface IDropdownProps extends SelectProps {
132
154
  errorMsg?: string;
133
155
  }
134
156
 
135
- declare interface IImageUploaderProps extends DropzoneProps {
136
- width?: number;
137
- height?: number;
138
- defaultMsg?: ReactNode;
139
- file?: string | FileWithPath;
140
- showClearButton?: boolean;
141
- onClear?: () => void;
142
- }
143
-
144
157
  export declare interface ILocation {
145
158
  latitude?: number;
146
159
  longitude?: number;
147
160
  }
148
161
 
149
- export declare const ImageUploader: ({ width, height, defaultMsg, file, onDrop, showClearButton, onClear, ...props }: IImageUploaderProps) => JSX.Element;
162
+ export declare const ImageInput: ({ value, onChange, accept, length, width, height, placeholder, hasIcon, hasLink, onLinkClick, hasEdit, canDelete, minLength, maxLength, errorMsg, isLoading, readOnly, gap, }: ImageInputProps) => JSX.Element;
163
+
164
+ export declare type ImageInputAccept = TImageMimeType[];
165
+
166
+ export declare type ImageInputChangeAction = 'create' | 'replace' | 'delete' | 'reorder' | 'crop';
167
+
168
+ export declare interface ImageInputChangeMeta {
169
+ action: ImageInputChangeAction;
170
+ itemId: string;
171
+ index: number;
172
+ previousIndex?: number;
173
+ nextIndex?: number;
174
+ }
175
+
176
+ export declare interface ImageInputItem {
177
+ id: string;
178
+ url?: string;
179
+ file?: File;
180
+ isLoading?: boolean;
181
+ position?: number;
182
+ }
183
+
184
+ export declare interface ImageInputProps {
185
+ value: ImageInputItem[];
186
+ onChange?: (nextValue: ImageInputItem[], meta: ImageInputChangeMeta) => void;
187
+ accept?: ImageInputAccept;
188
+ length?: number;
189
+ width?: number;
190
+ height?: number;
191
+ placeholder?: TImageInputPlaceholder;
192
+ hasIcon?: boolean;
193
+ hasLink?: boolean;
194
+ onLinkClick?: (item: ImageInputItem) => void;
195
+ hasEdit?: boolean;
196
+ minLength?: number;
197
+ maxLength?: number;
198
+ errorMsg?: ReactNode;
199
+ isLoading?: boolean;
200
+ readOnly?: boolean;
201
+ gap?: number;
202
+ canDelete?: boolean;
203
+ }
150
204
 
151
205
  /** Direction/navigation options */
152
206
  export declare interface IMapDirection {
@@ -266,6 +320,10 @@ export declare interface IPopdealMarkerData extends IBaseMarkerData {
266
320
  active?: boolean;
267
321
  }
268
322
 
323
+ declare interface IPopUIConfigValue {
324
+ naverClientId?: string;
325
+ }
326
+
269
327
  export declare interface IPopUiProviderProps {
270
328
  children: default_2.ReactNode;
271
329
  defaultTheme?: TThemeMode;
@@ -329,6 +387,13 @@ declare interface IToastOptions {
329
387
  autoClose?: number | false;
330
388
  }
331
389
 
390
+ declare interface IToastRuntime {
391
+ (input: TToastInput): void;
392
+ update: (id: string, input: TToastInput) => void;
393
+ hide: (id: string) => void;
394
+ clean: () => void;
395
+ }
396
+
332
397
  declare interface IToggleProps extends SwitchProps {
333
398
  size?: 'sm' | 'md' | 'lg';
334
399
  labelPosition: 'left' | 'right';
@@ -347,6 +412,46 @@ export declare interface IUseLocationOptions {
347
412
  errorDescription?: string;
348
413
  }
349
414
 
415
+ export declare const LottieInput: ({ value, onChange, width, height, placeholder, hasIcon, hasLink, onLinkClick, length, minLength, maxLength, errorMsg, isLoading, readOnly, gap, canDelete, }: LottieInputProps) => JSX.Element;
416
+
417
+ export declare type LottieInputChangeAction = 'create' | 'delete' | 'reorder';
418
+
419
+ export declare interface LottieInputChangeMeta {
420
+ action: LottieInputChangeAction;
421
+ itemId: string;
422
+ index: number;
423
+ previousIndex?: number;
424
+ nextIndex?: number;
425
+ }
426
+
427
+ export declare interface LottieInputItem {
428
+ id: string;
429
+ url?: string;
430
+ file?: File;
431
+ animationData?: Record<string, unknown>;
432
+ isLoading?: boolean;
433
+ position?: number;
434
+ }
435
+
436
+ export declare interface LottieInputProps {
437
+ value: LottieInputItem[];
438
+ onChange?: (nextValue: LottieInputItem[], meta: LottieInputChangeMeta) => void;
439
+ width?: number;
440
+ height?: number;
441
+ placeholder?: ReactNode | ((index: number) => ReactNode);
442
+ hasIcon?: boolean;
443
+ hasLink?: boolean;
444
+ onLinkClick?: (item: LottieInputItem) => void;
445
+ length?: number;
446
+ minLength?: number;
447
+ maxLength?: number;
448
+ errorMsg?: ReactNode;
449
+ isLoading?: boolean;
450
+ readOnly?: boolean;
451
+ gap?: number;
452
+ canDelete?: boolean;
453
+ }
454
+
350
455
  /**
351
456
  * Naver Maps Marker Clustering utility
352
457
  * Creates clustered markers when multiple markers are close together
@@ -382,14 +487,18 @@ export declare const SegmentButton: ({ size, radius, ...props }: ISegmentButtonP
382
487
 
383
488
  export declare const Tab: ({ tabList, containerPaddingTop, ...props }: ITabProps) => JSX.Element;
384
489
 
385
- declare type TButtonSize = "sm" | "md" | "lg";
490
+ declare type TButtonSize = 'sm' | 'md' | 'lg';
386
491
 
387
- declare type TButtonVariant = "primary" | "primaryLine" | "basic" | "danger" | "setting" | "warning";
492
+ declare type TButtonVariant = 'primary' | 'primaryLine' | 'basic' | 'danger' | 'setting' | 'warning' | 'ghost';
388
493
 
389
494
  export declare type TDayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
390
495
 
391
496
  export declare const TextField: (allProps: TTextFieldProps) => JSX.Element;
392
497
 
498
+ declare type TImageInputPlaceholder = ReactNode | ((index: number) => ReactNode);
499
+
500
+ declare type TImageMimeType = 'image/png' | 'image/gif' | 'image/jpeg' | 'image/svg+xml' | 'image/webp' | 'image/avif' | 'image/heic' | 'image/heif';
501
+
393
502
  export declare const TimePicker: ({ size, ...props }: ITimePickerProps) => JSX.Element;
394
503
 
395
504
  export declare type TMarkerData = IClusterMarkerData | IPopdealMarkerData | IPinMarkerData | IPiMarkerData;
@@ -416,18 +525,14 @@ export declare type TMarkerType = 'cluster' | 'popdeal' | 'pin' | 'pi' | 'pi-exp
416
525
  * message: '저장 중...',
417
526
  * });
418
527
  *
419
- * // 같은 id로 다시 호출하면 기존 토스트가 업데이트됩니다
420
- * toast({
421
- * id: 'save-toast',
528
+ * // 업데이트는 toast.update(id, input)로 수행합니다
529
+ * toast.update('save-toast', {
422
530
  * message: '저장 완료!',
423
531
  * });
532
+ *
533
+ * // 런타임에서는 PopUiProvider가 Notifications 경계를 제공합니다
424
534
  */
425
- export declare const toast: {
426
- (input: TToastInput): void;
427
- update(id: string, input: TToastInput): void;
428
- hide(id: string): void;
429
- clean(): void;
430
- };
535
+ export declare const toast: IToastRuntime;
431
536
 
432
537
  export declare const Toggle: ({ size, labelPosition, disabled, onChange, ...props }: IToggleProps) => JSX.Element;
433
538
 
@@ -466,6 +571,8 @@ export declare const useMap: (map: naver.maps.Map | null) => {
466
571
 
467
572
  export declare const useNaverMap: () => INaverMapContextValue;
468
573
 
574
+ export declare const usePopUIConfig: () => IPopUIConfigValue;
575
+
469
576
  export declare const useTheme: () => IThemeContextValue;
470
577
 
471
578
  export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pop-ui/core",
3
3
  "type": "module",
4
- "version": "0.0.41",
4
+ "version": "0.0.42",
5
5
  "main": "./dist/core.umd.cjs",
6
6
  "module": "./dist/core.js",
7
7
  "types": "./dist/types/index.d.ts",
@@ -44,13 +44,18 @@
44
44
  "preview": "vite preview"
45
45
  },
46
46
  "dependencies": {
47
+ "@dnd-kit/core": "^6.3.1",
48
+ "@dnd-kit/sortable": "^10.0.0",
49
+ "@dnd-kit/utilities": "^3.2.2",
47
50
  "@mantine/core": "^8.3.6",
48
51
  "@mantine/dates": "^8.3.6",
49
52
  "@mantine/dropzone": "^8.3.6",
50
53
  "@mantine/hooks": "^8.3.6",
51
54
  "@mantine/notifications": "^8.3.6",
52
- "@pop-ui/foundation": "0.0.35",
53
- "dayjs": "^1.11.18"
55
+ "@pop-ui/foundation": "1.1.5",
56
+ "dayjs": "^1.11.18",
57
+ "lottie-react": "^2.4.1",
58
+ "react-easy-crop": "^5.5.3"
54
59
  },
55
60
  "peerDependencies": {
56
61
  "react": "^19.2.0",
@@ -97,5 +102,5 @@
97
102
  "typescript": "^5.9.3",
98
103
  "vite": "^7.1.12"
99
104
  },
100
- "gitHead": "2d032b939907ec4360e4f8e3ecb97a88311df6eb"
101
- }
105
+ "gitHead": "9a120a33dbe9dfaffabb94219c301d5834968fae"
106
+ }