myshell-react-lib 0.1.4 → 0.1.6

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 (147) hide show
  1. package/dist/index.cjs +52 -3
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +8 -2
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -2
  8. package/src/common/assets/audio-playing.json +0 -3657
  9. package/src/common/constants/constants.ts +0 -24
  10. package/src/common/constants/types/common.ts +0 -10
  11. package/src/common/hooks/useAudioPlayer.tsx +0 -198
  12. package/src/common/hooks/useDevice.ts +0 -26
  13. package/src/common/hooks/useNativeBridge.ts +0 -42
  14. package/src/common/hooks/useNotification.tsx +0 -179
  15. package/src/common/hooks/useWindowWidth.ts +0 -19
  16. package/src/common/utils/common-helper.ts +0 -81
  17. package/src/components/ItemDemo.tsx +0 -15
  18. package/src/components/accordion.tsx +0 -126
  19. package/src/components/alert-dialog.tsx +0 -148
  20. package/src/components/alert.tsx +0 -65
  21. package/src/components/aspect-ratio.tsx +0 -7
  22. package/src/components/audio-player.tsx +0 -60
  23. package/src/components/audio-playing.tsx +0 -33
  24. package/src/components/avatar.tsx +0 -133
  25. package/src/components/badge.tsx +0 -67
  26. package/src/components/button/button.styles.ts +0 -258
  27. package/src/components/button/button.tsx +0 -215
  28. package/src/components/button/icon-button.styles.ts +0 -101
  29. package/src/components/button/icon-button.tsx +0 -100
  30. package/src/components/button/index.tsx +0 -3
  31. package/src/components/button/link-button.tsx +0 -184
  32. package/src/components/cascader.tsx +0 -175
  33. package/src/components/checkbox.tsx +0 -135
  34. package/src/components/command.tsx +0 -155
  35. package/src/components/context-menu.tsx +0 -198
  36. package/src/components/count-down.tsx +0 -83
  37. package/src/components/custom-notification.tsx +0 -95
  38. package/src/components/dialog.tsx +0 -158
  39. package/src/components/drawer.tsx +0 -116
  40. package/src/components/dropdown-menu.tsx +0 -196
  41. package/src/components/energy-progress.tsx +0 -55
  42. package/src/components/form.tsx +0 -201
  43. package/src/components/group.tsx +0 -9
  44. package/src/components/guide.tsx +0 -243
  45. package/src/components/icon.tsx +0 -96
  46. package/src/components/icons/index.tsx +0 -13
  47. package/src/components/icons/outline/ArrowLeftIcon.tsx +0 -28
  48. package/src/components/icons/outline/ArrowUpTrayIcon.tsx +0 -28
  49. package/src/components/icons/outline/CheckCircleIcon.tsx +0 -27
  50. package/src/components/icons/outline/ConfigIcon.tsx +0 -42
  51. package/src/components/icons/outline/DownIcon.tsx +0 -18
  52. package/src/components/icons/outline/FilterIcon.tsx +0 -20
  53. package/src/components/icons/outline/PencilSquareIcon.tsx +0 -28
  54. package/src/components/icons/outline/WindowIcon.tsx +0 -26
  55. package/src/components/icons/solid/CaretDownIcon.tsx +0 -22
  56. package/src/components/icons/solid/CodeIcon.tsx +0 -25
  57. package/src/components/icons/solid/DragIcon.tsx +0 -24
  58. package/src/components/icons/solid/PhoneIcon.tsx +0 -29
  59. package/src/components/icons/solid/RectangleGroupIcon.tsx +0 -26
  60. package/src/components/image.tsx +0 -151
  61. package/src/components/input.tsx +0 -118
  62. package/src/components/label.tsx +0 -26
  63. package/src/components/link.tsx +0 -123
  64. package/src/components/marquee/index.css +0 -15
  65. package/src/components/marquee/marquee.tsx +0 -220
  66. package/src/components/masonry.tsx +0 -138
  67. package/src/components/menubar.tsx +0 -234
  68. package/src/components/mobile/m-tooltip.tsx +0 -34
  69. package/src/components/modal.tsx +0 -561
  70. package/src/components/navigation-bar.tsx +0 -100
  71. package/src/components/number-input.tsx +0 -143
  72. package/src/components/page-content.tsx +0 -16
  73. package/src/components/popover.tsx +0 -191
  74. package/src/components/progress.tsx +0 -80
  75. package/src/components/radio-group.tsx +0 -44
  76. package/src/components/scroll-area.tsx +0 -49
  77. package/src/components/search-bar.tsx +0 -140
  78. package/src/components/secondary-navigation-bar.tsx +0 -328
  79. package/src/components/select.tsx +0 -273
  80. package/src/components/separator.tsx +0 -31
  81. package/src/components/sheet.tsx +0 -143
  82. package/src/components/skeleton.tsx +0 -20
  83. package/src/components/slider.tsx +0 -160
  84. package/src/components/spinner.tsx +0 -50
  85. package/src/components/swiper/index.module.scss +0 -88
  86. package/src/components/swiper/index.tsx +0 -319
  87. package/src/components/switch.tsx +0 -67
  88. package/src/components/tabs.tsx +0 -325
  89. package/src/components/textarea.tsx +0 -71
  90. package/src/components/toast/toast.tsx +0 -182
  91. package/src/components/toast/toaster.tsx +0 -160
  92. package/src/components/toast/use-toast.tsx +0 -248
  93. package/src/components/toggle-group.tsx +0 -64
  94. package/src/components/toggle.tsx +0 -46
  95. package/src/components/tooltip.tsx +0 -283
  96. package/src/components/typography.tsx +0 -437
  97. package/src/index.ts +0 -70
  98. package/src/lib/utils.ts +0 -62
  99. package/src/stories/Accordion.stories.tsx +0 -64
  100. package/src/stories/AccordionItem.stories.tsx +0 -48
  101. package/src/stories/Avatar.stories.ts +0 -58
  102. package/src/stories/Badge.stories.tsx +0 -40
  103. package/src/stories/BannerSwiper.stories.tsx +0 -102
  104. package/src/stories/Button.stories.tsx +0 -543
  105. package/src/stories/Checkbox.stories.tsx +0 -161
  106. package/src/stories/Configure.mdx +0 -341
  107. package/src/stories/CssProperties.mdx +0 -30
  108. package/src/stories/Description.stories.ts +0 -70
  109. package/src/stories/Display.stories.ts +0 -64
  110. package/src/stories/FeaturedSwiper.stories.tsx +0 -6978
  111. package/src/stories/GridSwiper.stories.tsx +0 -1407
  112. package/src/stories/Guide.stories.tsx +0 -247
  113. package/src/stories/Heading.stories.ts +0 -89
  114. package/src/stories/Icon.stories.ts +0 -77
  115. package/src/stories/IconButton.stories.tsx +0 -301
  116. package/src/stories/IconTextButton.stories.ts +0 -59
  117. package/src/stories/Image.stories.ts +0 -55
  118. package/src/stories/Input.stories.tsx +0 -203
  119. package/src/stories/Modal.stories.tsx +0 -144
  120. package/src/stories/NavigationBar.stories.tsx +0 -81
  121. package/src/stories/Notification.stories.tsx +0 -276
  122. package/src/stories/Popover.stories.tsx +0 -100
  123. package/src/stories/SearchBar.stories.ts +0 -43
  124. package/src/stories/SecondaryNavigationBar.stories.tsx +0 -199
  125. package/src/stories/Select.stories.tsx +0 -107
  126. package/src/stories/Separator.stories.tsx +0 -49
  127. package/src/stories/Spinner.stories.tsx +0 -48
  128. package/src/stories/SubHeading.stories.ts +0 -64
  129. package/src/stories/Swich.stories.tsx +0 -69
  130. package/src/stories/Tabs.stories.tsx +0 -90
  131. package/src/stories/Text.stories.ts +0 -78
  132. package/src/stories/Textarea.stories.tsx +0 -155
  133. package/src/stories/Toast.stories.tsx +0 -424
  134. package/src/stories/Tooltip.stories.tsx +0 -244
  135. package/src/stories/ViewAutoSwiper.stories.tsx +0 -1408
  136. package/src/styles/components-dark.scss +0 -212
  137. package/src/styles/components-light.scss +0 -210
  138. package/src/styles/design-dark.scss +0 -330
  139. package/src/styles/design-light.scss +0 -345
  140. package/src/styles/design2-dark.scss +0 -319
  141. package/src/styles/design2-light.scss +0 -364
  142. package/src/styles/font.css +0 -19
  143. package/src/styles/global.scss +0 -251
  144. package/src/styles/md-viewer.scss +0 -155
  145. package/src/styles/new-tokens.scss +0 -255
  146. package/src/styles/tokens.scss +0 -401
  147. package/src/types/scss.d.ts +0 -24
