Skip to content

Commit

Permalink
remove active state
Browse files Browse the repository at this point in the history
  • Loading branch information
changmaru committed Jan 21, 2025
1 parent 71d401c commit 75e90b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
8 changes: 0 additions & 8 deletions packages/callout/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@
margin-block-end: 0;
}

&:active,
&.--active {
visibility: visible;
opacity: 100%;
translate: 0 0;
transition: all 0.4s;
}

._trailing {
margin-left: auto;
}
Expand Down
12 changes: 3 additions & 9 deletions packages/stories-web/src/components/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,21 @@ export interface Props {
"informative" | "positive" | "negative" | "notice"
>;
size?: Extract<Size, 's' | 'm' | 'l'>;
isActive?: boolean;
hasCloseButton?: boolean;
hasButton?: boolean;
}

const Callout: FC<Props> = (props: Props) => {
const wrapperClasses = ['in-callout']
const {
color = "informative",
size = "m",
isActive = true,
hasCloseButton = false,
hasButton = false,
children
} = props

wrapperClasses.push(`-color-${color}`)
wrapperClasses.push(`-size-${size}`)

if (hasCloseButton === false || isActive === true) {
wrapperClasses.push(`--active`)
}

return (
<div
className={wrapperClasses.join(' ')}
Expand All @@ -38,7 +32,7 @@ const Callout: FC<Props> = (props: Props) => {
<div className="_body">
{ children }
</div>
{ hasCloseButton && (
{ hasButton && (
<div className="_trailing">
<button className="in-button -size-s -appearance-transparent">
<div className="_body">閉じる</div>
Expand Down

0 comments on commit 75e90b0

Please sign in to comment.