Skip to content

Commit 0216099

Browse files
committed
fix: props
1 parent 9548e84 commit 0216099

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

packages/component-library/src/SearchButton/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
display: none;
1515
}
1616
}
17-
}
17+
}

packages/component-library/src/SearchButton/index.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { Meta, StoryObj } from "@storybook/react";
44
import { SearchButton as SearchButtonComponent } from "./index.jsx";
55
import { SIZES } from "../Button/index.jsx";
66

7-
87
const iconControl = {
98
control: "select",
109
options: Object.keys(icons),
@@ -19,7 +18,7 @@ const iconControl = {
1918
const meta = {
2019
component: SearchButtonComponent,
2120
argTypes: {
22-
size: {
21+
size: {
2322
control: "inline-radio",
2423
options: SIZES,
2524
table: {
@@ -32,7 +31,6 @@ const meta = {
3231
category: "Contents",
3332
},
3433
},
35-
3634
},
3735
} satisfies Meta<typeof SearchButtonComponent>;
3836
export default meta;

packages/component-library/src/SearchButton/index.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"use client";
22

33
import { MagnifyingGlass } from '@phosphor-icons/react/dist/ssr/MagnifyingGlass';
4-
import type { ComponentProps, ReactNode } from "react";
4+
import clsx from 'clsx';
5+
import type { ReactNode } from "react";
6+
import { Button as BaseButton } from "react-aria-components";
57

8+
import type { Props as ButtonProps } from "../Button";
69
import { Button } from "../Button";
710
import styles from "./index.module.scss";
811

@@ -13,8 +16,8 @@ type OwnProps = {
1316
};
1417

1518
type Props = Pick<
16-
ComponentProps<typeof Button>,
17-
'beforeIcon' | 'size' | 'onClick'
19+
ButtonProps<typeof BaseButton>,
20+
'beforeIcon' | 'size' | 'onClick' | 'className' | 'isPending'
1821
> &
1922
OwnProps;
2023

@@ -27,7 +30,7 @@ export const SearchButton = ({
2730
return (
2831
<div className={styles.searchButton}>
2932
<Button
30-
className={styles.largeScreenSearchButton ?? ""}
33+
className={clsx(styles.largeScreenSearchButton, props.className)}
3134
variant="outline"
3235
beforeIcon={beforeIcon ?? <MagnifyingGlass />}
3336
size="sm"
@@ -38,7 +41,7 @@ export const SearchButton = ({
3841
{largeScreenContent}
3942
</Button>
4043
<Button
41-
className={styles.smallScreenSearchButton ?? ""}
44+
className={clsx(styles.smallScreenSearchButton, props.className)}
4245
hideText
4346
variant="ghost"
4447
beforeIcon={beforeIcon ?? <MagnifyingGlass />}

0 commit comments

Comments
 (0)