Skip to content

Commit 2dc8d69

Browse files
feat: add Alert component & theme
1 parent 62e0632 commit 2dc8d69

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

lib/chakra-re-exports/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
* These components are re-exported directly from Chakra without any customizations.
33
*/
44

5+
//
6+
export type { AlertDescriptionProps, AlertIconProps, AlertProps, AlertStatus, AlertTitleProps } from '@chakra-ui/react';
7+
export { Alert, AlertDescription, AlertIcon, AlertTitle } from '@chakra-ui/react';
8+
59
// AspectRatio
610
export type { AspectRatioProps } from '@chakra-ui/react';
711
export { AspectRatio } from '@chakra-ui/react';

lib/theme/components/alert.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { alertAnatomy as parts } from '@chakra-ui/anatomy';
2+
import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system';
3+
4+
const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(parts.keys);
5+
6+
const baseStyle = definePartsStyle(() => ({
7+
container: {
8+
borderRadius: 'base',
9+
fontSize: 'sm',
10+
shadow: 'md',
11+
},
12+
}));
13+
14+
export const alertTheme = defineMultiStyleConfig({
15+
baseStyle,
16+
});

lib/theme/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ThemeOverride } from '@chakra-ui/react';
22

33
import { accordionTheme } from './accordion';
4+
import { alertTheme } from './alert';
45
import { badgeTheme } from './badge';
56
import { buttonTheme } from './button';
67
import { cardTheme } from './card';
@@ -25,6 +26,7 @@ import { tooltipTheme } from './tooltip';
2526

2627
export const components: ThemeOverride['components'] = {
2728
Accordion: accordionTheme,
29+
Alert: alertTheme,
2830
Badge: badgeTheme,
2931
Button: buttonTheme,
3032
Card: cardTheme,

0 commit comments

Comments
 (0)