Skip to content

Commit 7f6171f

Browse files
Lunorybenax-se
authored andcommitted
feat(TopPanel): add align prop (#317)
1 parent b7dc21d commit 7f6171f

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/components/AsideHeader/README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,19 @@ Top Alert can be useful for displaying important information that users need to
176176

177177
You can customize the inner content, make alert closeable if necessary. For reading top alert height see value from CSS variable `--gn-aside-top-panel-height`.
178178

179-
| Name | Description | Type | Default |
180-
| :-------------- | :----------------------------------------------------------------- | :------------------------------------------------------------------------------------------------: | :---------: |
181-
| actions | Array of buttons or full custom components | [`AlertActions`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#properties) | |
182-
| centered | Centering all content | `boolean` | `false` |
183-
| closable | Show close button and make possible to pass `onCloseTopAlert` prop | `boolean` | `false` |
184-
| dense | Add top, bottom paddings to `TopAlert` container | `boolean` | `false` |
185-
| icon | Override default icon | [`AlertIcon`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#properties) | |
186-
| message | Message of the alert | [`AlertMessage`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#alert-message) | |
187-
| onCloseTopAlert | Callback will be called when clicking on the close button | `() => void` | |
188-
| title | Title of the alert | [`AlertTitle`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#alert-title) | |
189-
| theme | Alert appearance | [`AlertTheme`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#theme) | `"warning"` |
190-
| view | Enable/disable background color of the alert | [`AlertView`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#view) | `"filled"` |
179+
| Name | Description | Type | Default |
180+
| :-------------- | :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------: | :----------: |
181+
| actions | Array of buttons or full custom components | [`AlertActions`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#properties) | |
182+
| centered | Centering all content | `boolean` | `false` |
183+
| align | Determines how content inside the Alert component is vertically aligned | [`AlertAlign`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#align) | `"baseline"` |
184+
| closable | Show close button and make possible to pass `onCloseTopAlert` prop | `boolean` | `false` |
185+
| dense | Add top, bottom paddings to `TopAlert` container | `boolean` | `false` |
186+
| icon | Override default icon | [`AlertIcon`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#properties) | |
187+
| message | Message of the alert | [`AlertMessage`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#alert-message) | |
188+
| onCloseTopAlert | Callback will be called when clicking on the close button | `() => void` | |
189+
| title | Title of the alert | [`AlertTitle`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#alert-title) | |
190+
| theme | Alert appearance | [`AlertTheme`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#theme) | `"warning"` |
191+
| view | Enable/disable background color of the alert | [`AlertView`](https://github.com/gravity-ui/uikit/tree/main/src/components/Alert#view) | `"filled"` |
191192

192193
## CSS API
193194

src/components/AsideHeader/components/TopPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const TopPanel = ({topAlert}: Props) => {
4141
})}
4242
corners="square"
4343
layout="horizontal"
44+
align={topAlert.align}
4445
theme={topAlert.theme || 'warning'}
4546
view={topAlert.view}
4647
icon={topAlert.icon}

src/components/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export type AsideHeaderTopAlertProps = {
8383
view?: AlertProps['view'];
8484
theme?: AlertProps['theme'];
8585
actions?: AlertProps['actions'];
86+
align?: AlertProps['align'];
8687
closable?: boolean;
8788
centered?: boolean;
8889
dense?: boolean;

0 commit comments

Comments
 (0)