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,143 @@
1
+ 'use client';
2
+
3
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
4
+ import { cva, type VariantProps } from 'class-variance-authority';
5
+ import { X } from 'lucide-react';
6
+ import * as React from 'react';
7
+
8
+ import { cn } from '@/lib/utils';
9
+
10
+ const Sheet = SheetPrimitive.Root;
11
+
12
+ const SheetTrigger = SheetPrimitive.Trigger;
13
+
14
+ const SheetClose = SheetPrimitive.Close;
15
+
16
+ const SheetPortal = SheetPrimitive.Portal;
17
+
18
+ const SheetOverlay = React.forwardRef<
19
+ React.ElementRef<typeof SheetPrimitive.Overlay>,
20
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
21
+ >(({ className, ...props }, ref) => (
22
+ <SheetPrimitive.Overlay
23
+ className={cn(
24
+ 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
25
+ className
26
+ )}
27
+ {...props}
28
+ ref={ref}
29
+ />
30
+ ));
31
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
32
+
33
+ const sheetVariants = cva(
34
+ 'fixed z-50 gap-4 bg-white p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:bg-slate-950',
35
+ {
36
+ variants: {
37
+ side: {
38
+ top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
39
+ bottom:
40
+ 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
41
+ left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
42
+ right:
43
+ 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
44
+ },
45
+ },
46
+ defaultVariants: {
47
+ side: 'right',
48
+ },
49
+ }
50
+ );
51
+
52
+ interface SheetContentProps
53
+ extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
54
+ VariantProps<typeof sheetVariants> {}
55
+
56
+ const SheetContent = React.forwardRef<
57
+ React.ElementRef<typeof SheetPrimitive.Content>,
58
+ SheetContentProps
59
+ >(({ side = 'right', className, children, ...props }, ref) => (
60
+ <SheetPortal>
61
+ <SheetOverlay />
62
+ <SheetPrimitive.Content
63
+ ref={ref}
64
+ className={cn(sheetVariants({ side }), className)}
65
+ {...props}
66
+ >
67
+ {children}
68
+ <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 dark:ring-offset-slate-950 dark:focus:ring-slate-300 dark:data-[state=open]:bg-slate-800">
69
+ <X className="h-4 w-4" />
70
+ <span className="sr-only">Close</span>
71
+ </SheetPrimitive.Close>
72
+ </SheetPrimitive.Content>
73
+ </SheetPortal>
74
+ ));
75
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
76
+
77
+ const SheetHeader = ({
78
+ className,
79
+ ...props
80
+ }: React.HTMLAttributes<HTMLDivElement>) => (
81
+ <div
82
+ className={cn(
83
+ 'flex flex-col space-y-2 text-center sm:text-left',
84
+ className
85
+ )}
86
+ {...props}
87
+ />
88
+ );
89
+ SheetHeader.displayName = 'SheetHeader';
90
+
91
+ const SheetFooter = ({
92
+ className,
93
+ ...props
94
+ }: React.HTMLAttributes<HTMLDivElement>) => (
95
+ <div
96
+ className={cn(
97
+ 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
98
+ className
99
+ )}
100
+ {...props}
101
+ />
102
+ );
103
+ SheetFooter.displayName = 'SheetFooter';
104
+
105
+ const SheetTitle = React.forwardRef<
106
+ React.ElementRef<typeof SheetPrimitive.Title>,
107
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
108
+ >(({ className, ...props }, ref) => (
109
+ <SheetPrimitive.Title
110
+ ref={ref}
111
+ className={cn(
112
+ 'text-lg font-semibold text-slate-950 dark:text-slate-50',
113
+ className
114
+ )}
115
+ {...props}
116
+ />
117
+ ));
118
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
119
+
120
+ const SheetDescription = React.forwardRef<
121
+ React.ElementRef<typeof SheetPrimitive.Description>,
122
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
123
+ >(({ className, ...props }, ref) => (
124
+ <SheetPrimitive.Description
125
+ ref={ref}
126
+ className={cn('text-sm text-slate-500 dark:text-slate-400', className)}
127
+ {...props}
128
+ />
129
+ ));
130
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
131
+
132
+ export {
133
+ Sheet,
134
+ SheetPortal,
135
+ SheetOverlay,
136
+ SheetTrigger,
137
+ SheetClose,
138
+ SheetContent,
139
+ SheetHeader,
140
+ SheetFooter,
141
+ SheetTitle,
142
+ SheetDescription,
143
+ };
@@ -0,0 +1,20 @@
1
+ import { cn } from '@/lib/utils';
2
+
3
+ function Skeleton({
4
+ className,
5
+ animate = true,
6
+ ...props
7
+ }: React.HTMLAttributes<HTMLDivElement> & { animate?: boolean }) {
8
+ return (
9
+ <div
10
+ className={cn(
11
+ 'rounded-md bg-Colors-Background-Normal-Secondary-Default',
12
+ className,
13
+ animate && 'animate-pulse'
14
+ )}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ export { Skeleton };
@@ -0,0 +1,160 @@
1
+ 'use client';
2
+
3
+ import * as SliderPrimitive from '@radix-ui/react-slider';
4
+ import * as React from 'react';
5
+ import { ClassNameValue } from 'tailwind-merge';
6
+
7
+ import { cn } from '@/lib/utils';
8
+
9
+ import { NumberInput } from './number-input';
10
+
11
+ type Size = 'sm' | 'lg';
12
+ const Slider = React.forwardRef<
13
+ React.ElementRef<typeof SliderPrimitive.Root>,
14
+ React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> & {
15
+ size?: Size;
16
+ }
17
+ >(({ className, size = 'lg', ...props }, ref) => (
18
+ <div className="w-full p-3 flex justify-center items-center h-10 rounded-lg border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active shadow-background-default text-sm text-Colors-Text-Default ring-offset-cc-Focus-Rings-Brand-default hover:border-hovered hover:bg-surface-subtle aria-[invalid=true]:border-critical aria-[invalid=true]:hover:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-surface-accent-red-subtlest aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30">
19
+ <SliderPrimitive.Root
20
+ ref={ref}
21
+ className={cn(
22
+ 'relative flex w-full touch-none select-none items-center',
23
+ className
24
+ )}
25
+ {...props}
26
+ >
27
+ <SliderPrimitive.Track
28
+ className={cn(
29
+ 'relative w-full grow overflow-hidden rounded-full bg-Colors-Background-Neutral-Primary-Hover data-[disabled]:opacity-30',
30
+ size === 'sm' ? 'h-0.5' : 'h-1.5'
31
+ )}
32
+ >
33
+ <SliderPrimitive.Range className="absolute h-full bg-Colors-Background-Brand-Default data-[disabled]:opacity-30" />
34
+ </SliderPrimitive.Track>
35
+ <SliderPrimitive.Thumb
36
+ className={cn(
37
+ 'block rounded-full border-Colors-Utility-Lake-Blue-40 bg-Colors-Background-Normal-Primary-Default ring-offset-cc-Focus-Rings-Brand-default transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 data-[disabled]:pointer-events-none data-[disabled]:opacity-30',
38
+ size === 'sm' ? 'w-2 h-2 border-[1.5px]' : 'w-5 h-5 border-[3px]'
39
+ )}
40
+ />
41
+ </SliderPrimitive.Root>
42
+ </div>
43
+ ));
44
+ Slider.displayName = SliderPrimitive.Root.displayName;
45
+
46
+ interface ISliderBaseProps
47
+ extends React.RefAttributes<HTMLSpanElement>,
48
+ Omit<
49
+ SliderPrimitive.SliderProps,
50
+ 'value' | 'defaultValue' | 'onValueChange' | 'onValueCommit'
51
+ > {}
52
+
53
+ interface ISliderSingleProps extends ISliderBaseProps {
54
+ size?: Size;
55
+ value?: number;
56
+ defaultValue?: number;
57
+ onValueChange?: (value: number) => void;
58
+ onValueCommit?: (value: number) => void;
59
+ // 是否展示输入框设置器
60
+ settable?: boolean;
61
+ // 容器样式
62
+ containerClassName?: ClassNameValue;
63
+ // 轨道样式
64
+ trackClassName?: ClassNameValue;
65
+ // 已选范围样式
66
+ rangeClassName?: ClassNameValue;
67
+ // 滑块样式
68
+ thumbClassName?: ClassNameValue;
69
+ }
70
+
71
+ const SliderSingle = React.forwardRef<
72
+ React.ElementRef<React.ForwardRefExoticComponent<ISliderSingleProps>>,
73
+ React.ComponentPropsWithoutRef<
74
+ React.ForwardRefExoticComponent<ISliderSingleProps>
75
+ >
76
+ >(
77
+ (
78
+ {
79
+ className,
80
+ containerClassName,
81
+ trackClassName,
82
+ rangeClassName,
83
+ thumbClassName,
84
+ size = 'lg',
85
+ value,
86
+ defaultValue,
87
+ onValueChange,
88
+ onValueCommit,
89
+ settable = true,
90
+ ...props
91
+ },
92
+ ref
93
+ ) => (
94
+ <div className="flex w-full items-center space-x-1.5">
95
+ <div
96
+ className={cn(
97
+ 'w-full p-3 flex justify-center items-center h-10 rounded-lg border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active shadow-background-default text-sm text-Colors-Text-Default ring-offset-cc-Focus-Rings-Brand-default hover:border-hovered hover:bg-surface-subtle aria-[invalid=true]:border-critical aria-[invalid=true]:hover:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-surface-accent-red-subtlest aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30',
98
+ containerClassName
99
+ )}
100
+ >
101
+ <SliderPrimitive.Root
102
+ ref={ref}
103
+ className={cn(
104
+ 'relative flex w-full touch-none select-none items-center',
105
+ className
106
+ )}
107
+ value={typeof value === 'number' ? [value] : value}
108
+ defaultValue={
109
+ typeof defaultValue === 'number' ? [defaultValue] : defaultValue
110
+ }
111
+ onValueChange={(rootValue: number[]) =>
112
+ onValueChange?.(rootValue?.[0])
113
+ }
114
+ onValueCommit={(rootValue: number[]) =>
115
+ onValueCommit?.(rootValue?.[0])
116
+ }
117
+ {...props}
118
+ >
119
+ <SliderPrimitive.Track
120
+ className={cn(
121
+ 'relative w-full grow overflow-hidden rounded-full bg-Colors-Background-Neutral-Primary-Hover data-[disabled]:opacity-30',
122
+ size === 'sm' ? 'h-0.5' : 'h-1.5',
123
+ trackClassName
124
+ )}
125
+ >
126
+ <SliderPrimitive.Range
127
+ className={cn(
128
+ 'absolute h-full bg-Colors-Background-Brand-Default data-[disabled]:opacity-30',
129
+ rangeClassName
130
+ )}
131
+ />
132
+ </SliderPrimitive.Track>
133
+ <SliderPrimitive.Thumb
134
+ className={cn(
135
+ 'cursor-pointer block rounded-full border-Colors-Utility-Lake-Blue-40 bg-Colors-Background-Normal-Primary-Default ring-offset-cc-Focus-Rings-Brand-default transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 data-[disabled]:pointer-events-none data-[disabled]:opacity-30',
136
+ size === 'sm' ? 'w-2 h-2 border-[1.5px]' : 'w-5 h-5 border-[3px]',
137
+ thumbClassName
138
+ )}
139
+ />
140
+ </SliderPrimitive.Root>
141
+ </div>
142
+ {settable && (
143
+ <div className="flex-shrink-0 w-14 h-9 flex justify-center items-center rounded-lg">
144
+ <NumberInput
145
+ value={value}
146
+ min={props?.min}
147
+ max={props?.max}
148
+ step={props?.step}
149
+ controls={false}
150
+ defaultValue={defaultValue}
151
+ onChange={(e) => onValueChange?.(Number(e.target.value))}
152
+ />
153
+ </div>
154
+ )}
155
+ </div>
156
+ )
157
+ );
158
+ SliderSingle.displayName = 'SliderSingle';
159
+
160
+ export { Slider, SliderSingle };
@@ -0,0 +1,48 @@
1
+ import { VariantProps, cva } from 'class-variance-authority';
2
+ import { Loader2 } from 'lucide-react';
3
+ import { ClassNameValue } from 'tailwind-merge';
4
+
5
+ import { cn } from '@/lib/utils';
6
+
7
+ const spinnerVariants = cva('animate-spin', {
8
+ variants: {
9
+ size: {
10
+ '2xs': 'h-3.5 w-3.5',
11
+ xs: 'h-4 w-4',
12
+ sm: 'h-5 w-5',
13
+ md: 'h-6 w-6',
14
+ xl: 'h-7 w-7',
15
+ lg: 'h-9 w-9',
16
+ },
17
+ speed: {
18
+ slow: 'duration-2000',
19
+ default: 'duration-600',
20
+ fast: 'duration-500',
21
+ },
22
+ color: {
23
+ default: 'text-Colors-Text-Default',
24
+ brand: 'text-Colors-Text-Brand-Default',
25
+ static: 'text-Colors-Text-Static-White',
26
+ warning: 'text-Colors-Text-Warning-Default',
27
+ success: 'text-Colors-Text-Success-Default',
28
+ },
29
+ },
30
+ defaultVariants: {
31
+ size: 'md',
32
+ speed: 'default',
33
+ color: 'default',
34
+ },
35
+ });
36
+ interface SpinnerProps extends VariantProps<typeof spinnerVariants> {
37
+ className?: ClassNameValue;
38
+ }
39
+
40
+ export default function Spinner(props: SpinnerProps) {
41
+ const { size, speed, color, className } = props;
42
+
43
+ return (
44
+ <Loader2
45
+ className={cn(spinnerVariants({ size, speed, color }), className)}
46
+ />
47
+ );
48
+ }
@@ -0,0 +1,88 @@
1
+ .swiperBox{
2
+ @apply w-full h-fit;
3
+
4
+ :global(.swiper) {
5
+ :global(.swiper-button-prev){
6
+ @apply bg-contain bg-no-repeat;
7
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzQxNDM0NSIgY2xhc3M9InNpemUtNSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzggNS4yMmEuNzUuNzUgMCAwIDEgMCAxLjA2TDguMDYgMTBsMy43MiAzLjcyYS43NS43NSAwIDEgMS0xLjA2IDEuMDZsLTQuMjUtNC4yNWEuNzUuNzUgMCAwIDEgMC0xLjA2bDQuMjUtNC4yNWEuNzUuNzUgMCAwIDEgMS4wNiAwWiIgY2xpcC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4K');
8
+ }
9
+ :global(.swiper-button-next){
10
+ @apply bg-contain bg-no-repeat;
11
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzQxNDM0NSIgY2xhc3M9InNpemUtNSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC4yMiA1LjIyYS43NS43NSAwIDAgMSAxLjA2IDBsNC4yNSA0LjI1YS43NS43NSAwIDAgMSAwIDEuMDZsLTQuMjUgNC4yNWEuNzUuNzUgMCAwIDEtMS4wNi0xLjA2TDExLjk0IDEwIDguMjIgNi4yOGEuNzUuNzUgMCAwIDEgMC0xLjA2WiIgY2xpcC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4KCg==');
12
+ }
13
+ :global(.swiper-button-prev::after){
14
+ @apply text-icon content-none;
15
+ }
16
+ :global(.swiper-button-next::after){
17
+ @apply text-icon content-none;
18
+ }
19
+ }
20
+ :global(.swiper.banner-swiper) {
21
+ :global(.banner-swiper-slide.swiper-slide-prev) {
22
+ // transform: scale(0.8);
23
+ @apply origin-right;
24
+ }
25
+ :global(.banner-swiper-slide.swiper-slide-next) {
26
+ // transform: scale(0.8);
27
+ @apply origin-left;
28
+ }
29
+ :global(.swiper-slide-active) {
30
+ @apply opacity-100;
31
+ // transform: scale(1) translateX(0);
32
+ }
33
+ :global(.swiper-button-next){
34
+ @apply -right-4 md:right-0 3xl:right-[calc((100%-1200px)/2-16px)];
35
+ }
36
+ :global(.swiper-button-prev){
37
+ @apply -left-4 md:left-0 3xl:left-[calc((100%-1200px)/2-16px)];
38
+ }
39
+ }
40
+ :global(.swiper.feature-swiper) {
41
+ :global(.swiper-button-next){
42
+ @apply right-0;
43
+ }
44
+ :global(.swiper-button-prev){
45
+ @apply left-0;
46
+ }
47
+ :global(.swiper-button-disabled) {
48
+ @apply hidden;
49
+ }
50
+ }
51
+ :global(.swiper.patron-badge-swiper) {
52
+ :global(.swiper-button-next){
53
+ @apply right-0;
54
+ }
55
+ :global(.swiper-button-prev){
56
+ @apply left-0;
57
+ }
58
+ :global(.swiper-button-disabled) {
59
+ @apply hidden;
60
+ }
61
+ }
62
+ :global(.swiper.grid-swiper) {
63
+ :global(.swiper-wrapper) {
64
+ @apply w-[100vw] md:w-full flex-wrap flex-col m-0;
65
+ }
66
+ }
67
+ :global(.swiper) {
68
+
69
+ :global(.swiper-button-next){
70
+ @apply hidden md:flex justify-center items-center absolute top-[50%] w-8 h-8 font-semibold text-icon border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Default rounded-full cursor-pointer hover:bg-surface-hovered active:bg-Colors-Background-Normal-Primary-Active;
71
+ &::after {
72
+ @apply text-icon text-xs font-bold;
73
+ }
74
+ }
75
+ :global(.swiper-button-prev){
76
+ @apply hidden md:flex justify-center items-center absolute top-[50%] w-8 h-8 font-semibold text-icon border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Default rounded-full cursor-pointer hover:bg-surface-hovered active:bg-Colors-Background-Normal-Primary-Active;
77
+ &::after {
78
+ @apply text-icon text-xs font-bold;
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ .animate {
85
+ :global(.swiper-slide) {
86
+ transition: transform 500ms linear;
87
+ }
88
+ }