myshell-react-lib 0.1.5 → 0.1.7
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/index.cjs +50 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/src/common/assets/audio-playing.json +0 -3657
- package/src/common/constants/constants.ts +0 -24
- package/src/common/constants/types/common.ts +0 -10
- package/src/common/hooks/useAudioPlayer.tsx +0 -198
- package/src/common/hooks/useDevice.ts +0 -26
- package/src/common/hooks/useNativeBridge.ts +0 -42
- package/src/common/hooks/useNotification.tsx +0 -179
- package/src/common/hooks/useWindowWidth.ts +0 -19
- package/src/common/utils/common-helper.ts +0 -81
- package/src/components/ItemDemo.tsx +0 -15
- package/src/components/accordion.tsx +0 -126
- package/src/components/alert-dialog.tsx +0 -148
- package/src/components/alert.tsx +0 -65
- package/src/components/aspect-ratio.tsx +0 -7
- package/src/components/audio-player.tsx +0 -60
- package/src/components/audio-playing.tsx +0 -33
- package/src/components/avatar.tsx +0 -133
- package/src/components/badge.tsx +0 -67
- package/src/components/button/button.styles.ts +0 -258
- package/src/components/button/button.tsx +0 -215
- package/src/components/button/icon-button.styles.ts +0 -103
- package/src/components/button/icon-button.tsx +0 -100
- package/src/components/button/index.tsx +0 -3
- package/src/components/button/link-button.tsx +0 -184
- package/src/components/cascader.tsx +0 -175
- package/src/components/checkbox.tsx +0 -135
- package/src/components/command.tsx +0 -155
- package/src/components/context-menu.tsx +0 -198
- package/src/components/count-down.tsx +0 -83
- package/src/components/custom-notification.tsx +0 -95
- package/src/components/dialog.tsx +0 -158
- package/src/components/drawer.tsx +0 -116
- package/src/components/dropdown-menu.tsx +0 -196
- package/src/components/energy-progress.tsx +0 -55
- package/src/components/form.tsx +0 -201
- package/src/components/group.tsx +0 -9
- package/src/components/guide.tsx +0 -243
- package/src/components/icon.tsx +0 -96
- package/src/components/icons/index.tsx +0 -13
- package/src/components/icons/outline/ArrowLeftIcon.tsx +0 -28
- package/src/components/icons/outline/ArrowUpTrayIcon.tsx +0 -28
- package/src/components/icons/outline/CheckCircleIcon.tsx +0 -27
- package/src/components/icons/outline/ConfigIcon.tsx +0 -42
- package/src/components/icons/outline/DownIcon.tsx +0 -18
- package/src/components/icons/outline/FilterIcon.tsx +0 -20
- package/src/components/icons/outline/PencilSquareIcon.tsx +0 -28
- package/src/components/icons/outline/WindowIcon.tsx +0 -26
- package/src/components/icons/solid/CaretDownIcon.tsx +0 -22
- package/src/components/icons/solid/CodeIcon.tsx +0 -25
- package/src/components/icons/solid/DragIcon.tsx +0 -24
- package/src/components/icons/solid/PhoneIcon.tsx +0 -29
- package/src/components/icons/solid/RectangleGroupIcon.tsx +0 -26
- package/src/components/image.tsx +0 -152
- package/src/components/input.tsx +0 -118
- package/src/components/label.tsx +0 -26
- package/src/components/link.tsx +0 -123
- package/src/components/marquee/index.css +0 -15
- package/src/components/marquee/marquee.tsx +0 -220
- package/src/components/masonry.tsx +0 -138
- package/src/components/menubar.tsx +0 -234
- package/src/components/mobile/m-tooltip.tsx +0 -34
- package/src/components/modal.tsx +0 -561
- package/src/components/navigation-bar.tsx +0 -100
- package/src/components/number-input.tsx +0 -143
- package/src/components/page-content.tsx +0 -16
- package/src/components/popover.tsx +0 -191
- package/src/components/progress.tsx +0 -80
- package/src/components/radio-group.tsx +0 -44
- package/src/components/scroll-area.tsx +0 -49
- package/src/components/search-bar.tsx +0 -140
- package/src/components/secondary-navigation-bar.tsx +0 -328
- package/src/components/select.tsx +0 -273
- package/src/components/separator.tsx +0 -31
- package/src/components/sheet.tsx +0 -143
- package/src/components/skeleton.tsx +0 -20
- package/src/components/slider.tsx +0 -160
- package/src/components/spinner.tsx +0 -50
- package/src/components/swiper/index.module.scss +0 -88
- package/src/components/swiper/index.tsx +0 -319
- package/src/components/switch.tsx +0 -67
- package/src/components/tabs.tsx +0 -325
- package/src/components/textarea.tsx +0 -71
- package/src/components/toast/toast.tsx +0 -182
- package/src/components/toast/toaster.tsx +0 -160
- package/src/components/toast/use-toast.tsx +0 -248
- package/src/components/toggle-group.tsx +0 -64
- package/src/components/toggle.tsx +0 -46
- package/src/components/tooltip.tsx +0 -283
- package/src/components/typography.tsx +0 -437
- package/src/index.ts +0 -70
- package/src/lib/utils.ts +0 -62
- package/src/stories/Accordion.stories.tsx +0 -64
- package/src/stories/AccordionItem.stories.tsx +0 -48
- package/src/stories/Avatar.stories.ts +0 -58
- package/src/stories/Badge.stories.tsx +0 -40
- package/src/stories/BannerSwiper.stories.tsx +0 -102
- package/src/stories/Button.stories.tsx +0 -543
- package/src/stories/Checkbox.stories.tsx +0 -161
- package/src/stories/Configure.mdx +0 -341
- package/src/stories/CssProperties.mdx +0 -30
- package/src/stories/Description.stories.ts +0 -70
- package/src/stories/Display.stories.ts +0 -64
- package/src/stories/FeaturedSwiper.stories.tsx +0 -6978
- package/src/stories/GridSwiper.stories.tsx +0 -1407
- package/src/stories/Guide.stories.tsx +0 -247
- package/src/stories/Heading.stories.ts +0 -89
- package/src/stories/Icon.stories.ts +0 -77
- package/src/stories/IconButton.stories.tsx +0 -301
- package/src/stories/IconTextButton.stories.ts +0 -59
- package/src/stories/Image.stories.ts +0 -55
- package/src/stories/Input.stories.tsx +0 -203
- package/src/stories/Modal.stories.tsx +0 -144
- package/src/stories/NavigationBar.stories.tsx +0 -81
- package/src/stories/Notification.stories.tsx +0 -276
- package/src/stories/Popover.stories.tsx +0 -100
- package/src/stories/SearchBar.stories.ts +0 -43
- package/src/stories/SecondaryNavigationBar.stories.tsx +0 -199
- package/src/stories/Select.stories.tsx +0 -107
- package/src/stories/Separator.stories.tsx +0 -49
- package/src/stories/Spinner.stories.tsx +0 -48
- package/src/stories/SubHeading.stories.ts +0 -64
- package/src/stories/Swich.stories.tsx +0 -69
- package/src/stories/Tabs.stories.tsx +0 -90
- package/src/stories/Text.stories.ts +0 -78
- package/src/stories/Textarea.stories.tsx +0 -155
- package/src/stories/Toast.stories.tsx +0 -424
- package/src/stories/Tooltip.stories.tsx +0 -244
- package/src/stories/ViewAutoSwiper.stories.tsx +0 -1408
- package/src/styles/components-dark.scss +0 -212
- package/src/styles/components-light.scss +0 -210
- package/src/styles/design-dark.scss +0 -330
- package/src/styles/design-light.scss +0 -345
- package/src/styles/design2-dark.scss +0 -319
- package/src/styles/design2-light.scss +0 -364
- package/src/styles/font.css +0 -19
- package/src/styles/global.scss +0 -251
- package/src/styles/md-viewer.scss +0 -155
- package/src/styles/new-tokens.scss +0 -255
- package/src/styles/tokens.scss +0 -401
- package/src/types/scss.d.ts +0 -24
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
2
|
-
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils';
|
|
6
|
-
|
|
7
|
-
const ContextMenu = ContextMenuPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
12
|
-
|
|
13
|
-
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
14
|
-
|
|
15
|
-
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
16
|
-
|
|
17
|
-
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
18
|
-
|
|
19
|
-
const ContextMenuSubTrigger = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
22
|
-
inset?: boolean;
|
|
23
|
-
}
|
|
24
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
25
|
-
<ContextMenuPrimitive.SubTrigger
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
'flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50',
|
|
29
|
-
inset && 'pl-8',
|
|
30
|
-
className
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
36
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
37
|
-
));
|
|
38
|
-
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
39
|
-
|
|
40
|
-
const ContextMenuSubContent = React.forwardRef<
|
|
41
|
-
React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
|
|
42
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
|
|
43
|
-
>(({ className, ...props }, ref) => (
|
|
44
|
-
<ContextMenuPrimitive.SubContent
|
|
45
|
-
ref={ref}
|
|
46
|
-
className={cn(
|
|
47
|
-
'flex flex-col gap-y-1 z-50 overflow-hidden rounded-xl border border-opaque bg-Colors-Background-Neutral-Primary-Default p-2 text-Colors-Text-Default shadow-modal-default',
|
|
48
|
-
className
|
|
49
|
-
)}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
));
|
|
53
|
-
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
54
|
-
|
|
55
|
-
const ContextMenuContent = React.forwardRef<
|
|
56
|
-
React.ElementRef<typeof ContextMenuPrimitive.Content>,
|
|
57
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
|
|
58
|
-
>(({ className, ...props }, ref) => (
|
|
59
|
-
<ContextMenuPrimitive.Portal>
|
|
60
|
-
<ContextMenuPrimitive.Content
|
|
61
|
-
ref={ref}
|
|
62
|
-
className={cn(
|
|
63
|
-
'z-50 min-w-[8rem] overflow-hidden rounded-xl border-none bg-Colors-Background-Normal-Primary-Default p-1 text-Colors-Text-Default shadow-modal-default border border-opaque',
|
|
64
|
-
className
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
/>
|
|
68
|
-
</ContextMenuPrimitive.Portal>
|
|
69
|
-
));
|
|
70
|
-
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
71
|
-
|
|
72
|
-
const ContextMenuItem = React.forwardRef<
|
|
73
|
-
React.ElementRef<typeof ContextMenuPrimitive.Item>,
|
|
74
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
|
|
75
|
-
inset?: boolean;
|
|
76
|
-
}
|
|
77
|
-
>(({ className, inset, ...props }, ref) => (
|
|
78
|
-
<ContextMenuPrimitive.Item
|
|
79
|
-
ref={ref}
|
|
80
|
-
className={cn(
|
|
81
|
-
'relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-30 focus:bg-Colors-Background-Neutral-Primary-Default',
|
|
82
|
-
inset && 'pl-8',
|
|
83
|
-
className
|
|
84
|
-
)}
|
|
85
|
-
{...props}
|
|
86
|
-
/>
|
|
87
|
-
));
|
|
88
|
-
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
89
|
-
|
|
90
|
-
const ContextMenuCheckboxItem = React.forwardRef<
|
|
91
|
-
React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
|
|
92
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
|
|
93
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
94
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
95
|
-
ref={ref}
|
|
96
|
-
className={cn(
|
|
97
|
-
'relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50',
|
|
98
|
-
className
|
|
99
|
-
)}
|
|
100
|
-
checked={checked}
|
|
101
|
-
{...props}
|
|
102
|
-
>
|
|
103
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
104
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
105
|
-
<Check className="h-4 w-4" />
|
|
106
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
107
|
-
</span>
|
|
108
|
-
{children}
|
|
109
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
110
|
-
));
|
|
111
|
-
ContextMenuCheckboxItem.displayName =
|
|
112
|
-
ContextMenuPrimitive.CheckboxItem.displayName;
|
|
113
|
-
|
|
114
|
-
const ContextMenuRadioItem = React.forwardRef<
|
|
115
|
-
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
116
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
|
|
117
|
-
>(({ className, children, ...props }, ref) => (
|
|
118
|
-
<ContextMenuPrimitive.RadioItem
|
|
119
|
-
ref={ref}
|
|
120
|
-
className={cn(
|
|
121
|
-
'relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
122
|
-
className
|
|
123
|
-
)}
|
|
124
|
-
{...props}
|
|
125
|
-
>
|
|
126
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
127
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
128
|
-
<Circle className="h-2 w-2 fill-current" />
|
|
129
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
130
|
-
</span>
|
|
131
|
-
{children}
|
|
132
|
-
</ContextMenuPrimitive.RadioItem>
|
|
133
|
-
));
|
|
134
|
-
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
135
|
-
|
|
136
|
-
const ContextMenuLabel = React.forwardRef<
|
|
137
|
-
React.ElementRef<typeof ContextMenuPrimitive.Label>,
|
|
138
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
|
|
139
|
-
inset?: boolean;
|
|
140
|
-
}
|
|
141
|
-
>(({ className, inset, ...props }, ref) => (
|
|
142
|
-
<ContextMenuPrimitive.Label
|
|
143
|
-
ref={ref}
|
|
144
|
-
className={cn(
|
|
145
|
-
'px-2 py-1.5 text-sm font-semibold text-Colors-Text-Default',
|
|
146
|
-
inset && 'pl-8',
|
|
147
|
-
className
|
|
148
|
-
)}
|
|
149
|
-
{...props}
|
|
150
|
-
/>
|
|
151
|
-
));
|
|
152
|
-
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
153
|
-
|
|
154
|
-
const ContextMenuSeparator = React.forwardRef<
|
|
155
|
-
React.ElementRef<typeof ContextMenuPrimitive.Separator>,
|
|
156
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
|
|
157
|
-
>(({ className, ...props }, ref) => (
|
|
158
|
-
<ContextMenuPrimitive.Separator
|
|
159
|
-
ref={ref}
|
|
160
|
-
className={cn('my-1 h-px bg-[var(--border)]', className)}
|
|
161
|
-
{...props}
|
|
162
|
-
/>
|
|
163
|
-
));
|
|
164
|
-
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
165
|
-
|
|
166
|
-
const ContextMenuShortcut = ({
|
|
167
|
-
className,
|
|
168
|
-
...props
|
|
169
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
170
|
-
return (
|
|
171
|
-
<span
|
|
172
|
-
className={cn(
|
|
173
|
-
'ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400',
|
|
174
|
-
className
|
|
175
|
-
)}
|
|
176
|
-
{...props}
|
|
177
|
-
/>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
180
|
-
ContextMenuShortcut.displayName = 'ContextMenuShortcut';
|
|
181
|
-
|
|
182
|
-
export {
|
|
183
|
-
ContextMenu,
|
|
184
|
-
ContextMenuCheckboxItem,
|
|
185
|
-
ContextMenuContent,
|
|
186
|
-
ContextMenuGroup,
|
|
187
|
-
ContextMenuItem,
|
|
188
|
-
ContextMenuLabel,
|
|
189
|
-
ContextMenuPortal,
|
|
190
|
-
ContextMenuRadioGroup,
|
|
191
|
-
ContextMenuRadioItem,
|
|
192
|
-
ContextMenuSeparator,
|
|
193
|
-
ContextMenuShortcut,
|
|
194
|
-
ContextMenuSub,
|
|
195
|
-
ContextMenuSubContent,
|
|
196
|
-
ContextMenuSubTrigger,
|
|
197
|
-
ContextMenuTrigger,
|
|
198
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import duration, { Duration } from 'dayjs/plugin/duration';
|
|
3
|
-
import utc from 'dayjs/plugin/utc';
|
|
4
|
-
import { useMemo, useEffect, useState } from 'react';
|
|
5
|
-
|
|
6
|
-
dayjs.extend(duration);
|
|
7
|
-
dayjs.extend(utc);
|
|
8
|
-
|
|
9
|
-
interface CountDownProps {
|
|
10
|
-
endTime: string;
|
|
11
|
-
callback?: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default function CountDown({ endTime, callback }: CountDownProps) {
|
|
15
|
-
const end = dayjs(parseInt(endTime));
|
|
16
|
-
const [duration, setDuration] = useState<Duration | null>(null);
|
|
17
|
-
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
let timer: any = null;
|
|
20
|
-
const countdown = () => {
|
|
21
|
-
const now = dayjs();
|
|
22
|
-
const diff = end.diff(now);
|
|
23
|
-
|
|
24
|
-
if (diff > 0) {
|
|
25
|
-
setDuration(dayjs.duration(diff));
|
|
26
|
-
timer = setTimeout(countdown, 1000);
|
|
27
|
-
} else {
|
|
28
|
-
callback && callback();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
countdown();
|
|
33
|
-
|
|
34
|
-
return () => {
|
|
35
|
-
clearTimeout(timer);
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
const days = useMemo(() => {
|
|
40
|
-
return duration ? duration.days().toString().padStart(2, '0') : null;
|
|
41
|
-
}, [duration]);
|
|
42
|
-
|
|
43
|
-
const hours = useMemo(() => {
|
|
44
|
-
return duration ? duration.hours().toString().padStart(2, '0') : null;
|
|
45
|
-
}, [duration]);
|
|
46
|
-
|
|
47
|
-
const minutes = useMemo(() => {
|
|
48
|
-
return duration ? duration.minutes().toString().padStart(2, '0') : null;
|
|
49
|
-
}, [duration]);
|
|
50
|
-
|
|
51
|
-
const seconds = useMemo(() => {
|
|
52
|
-
return duration ? duration.seconds().toString().padStart(2, '0') : null;
|
|
53
|
-
}, [duration]);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div className="flex items-center space-x-2 text-Colors-Text-Default">
|
|
57
|
-
<div className="px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default">
|
|
58
|
-
<div className="h-full flex flex-col justify-center items-center">
|
|
59
|
-
<p className="font-semibold text-[20px]">{days ?? '00'}</p>
|
|
60
|
-
<p className="opacity-60 text-[12px]">days</p>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
<div className="px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default">
|
|
64
|
-
<div className="h-full flex flex-col justify-center items-center">
|
|
65
|
-
<p className="font-semibold text-[20px]">{hours ?? '00'}</p>
|
|
66
|
-
<p className="opacity-60 text-[12px]">hrs</p>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<div className="px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default">
|
|
70
|
-
<div className="h-full flex flex-col justify-center items-center">
|
|
71
|
-
<p className="font-semibold text-[20px]">{minutes ?? '00'}</p>
|
|
72
|
-
<p className="opacity-60 text-[12px]">mins</p>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
<div className="px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default">
|
|
76
|
-
<div className="h-full flex flex-col justify-center items-center">
|
|
77
|
-
<p className="font-semibold text-[20px]">{seconds ?? '00'}</p>
|
|
78
|
-
<p className="opacity-60 text-[12px]">secs</p>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import XMarkIcon from '@heroicons/react/24/outline/esm/XMarkIcon';
|
|
4
|
-
import CheckCircleIcon from '@heroicons/react/24/solid/esm/CheckCircleIcon';
|
|
5
|
-
import ExclamationCircleIcon from '@heroicons/react/24/solid/esm/ExclamationCircleIcon';
|
|
6
|
-
import InformationCircleIcon from '@heroicons/react/24/solid/esm/InformationCircleIcon';
|
|
7
|
-
import XCircleIcon from '@heroicons/react/24/solid/esm/XCircleIcon';
|
|
8
|
-
import { toast, ToastOptions } from 'react-hot-toast';
|
|
9
|
-
|
|
10
|
-
import { IconButton } from './button/icon-button';
|
|
11
|
-
import { Separator } from './separator';
|
|
12
|
-
import { Text } from './typography';
|
|
13
|
-
import { isString } from '@/common/utils/common-helper';
|
|
14
|
-
import { CustomToasterProps } from '@/common/hooks/useNotification';
|
|
15
|
-
import { Spinner } from './spinner';
|
|
16
|
-
|
|
17
|
-
export default function CustomNotification({
|
|
18
|
-
tProps,
|
|
19
|
-
customProps,
|
|
20
|
-
}: {
|
|
21
|
-
tProps: ToastOptions;
|
|
22
|
-
customProps: CustomToasterProps;
|
|
23
|
-
}) {
|
|
24
|
-
const {
|
|
25
|
-
type,
|
|
26
|
-
title,
|
|
27
|
-
content,
|
|
28
|
-
isClosable = false,
|
|
29
|
-
action,
|
|
30
|
-
loading,
|
|
31
|
-
} = customProps;
|
|
32
|
-
const { id } = tProps;
|
|
33
|
-
|
|
34
|
-
const displayedContent = !isString(content)
|
|
35
|
-
? JSON.stringify(content)
|
|
36
|
-
: content;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div>
|
|
40
|
-
<div
|
|
41
|
-
id={id}
|
|
42
|
-
className="z-[10000000] min-h-10 w-fit max-w-[90vw] rounded-full border border-opaque bg-Colors-Background-Normal-Primary-Active px-3 py-2 shadow-modal-default md:max-w-[560px]"
|
|
43
|
-
>
|
|
44
|
-
<div className="flex w-full items-center justify-center gap-2">
|
|
45
|
-
{loading && <Spinner />}
|
|
46
|
-
{!loading && type && (
|
|
47
|
-
<div className="flex flex-shrink-0 items-center">
|
|
48
|
-
{type === 'info' && (
|
|
49
|
-
<InformationCircleIcon className="h-6 w-6 text-cc-Icon-Featured-icon-fg-Info" />
|
|
50
|
-
)}
|
|
51
|
-
{type === 'success' && (
|
|
52
|
-
<CheckCircleIcon className="h-6 w-6 text-cc-Icon-Featured-icon-fg-Success" />
|
|
53
|
-
)}
|
|
54
|
-
{type === 'warning' && (
|
|
55
|
-
<ExclamationCircleIcon className="h-6 w-6 text-cc-Icon-Featured-icon-fg-Warning" />
|
|
56
|
-
)}
|
|
57
|
-
{type === 'error' && (
|
|
58
|
-
<XCircleIcon className="h-6 w-6 text-cc-Icon-Featured-icon-fg-Error" />
|
|
59
|
-
)}
|
|
60
|
-
</div>
|
|
61
|
-
)}
|
|
62
|
-
<div className="flex flex-grow flex-col space-y-1 overflow-hidden">
|
|
63
|
-
{title && (
|
|
64
|
-
<Text size="sm" weight="regular" color="default">
|
|
65
|
-
{title}
|
|
66
|
-
</Text>
|
|
67
|
-
)}
|
|
68
|
-
<div>
|
|
69
|
-
<Text size="sm" weight="regular" color="default">
|
|
70
|
-
{displayedContent}
|
|
71
|
-
</Text>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
{action && (
|
|
76
|
-
<>
|
|
77
|
-
<Separator orientation="vertical" className="h-3" />
|
|
78
|
-
{action}
|
|
79
|
-
</>
|
|
80
|
-
)}
|
|
81
|
-
|
|
82
|
-
{isClosable && (
|
|
83
|
-
<IconButton
|
|
84
|
-
size="sm"
|
|
85
|
-
variant="plain"
|
|
86
|
-
icon={XMarkIcon}
|
|
87
|
-
onClick={() => toast.dismiss(id)}
|
|
88
|
-
className="text-Colors-Foreground-Subtlest"
|
|
89
|
-
/>
|
|
90
|
-
)}
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
-
import { X } from 'lucide-react';
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
|
|
9
|
-
const Dialog = DialogPrimitive.Root;
|
|
10
|
-
|
|
11
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
12
|
-
|
|
13
|
-
const DialogClose = DialogPrimitive.Close;
|
|
14
|
-
|
|
15
|
-
const DialogTrigger = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof DialogPrimitive.Trigger>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<DialogPrimitive.Trigger
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
'ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1',
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
));
|
|
28
|
-
DialogTrigger.displayName = DialogPrimitive.Trigger.displayName;
|
|
29
|
-
|
|
30
|
-
const DialogOverlay = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
33
|
-
>(({ className, ...props }, ref) => (
|
|
34
|
-
<DialogPrimitive.Overlay
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(
|
|
37
|
-
'fixed inset-0 z-50 bg-opacity-90 md:bg-opacity-75 bg-Colors-Background-Utilities-Overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
38
|
-
className
|
|
39
|
-
)}
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
42
|
-
));
|
|
43
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
44
|
-
|
|
45
|
-
const DialogContent = React.forwardRef<
|
|
46
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
47
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
48
|
-
maskClosable?: boolean;
|
|
49
|
-
hideClose?: boolean;
|
|
50
|
-
onClose?: () => void;
|
|
51
|
-
overlayClose?: boolean;
|
|
52
|
-
overlayClassName?: string;
|
|
53
|
-
iconClassName?: string;
|
|
54
|
-
}
|
|
55
|
-
>(
|
|
56
|
-
(
|
|
57
|
-
{
|
|
58
|
-
className,
|
|
59
|
-
children,
|
|
60
|
-
hideClose = false,
|
|
61
|
-
maskClosable = true,
|
|
62
|
-
overlayClose = true,
|
|
63
|
-
onClose,
|
|
64
|
-
overlayClassName,
|
|
65
|
-
iconClassName,
|
|
66
|
-
...props
|
|
67
|
-
},
|
|
68
|
-
ref
|
|
69
|
-
) => (
|
|
70
|
-
<DialogPortal>
|
|
71
|
-
<DialogOverlay
|
|
72
|
-
onClick={() => {
|
|
73
|
-
maskClosable && overlayClose && onClose && onClose();
|
|
74
|
-
}}
|
|
75
|
-
className={overlayClassName}
|
|
76
|
-
/>
|
|
77
|
-
<DialogPrimitive.Content
|
|
78
|
-
ref={ref}
|
|
79
|
-
className={cn(
|
|
80
|
-
'fixed left-[50%] top-[50%] z-50 grid w-[90%] rounded-4xl max-w-lg translate-x-[-50%] translate-y-[-50%] bg-Colors-Background-Normal-Primary-Default shadow-modal-default duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 focus-visible:outline-0',
|
|
81
|
-
className
|
|
82
|
-
)}
|
|
83
|
-
{...props}
|
|
84
|
-
>
|
|
85
|
-
{children}
|
|
86
|
-
|
|
87
|
-
{!hideClose && (
|
|
88
|
-
<DialogPrimitive.Close
|
|
89
|
-
className={cn(
|
|
90
|
-
'w-9 h-9 absolute right-5 top-3 flex justify-center items-center focus-visible:outline-0 rounded-full hover:bg-surface-hovered',
|
|
91
|
-
iconClassName
|
|
92
|
-
)}
|
|
93
|
-
onClick={() => {
|
|
94
|
-
onClose && onClose();
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
97
|
-
<X className="w-6 h-6 text-Colors-Foreground-Subtle" />
|
|
98
|
-
<span className="sr-only">Close</span>
|
|
99
|
-
</DialogPrimitive.Close>
|
|
100
|
-
)}
|
|
101
|
-
</DialogPrimitive.Content>
|
|
102
|
-
</DialogPortal>
|
|
103
|
-
)
|
|
104
|
-
);
|
|
105
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
106
|
-
|
|
107
|
-
function DialogHeader({
|
|
108
|
-
className,
|
|
109
|
-
...props
|
|
110
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
111
|
-
return <div className={cn('flex flex-col p-4', className)} {...props} />;
|
|
112
|
-
}
|
|
113
|
-
DialogHeader.displayName = 'DialogHeader';
|
|
114
|
-
|
|
115
|
-
function DialogFooter({
|
|
116
|
-
className,
|
|
117
|
-
...props
|
|
118
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
119
|
-
return <div className={cn('flex justify-end p-4', className)} {...props} />;
|
|
120
|
-
}
|
|
121
|
-
DialogFooter.displayName = 'DialogFooter';
|
|
122
|
-
|
|
123
|
-
const DialogTitle = React.forwardRef<
|
|
124
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
125
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
126
|
-
>(({ className, ...props }, ref) => (
|
|
127
|
-
<DialogPrimitive.Title
|
|
128
|
-
ref={ref}
|
|
129
|
-
className={cn('text-xl font-normal', className)}
|
|
130
|
-
{...props}
|
|
131
|
-
/>
|
|
132
|
-
));
|
|
133
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
134
|
-
|
|
135
|
-
const DialogDescription = React.forwardRef<
|
|
136
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
137
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
138
|
-
>(({ className, ...props }, ref) => (
|
|
139
|
-
<DialogPrimitive.Description
|
|
140
|
-
ref={ref}
|
|
141
|
-
className={cn('text-sm text-Colors-Text-Subtle p-4', className)}
|
|
142
|
-
{...props}
|
|
143
|
-
/>
|
|
144
|
-
));
|
|
145
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
146
|
-
|
|
147
|
-
export {
|
|
148
|
-
Dialog,
|
|
149
|
-
DialogPortal,
|
|
150
|
-
DialogOverlay,
|
|
151
|
-
DialogClose,
|
|
152
|
-
DialogTrigger,
|
|
153
|
-
DialogContent,
|
|
154
|
-
DialogHeader,
|
|
155
|
-
DialogFooter,
|
|
156
|
-
DialogTitle,
|
|
157
|
-
DialogDescription,
|
|
158
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
function Drawer({
|
|
9
|
-
shouldScaleBackground = false,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<DrawerPrimitive.Root
|
|
14
|
-
shouldScaleBackground={shouldScaleBackground}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
Drawer.displayName = 'Drawer';
|
|
20
|
-
|
|
21
|
-
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
22
|
-
|
|
23
|
-
const DrawerPortal = DrawerPrimitive.Portal;
|
|
24
|
-
|
|
25
|
-
const DrawerClose = DrawerPrimitive.Close;
|
|
26
|
-
|
|
27
|
-
const DrawerOverlay = React.forwardRef<
|
|
28
|
-
React.ElementRef<typeof DrawerPrimitive.Overlay>,
|
|
29
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
30
|
-
>(({ className, ...props }, ref) => (
|
|
31
|
-
<DrawerPrimitive.Overlay
|
|
32
|
-
ref={ref}
|
|
33
|
-
className={cn('fixed inset-0 z-50 bg-alpha-mask-mobile', className)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
));
|
|
37
|
-
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
38
|
-
|
|
39
|
-
const DrawerContent = React.forwardRef<
|
|
40
|
-
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
41
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
42
|
-
>(({ className, children, ...props }, ref) => (
|
|
43
|
-
<DrawerPortal>
|
|
44
|
-
<DrawerOverlay />
|
|
45
|
-
<DrawerPrimitive.Content
|
|
46
|
-
ref={ref}
|
|
47
|
-
className={cn(
|
|
48
|
-
'fixed inset-x-0 bottom-0 z-50 flex h-auto max-h-[70%] flex-col rounded-t-2xl bg-Colors-Background-Normal-Primary-Default shadow-modal-default',
|
|
49
|
-
className
|
|
50
|
-
)}
|
|
51
|
-
{...props}
|
|
52
|
-
>
|
|
53
|
-
{/* <DrawerPrimitive.Close className="w-9 h-9 absolute right-4 top-4 flex justify-center items-center ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1">
|
|
54
|
-
<X className="w-[22px] h-[22px] text-icon" />
|
|
55
|
-
<span className="sr-only">Close</span>
|
|
56
|
-
</DrawerPrimitive.Close> */}
|
|
57
|
-
{/* 类app拖动块在H5端不需要 */}
|
|
58
|
-
{/* <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-border-Colors-Border-Default" /> */}
|
|
59
|
-
{children}
|
|
60
|
-
</DrawerPrimitive.Content>
|
|
61
|
-
</DrawerPortal>
|
|
62
|
-
));
|
|
63
|
-
DrawerContent.displayName = 'DrawerContent';
|
|
64
|
-
|
|
65
|
-
function DrawerHeader({
|
|
66
|
-
className,
|
|
67
|
-
...props
|
|
68
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
69
|
-
return <div className={cn('p-4', className)} {...props} />;
|
|
70
|
-
}
|
|
71
|
-
DrawerHeader.displayName = 'DrawerHeader';
|
|
72
|
-
|
|
73
|
-
function DrawerFooter({
|
|
74
|
-
className,
|
|
75
|
-
...props
|
|
76
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
77
|
-
return <div className={cn('p-4', className)} {...props} />;
|
|
78
|
-
}
|
|
79
|
-
DrawerFooter.displayName = 'DrawerFooter';
|
|
80
|
-
|
|
81
|
-
const DrawerTitle = React.forwardRef<
|
|
82
|
-
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
83
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
84
|
-
>(({ className, ...props }, ref) => (
|
|
85
|
-
<DrawerPrimitive.Title
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={cn('text-xl font-normal text-Colors-Text-Default', className)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
));
|
|
91
|
-
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
92
|
-
|
|
93
|
-
const DrawerDescription = React.forwardRef<
|
|
94
|
-
React.ElementRef<typeof DrawerPrimitive.Description>,
|
|
95
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
|
|
96
|
-
>(({ className, ...props }, ref) => (
|
|
97
|
-
<DrawerPrimitive.Description
|
|
98
|
-
ref={ref}
|
|
99
|
-
className={cn('text-sm text-Colors-Text-Subtle', className)}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
));
|
|
103
|
-
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
104
|
-
|
|
105
|
-
export {
|
|
106
|
-
Drawer,
|
|
107
|
-
DrawerPortal,
|
|
108
|
-
DrawerOverlay,
|
|
109
|
-
DrawerTrigger,
|
|
110
|
-
DrawerClose,
|
|
111
|
-
DrawerContent,
|
|
112
|
-
DrawerHeader,
|
|
113
|
-
DrawerFooter,
|
|
114
|
-
DrawerTitle,
|
|
115
|
-
DrawerDescription,
|
|
116
|
-
};
|