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.
Files changed (151) hide show
  1. package/README.md +268 -0
  2. package/dist/assets/audio-playing.json +3657 -0
  3. package/dist/index.cjs +9654 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +1431 -0
  6. package/dist/index.d.ts +1431 -0
  7. package/dist/index.js +8788 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +140 -0
  10. package/src/common/assets/audio-playing.json +3657 -0
  11. package/src/common/constants/constants.ts +24 -0
  12. package/src/common/constants/types/common.ts +10 -0
  13. package/src/common/hooks/useAudioPlayer.tsx +198 -0
  14. package/src/common/hooks/useDevice.ts +26 -0
  15. package/src/common/hooks/useNativeBridge.ts +42 -0
  16. package/src/common/hooks/useNotification.tsx +179 -0
  17. package/src/common/hooks/useWindowWidth.ts +19 -0
  18. package/src/common/utils/common-helper.ts +81 -0
  19. package/src/components/ItemDemo.tsx +15 -0
  20. package/src/components/accordion.tsx +126 -0
  21. package/src/components/alert-dialog.tsx +148 -0
  22. package/src/components/alert.tsx +65 -0
  23. package/src/components/aspect-ratio.tsx +7 -0
  24. package/src/components/audio-player.tsx +58 -0
  25. package/src/components/avatar.tsx +133 -0
  26. package/src/components/badge.tsx +65 -0
  27. package/src/components/button/button.styles.ts +258 -0
  28. package/src/components/button/button.tsx +215 -0
  29. package/src/components/button/icon-button.styles.ts +101 -0
  30. package/src/components/button/icon-button.tsx +100 -0
  31. package/src/components/button/index.tsx +3 -0
  32. package/src/components/button/link-button.tsx +184 -0
  33. package/src/components/cascader.tsx +175 -0
  34. package/src/components/checkbox.tsx +135 -0
  35. package/src/components/command.tsx +155 -0
  36. package/src/components/context-menu.tsx +198 -0
  37. package/src/components/count-down.tsx +83 -0
  38. package/src/components/custom-notification.tsx +95 -0
  39. package/src/components/dialog.tsx +158 -0
  40. package/src/components/drawer.tsx +116 -0
  41. package/src/components/dropdown-menu.tsx +196 -0
  42. package/src/components/energy-progress.tsx +55 -0
  43. package/src/components/form.tsx +201 -0
  44. package/src/components/group.tsx +9 -0
  45. package/src/components/guide.tsx +243 -0
  46. package/src/components/icon.tsx +89 -0
  47. package/src/components/icons/outline/DownIcon.tsx +18 -0
  48. package/src/components/icons/outline/FilterIcon.tsx +21 -0
  49. package/src/components/icons/outline/arrow-left.tsx +16 -0
  50. package/src/components/icons/outline/arrow-up-tray.tsx +16 -0
  51. package/src/components/icons/outline/check-circle.tsx +17 -0
  52. package/src/components/icons/outline/config.tsx +42 -0
  53. package/src/components/icons/outline/pencil-square.tsx +16 -0
  54. package/src/components/icons/outline/trash.tsx +17 -0
  55. package/src/components/icons/outline/window.tsx +16 -0
  56. package/src/components/icons/outline/x-circle.tsx +17 -0
  57. package/src/components/icons/outline/x-mark.tsx +16 -0
  58. package/src/components/icons/solid/audio-playing.tsx +31 -0
  59. package/src/components/icons/solid/caret-down.tsx +14 -0
  60. package/src/components/icons/solid/code.tsx +18 -0
  61. package/src/components/icons/solid/drag.tsx +14 -0
  62. package/src/components/icons/solid/phone.tsx +23 -0
  63. package/src/components/icons/solid/rectangle-group.tsx +14 -0
  64. package/src/components/image.tsx +151 -0
  65. package/src/components/input.tsx +118 -0
  66. package/src/components/label.tsx +26 -0
  67. package/src/components/link.tsx +123 -0
  68. package/src/components/marquee/index.css +15 -0
  69. package/src/components/marquee/marquee.tsx +220 -0
  70. package/src/components/masonry.tsx +138 -0
  71. package/src/components/menubar.tsx +234 -0
  72. package/src/components/mobile/m-tooltip.tsx +34 -0
  73. package/src/components/modal.tsx +561 -0
  74. package/src/components/navigation-bar.tsx +100 -0
  75. package/src/components/number-input.tsx +143 -0
  76. package/src/components/page-content.tsx +16 -0
  77. package/src/components/popover.tsx +191 -0
  78. package/src/components/progress.tsx +80 -0
  79. package/src/components/radio-group.tsx +44 -0
  80. package/src/components/scroll-area.tsx +49 -0
  81. package/src/components/search-bar.tsx +140 -0
  82. package/src/components/secondary-navigation-bar.tsx +307 -0
  83. package/src/components/select.tsx +273 -0
  84. package/src/components/separator.tsx +31 -0
  85. package/src/components/sheet.tsx +143 -0
  86. package/src/components/skeleton.tsx +20 -0
  87. package/src/components/slider.tsx +160 -0
  88. package/src/components/spinner.tsx +48 -0
  89. package/src/components/swiper/index.module.scss +88 -0
  90. package/src/components/swiper/index.tsx +319 -0
  91. package/src/components/switch.tsx +67 -0
  92. package/src/components/tabs.tsx +325 -0
  93. package/src/components/textarea.tsx +71 -0
  94. package/src/components/toast/toast.tsx +182 -0
  95. package/src/components/toast/toaster.tsx +160 -0
  96. package/src/components/toast/use-toast.tsx +248 -0
  97. package/src/components/toggle-group.tsx +64 -0
  98. package/src/components/toggle.tsx +46 -0
  99. package/src/components/tooltip.tsx +283 -0
  100. package/src/components/typography.tsx +437 -0
  101. package/src/index.ts +66 -0
  102. package/src/lib/utils.ts +62 -0
  103. package/src/stories/Accordion.stories.tsx +64 -0
  104. package/src/stories/AccordionItem.stories.tsx +48 -0
  105. package/src/stories/Avatar.stories.ts +58 -0
  106. package/src/stories/Badge.stories.tsx +40 -0
  107. package/src/stories/BannerSwiper.stories.tsx +102 -0
  108. package/src/stories/Button.stories.tsx +543 -0
  109. package/src/stories/Checkbox.stories.tsx +161 -0
  110. package/src/stories/Configure.mdx +341 -0
  111. package/src/stories/CssProperties.mdx +30 -0
  112. package/src/stories/Description.stories.ts +70 -0
  113. package/src/stories/Display.stories.ts +64 -0
  114. package/src/stories/FeaturedSwiper.stories.tsx +6978 -0
  115. package/src/stories/GridSwiper.stories.tsx +1407 -0
  116. package/src/stories/Guide.stories.tsx +247 -0
  117. package/src/stories/Heading.stories.ts +89 -0
  118. package/src/stories/Icon.stories.ts +77 -0
  119. package/src/stories/IconButton.stories.tsx +301 -0
  120. package/src/stories/IconTextButton.stories.ts +59 -0
  121. package/src/stories/Image.stories.ts +55 -0
  122. package/src/stories/Input.stories.tsx +203 -0
  123. package/src/stories/Modal.stories.tsx +144 -0
  124. package/src/stories/NavigationBar.stories.tsx +81 -0
  125. package/src/stories/Notification.stories.tsx +276 -0
  126. package/src/stories/Popover.stories.tsx +100 -0
  127. package/src/stories/SearchBar.stories.ts +43 -0
  128. package/src/stories/SecondaryNavigationBar.stories.tsx +199 -0
  129. package/src/stories/Select.stories.tsx +107 -0
  130. package/src/stories/Separator.stories.tsx +49 -0
  131. package/src/stories/Spinner.stories.tsx +48 -0
  132. package/src/stories/SubHeading.stories.ts +64 -0
  133. package/src/stories/Swich.stories.tsx +69 -0
  134. package/src/stories/Tabs.stories.tsx +90 -0
  135. package/src/stories/Text.stories.ts +78 -0
  136. package/src/stories/Textarea.stories.tsx +155 -0
  137. package/src/stories/Toast.stories.tsx +424 -0
  138. package/src/stories/Tooltip.stories.tsx +244 -0
  139. package/src/stories/ViewAutoSwiper.stories.tsx +1408 -0
  140. package/src/styles/components-dark.scss +212 -0
  141. package/src/styles/components-light.scss +210 -0
  142. package/src/styles/design-dark.scss +330 -0
  143. package/src/styles/design-light.scss +345 -0
  144. package/src/styles/design2-dark.scss +319 -0
  145. package/src/styles/design2-light.scss +364 -0
  146. package/src/styles/font.css +19 -0
  147. package/src/styles/global.scss +251 -0
  148. package/src/styles/md-viewer.scss +155 -0
  149. package/src/styles/new-tokens.scss +255 -0
  150. package/src/styles/tokens.scss +401 -0
  151. package/src/types/scss.d.ts +24 -0
