Skip to content

Commit 91dd3e5

Browse files
feat(icon-button): improved styles for promptOverlay variant
1 parent 7aab749 commit 91dd3e5

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

lib/components/button/icon-button.stories.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Meta, StoryObj } from '@storybook/react';
22
import { FaBoltLightning } from 'react-icons/fa6';
33

4-
import type { IconButtonProps } from './icon-button';
54
import { IconButton } from './icon-button';
65

76
const meta: Meta<typeof IconButton> = {
@@ -16,8 +15,17 @@ const meta: Meta<typeof IconButton> = {
1615
export default meta;
1716
type Story = StoryObj<typeof IconButton>;
1817

19-
const Component = (props: IconButtonProps) => {
20-
return <IconButton {...props} />;
18+
const Component = () => {
19+
return (
20+
<>
21+
<IconButton aria-label="label" variant="solid" icon={<FaBoltLightning />} />
22+
<IconButton aria-label="label" variant="ghost" icon={<FaBoltLightning />} />
23+
<IconButton aria-label="label" variant="link" icon={<FaBoltLightning />} />
24+
<IconButton aria-label="label" variant="outline" icon={<FaBoltLightning />} />
25+
<IconButton aria-label="label" variant="promptOverlay" icon={<FaBoltLightning />} />
26+
<IconButton aria-label="label" variant="promptOverlay" colorScheme="error" icon={<FaBoltLightning />} />
27+
</>
28+
);
2129
};
2230

2331
export const Default: Story = {

lib/theme/components/button.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,13 @@ const getStyles = (props: StyleFunctionProps, variant: 'ghost' | 'solid' | 'outl
149149
} as const;
150150
};
151151

152-
export const variantPromptOverlay = defineStyle(() => {
152+
export const variantPromptOverlay = defineStyle((props) => {
153+
const { colorScheme: c } = props;
153154
const _disabled = {
154155
bg: 'none',
155-
color: 'base.500',
156+
color: `${c}.500`,
156157
svg: {
157-
fill: 'base.500',
158+
fill: `${c}.500`,
158159
},
159160
opacity: 0.7,
160161
};
@@ -166,16 +167,16 @@ export const variantPromptOverlay = defineStyle(() => {
166167
minW: 'unset',
167168
minH: 'unset',
168169
bg: 'none',
169-
color: 'base.400',
170+
color: `${c}.400`,
170171
svg: {
171-
fill: 'base.400',
172+
fill: `${c}.400`,
172173
},
173174
_disabled,
174175
_hover: {
175176
bg: 'none',
176-
color: 'base.100',
177+
color: c === 'base' ? 'base.100' : `${c}.300`,
177178
svg: {
178-
fill: 'base.100',
179+
fill: c === 'base' ? 'base.100' : `${c}.300`,
179180
},
180181
_disabled,
181182
},

0 commit comments

Comments
 (0)