Skip to content

Commit

Permalink
fix(AppNotification): apply usage feedback (#1949)
Browse files Browse the repository at this point in the history
- spacing for close button when text is brief
- better storybook handling
- add type exports
  • Loading branch information
booc0mtaco authored May 17, 2024
1 parent 56fa437 commit 06cc194
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/components/AppNotification/AppNotification.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
max-width: 1320px;
display: flex;
gap: 0.5rem;

& > section {
width: 100%;
}
}

.app-notification__close-btn {
Expand Down
4 changes: 4 additions & 0 deletions src/components/AppNotification/AppNotification.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export default {
type: null,
},
},
subTitle: {
control: 'text',
},
},
} as Meta<Args>;

Expand Down Expand Up @@ -63,6 +66,7 @@ export const LightColor: StoryObj<Args> = {
export const WithDismissAndControls: StoryObj<Args> = {
args: {
...WithControls.args,
subTitle: 'Limited subtitle text',
onDismiss: () => {
console.log('dismissing!');
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/AppNotification/AppNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ButtonV2 as Button } from '../Button';
import Text from '../Text';
import styles from './AppNotification.module.css';

export interface Props {
export interface AppNotificationProps {
// Design API
/**
* The title/heading of the notification
Expand Down Expand Up @@ -47,7 +47,7 @@ export const AppNotification = ({
subTitle,
title,
...other
}: Props) => {
}: AppNotificationProps) => {
const componentClassName = clsx(
styles['app-notification'],
color && styles[`app-notification--color-${color}`],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ exports[`<AppNotification /> WithDismissAndControls story renders snapshot 1`] =
<p
class="text text--body-md app-notification__sub-title"
>
Lorem ipsum dolor sit amet consectetur. At et vitae quis amet felis mollis in vitae. Eget in neque et molestie. Luctus sed id commodo volutpat. In a eu in id molestie consectetur pellentesque.
Limited subtitle text
</p>
<div
class="app-notification__actions"
Expand Down
1 change: 1 addition & 0 deletions src/components/AppNotification/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { AppNotification as default } from './AppNotification';
export type { AppNotificationProps } from './AppNotification';
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@ export type { IconNameV2 } from './components/Icon';
export type { ButtonV2Props } from './components/Button';
export type { LinkV2Props } from './components/Link';
export type { PageNotificationProps as PageNotificationV2Props } from './components/PageNotification';
export type { AppNotificationProps as AppNotificationV2Props } from './components/AppNotification';

0 comments on commit 06cc194

Please sign in to comment.