@@ -1,64 +0,0 @@
1
- 'use client';
2
-
3
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
4
- import { type VariantProps } from 'class-variance-authority';
5
- import * as React from 'react';
6
-
7
- import { toggleVariants } from './toggle';
8
- import { cn } from '@/lib/utils';
9
-
10
- const ToggleGroupContext = React.createContext<
11
- VariantProps<typeof toggleVariants>
12
- >({
13
- size: 'default',
14
- variant: 'default',
15
- });
16
-
17
- const ToggleGroup = React.forwardRef<
18
- React.ElementRef<typeof ToggleGroupPrimitive.Root>,
19
- React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
20
- VariantProps<typeof toggleVariants>
21
- >(({ className, variant, size, children, ...props }, ref) => (
22
- <ToggleGroupPrimitive.Root
23
- ref={ref}
24
- className={cn(
25
- 'flex items-center justify-center gap-1 p-0.5 rounded-md border border-Colors-Border-Default bg-Colors-Background-Neutral-Primary-Default',
26
- className
27
- )}
28
- {...props}
29
- >
30
- <ToggleGroupContext.Provider value={{ variant, size }}>
31
- {children}
32
- </ToggleGroupContext.Provider>
33
- </ToggleGroupPrimitive.Root>
34
- ));
35
-
36
- ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
37
-
38
- const ToggleGroupItem = React.forwardRef<
39
- React.ElementRef<typeof ToggleGroupPrimitive.Item>,
40
- React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
41
- VariantProps<typeof toggleVariants>
42
- >(({ className, children, variant, size, ...props }, ref) => {
43
- const context = React.useContext(ToggleGroupContext);
44
-
45
- return (
46
- <ToggleGroupPrimitive.Item
47
- ref={ref}
48
- className={cn(
49
- toggleVariants({
50
- variant: context.variant || variant,
51
- size: context.size || size,
52
- }),
53
- className
54
- )}
55
- {...props}
56
- >
57
- {children}
58
- </ToggleGroupPrimitive.Item>
59
- );
60
- });
61
-
62
- ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
63
-
64
- export { ToggleGroup, ToggleGroupItem };
@@ -1,46 +0,0 @@
1
- 'use client';
2
-
3
- import * as TogglePrimitive from '@radix-ui/react-toggle';
4
- import { cva, type VariantProps } from 'class-variance-authority';
5
- import * as React from 'react';
6
-
7
- import { cn } from '@/lib/utils';
8
-
9
- const toggleVariants = cva(
10
- 'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white text-Colors-Text-Subtlest hover:bg-slate-100 hover:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-Colors-Background-Normal-Primary-Active data-[state=on]:text-Colors-Text-Brand-Default [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2 dark:ring-offset-slate-950 dark:hover:bg-slate-800 dark:hover:text-Colors-Text-Brand-Default dark:focus-visible:ring-slate-300 dark:data-[state=on]:bg-Colors-Background-Normal-Primary-Active dark:data-[state=on]:text-Colors-Text-Brand-Default',
11
- {
12
- variants: {
13
- variant: {
14
- default: 'bg-transparent',
15
- outline:
16
- 'border border-slate-200 bg-transparent hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:hover:bg-slate-800 dark:hover:text-slate-50',
17
- },
18
- size: {
19
- default: 'h-10 px-3 min-w-10',
20
- sm: 'h-9 px-2.5 min-w-9',
21
- lg: 'h-11 px-5 min-w-11',
22
- xs: 'h-5 min-w-8 text-xs px-3',
23
- },
24
- },
25
- defaultVariants: {
26
- variant: 'default',
27
- size: 'default',
28
- },
29
- }
30
- );
31
-
32
- const Toggle = React.forwardRef<
33
- React.ElementRef<typeof TogglePrimitive.Root>,
34
- React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
35
- VariantProps<typeof toggleVariants>
36
- >(({ className, variant, size, ...props }, ref) => (
37
- <TogglePrimitive.Root
38
- ref={ref}
39
- className={cn(toggleVariants({ variant, size, className }))}
40
- {...props}
41
- />
42
- ));
43
-
44
- Toggle.displayName = TogglePrimitive.Root.displayName;
45
-
46
- export { Toggle, toggleVariants };
@@ -1,283 +0,0 @@
1
- /* eslint-disable react/jsx-no-useless-fragment */
2
-
3
- 'use client';
4
-
5
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
6
- import * as React from 'react';
7
-
8
- import { cn } from '@/lib/utils';
9
-
10
- import { Popover } from './popover';
11
- import { Description } from './typography';
12
- import { useMedia } from 'react-use';
13
-
14
- const TooltipProvider = TooltipPrimitive.Provider;
15
-
16
- const TooltipTrigger = TooltipPrimitive.Trigger;
17
- const TooltipArrow = TooltipPrimitive.Arrow;
18
-
19
- const Tooltip = React.forwardRef<
20
- React.ElementRef<typeof TooltipPrimitive.Root>,
21
- React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root> & {
22
- /**
23
- * 文案大小
24
- */
25
- size?: 'sm' | 'md';
26
-
27
- /**
28
- * 气泡是否打开
29
- */
30
- open?: boolean;
31
- /**
32
- * 气泡是否默认打开
33
- */
34
- defaultOpen?: boolean;
35
- /**
36
- * 气泡是否禁用
37
- */
38
- disabled?: boolean;
39
- /**
40
- * 气泡标题
41
- */
42
- title?: string;
43
- /**
44
- * 气泡标题是否危险
45
- */
46
- titleDangerous?: boolean;
47
- /**
48
- * 气泡描述
49
- */
50
- description?: string | React.ReactNode;
51
- /**
52
- * 气泡描述是否危险
53
- */
54
- descriptionDangerous?: boolean;
55
- /**
56
- * 气泡样式类型
57
- *
58
- *
59
- * @default 'default'
60
- */
61
- variant?: 'default' | 'info' | 'message';
62
- /**
63
- * 气泡方向
64
- *
65
- * @default 'top'
66
- */
67
- side?: 'top' | 'right' | 'bottom' | 'left';
68
- /**
69
- * 气泡箭头位置
70
- *
71
- * @default 'center'
72
- */
73
- align?: 'start' | 'center' | 'end';
74
- /**
75
- * 内容偏移量
76
- *
77
- * @default 6
78
- */
79
- sideOffset?: number;
80
- /**
81
- * 箭头偏移量
82
- *
83
- * @default -2
84
- */
85
- alignOffset?: number;
86
- /**
87
- * 箭头样式
88
- */
89
- arrowClassName?: string;
90
- /**
91
- * 是否显示箭头
92
- *
93
- * @default true
94
- */
95
- showArrow?: boolean;
96
- /**
97
- * 内容样式
98
- */
99
- contentClassName?: string;
100
- /**
101
- * 触发器样式
102
- */
103
- triggerClassName?: string;
104
- }
105
- >(
106
- (
107
- {
108
- open,
109
- defaultOpen,
110
- disabled = false,
111
- children,
112
- title,
113
- description,
114
- size = 'sm',
115
- titleDangerous = false,
116
- descriptionDangerous = false,
117
- contentClassName,
118
- triggerClassName,
119
- ...props
120
- },
121
- ref
122
- ) => {
123
- const isDesktop = !useMedia('(max-width: 768px)');
124
- const defaultTitleColor =
125
- props.variant === 'message'
126
- ? 'static'
127
- : props.variant === 'default'
128
- ? 'warning-bolder'
129
- : 'default';
130
- const defaultDescColor =
131
- props.variant === 'message'
132
- ? 'static'
133
- : props.variant === 'info'
134
- ? 'warning-bolder'
135
- : 'default';
136
-
137
- if (disabled) {
138
- return <>{children}</>;
139
- }
140
- return (
141
- <>
142
- {isDesktop ? (
143
- <TooltipProvider>
144
- <TooltipPrimitive.Root
145
- open={disabled || (!description && !title) ? false : open}
146
- defaultOpen={defaultOpen}
147
- >
148
- <TooltipTrigger asChild>
149
- <div className={cn('cursor-pointer', triggerClassName)}>
150
- {children}
151
- </div>
152
- </TooltipTrigger>
153
- <TooltipContent ref={ref} className={contentClassName} {...props}>
154
- {title && (
155
- <p className="mb-1">
156
- <Description
157
- size="lg"
158
- weight="medium"
159
- color={defaultTitleColor}
160
- dangerous={titleDangerous}
161
- className={cn(
162
- 'text-wrap text-inherit',
163
- size === 'md' && 'text-sm'
164
- )}
165
- >
166
- {title}
167
- </Description>
168
- </p>
169
- )}
170
- {description && (
171
- <Description
172
- size="lg"
173
- weight={title ? 'regular' : 'medium'}
174
- color={title ? 'subtle' : defaultDescColor}
175
- dangerous={descriptionDangerous}
176
- className={cn(
177
- 'text-wrap text-inherit',
178
- size === 'md' && 'text-sm'
179
- )}
180
- >
181
- {description}
182
- </Description>
183
- )}
184
- </TooltipContent>
185
- </TooltipPrimitive.Root>
186
- </TooltipProvider>
187
- ) : (
188
- <Popover
189
- open={open}
190
- title={title}
191
- content={description}
192
- disabled={disabled}
193
- triggerClassName={triggerClassName}
194
- className={cn(contentClassName, size === 'md' && 'text-sm')}
195
- isMTooltip
196
- {...props}
197
- >
198
- {children}
199
- </Popover>
200
- )}
201
- </>
202
- );
203
- }
204
- );
205
- Tooltip.displayName = TooltipPrimitive.Root.displayName;
206
-
207
- const TooltipContent = React.forwardRef<
208
- React.ElementRef<typeof TooltipPrimitive.Content>,
209
- React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {
210
- showArrow?: boolean;
211
- variant?: 'default' | 'info' | 'message';
212
- /**
213
- * 气泡方向
214
- */
215
- side?: 'top' | 'right' | 'bottom' | 'left';
216
- /**
217
- * 气泡箭头位置
218
- *
219
- */
220
- align?: 'start' | 'center' | 'end';
221
-
222
- /**
223
- * 箭头样式
224
- */
225
- arrowClassName?: string;
226
- }
227
- >(
228
- (
229
- {
230
- className,
231
- variant = 'default',
232
- align = 'center',
233
- side = 'top',
234
- sideOffset = 6,
235
- alignOffset = 0,
236
- showArrow = true,
237
- arrowClassName,
238
- ...props
239
- },
240
- ref
241
- ) => (
242
- <TooltipPrimitive.Content
243
- ref={ref}
244
- align={align}
245
- sideOffset={sideOffset}
246
- alignOffset={alignOffset}
247
- side={side}
248
- className={cn(
249
- 'relative z-[49] mx-4 w-fit max-w-72 rounded-lg px-3 py-2 text-left text-xs shadow-modal-bolder',
250
- 'outline-none delay-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 [&[data-state=open]>span]:animate-none',
251
- 'data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 [&[data-state=delayed-open]>span]:animate-none',
252
- 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
253
- 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
254
- variant === 'default'
255
- ? 'bg-cc-Tooltip-bg-default text-cc-Tooltip-fg-default border border-cc-Tooltip-border-default'
256
- : variant === 'info'
257
- ? 'bg-surface-accent-yellow-subtle text-Colors-Text-Warning-Bolder'
258
- : 'bg-Colors-Utility-Lake-Blue-50 text-cc-Tooltip-fg-default',
259
- className
260
- )}
261
- {...props}
262
- >
263
- {props.children}
264
- {showArrow && (
265
- <TooltipArrow
266
- width={12}
267
- height={6}
268
- className={cn(
269
- variant === 'default'
270
- ? 'fill-cc-Tooltip-bg-default stroke-cc-Tooltip-border-default -ml-[0.5px]'
271
- : variant === 'info'
272
- ? 'fill-surface-accent-yellow-subtle'
273
- : 'fill-Colors-Utility-Lake-Blue-50',
274
- arrowClassName
275
- )}
276
- />
277
- )}
278
- </TooltipPrimitive.Content>
279
- )
280
- );
281
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
282
-
283
- export { Tooltip, TooltipProvider };