Skip to content

Commit 318ec9b

Browse files
authored
Merge pull request #44 from 1Byte-Software/develop
Update version 1.8.0
2 parents c5d4edc + 2207395 commit 318ec9b

File tree

14 files changed

+122
-5
lines changed

14 files changed

+122
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Added `Alert` component.
13+
- Added `Progress` component.
14+
- Added default `scroll` for `Table` component.
15+
16+
## [1.8.0]
17+
18+
### Added
19+
1220
- Added chart to `SummaryCard` component.
1321
- Added `Statistic` component.
1422
- Added `Grid.useBreakpoint()` hooks.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "1byte-react-design",
3-
"version": "1.8.0",
3+
"version": "1.9.0",
44
"description": "A simple React UI library",
55
"main": "dist/index.js",
66
"module": "dist/index.js",

src/molecules/Alert/Alert.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { forwardRef } from 'react';
2+
import { AlertStyled } from './styles';
3+
import { RdAlertComponent, RdAlertCompoundedComponent } from './types';
4+
5+
export const InternalAlert: RdAlertComponent = forwardRef((props, ref) => {
6+
return <AlertStyled {...props} ref={ref} />;
7+
});
8+
9+
export const Alert: RdAlertCompoundedComponent = InternalAlert as RdAlertCompoundedComponent;

src/molecules/Alert/Timer.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { TimerStyled } from './styles';
2+
import { RdAlertTimerComponent } from './types';
3+
4+
export const Timer: RdAlertTimerComponent = props => {
5+
return <TimerStyled {...props} />;
6+
};

src/molecules/Alert/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './Alert';
2+
export * from './types';

src/molecules/Alert/styles.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import styled from '@emotion/styled';
2+
import { Alert } from 'antd';
3+
4+
export const AlertStyled = styled(Alert)``;

src/molecules/Alert/types.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Alert, GetProps } from 'antd';
2+
import { AlertRef } from 'antd/es/alert/Alert';
3+
import { ComponentToken as AlertComponentTokenAntd } from 'antd/es/drawer/style';
4+
import { ComponentProps } from 'react';
5+
6+
type AlertPropsAntd = GetProps<typeof Alert>;
7+
type AlertErrorBoundaryPropsAntd = GetProps<typeof Alert.ErrorBoundary>;
8+
9+
type AlertRefAntd = AlertRef;
10+
11+
//#endregion
12+
13+
//#region Define extended component tokens
14+
type AlertComponentTokenExtend = {};
15+
//#endregion
16+
17+
//#region Define extended types
18+
type AlertPropsExtend = {};
19+
type AlertErrorBoundaryPropsExtend = {};
20+
21+
type AlertRefExtend = {};
22+
//#endregion
23+
24+
//#region Export types
25+
export type RdAlertProps = AlertPropsAntd & AlertPropsExtend;
26+
export type RdAlertErrorBoundaryProps = AlertErrorBoundaryPropsAntd & AlertErrorBoundaryPropsExtend;
27+
export type RdAlertRef = AlertRefAntd & AlertRefExtend;
28+
export type RdAlertComponentToken = AlertComponentTokenAntd & AlertComponentTokenExtend;
29+
//#endregion
30+
31+
//#region Define component types
32+
// export type RdAlertComponent = React.FC<RdAlertProps>;
33+
export type RdAlertComponent = React.ForwardRefExoticComponent<
34+
RdAlertProps & React.RefAttributes<RdAlertRef>
35+
>;
36+
37+
export type RdAlertCompoundedComponent = RdAlertComponent & {
38+
// Timer: RdAlertErrorBoundaryComponent;
39+
};
40+
//#endregion
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { forwardRef } from 'react';
2+
import { ProgressStyles } from './styles';
3+
import { RdProgressComponent } from './types';
4+
5+
export const Progress: RdProgressComponent = forwardRef((props, ref) => {
6+
return <ProgressStyles ref={ref} {...props} />;
7+
});

src/molecules/Progress/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './Progress';
2+
export * from './types';

src/molecules/Progress/styles.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import styled from '@emotion/styled';
2+
import { Progress } from 'antd';
3+
4+
export const ProgressStyles = styled(Progress)``;

0 commit comments

Comments
 (0)