@pop-ui/core 0.0.36 → 0.0.39

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.
@@ -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,76 @@ 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
+ export declare interface IMapInfoProps {
152
+ /** Shop/store address (required) */
153
+ address: string;
154
+ /** Latitude coordinate (required) */
155
+ latitude: number;
156
+ /** Longitude coordinate (required) */
157
+ longitude: number;
158
+ /** Shop/store name (required) */
159
+ shopTitle: string;
160
+ /** Naver Cloud Platform Client ID (required) */
161
+ naverClientId: string;
162
+ /** Custom direction URL (optional, defaults to Naver Map search) */
163
+ directionUrl?: string;
164
+ /** Custom marker image URL (optional) */
165
+ markerImageUrl?: string;
166
+ /** Direction button label (default: '길찾기') */
167
+ directionLabel?: string;
168
+ /** Toast message when address is copied (default: '주소 복사 완료') */
169
+ addressCopiedMessage?: string;
170
+ /** Callback when map preview is clicked (for expanding to full view) */
171
+ onExpandRequest?: () => void;
172
+ /** Total height of the component (default: 200) */
173
+ height?: number;
174
+ /** Callback when address bar area is clicked */
175
+ onClickMap?: () => void;
176
+ }
177
+
178
+ export declare interface IMapOptions extends Partial<naver.maps.MapOptions> {
179
+ width?: string | number;
180
+ height?: string | number;
181
+ }
182
+
183
+ export declare interface IMapProps {
184
+ options?: IMapOptions;
185
+ onLoad?: (mapRef: IMapRef) => void;
186
+ }
187
+
188
+ export declare interface IMapRef {
189
+ map: naver.maps.Map | null;
190
+ addMarker: (data: TMarkerData) => naver.maps.Marker | null;
191
+ updateMarker: (id: string, updates: Partial<TMarkerData>) => void;
192
+ clearMarkers: () => void;
193
+ panTo: (coord: ICoord) => void;
194
+ fitBounds: (coords: ICoord[]) => void;
195
+ }
196
+
127
197
  declare interface IModalProps extends ModalProps {
128
198
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
129
199
  width?: number;
130
200
  }
131
201
 
