myshell-react-lib 0.1.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.
- package/README.md +268 -0
- package/dist/assets/audio-playing.json +3657 -0
- package/dist/index.cjs +9654 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1431 -0
- package/dist/index.d.ts +1431 -0
- package/dist/index.js +8788 -0
- package/dist/index.js.map +1 -0
- package/package.json +140 -0
- package/src/common/assets/audio-playing.json +3657 -0
- package/src/common/constants/constants.ts +24 -0
- package/src/common/constants/types/common.ts +10 -0
- package/src/common/hooks/useAudioPlayer.tsx +198 -0
- package/src/common/hooks/useDevice.ts +26 -0
- package/src/common/hooks/useNativeBridge.ts +42 -0
- package/src/common/hooks/useNotification.tsx +179 -0
- package/src/common/hooks/useWindowWidth.ts +19 -0
- package/src/common/utils/common-helper.ts +81 -0
- package/src/components/ItemDemo.tsx +15 -0
- package/src/components/accordion.tsx +126 -0
- package/src/components/alert-dialog.tsx +148 -0
- package/src/components/alert.tsx +65 -0
- package/src/components/aspect-ratio.tsx +7 -0
- package/src/components/audio-player.tsx +58 -0
- package/src/components/avatar.tsx +133 -0
- package/src/components/badge.tsx +65 -0
- package/src/components/button/button.styles.ts +258 -0
- package/src/components/button/button.tsx +215 -0
- package/src/components/button/icon-button.styles.ts +101 -0
- package/src/components/button/icon-button.tsx +100 -0
- package/src/components/button/index.tsx +3 -0
- package/src/components/button/link-button.tsx +184 -0
- package/src/components/cascader.tsx +175 -0
- package/src/components/checkbox.tsx +135 -0
- package/src/components/command.tsx +155 -0
- package/src/components/context-menu.tsx +198 -0
- package/src/components/count-down.tsx +83 -0
- package/src/components/custom-notification.tsx +95 -0
- package/src/components/dialog.tsx +158 -0
- package/src/components/drawer.tsx +116 -0
- package/src/components/dropdown-menu.tsx +196 -0
- package/src/components/energy-progress.tsx +55 -0
- package/src/components/form.tsx +201 -0
- package/src/components/group.tsx +9 -0
- package/src/components/guide.tsx +243 -0
- package/src/components/icon.tsx +89 -0
- package/src/components/icons/outline/DownIcon.tsx +18 -0
- package/src/components/icons/outline/FilterIcon.tsx +21 -0
- package/src/components/icons/outline/arrow-left.tsx +16 -0
- package/src/components/icons/outline/arrow-up-tray.tsx +16 -0
- package/src/components/icons/outline/check-circle.tsx +17 -0
- package/src/components/icons/outline/config.tsx +42 -0
- package/src/components/icons/outline/pencil-square.tsx +16 -0
- package/src/components/icons/outline/trash.tsx +17 -0
- package/src/components/icons/outline/window.tsx +16 -0
- package/src/components/icons/outline/x-circle.tsx +17 -0
- package/src/components/icons/outline/x-mark.tsx +16 -0
- package/src/components/icons/solid/audio-playing.tsx +31 -0
- package/src/components/icons/solid/caret-down.tsx +14 -0
- package/src/components/icons/solid/code.tsx +18 -0
- package/src/components/icons/solid/drag.tsx +14 -0
- package/src/components/icons/solid/phone.tsx +23 -0
- package/src/components/icons/solid/rectangle-group.tsx +14 -0
- package/src/components/image.tsx +151 -0
- package/src/components/input.tsx +118 -0
- package/src/components/label.tsx +26 -0
- package/src/components/link.tsx +123 -0
- package/src/components/marquee/index.css +15 -0
- package/src/components/marquee/marquee.tsx +220 -0
- package/src/components/masonry.tsx +138 -0
- package/src/components/menubar.tsx +234 -0
- package/src/components/mobile/m-tooltip.tsx +34 -0
- package/src/components/modal.tsx +561 -0
- package/src/components/navigation-bar.tsx +100 -0
- package/src/components/number-input.tsx +143 -0
- package/src/components/page-content.tsx +16 -0
- package/src/components/popover.tsx +191 -0
- package/src/components/progress.tsx +80 -0
- package/src/components/radio-group.tsx +44 -0
- package/src/components/scroll-area.tsx +49 -0
- package/src/components/search-bar.tsx +140 -0
- package/src/components/secondary-navigation-bar.tsx +307 -0
- package/src/components/select.tsx +273 -0
- package/src/components/separator.tsx +31 -0
- package/src/components/sheet.tsx +143 -0
- package/src/components/skeleton.tsx +20 -0
- package/src/components/slider.tsx +160 -0
- package/src/components/spinner.tsx +48 -0
- package/src/components/swiper/index.module.scss +88 -0
- package/src/components/swiper/index.tsx +319 -0
- package/src/components/switch.tsx +67 -0
- package/src/components/tabs.tsx +325 -0
- package/src/components/textarea.tsx +71 -0
- package/src/components/toast/toast.tsx +182 -0
- package/src/components/toast/toaster.tsx +160 -0
- package/src/components/toast/use-toast.tsx +248 -0
- package/src/components/toggle-group.tsx +64 -0
- package/src/components/toggle.tsx +46 -0
- package/src/components/tooltip.tsx +283 -0
- package/src/components/typography.tsx +437 -0
- package/src/index.ts +66 -0
- package/src/lib/utils.ts +62 -0
- package/src/stories/Accordion.stories.tsx +64 -0
- package/src/stories/AccordionItem.stories.tsx +48 -0
- package/src/stories/Avatar.stories.ts +58 -0
- package/src/stories/Badge.stories.tsx +40 -0
- package/src/stories/BannerSwiper.stories.tsx +102 -0
- package/src/stories/Button.stories.tsx +543 -0
- package/src/stories/Checkbox.stories.tsx +161 -0
- package/src/stories/Configure.mdx +341 -0
- package/src/stories/CssProperties.mdx +30 -0
- package/src/stories/Description.stories.ts +70 -0
- package/src/stories/Display.stories.ts +64 -0
- package/src/stories/FeaturedSwiper.stories.tsx +6978 -0
- package/src/stories/GridSwiper.stories.tsx +1407 -0
- package/src/stories/Guide.stories.tsx +247 -0
- package/src/stories/Heading.stories.ts +89 -0
- package/src/stories/Icon.stories.ts +77 -0
- package/src/stories/IconButton.stories.tsx +301 -0
- package/src/stories/IconTextButton.stories.ts +59 -0
- package/src/stories/Image.stories.ts +55 -0
- package/src/stories/Input.stories.tsx +203 -0
- package/src/stories/Modal.stories.tsx +144 -0
- package/src/stories/NavigationBar.stories.tsx +81 -0
- package/src/stories/Notification.stories.tsx +276 -0
- package/src/stories/Popover.stories.tsx +100 -0
- package/src/stories/SearchBar.stories.ts +43 -0
- package/src/stories/SecondaryNavigationBar.stories.tsx +199 -0
- package/src/stories/Select.stories.tsx +107 -0
- package/src/stories/Separator.stories.tsx +49 -0
- package/src/stories/Spinner.stories.tsx +48 -0
- package/src/stories/SubHeading.stories.ts +64 -0
- package/src/stories/Swich.stories.tsx +69 -0
- package/src/stories/Tabs.stories.tsx +90 -0
- package/src/stories/Text.stories.ts +78 -0
- package/src/stories/Textarea.stories.tsx +155 -0
- package/src/stories/Toast.stories.tsx +424 -0
- package/src/stories/Tooltip.stories.tsx +244 -0
- package/src/stories/ViewAutoSwiper.stories.tsx +1408 -0
- package/src/styles/components-dark.scss +212 -0
- package/src/styles/components-light.scss +210 -0
- package/src/styles/design-dark.scss +330 -0
- package/src/styles/design-light.scss +345 -0
- package/src/styles/design2-dark.scss +319 -0
- package/src/styles/design2-light.scss +364 -0
- package/src/styles/font.css +19 -0
- package/src/styles/global.scss +251 -0
- package/src/styles/md-viewer.scss +155 -0
- package/src/styles/new-tokens.scss +255 -0
- package/src/styles/tokens.scss +401 -0
- package/src/types/scss.d.ts +24 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
3
|
+
|
|
4
|
+
import { Avatar } from '@/components/avatar';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/数据展示/Avatar-头像',
|
|
9
|
+
component: Avatar,
|
|
10
|
+
parameters: {
|
|
11
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
|
|
17
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
18
|
+
args: {
|
|
19
|
+
size: 'lg',
|
|
20
|
+
src: 'https://d6phagtfbtco7.cloudfront.net/bot-logo/8a40733494be4bcbbf58b1ec6bb56513.png',
|
|
21
|
+
variant: 'bot',
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
// 定义size为select类型的控件
|
|
25
|
+
size: {
|
|
26
|
+
control: 'select',
|
|
27
|
+
options: [
|
|
28
|
+
'xs',
|
|
29
|
+
'sm',
|
|
30
|
+
'md',
|
|
31
|
+
'lg',
|
|
32
|
+
'xl',
|
|
33
|
+
'2xl',
|
|
34
|
+
'3xl',
|
|
35
|
+
'4xl',
|
|
36
|
+
'5xl',
|
|
37
|
+
'6xl',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
variant: {
|
|
41
|
+
control: 'select',
|
|
42
|
+
options: ['bot', 'user', 'widget'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
} satisfies Meta<typeof Avatar>;
|
|
46
|
+
|
|
47
|
+
export default meta;
|
|
48
|
+
// export const Default: StoryObj<typeof meta> = {
|
|
49
|
+
// // 这里不需要设置 args,因为它会继承 meta 中的 args
|
|
50
|
+
// };
|
|
51
|
+
type Story = StoryObj<typeof meta>;
|
|
52
|
+
|
|
53
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
54
|
+
export const Demo: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
...meta.args, // 继承默认参数
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import Badge from '../components/badge';
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/数据展示/Badge-徽标',
|
|
8
|
+
component: Badge,
|
|
9
|
+
parameters: {
|
|
10
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
|
|
16
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
17
|
+
args: {
|
|
18
|
+
status: 'default',
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
// 定义size为select类型的控件
|
|
22
|
+
status: {
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: ['default', 'unRead', 'public', 'private', 'hidden', 'new'],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta<typeof Badge>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
// export const Default: StoryObj<typeof meta> = {
|
|
31
|
+
// // 这里不需要设置 args,因为它会继承 meta 中的 args
|
|
32
|
+
// };
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
|
|
35
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
36
|
+
export const Demo: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
...meta.args, // 继承默认参数
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Swiper } from '../components/swiper/index';
|
|
5
|
+
// import { BannerItem } from '@/components/explore/components/banner-item';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/数据展示/Swiper-轮播图',
|
|
10
|
+
component: Swiper,
|
|
11
|
+
parameters: {
|
|
12
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
13
|
+
layout: 'centered',
|
|
14
|
+
nextjs: {
|
|
15
|
+
appDirectory: true, // 如果组件里有用到router next/navigation,则需要设置此配置
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
|
|
21
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
22
|
+
args: {
|
|
23
|
+
// component: BannerItem,
|
|
24
|
+
className: '',
|
|
25
|
+
swiperType: 'banner',
|
|
26
|
+
dataList: [
|
|
27
|
+
{
|
|
28
|
+
title: 'Beta Season S11',
|
|
29
|
+
description:
|
|
30
|
+
'Beta Season S11 is in full swing, come and earn generous rewards!',
|
|
31
|
+
imageUrl:
|
|
32
|
+
'https://www.myshellstatic.com/image/homepage/20240329/cb26ac85a4fb4844ac0a5509d4660da0.png',
|
|
33
|
+
mobileImageUrl:
|
|
34
|
+
'https://www.myshellstatic.com/image/homepage/20240329/a80c53980e9a4d588fdd829abb6cfc1e.png',
|
|
35
|
+
gotoUrl: '/rewards-center',
|
|
36
|
+
gotoSchema: 'myshell://native/main?tab=rewards',
|
|
37
|
+
buttonText: 'Join Now',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: 'AICM Joins Now',
|
|
41
|
+
description:
|
|
42
|
+
'Enter the world of Demon Slayer. Be a Slayer, a warrior shielding humanity from demons, or turn into a Demon yourself, hunting humans for sustenance.',
|
|
43
|
+
imageUrl:
|
|
44
|
+
'https://www.myshellstatic.com/image/homepage/20240329/128ab0faadbc448280dbdf9876a23de2.png',
|
|
45
|
+
mobileImageUrl:
|
|
46
|
+
'https://www.myshellstatic.com/image/homepage/20240329/036f3920a433490d91494e5ff3b8becf.png',
|
|
47
|
+
gotoUrl: '/bot/FBFryy/1705953885',
|
|
48
|
+
gotoSchema: 'myshell://native/chat/1705953885',
|
|
49
|
+
buttonText: 'Chat Now',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: 'Officially Produced',
|
|
53
|
+
description:
|
|
54
|
+
'Feature-rich AI tools: Experience endless surprises in MyShell!',
|
|
55
|
+
imageUrl:
|
|
56
|
+
'https://www.myshellstatic.com/image/homepage/20240329/e2a2e885f04e4749a93ca0599a644d4b.png',
|
|
57
|
+
mobileImageUrl:
|
|
58
|
+
'https://www.myshellstatic.com/image/homepage/20240329/5a71f97720614f329d50ba7375160d39.png',
|
|
59
|
+
gotoUrl: 'explore?filter=1719340128622136757',
|
|
60
|
+
gotoSchema: 'myshell://native/chat/1705953885',
|
|
61
|
+
buttonText: 'Try Now',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: 'Discord Forum',
|
|
65
|
+
description:
|
|
66
|
+
'Jump into the rabbit hole of Prompt: Step-by-step tutorial, easily from beginner to advanced.\n12313213213213213噶哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈',
|
|
67
|
+
imageUrl:
|
|
68
|
+
'https://www.myshellstatic.com/image/homepage/20240329/ea221905d4fd42f481a48a334d72324e.png',
|
|
69
|
+
mobileImageUrl:
|
|
70
|
+
'https://www.myshellstatic.com/image/homepage/20240329/7465f7d5619e47c0bf65e56ba767b757.png',
|
|
71
|
+
gotoUrl:
|
|
72
|
+
'https://discord.com/channels/1122227993805336617/1127967758919925953',
|
|
73
|
+
gotoSchema:
|
|
74
|
+
'https://discord.com/channels/1122227993805336617/1127967758919925953',
|
|
75
|
+
buttonText: 'Join Now',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
argTypes: {
|
|
80
|
+
// 定义size为select类型的控件
|
|
81
|
+
},
|
|
82
|
+
} satisfies Meta<typeof Swiper>;
|
|
83
|
+
|
|
84
|
+
export default meta;
|
|
85
|
+
// export const Default: StoryObj<typeof meta> = {
|
|
86
|
+
// // 这里不需要设置 args,因为它会继承 meta 中的 args
|
|
87
|
+
// };
|
|
88
|
+
type Story = StoryObj<typeof meta>;
|
|
89
|
+
|
|
90
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
91
|
+
export const BannerDemo: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
...meta.args, // 继承默认参数
|
|
94
|
+
},
|
|
95
|
+
render: (args) => {
|
|
96
|
+
return (
|
|
97
|
+
<div className="w-[70vw] px-3 rounded-md">
|
|
98
|
+
{/* <Swiper {...args} /> */}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
};
|