@@ -0,0 +1,244 @@
1
+ /* eslint-disable import/no-unused-modules */
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import React from 'react';
4
+
5
+ import { Tooltip } from '@/components/tooltip';
6
+
7
+ const meta = {
8
+ title: 'Components/数据展示/Tooltip-气泡',
9
+ component: Tooltip,
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
+ args: {
17
+ variant: 'default',
18
+ showArrow: true,
19
+ description: '',
20
+ side: 'top',
21
+ align: 'center',
22
+ sideOffset: 6,
23
+ alignOffset: 0,
24
+ contentClassName: '',
25
+ triggerClassName: '',
26
+ },
27
+ argTypes: {
28
+ disabled: {
29
+ description: '是否禁用',
30
+ control: 'boolean',
31
+ },
32
+ variant: {
33
+ description: '类型',
34
+ control: 'select',
35
+ options: ['default', 'info', 'message'],
36
+ },
37
+ open: {
38
+ description: '是否打开',
39
+ control: 'boolean',
40
+ },
41
+ defaultOpen: {
42
+ description: '默认是否打开',
43
+ control: 'boolean',
44
+ },
45
+ side: {
46
+ description: '气泡方向',
47
+ control: 'select',
48
+ options: ['top', 'right', 'bottom', 'left'],
49
+ },
50
+ align: {
51
+ description: '气泡箭头位置',
52
+ control: 'select',
53
+ options: ['start', 'center', 'end'],
54
+ },
55
+ sideOffset: {
56
+ description: '气泡偏移量',
57
+ control: 'number',
58
+ },
59
+ alignOffset: {
60
+ description: '气泡箭头偏移量',
61
+ control: 'number',
62
+ },
63
+ showArrow: {
64
+ description: '是否显示箭头',
65
+ control: 'boolean',
66
+ },
67
+ title: {
68
+ description: '标题 string | node',
69
+ control: 'object',
70
+ },
71
+ description: {
72
+ description: '描述 string | node',
73
+ control: 'object',
74
+ },
75
+ contentClassName: {
76
+ description: '内容样式',
77
+ control: 'text',
78
+ },
79
+ triggerClassName: {
80
+ description: '触发器样式',
81
+ control: 'text',
82
+ },
83
+ titleDangerous: {
84
+ description: '标题是否危险',
85
+ control: 'boolean',
86
+ },
87
+ descriptionDangerous: {
88
+ description: '描述是否危险',
89
+ control: 'boolean',
90
+ },
91
+ },
92
+ } satisfies Meta<typeof Tooltip>;
93
+ export default meta;
94
+
95
+ type Story = StoryObj<typeof meta>;
96
+
97
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
98
+ export const TooltipDemo: Story = {
99
+ args: {
100
+ ...meta.args, // 继承默认参数
101
+ },
102
+ render: (args) => {
103
+ return (
104
+ <div className="w-[40vw] min-h-[200px] py-10 px-3 rounded-md space-y-3 flex flex-col justify-center">
105
+ <div className="grid grid-cols-5">
106
+ <div />
107
+ <div>
108
+ <Tooltip
109
+ {...args}
110
+ side="top"
111
+ align="start"
112
+ description="tooltip description"
113
+ >
114
+ topStart
115
+ </Tooltip>
116
+ </div>
117
+ <div>
118
+ <Tooltip
119
+ {...args}
120
+ side="top"
121
+ align="center"
122
+ description="tooltip description"
123
+ >
124
+ topCenter
125
+ </Tooltip>
126
+ </div>
127
+ <div>
128
+ <Tooltip
129
+ {...args}
130
+ side="top"
131
+ align="end"
132
+ description="tooltip description"
133
+ >
134
+ topEnd
135
+ </Tooltip>
136
+ </div>
137
+ <div />
138
+ </div>
139
+ <div className="grid grid-cols-5 space-x-5">
140
+ <div>
141
+ <Tooltip
142
+ {...args}
143
+ side="left"
144
+ align="start"
145
+ description="tooltip description"
146
+ >
147
+ leftStart
148
+ </Tooltip>
149
+ </div>
150
+
151
+ <div />
152
+ <div />
153
+ <div />
154
+ <div>
155
+ <Tooltip
156
+ {...args}
157
+ side="right"
158
+ align="end"
159
+ description="tooltip description"
160
+ >
161
+ rightStart
162
+ </Tooltip>
163
+ </div>
164
+ </div>
165
+
166
+ <div className="grid grid-cols-5 space-x-5">
167
+ <div>
168
+ <Tooltip {...args} side="left" description="tooltip description">
169
+ left
170
+ </Tooltip>
171
+ </div>
172
+ <div />
173
+ <div />
174
+ <div />
175
+ <div>
176
+ <Tooltip {...args} side="right" description="tooltip description">
177
+ right
178
+ </Tooltip>
179
+ </div>
180
+ </div>
181
+
182
+ <div className="grid grid-cols-5 space-x-5">
183
+ <div>
184
+ <Tooltip
185
+ {...args}
186
+ side="left"
187
+ align="end"
188
+ description="tooltip description"
189
+ >
190
+ leftEnd
191
+ </Tooltip>
192
+ </div>
193
+ <div />
194
+ <div />
195
+ <div />
196
+ <div>
197
+ <Tooltip
198
+ {...args}
199
+ side="right"
200
+ align="end"
201
+ description="tooltip description"
202
+ >
203
+ rightEnd
204
+ </Tooltip>
205
+ </div>
206
+ </div>
207
+ <div className="grid grid-cols-5 space-x-1">
208
+ <div />
209
+ <div>
210
+ <Tooltip
211
+ {...args}
212
+ side="bottom"
213
+ align="start"
214
+ description="tooltip description"
215
+ >
216
+ bottomStart
217
+ </Tooltip>
218
+ </div>
219
+ <div>
220
+ <Tooltip
221
+ {...args}
222
+ side="bottom"
223
+ align="center"
224
+ description="tooltip description"
225
+ >
226
+ bottomCenter
227
+ </Tooltip>
228
+ </div>
229
+ <div>
230
+ <Tooltip
231
+ {...args}
232
+ side="bottom"
233
+ align="end"
234
+ description="tooltip description"
235
+ >
236
+ bottonEnd
237
+ </Tooltip>
238
+ </div>
239
+ <div />
240
+ </div>
241
+ </div>
242
+ );
243
+ },
244
+ };