@pop-ui/core 0.0.37 → 0.0.40
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/core.css +1 -1
- package/dist/core.js +1625 -624
- package/dist/core.umd.cjs +323 -5
- package/dist/types/index.d.ts +178 -0
- package/package.json +3 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -40,6 +40,15 @@ export declare const DatePicker: ({ size, type, withTime, ...props }: IDatePicke
|
|
|
40
40
|
|
|
41
41
|
export declare const Dropdown: ({ label, labelPosition, size, required, tooltip, tooltipPosition, errorMsg, description, ...props }: IDropdownProps) => JSX.Element;
|
|
42
42
|
|
|
43
|
+
export declare const getMarkerHTML: (data: TMarkerData) => string;
|
|
44
|
+
|
|
45
|
+
export declare interface IBaseMarkerData {
|
|
46
|
+
id: string;
|
|
47
|
+
position: ICoord;
|
|
48
|
+
type: TMarkerType;
|
|
49
|
+
onClick?: (id: string) => void;
|
|
50
|
+
}
|
|
51
|
+
|
|
43
52
|
declare interface IButtonProps extends Omit<ButtonProps, 'variant' | 'styles'> {
|
|
44
53
|
onClick?: () => void;
|
|
45
54
|
size?: TButtonSize;
|
|
@@ -83,6 +92,11 @@ declare interface ICheckboxProps extends CheckboxProps {
|
|
|
83
92
|
size?: 'sm' | 'md' | 'lg';
|
|
84
93
|
}
|
|
85
94
|
|
|
95
|
+
export declare interface IClusterMarkerData extends IBaseMarkerData {
|
|
96
|
+
type: 'cluster';
|
|
97
|
+
count: number;
|
|
98
|
+
}
|
|
99
|
+
|
|
86
100
|
declare interface ICommonTextFieldProps {
|
|
87
101
|
label?: string;
|
|
88
102
|
labelPosition?: 'top' | 'left';
|
|
@@ -97,6 +111,11 @@ declare interface ICommonTextFieldProps {
|
|
|
97
111
|
onClear?: () => void;
|
|
98
112
|
}
|
|
99
113
|
|
|
114
|
+
export declare interface ICoord {
|
|
115
|
+
latitude: number;
|
|
116
|
+
longitude: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
100
119
|
declare interface IDatePickerProps extends DatePickerInputProps {
|
|
101
120
|
size?: 'sm' | 'md' | 'lg';
|
|
102
121
|
type?: 'default' | 'multiple' | 'range';
|
|
@@ -122,13 +141,100 @@ declare interface IImageUploaderProps extends DropzoneProps {
|
|
|
122
141
|
onClear?: () => void;
|
|
123
142
|
}
|
|
124
143
|
|
|
144
|
+
export declare interface ILocation {
|
|
145
|
+
latitude?: number;
|
|
146
|
+
longitude?: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
125
149
|
export declare const ImageUploader: ({ width, height, defaultMsg, file, onDrop, showClearButton, onClear, ...props }: IImageUploaderProps) => JSX.Element;
|
|
126
150
|
|
|
151
|
+
/** Direction/navigation options */
|
|
152
|
+
export declare interface IMapDirection {
|
|
153
|
+
/** Custom direction URL (defaults to Naver Map search) */
|
|
154
|
+
url?: string;
|
|
155
|
+
/** Button label (default: '길찾기') */
|
|
156
|
+
label?: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export declare interface IMapInfoProps {
|
|
160
|
+
/** Location information (required) */
|
|
161
|
+
location: IMapLocation;
|
|
162
|
+
/** Marker customization (optional) */
|
|
163
|
+
marker?: IMapMarker;
|
|
164
|
+
/** Direction/navigation settings (optional) */
|
|
165
|
+
direction?: IMapDirection;
|
|
166
|
+
/** Toast message customization (optional) */
|
|
167
|
+
toast?: IMapToast;
|
|
168
|
+
/** Naver Cloud Platform Client ID (optional if provided via PopUIProvider) */
|
|
169
|
+
naverClientId?: string;
|
|
170
|
+
/** Total height of the component in pixels (default: 200) */
|
|
171
|
+
height?: number;
|
|
172
|
+
/** Callback when map preview is clicked (for expanding to full view) */
|
|
173
|
+
onExpandRequest?: () => void;
|
|
174
|
+
/** Callback when the entire component is clicked */
|
|
175
|
+
onClick?: () => void;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Location information for the map */
|
|
179
|
+
export declare interface IMapLocation {
|
|
180
|
+
/** Display title/name of the location */
|
|
181
|
+
title: string;
|
|
182
|
+
/** Full address text */
|
|
183
|
+
address: string;
|
|
184
|
+
/** Latitude coordinate */
|
|
185
|
+
latitude: number;
|
|
186
|
+
/** Longitude coordinate */
|
|
187
|
+
longitude: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Marker customization options */
|
|
191
|
+
export declare interface IMapMarker {
|
|
192
|
+
/** Custom marker image URL */
|
|
193
|
+
imageUrl?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare interface IMapOptions extends Partial<naver.maps.MapOptions> {
|
|
197
|
+
width?: string | number;
|
|
198
|
+
height?: string | number;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare interface IMapProps {
|
|
202
|
+
options?: IMapOptions;
|
|
203
|
+
onLoad?: (mapRef: IMapRef) => void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export declare interface IMapRef {
|
|
207
|
+
map: naver.maps.Map | null;
|
|
208
|
+
addMarker: (data: TMarkerData) => naver.maps.Marker | null;
|
|
209
|
+
updateMarker: (id: string, updates: Partial<TMarkerData>) => void;
|
|
210
|
+
clearMarkers: () => void;
|
|
211
|
+
panTo: (coord: ICoord) => void;
|
|
212
|
+
fitBounds: (coords: ICoord[]) => void;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Toast message customization */
|
|
216
|
+
export declare interface IMapToast {
|
|
217
|
+
/** Message when address is copied (default: '주소 복사 완료') */
|
|
218
|
+
addressCopied?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
127
221
|
declare interface IModalProps extends ModalProps {
|
|
128
222
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
129
223
|
width?: number;
|
|
130
224
|
}
|
|
131
225
|
|
|
226
|
+
export declare interface INaverMapContextValue {
|
|
227
|
+
naver: typeof naver | null;
|
|
228
|
+
createMap: (containerRef: React.RefObject<HTMLDivElement | null>, options: naver.maps.MapOptions) => naver.maps.Map | null;
|
|
229
|
+
maps: Record<string, naver.maps.Map | null>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export declare interface INaverMapProviderProps {
|
|
233
|
+
clientId: string;
|
|
234
|
+
language?: 'ko' | 'en';
|
|
235
|
+
children: React.ReactNode;
|
|
236
|
+
}
|
|
237
|
+
|
|
132
238
|
declare interface IPaginationProps extends HTMLAttributes<HTMLDivElement> {
|
|
133
239
|
currentPageIdx: number;
|
|
134
240
|
rowsPerPage?: number;
|
|
@@ -137,9 +243,34 @@ declare interface IPaginationProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
137
243
|
onPageChange?: (e: number) => void;
|
|
138
244
|
}
|
|
139
245
|
|
|
246
|
+
export declare interface IPiMarkerData extends IBaseMarkerData {
|
|
247
|
+
type: 'pi' | 'pi-expanded';
|
|
248
|
+
title: string;
|
|
249
|
+
icon?: string;
|
|
250
|
+
address?: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export declare interface IPinMarkerData extends IBaseMarkerData {
|
|
254
|
+
type: 'pin';
|
|
255
|
+
name: string;
|
|
256
|
+
icon?: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export declare interface IPopdealMarkerData extends IBaseMarkerData {
|
|
260
|
+
type: 'popdeal';
|
|
261
|
+
title: string;
|
|
262
|
+
price: number;
|
|
263
|
+
discountRate?: number;
|
|
264
|
+
originalPrice?: number;
|
|
265
|
+
category?: string;
|
|
266
|
+
active?: boolean;
|
|
267
|
+
}
|
|
268
|
+
|
|
140
269
|
export declare interface IPopUiProviderProps {
|
|
141
270
|
children: default_2.ReactNode;
|
|
142
271
|
defaultTheme?: TThemeMode;
|
|
272
|
+
/** Naver Cloud Platform Client ID for Map components */
|
|
273
|
+
naverClientId?: string;
|
|
143
274
|
/** Notifications 표시 위치 */
|
|
144
275
|
notificationPosition?: NotificationsProps['position'];
|
|
145
276
|
/** 동시에 표시되는 최대 알림 수 */
|
|
@@ -210,8 +341,35 @@ declare interface ITooltipProps extends TooltipProps {
|
|
|
210
341
|
content: string;
|
|
211
342
|
}
|
|
212
343
|
|
|
344
|
+
export declare interface IUseLocationOptions {
|
|
345
|
+
isActive: boolean;
|
|
346
|
+
errorMessage?: string;
|
|
347
|
+
errorDescription?: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Naver Maps Marker Clustering utility
|
|
352
|
+
* Creates clustered markers when multiple markers are close together
|
|
353
|
+
*
|
|
354
|
+
* This is adapted from Naver's official marker clustering library.
|
|
355
|
+
* Some legacy patterns are preserved for compatibility.
|
|
356
|
+
*/
|
|
357
|
+
export declare function makeMarkerClustering(naver: any): any;
|
|
358
|
+
|
|
359
|
+
declare const Map_2: {
|
|
360
|
+
({ options, onLoad }: IMapProps): JSX.Element;
|
|
361
|
+
displayName: string;
|
|
362
|
+
};
|
|
363
|
+
export { Map_2 as Map }
|
|
364
|
+
|
|
365
|
+
export declare const MapInfo: ({ location, marker, direction, toast: toastConfig, naverClientId: naverClientIdProp, onExpandRequest, onClick, height, }: IMapInfoProps) => JSX.Element;
|
|
366
|
+
|
|
367
|
+
export declare const markerStyles = "\n /* Common marker styles */\n [class$=\"marker\"] {\n user-select: none;\n }\n\n /* Pin Marker */\n .pin-marker {\n position: relative;\n z-index: 10;\n transform: translate(-50%, -100%);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n }\n\n .pin-marker-name {\n min-width: max-content;\n color: #1A1A1A;\n text-align: center;\n font-weight: 700;\n font-size: 14px;\n line-height: 1.4;\n text-shadow:\n -2px -2px 0 white,\n 2px -2px 0 white,\n -2px 2px 0 white,\n 2px 2px 0 white;\n }\n\n /* Popdeal Marker */\n .popdeal-marker {\n transform: translate(-50%, -100%);\n padding: 10px 16px;\n width: fit-content;\n max-width: 210px;\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 4px;\n transition: border-color 0.2s ease-in-out;\n word-break: keep-all;\n background: white;\n box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.12);\n border-radius: 12px;\n color: #3D3D3D;\n }\n\n .popdeal-marker:hover {\n z-index: 10;\n filter: drop-shadow(0px 4px 12px rgba(0, 0, 0, 0.12));\n }\n\n .popdeal-marker::after {\n content: \"\";\n display: block;\n width: 12px;\n height: 12px;\n position: absolute;\n bottom: -7px;\n left: 50%;\n right: 50%;\n background: white;\n transform: translate(-50%) rotate(45deg);\n }\n\n .popdeal-marker[active=\"true\"] {\n z-index: 10;\n border: 2px solid #00C4C4;\n }\n\n .popdeal-marker[active=\"true\"]::after {\n border-right: 2px solid #00C4C4;\n border-bottom: 2px solid #00C4C4;\n }\n\n .popdeal-marker[active=\"false\"] {\n border: 1px solid #F5F5F5;\n }\n\n .popdeal-marker[active=\"false\"]::after {\n border-right: 1px solid #F5F5F5;\n border-bottom: 1px solid #F5F5F5;\n }\n\n .popdeal-marker-section {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 0;\n flex-wrap: nowrap;\n }\n\n .popdeal-marker-section-header {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n flex-wrap: nowrap;\n }\n\n .popdeal-marker-section-price {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0 4px;\n flex-wrap: wrap;\n }\n\n .popdeal-marker-title {\n font-weight: 700;\n font-size: 14px;\n text-align: center;\n width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .popdeal-marker-discount_rate {\n color: #00C4C4;\n font-weight: 600;\n font-size: 14px;\n }\n\n .popdeal-marker-discounted_price {\n color: #3D3D3D;\n font-weight: 600;\n font-size: 14px;\n }\n\n .popdeal-marker-original_price {\n width: 100%;\n color: #B3B3B3;\n text-align: center;\n font-size: 14px;\n text-decoration: line-through;\n }\n\n .popdeal-marker-category {\n color: #6E6E6E;\n font-weight: 600;\n font-size: 12px;\n }\n\n .popdeal-marker-category::before {\n content: \"|\";\n color: #B3B3B3;\n margin-right: 4px;\n }\n\n /* PI Marker */\n .pi-marker {\n transform: translate(-50%, -50%);\n z-index: 10;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 4px;\n }\n\n .pi-marker-icon {\n width: 32px;\n height: 32px;\n object-fit: cover;\n border-radius: 50%;\n }\n\n .pi-marker-text {\n position: absolute;\n top: calc(100% + 5px);\n left: 50%;\n transform: translateX(-50%);\n min-width: max-content;\n padding: 4px 8px;\n background: white;\n font-size: 12px;\n border-radius: 99px;\n color: #3D3D3D;\n box-shadow: 0 0.432px 0.864px 0 rgba(0, 0, 0, 0.28);\n }\n\n /* PI Expanded Marker */\n .pi-expanded-marker {\n transform: translate(-50%, -50%);\n z-index: 100;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 4px;\n filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));\n }\n\n .pi-expanded-marker-icon {\n width: 32px;\n height: 32px;\n object-fit: cover;\n border-radius: 50%;\n }\n\n .pi-expanded-marker-content {\n position: absolute;\n bottom: calc(100% + 10px);\n left: 50%;\n transform: translateX(-50%);\n width: max-content;\n max-width: 200px;\n padding: 16px;\n word-break: keep-all;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: white;\n border-radius: 8px;\n }\n\n .pi-expanded-marker-title {\n font-weight: 600;\n font-size: 14px;\n text-align: center;\n color: #1A1A1A;\n }\n\n .pi-expanded-marker-address {\n font-size: 14px;\n color: #6E6E6E;\n width: 100%;\n text-align: center;\n }\n\n /* Cluster Marker */\n .cluster-marker {\n width: fit-content;\n min-width: 52px;\n height: 36px;\n padding: 13px;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 12px;\n background: #00C4C4;\n box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.12);\n transform: translate(-50%, -50%);\n }\n\n .cluster-marker-text {\n font-weight: 700;\n font-size: 15px;\n color: white;\n }\n\n .cluster-marker::after {\n content: \"\";\n display: block;\n width: 12px;\n height: 12px;\n position: absolute;\n bottom: -2px;\n left: 50%;\n right: 50%;\n background: #00C4C4;\n transform: translate(-50%) rotate(45deg);\n }\n";
|
|
368
|
+
|
|
213
369
|
export declare const Modal: ({ size, width, withCloseButton, ...props }: IModalProps) => JSX.Element;
|
|
214
370
|
|
|
371
|
+
export declare const NaverMapProvider: ({ clientId, language, children, }: INaverMapProviderProps) => JSX.Element;
|
|
372
|
+
|
|
215
373
|
export declare const Pagination: ({ currentPageIdx, rowsPerPage, totalLength, paginationSize, onPageChange, ...props }: IPaginationProps) => JSX.Element;
|
|
216
374
|
|
|
217
375
|
export declare const PopUiProvider: default_2.FC<IPopUiProviderProps>;
|
|
@@ -234,6 +392,10 @@ export declare const TextField: (allProps: TTextFieldProps) => JSX.Element;
|
|
|
234
392
|
|
|
235
393
|
export declare const TimePicker: ({ size, ...props }: ITimePickerProps) => JSX.Element;
|
|
236
394
|
|
|
395
|
+
export declare type TMarkerData = IClusterMarkerData | IPopdealMarkerData | IPinMarkerData | IPiMarkerData;
|
|
396
|
+
|
|
397
|
+
export declare type TMarkerType = 'cluster' | 'popdeal' | 'pin' | 'pi' | 'pi-expanded';
|
|
398
|
+
|
|
237
399
|
/**
|
|
238
400
|
* 토스트 알림을 표시합니다
|
|
239
401
|
* @param input - 문자열 메시지 또는 옵션 객체
|
|
@@ -288,6 +450,22 @@ declare type TThemeMode = 'light' | 'dark';
|
|
|
288
450
|
|
|
289
451
|
declare type TToastInput = string | IToastOptions;
|
|
290
452
|
|
|
453
|
+
export declare const useLocation: ({ isActive, errorMessage, errorDescription, }: IUseLocationOptions) => {
|
|
454
|
+
position: ILocation | null;
|
|
455
|
+
isLoading: boolean;
|
|
456
|
+
isError: boolean;
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
export declare const useMap: (map: naver.maps.Map | null) => {
|
|
460
|
+
addMarker: (data: TMarkerData) => naver.maps.Marker | null;
|
|
461
|
+
updateMarker: (id: string, updates: Partial<TMarkerData>) => void;
|
|
462
|
+
clearMarkers: () => void;
|
|
463
|
+
panTo: (coord: ICoord) => void;
|
|
464
|
+
fitBounds: (coords: ICoord[]) => void;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
export declare const useNaverMap: () => INaverMapContextValue;
|
|
468
|
+
|
|
291
469
|
export declare const useTheme: () => IThemeContextValue;
|
|
292
470
|
|
|
293
471
|
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.
|
|
4
|
+
"version": "0.0.40",
|
|
5
5
|
"main": "./dist/core.umd.cjs",
|
|
6
6
|
"module": "./dist/core.js",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@mantine/dropzone": "^8.3.6",
|
|
50
50
|
"@mantine/hooks": "^8.3.6",
|
|
51
51
|
"@mantine/notifications": "^8.3.6",
|
|
52
|
-
"@pop-ui/foundation": "0.0.
|
|
52
|
+
"@pop-ui/foundation": "0.0.33",
|
|
53
53
|
"dayjs": "^1.11.18"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"typescript": "^5.9.3",
|
|
98
98
|
"vite": "^7.1.12"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "5924e33bddfd2ffa4497d93ec54238ba3e891feb"
|
|
101
101
|
}
|