@lmy54321/design-system 1.0.0

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.
@@ -0,0 +1,388 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import React__default from 'react';
4
+ import * as class_variance_authority_types from 'class-variance-authority/types';
5
+ import { VariantProps } from 'class-variance-authority';
6
+ import { ClassValue } from 'clsx';
7
+
8
+ type BtnSize = "xsmall" | "small" | "middle" | "large";
9
+ type BtnVariant = "primary" | "secondary" | "outline" | "ghost";
10
+ type BtnProps = {
11
+ size?: BtnSize;
12
+ variant?: BtnVariant;
13
+ label?: string;
14
+ icon?: React.ReactNode;
15
+ iconPosition?: "left" | "right";
16
+ onClick?: () => void;
17
+ className?: string;
18
+ };
19
+ declare function Btn({ size, // Default to middle if not specified
20
+ variant, label, icon, iconPosition, onClick, className, }: BtnProps): react_jsx_runtime.JSX.Element;
21
+
22
+ interface SwitchProps {
23
+ checked: boolean;
24
+ onCheckedChange?: (checked: boolean) => void;
25
+ disabled?: boolean;
26
+ className?: string;
27
+ }
28
+ declare function Switch({ checked, onCheckedChange, disabled, className }: SwitchProps): react_jsx_runtime.JSX.Element;
29
+
30
+ declare function IcPlan({ className }: {
31
+ className?: string;
32
+ }): react_jsx_runtime.JSX.Element;
33
+ declare function IcExpand({ className }: {
34
+ className?: string;
35
+ }): react_jsx_runtime.JSX.Element;
36
+ declare const tagVariants: (props?: ({
37
+ variant?: "filled" | "outlined" | null | undefined;
38
+ size?: "lg" | "md" | "sm" | "xs" | null | undefined;
39
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
40
+ interface TagProps extends React__default.HTMLAttributes<HTMLDivElement>, VariantProps<typeof tagVariants> {
41
+ /** Label text */
42
+ label: string;
43
+ /** Custom Left Icon. Pass `null` to hide. Defaults to internal Plan icon if undefined? No, user said "Left icon can be custom... and visible/hidden". I'll make it optional. */
44
+ icon?: React__default.ReactNode;
45
+ /** Whether to show the fixed right arrow icon */
46
+ showArrow?: boolean;
47
+ }
48
+ declare function Tag({ className, variant, size, label, icon, showArrow, onClick, ...props }: TagProps): react_jsx_runtime.JSX.Element;
49
+
50
+ interface LoadingProps {
51
+ showClose?: boolean;
52
+ onClose?: () => void;
53
+ className?: string;
54
+ }
55
+ declare function Loading({ showClose, onClose, className }: LoadingProps): react_jsx_runtime.JSX.Element;
56
+
57
+ type SegmentedControlSize = 'large' | 'middle' | 'small';
58
+ interface SegmentedControlProps {
59
+ value: string;
60
+ options: string[];
61
+ onChange: (value: string) => void;
62
+ size?: SegmentedControlSize;
63
+ className?: string;
64
+ }
65
+ declare function SegmentedControl({ value, options, onChange, size, className }: SegmentedControlProps): react_jsx_runtime.JSX.Element;
66
+
67
+ interface StatItem {
68
+ label: string;
69
+ value: string;
70
+ variant?: "primary" | "accent" | "default";
71
+ }
72
+ interface StatGridProps {
73
+ items: StatItem[];
74
+ className?: string;
75
+ }
76
+ declare function StatGrid({ items, className }: StatGridProps): react_jsx_runtime.JSX.Element;
77
+
78
+ type DialogVariant = 'default' | 'warning' | 'image';
79
+ interface DialogProps {
80
+ open: boolean;
81
+ onOpenChange: (open: boolean) => void;
82
+ variant?: DialogVariant;
83
+ title?: string;
84
+ description?: string;
85
+ mainActionText?: string;
86
+ secondaryActionText?: string;
87
+ imageSrc?: string;
88
+ onMainAction?: () => void;
89
+ onSecondaryAction?: () => void;
90
+ demoMode?: boolean;
91
+ }
92
+ declare function Dialog({ open, onOpenChange, variant, title, description, mainActionText, secondaryActionText, imageSrc, onMainAction, onSecondaryAction, demoMode, }: DialogProps): react_jsx_runtime.JSX.Element | null;
93
+
94
+ interface ToastProps {
95
+ /**
96
+ * The lines of text to display.
97
+ */
98
+ lines: string[];
99
+ /**
100
+ * Whether to show the icon (checkmark).
101
+ */
102
+ showIcon?: boolean;
103
+ /**
104
+ * Whether to show the close button.
105
+ * Ignored if variant is 'action'.
106
+ */
107
+ showClose?: boolean;
108
+ /**
109
+ * Callback when close button is clicked.
110
+ */
111
+ onClose?: () => void;
112
+ /**
113
+ * Variant of the toast.
114
+ * - 'default': Width fits content, centered.
115
+ * - 'action': Width fills container, used for bottom bar action toasts.
116
+ */
117
+ variant?: 'default' | 'action';
118
+ /**
119
+ * Text for the action button (only for 'action' variant).
120
+ */
121
+ actionText?: string;
122
+ /**
123
+ * Callback for the action button.
124
+ */
125
+ onAction?: () => void;
126
+ }
127
+ declare function Toast({ lines, showIcon, showClose, onClose, variant, actionText, onAction }: ToastProps): react_jsx_runtime.JSX.Element;
128
+
129
+ type ActionSheetVariant = 'default' | 'edit' | 'title' | 'selectable';
130
+ interface ActionSheetProps {
131
+ isOpen?: boolean;
132
+ onClose?: () => void;
133
+ demoMode?: boolean;
134
+ variant?: ActionSheetVariant;
135
+ className?: string;
136
+ }
137
+ declare function ActionSheet({ isOpen, onClose, demoMode, variant, className }: ActionSheetProps): react_jsx_runtime.JSX.Element | null;
138
+
139
+ type NotificationVariant = 'success' | 'warning' | 'attention' | 'info';
140
+ interface NotificationAction {
141
+ label: string;
142
+ onClick?: () => void;
143
+ icon?: React__default.ReactNode;
144
+ }
145
+ interface NotificationBarProps {
146
+ variant?: NotificationVariant;
147
+ message: string;
148
+ onClose?: () => void;
149
+ actions?: NotificationAction[];
150
+ className?: string;
151
+ }
152
+ declare function NotificationBar({ variant, message, onClose, actions, className }: NotificationBarProps): react_jsx_runtime.JSX.Element;
153
+
154
+ type BubblePlacement = 'top' | 'bottom' | 'left' | 'right';
155
+ type BubbleAlignment = 'start' | 'center' | 'end';
156
+ interface BubbleTipProps {
157
+ message?: string;
158
+ placement?: BubblePlacement;
159
+ alignment?: BubbleAlignment;
160
+ showIcon?: boolean;
161
+ closable?: boolean;
162
+ onClose?: () => void;
163
+ className?: string;
164
+ }
165
+ declare function BubbleTip({ message, placement, alignment, showIcon, closable, onClose, className }: BubbleTipProps): react_jsx_runtime.JSX.Element;
166
+
167
+ interface PushProps {
168
+ icon?: string;
169
+ title: string;
170
+ description: string;
171
+ actionText?: string;
172
+ onAction?: () => void;
173
+ className?: string;
174
+ }
175
+ declare function Push({ icon, title, description, actionText, onAction, className, }: PushProps): react_jsx_runtime.JSX.Element;
176
+
177
+ type EmptyStateVariant = 'not-logged-in' | 'network-error' | 'generic' | 'no-plan' | 'no-comment' | 'location-related';
178
+ interface EmptyStateProps {
179
+ variant?: EmptyStateVariant;
180
+ title?: string;
181
+ description?: string;
182
+ className?: string;
183
+ }
184
+ declare function EmptyState({ variant, title, description, className }: EmptyStateProps): react_jsx_runtime.JSX.Element;
185
+
186
+ type TabId = 'home' | 'explore' | 'plan' | 'me';
187
+ interface BottomNavigationBarProps {
188
+ activeTab?: TabId;
189
+ onTabChange?: (id: TabId) => void;
190
+ className?: string;
191
+ }
192
+ declare function BottomNavigationBar({ activeTab, onTabChange, className }: BottomNavigationBarProps): react_jsx_runtime.JSX.Element;
193
+
194
+ type ButtonAppearance = 'glass' | 'gray';
195
+ type ToolbarMode = 'left-title' | 'center-title' | 'tabs';
196
+ interface TopToolbarProps {
197
+ mode?: ToolbarMode;
198
+ appearance?: ButtonAppearance;
199
+ title?: string;
200
+ showTitle?: boolean;
201
+ showBack?: boolean;
202
+ onBack?: () => void;
203
+ rightActionCount?: number;
204
+ onAction?: (index: number) => void;
205
+ tabs?: string[];
206
+ activeTabIndex?: number;
207
+ onTabChange?: (index: number) => void;
208
+ className?: string;
209
+ }
210
+ declare function TopToolbar({ mode, appearance, title, showTitle, showBack, rightActionCount, onBack, onAction, tabs, activeTabIndex, onTabChange, className, }: TopToolbarProps): react_jsx_runtime.JSX.Element;
211
+
212
+ interface BottomSheetProps {
213
+ open: boolean;
214
+ onOpenChange: (open: boolean) => void;
215
+ title?: string;
216
+ headerDescription?: string;
217
+ description?: React.ReactNode;
218
+ mainActionText?: string;
219
+ secondaryActionText?: string;
220
+ onMainAction?: () => void;
221
+ onSecondaryAction?: () => void;
222
+ children?: React.ReactNode;
223
+ className?: string;
224
+ demoMode?: boolean;
225
+ imageSrc?: string;
226
+ }
227
+ declare function BottomSheet({ open, onOpenChange, title, headerDescription, description, mainActionText, secondaryActionText, onMainAction, onSecondaryAction, children, className, demoMode, imageSrc, }: BottomSheetProps): react_jsx_runtime.JSX.Element;
228
+ interface BottomSheetOptionProps {
229
+ label: string;
230
+ selected?: boolean;
231
+ onClick?: () => void;
232
+ hasDivider?: boolean;
233
+ }
234
+ declare function BottomSheetOption({ label, selected, onClick, hasDivider }: BottomSheetOptionProps): react_jsx_runtime.JSX.Element;
235
+ type ShareItemType = 'wechat' | 'moments' | 'qq' | 'weibo' | 'qr' | 'tap' | 'add_desk' | 'more';
236
+ interface BottomSheetShareItemProps {
237
+ type: ShareItemType;
238
+ label: string;
239
+ onClick?: () => void;
240
+ }
241
+ declare function BottomSheetShareItem({ type, label, onClick }: BottomSheetShareItemProps): react_jsx_runtime.JSX.Element;
242
+
243
+ declare const DRAWER_STATES: {
244
+ SMALL: number;
245
+ MEDIUM: number;
246
+ LARGE: number;
247
+ FULL: number;
248
+ };
249
+ interface DraggablePanelProps {
250
+ children?: React__default.ReactNode;
251
+ className?: string;
252
+ state?: number;
253
+ onStateChange?: (state: number) => void;
254
+ fullScreenContent?: React__default.ReactNode;
255
+ fullScreenTrigger?: (onTrigger: () => void) => React__default.ReactNode;
256
+ topToolbar?: TopToolbarProps;
257
+ showTopToolbarInStates?: number[];
258
+ bottomBar?: React__default.ReactNode;
259
+ }
260
+ declare function DraggablePanel({ children, className, state: controlledState, onStateChange, fullScreenContent, fullScreenTrigger, topToolbar, showTopToolbarInStates, bottomBar }: DraggablePanelProps): react_jsx_runtime.JSX.Element;
261
+
262
+ type SearchBoxVariant = 'card' | 'map';
263
+ type SearchBoxMode = 'default' | 'scenic' | 'scenic-date';
264
+ interface SearchBoxProps {
265
+ value?: string;
266
+ onChange?: (value: string) => void;
267
+ placeholder?: string;
268
+ variant?: SearchBoxVariant;
269
+ mode?: SearchBoxMode;
270
+ locationLabel?: string;
271
+ dateRange?: {
272
+ start: string;
273
+ end: string;
274
+ };
275
+ onBack?: () => void;
276
+ onSearch?: () => void;
277
+ onMic?: () => void;
278
+ onClear?: () => void;
279
+ className?: string;
280
+ }
281
+ declare function SearchBox({ value, onChange, placeholder, variant, mode, // Default to standard behavior
282
+ locationLabel, dateRange, onBack, onSearch, onMic, onClear, className }: SearchBoxProps): react_jsx_runtime.JSX.Element;
283
+
284
+ interface POI {
285
+ id: string;
286
+ title: string;
287
+ address: string;
288
+ tel?: string;
289
+ category?: string;
290
+ type?: string;
291
+ location: {
292
+ lat: number;
293
+ lng: number;
294
+ };
295
+ _distance?: number;
296
+ photo?: string;
297
+ }
298
+ interface POIListItemProps {
299
+ poi: POI;
300
+ onClick?: () => void;
301
+ highlighted?: string;
302
+ }
303
+ declare function POIListItem({ poi, onClick, highlighted }: POIListItemProps): react_jsx_runtime.JSX.Element;
304
+
305
+ interface PoiItemProps {
306
+ imageUrl: string;
307
+ title: string;
308
+ rating: string;
309
+ distance: string;
310
+ description: string;
311
+ className?: string;
312
+ }
313
+ declare function PoiItem({ imageUrl, title, rating, distance, description, className }: PoiItemProps): react_jsx_runtime.JSX.Element;
314
+
315
+ interface NewsItemProps {
316
+ title: string;
317
+ source: string;
318
+ time: string;
319
+ category: string;
320
+ variant?: "primary" | "accent" | "default";
321
+ className?: string;
322
+ }
323
+ declare function NewsItem({ title, source, time, category, variant, className }: NewsItemProps): react_jsx_runtime.JSX.Element;
324
+
325
+ type BottomActionMode = 'single' | 'split' | 'weighted';
326
+ type BottomLeftContentType = 'none' | 'search' | 'capsule' | 'capsule-more';
327
+ interface BottomActionButtonsProps {
328
+ mode: BottomActionMode;
329
+ leftContent?: BottomLeftContentType;
330
+ mainText?: string;
331
+ secondaryText?: string;
332
+ hasShadow?: boolean;
333
+ onMainClick?: () => void;
334
+ onSecondaryClick?: () => void;
335
+ className?: string;
336
+ }
337
+ declare function BottomActionButtons({ mode, leftContent, mainText, secondaryText, hasShadow, onMainClick, onSecondaryClick, className }: BottomActionButtonsProps): react_jsx_runtime.JSX.Element;
338
+
339
+ interface BottomToolbarProps {
340
+ leftMode?: "search" | "capsule" | "capsule-more" | "empty";
341
+ rightMode?: "dual" | "single";
342
+ actionSheetVariant?: ActionSheetVariant;
343
+ rightData?: {
344
+ primaryLabel?: string;
345
+ secondaryLabel?: string;
346
+ };
347
+ leftData?: {
348
+ searchText?: string;
349
+ };
350
+ }
351
+ declare function BottomToolbar({ leftMode, rightMode, actionSheetVariant, rightData, leftData }: BottomToolbarProps): react_jsx_runtime.JSX.Element;
352
+
353
+ declare global {
354
+ interface Window {
355
+ TMap: any;
356
+ }
357
+ }
358
+ interface TencentMapProps {
359
+ className?: string;
360
+ center?: {
361
+ lat: number;
362
+ lng: number;
363
+ };
364
+ zoom?: number;
365
+ pitch?: number;
366
+ rotation?: number;
367
+ showPois?: boolean;
368
+ showText?: boolean;
369
+ roamMode?: 'none' | 'orbit';
370
+ demoMode?: 'none' | 'route';
371
+ markers?: Array<{
372
+ id: string;
373
+ lat: number;
374
+ lng: number;
375
+ name?: string;
376
+ }>;
377
+ }
378
+ declare function TencentMap({ className, center, zoom, pitch, rotation, showPois, showText, roamMode, demoMode, markers }: TencentMapProps): react_jsx_runtime.JSX.Element;
379
+
380
+ declare function ImageWithFallback(props: React__default.ImgHTMLAttributes<HTMLImageElement>): react_jsx_runtime.JSX.Element;
381
+
382
+ declare function TypographyDocs(): react_jsx_runtime.JSX.Element;
383
+
384
+ declare function GridSystemDocs(): react_jsx_runtime.JSX.Element;
385
+
386
+ declare function cn(...inputs: ClassValue[]): string;
387
+
388
+ export { ActionSheet, type ActionSheetVariant, BottomActionButtons, type BottomActionButtonsProps, type BottomActionMode, BottomNavigationBar, BottomSheet, BottomSheetOption, type BottomSheetOptionProps, type BottomSheetProps, BottomSheetShareItem, type BottomSheetShareItemProps, BottomToolbar, type BottomToolbarProps, Btn, type BtnProps, type BtnSize, type BtnVariant, type BubbleAlignment, type BubblePlacement, BubbleTip, DRAWER_STATES, Dialog, type DialogProps, type DialogVariant, DraggablePanel, EmptyState, type EmptyStateProps, type EmptyStateVariant, GridSystemDocs, IcExpand, IcPlan, ImageWithFallback, Loading, type LoadingProps, NewsItem, type NewsItemProps, type NotificationAction, NotificationBar, type NotificationVariant, POIListItem, PoiItem, type PoiItemProps, Push, type PushProps, SearchBox, type SearchBoxMode, type SearchBoxProps, type SearchBoxVariant, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type ShareItemType, StatGrid, type StatGridProps, type StatItem, Switch, type SwitchProps, type TabId, Tag, type TagProps, TencentMap, Toast, type ToastProps, type ToolbarMode, TopToolbar, type TopToolbarProps, TypographyDocs, cn };