202
+ export declare interface INaverMapContextValue {
203
+ naver: typeof naver | null;
204
+ createMap: (containerRef: React.RefObject<HTMLDivElement | null>, options: naver.maps.MapOptions) => naver.maps.Map | null;
205
+ maps: Record<string, naver.maps.Map | null>;
206
+ }
207
+
208
+ export declare interface INaverMapProviderProps {
209
+ clientId: string;
210
+ language?: 'ko' | 'en';
211
+ children: React.ReactNode;
212
+ }
213
+
132
214
  declare interface IPaginationProps extends HTMLAttributes<HTMLDivElement> {
133
215
  currentPageIdx: number;
134
216
  rowsPerPage?: number;
@@ -137,9 +219,34 @@ declare interface IPaginationProps extends HTMLAttributes<HTMLDivElement> {
137
219
  onPageChange?: (e: number) => void;
138
220
  }
139
221
 
222
+ export declare interface IPiMarkerData extends IBaseMarkerData {
223
+ type: 'pi' | 'pi-expanded';
224
+ title: string;
225
+ icon?: string;
226
+ address?: string;
227
+ }
228
+
229
+ export declare interface IPinMarkerData extends IBaseMarkerData {
230
+ type: 'pin';
231
+ name: string;
232
+ icon?: string;
233
+ }
234
+
235
+ export declare interface IPopdealMarkerData extends IBaseMarkerData {
236
+ type: 'popdeal';
237
+ title: string;
238
+ price: number;
239
+ discountRate?: number;
240
+ originalPrice?: number;
241
+ category?: string;
242
+ active?: boolean;
243
+ }
244
+
140
245
  export declare interface IPopUiProviderProps {
141
246
  children: default_2.ReactNode;
142
247
  defaultTheme?: TThemeMode;
248
+ /** Naver Cloud Platform Client ID for Map components */
249
+ naverClientId?: string;
143
250
  /** Notifications 표시 위치 */
144
251
  notificationPosition?: NotificationsProps['position'];
145
252
  /** 동시에 표시되는 최대 알림 수 */
@@ -210,8 +317,35 @@ declare interface ITooltipProps extends TooltipProps {
210
317
  content: string;
211
318
  }
212
319
 
320
+ export declare interface IUseLocationOptions {
321
+ isActive: boolean;
322
+ errorMessage?: string;
323
+ errorDescription?: string;
324
+ }
325
+
326
+ /**
327
+ * Naver Maps Marker Clustering utility
328
+ * Creates clustered markers when multiple markers are close together
329
+ *
330
+ * This is adapted from Naver's official marker clustering library.
331
+ * Some legacy patterns are preserved for compatibility.
332
+ */
333
+ export declare function makeMarkerClustering(naver: any): any;
334
+
335
+ declare const Map_2: {
336
+ ({ options, onLoad }: IMapProps): JSX.Element;
337
+ displayName: string;
338
+ };
339
+ export { Map_2 as Map }
340
+
341
+ export declare const MapInfo: ({ onClickMap: onClickMapArea, address, markerImageUrl, shopTitle, directionUrl, latitude, longitude, naverClientId: naverClientIdProp, onExpandRequest, height, directionLabel, addressCopiedMessage, }: IMapInfoProps) => JSX.Element;
342
+
343
+ 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";
344
+
213
345
  export declare const Modal: ({ size, width, withCloseButton, ...props }: IModalProps) => JSX.Element;
214
346
 
347
+ export declare const NaverMapProvider: ({ clientId, language, children, }: INaverMapProviderProps) => JSX.Element;
348
+
215
349
  export declare const Pagination: ({ currentPageIdx, rowsPerPage, totalLength, paginationSize, onPageChange, ...props }: IPaginationProps) => JSX.Element;
216
350
 
217
351
  export declare const PopUiProvider: default_2.FC<IPopUiProviderProps>;
@@ -234,6 +368,10 @@ export declare const TextField: (allProps: TTextFieldProps) => JSX.Element;
234
368
 
235
369
  export declare const TimePicker: ({ size, ...props }: ITimePickerProps) => JSX.Element;
236
370
 
371
+ export declare type TMarkerData = IClusterMarkerData | IPopdealMarkerData | IPinMarkerData | IPiMarkerData;
372
+
373
+ export declare type TMarkerType = 'cluster' | 'popdeal' | 'pin' | 'pi' | 'pi-expanded';
374
+
237
375
  /**
238
376
  * 토스트 알림을 표시합니다
239
377
  * @param input - 문자열 메시지 또는 옵션 객체
@@ -288,6 +426,22 @@ declare type TThemeMode = 'light' | 'dark';
288
426
 
289
427
  declare type TToastInput = string | IToastOptions;
290
428
 
429
+ export declare const useLocation: ({ isActive, errorMessage, errorDescription, }: IUseLocationOptions) => {
430
+ position: ILocation | null;
431
+ isLoading: boolean;
432
+ isError: boolean;
433
+ };
434
+
435
+ export declare const useMap: (map: naver.maps.Map | null) => {
436
+ addMarker: (data: TMarkerData) => naver.maps.Marker | null;
437
+ updateMarker: (id: string, updates: Partial<TMarkerData>) => void;
438
+ clearMarkers: () => void;
439
+ panTo: (coord: ICoord) => void;
440
+ fitBounds: (coords: ICoord[]) => void;
441
+ };
442
+
443
+ export declare const useNaverMap: () => INaverMapContextValue;
444
+
291
445
  export declare const useTheme: () => IThemeContextValue;
292
446
 
293
447
  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.36",
4
+ "version": "0.0.39",
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.30",
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": "55fa481ff2884a6a093e0c1f604c5ca5995b0626"
100
+ "gitHead": "6025da040aea8c1152f2ccf33b0d1a4db25c04f5"
101
101
  }