Skip to content

Commit 10ebd17

Browse files
committed
fix: make linter happy
1 parent 1edc865 commit 10ebd17

File tree

4 files changed

+66
-54
lines changed

4 files changed

+66
-54
lines changed

components/ui/shadcn-io/code-tabs/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
TabsContents,
1313
useTabs,
1414
type TabsProps,
15-
} from '@repo/tabs';
16-
import { CopyButton } from '@repo/copy-button';
15+
} from '@/components/ui/shadcn-io/tabs';
16+
import { CopyButton } from '@/components/ui/shadcn-io/copy-button';
1717

1818
type CodeTabsProps = {
1919
codes: Record<string, string>;

components/ui/shadcn-io/tabs/index.tsx

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use client';
22

33
import * as React from 'react';
4-
import { motion, type Transition, type HTMLMotionProps } from 'motion/react';
4+
import {motion, type Transition, type HTMLMotionProps} from 'motion/react';
55

6-
import { cn } from '@/lib/utils';
6+
import {cn} from '@/lib/utils';
77
import {
88
MotionHighlight,
99
MotionHighlightItem,
10-
} from '@repo/motion-highlight';
10+
} from '@/components/ui/shadcn-io/motion-highlight';
1111

1212
// Tabs Component
1313
type TabsContextType<T extends string> = {
@@ -50,13 +50,13 @@ type TabsProps<T extends string = string> =
5050
| ControlledTabsProps<T>;
5151

5252
function Tabs<T extends string = string>({
53-
defaultValue,
54-
value,
55-
onValueChange,
56-
children,
57-
className,
58-
...props
59-
}: TabsProps<T>) {
53+
defaultValue,
54+
value,
55+
onValueChange,
56+
children,
57+
className,
58+
...props
59+
}: TabsProps<T>) {
6060
const [activeValue, setActiveValue] = React.useState<T | undefined>(
6161
defaultValue ?? undefined,
6262
);
@@ -120,17 +120,17 @@ type TabsListProps = React.ComponentProps<'div'> & {
120120
};
121121

122122
function TabsList({
123-
children,
124-
className,
125-
activeClassName,
126-
transition = {
127-
type: 'spring',
128-
stiffness: 200,
129-
damping: 25,
130-
},
131-
...props
132-
}: TabsListProps) {
133-
const { activeValue } = useTabs();
123+
children,
124+
className,
125+
activeClassName,
126+
transition = {
127+
type: 'spring',
128+
stiffness: 200,
129+
damping: 25,
130+
},
131+
...props
132+
}: TabsListProps) {
133+
const {activeValue} = useTabs();
134134

135135
return (
136136
<MotionHighlight
@@ -160,13 +160,13 @@ type TabsTriggerProps = HTMLMotionProps<'button'> & {
160160
};
161161

162162
function TabsTrigger({
163-
ref,
164-
value,
165-
children,
166-
className,
167-
...props
168-
}: TabsTriggerProps) {
169-
const { activeValue, handleValueChange, registerTrigger } = useTabs();
163+
ref,
164+
value,
165+
children,
166+
className,
167+
...props
168+
}: TabsTriggerProps) {
169+
const {activeValue, handleValueChange, registerTrigger} = useTabs();
170170

171171
const localRef = React.useRef<HTMLButtonElement | null>(null);
172172
React.useImperativeHandle(ref, () => localRef.current as HTMLButtonElement);
@@ -182,7 +182,7 @@ function TabsTrigger({
182182
ref={localRef}
183183
data-slot="tabs-trigger"
184184
role="tab"
185-
whileTap={{ scale: 0.95 }}
185+
whileTap={{scale: 0.95}}
186186
onClick={() => handleValueChange(value)}
187187
data-state={activeValue === value ? 'active' : 'inactive'}
188188
className={cn(
@@ -203,18 +203,18 @@ type TabsContentsProps = React.ComponentProps<'div'> & {
203203
};
204204

205205
function TabsContents({
206-
children,
207-
className,
208-
transition = {
209-
type: 'spring',
210-
stiffness: 300,
211-
damping: 30,
212-
bounce: 0,
213-
restDelta: 0.01,
214-
},
215-
...props
216-
}: TabsContentsProps) {
217-
const { activeValue } = useTabs();
206+
children,
207+
className,
208+
transition = {
209+
type: 'spring',
210+
stiffness: 300,
211+
damping: 30,
212+
bounce: 0,
213+
restDelta: 0.01,
214+
},
215+
...props
216+
}: TabsContentsProps) {
217+
const {activeValue} = useTabs();
218218
const childrenArray = React.Children.toArray(children);
219219
const activeIndex = childrenArray.findIndex(
220220
(child): child is React.ReactElement<{ value: string }> =>
@@ -233,7 +233,7 @@ function TabsContents({
233233
>
234234
<motion.div
235235
className="flex -mx-2"
236-
animate={{ x: activeIndex * -100 + '%' }}
236+
animate={{x: activeIndex * -100 + '%'}}
237237
transition={transition}
238238
>
239239
{childrenArray.map((child, index) => (
@@ -252,22 +252,22 @@ type TabsContentProps = HTMLMotionProps<'div'> & {
252252
};
253253

254254
function TabsContent({
255-
children,
256-
value,
257-
className,
258-
...props
259-
}: TabsContentProps) {
260-
const { activeValue } = useTabs();
255+
children,
256+
value,
257+
className,
258+
...props
259+
}: TabsContentProps) {
260+
const {activeValue} = useTabs();
261261
const isActive = activeValue === value;
262262
return (
263263
<motion.div
264264
role="tabpanel"
265265
data-slot="tabs-content"
266266
className={cn('overflow-hidden', className)}
267-
initial={{ filter: 'blur(0px)' }}
268-
animate={{ filter: isActive ? 'blur(0px)' : 'blur(4px)' }}
269-
exit={{ filter: 'blur(0px)' }}
270-
transition={{ type: 'spring', stiffness: 200, damping: 25 }}
267+
initial={{filter: 'blur(0px)'}}
268+
animate={{filter: isActive ? 'blur(0px)' : 'blur(4px)'}}
269+
exit={{filter: 'blur(0px)'}}
270+
transition={{type: 'spring', stiffness: 200, damping: 25}}
271271
{...props}
272272
>
273273
{children}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@radix-ui/react-slot": "^1.2.3",
1919
"@radix-ui/react-tabs": "^1.1.13",
2020
"@radix-ui/react-use-controllable-state": "^1.2.2",
21+
"@shikijs/transformers": "^3.13.0",
2122
"class-variance-authority": "^0.7.1",
2223
"clsx": "^2.1.1",
2324
"geist": "^1.5.1",

pnpm-lock.yaml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)