Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
59f1f0d
feature: append typography
Dec 10, 2024
3aa4d0f
feature: export typography atomics
Dec 10, 2024
549226a
feature: add forward ref for button
Dec 10, 2024
53497b6
feature: add forward ref for checkbox
Dec 10, 2024
c9a6f20
feature: merge Textarea and InputPassword to Input.Textarea and Input…
Dec 10, 2024
2b8c8e9
feature: add design token for each component
Dec 10, 2024
7a962dd
fix: type props name and add align prop custom
Dec 10, 2024
b9d0424
fix: variant style prop for button molecule
Dec 10, 2024
c21f2c0
refactor: function
Dec 10, 2024
c2c31bf
feature: add block prop for Form.Item and Form.ItemControl
Dec 10, 2024
63e8364
feature: add forward ref for InputNumber molecule
Dec 10, 2024
2757424
fix: remove redundant log
Dec 10, 2024
b6572a8
feature: add List molecule
Dec 10, 2024
fdc7650
feature: export type for Pagination molecule
Dec 10, 2024
4e0d55e
feature: add forward ref for RadioGroup molecule
Dec 10, 2024
aef3ad6
feature: add custom component token for RangePicker molecule
Dec 10, 2024
dc583ed
feature: add forward ref and fix type name for Select molecule
Dec 10, 2024
4e90647
feature: remove forward prop block for Space molecule
Dec 10, 2024
9d8f0fb
feature: add custom component token for Spin molecule
Dec 10, 2024
2525e30
feature: add forward ref for Switch molecule
Dec 10, 2024
b249b8f
feature: add forward ref for Tooltip molecule
Dec 10, 2024
2b42583
feature: add forward ref for UploadDragger molecule
Dec 10, 2024
637bb33
fix: export component token and delete redundant file
Dec 10, 2024
7410bd3
feature: remove label field wrapper molecule
Dec 15, 2024
a1a8544
feature: add Affix molecule
Dec 15, 2024
ef4f850
feature: add Anchor molecule
Dec 15, 2024
481acc3
feature: add Badge molecule
Dec 15, 2024
691e178
feature: add ColorPicker molecule
Dec 15, 2024
166858d
feature: add Empty molecule
Dec 15, 2024
a286418
feature: add Tag molecule
Dec 15, 2024
9f3a4a9
feature: remove TextError atomics, use typography instead
Dec 15, 2024
22a4bdf
feature: add Typography atom
Dec 15, 2024
f53cba3
refactor: Change Flex typescript
Dec 15, 2024
2ec1ec6
feature: remove TextError export
Dec 15, 2024
74de116
refactor: Avatar molecule typescript
Dec 15, 2024
62b6562
refactor: Breadcrumb molecule typescript
Dec 15, 2024
c9f1ca2
feature: Add DatePicker molecule
Dec 15, 2024
2ccc69c
feature: Add Grid molecule
Dec 15, 2024
2c0000d
feature: Remove row and col molecule
Dec 15, 2024
2251293
feature: Done Input molecule in antd
Dec 15, 2024
efdd8f3
feature: remove control component and change typescript Checkbox mole…
Dec 15, 2024
5031c53
refactor: Collapse molecule typescript
Dec 15, 2024
9f123d8
refactor: Divider molecule typescript
Dec 15, 2024
15684b0
refactor: Menu molecule typescript
Dec 15, 2024
213d9f2
refactor: Modal molecule typescript
Dec 15, 2024
0f584f2
refactor: Popover molecule typescript
Dec 15, 2024
982b1a4
refactor: Skeleton, Slider, Spin, Tabs, Tooltip molecules typescript
Dec 15, 2024
c927420
refactor: Drawer molecule typescript
Dec 15, 2024
3e6b671
refactor: Button molecule typescript
Dec 15, 2024
f9826e8
refactor: Card molecule typescript
Dec 15, 2024
95d61e1
refactor: Change Button component in Dropdown to DropdownButton compo…
Dec 15, 2024
c1a2456
refactor: FloatButton molecule typescript and remove Backtop to BackTop
Dec 15, 2024
532eb83
refactor: List molecule typescript
Dec 15, 2024
0498e27
refactor: InputNumber molecule typescript and remove Control component
Dec 15, 2024
b75496c
refactor: Layout molecule typescript
Dec 15, 2024
df86697
refactor: Pagination molecule typescript
Dec 15, 2024
42846b2
refactor: Radio molecule typescript and remove Control component
Dec 15, 2024
b75d750
feature: remove RangePicker, use DatePicker.RangePicker instead
Dec 15, 2024
0ff8294
feature: Add space compact for space molecule
Dec 15, 2024
694d552
refactor: Space molecule typescript
Dec 15, 2024
1ef74e1
refactor: Upload molecule typescript
Dec 15, 2024
f83a8ac
refactor: Table molecule typescript
Dec 15, 2024
c4d10dc
feature: Remove SwitchControl for Switch molecule
Dec 15, 2024
2464522
feature: Remove labelField wrapper in Select molecule
Dec 15, 2024
8b47764
feature: Remove SelectControl molecule
Dec 15, 2024
c398244
refactor: Select molecule typescript
Dec 15, 2024
492703d
feature: remove getAxisStyles util
Dec 15, 2024
ccdbd1a
feature: add default value for FormItemReactHookForm molecule
Dec 15, 2024
8b85475
feature: export molecules
Dec 15, 2024
e1a9b7a
feature: change prefix type and update RdComponentTokenMap
Dec 15, 2024
66b50a0
feature: remove export models
Dec 15, 2024
36191a9
feature: add clsx library
Dec 15, 2024
aa779e3
refactor: refactor molecules interface and fix forwardRef
Jan 23, 2025
03b22d8
#VDT-134 review source 1byte-react-design
Feb 21, 2025
2e0a31f
feature: Add allow sort to Table molecule
Feb 23, 2025
91ce507
Merge pull request #9 from 1Byte-Software/feature/append
KennethWise Feb 23, 2025
88214b3
fix: remove /index in export
Feb 23, 2025
9d90d42
fix: remove /index in export atomic
Feb 23, 2025
bd58d57
feature: add Popconfirm molecule
Feb 23, 2025
7dde1b4
build: change Backtop to ->BackTop folder name
Feb 23, 2025
a1a5ec8
build: change Backtop to ->BackTop folder name
Feb 23, 2025
e087d2e
build: change Backtop to ->BackTop folder name
Feb 23, 2025
c62b5cd
feature: add color success for button molecule
Feb 25, 2025
d9f422e
feature: add RdItemType interface for menu molecule
Feb 25, 2025
fbcccf6
feature: add forwardref for popconfirm molecule
Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cSpell.words": [
"Popconfirm",
"Sider"
]
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "1byte-react-design",
"version": "0.10.5",
"version": "0.10.31",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -13,9 +13,14 @@
"dist"
],
"dependencies": {
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/modifiers": "^9.0.0",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"antd": "^5.21.2",
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"polished": "^4.3.1",
"react": "^18.3.1",
Expand All @@ -36,6 +41,7 @@
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.6.2",
"webpack": "^5.95.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/ConfigProviderDesign.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigProvider, ThemeConfig } from 'antd';
import { PropsWithChildren } from 'react';
import { PropsWithChildren, useContext } from 'react';
import { config } from '.';

interface IConfigProviderDesignProps extends PropsWithChildren {
Expand Down
14 changes: 0 additions & 14 deletions src/atomics/ConditionalWrapper/index.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions src/atomics/ConditionalWrapper/types.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/atomics/Flex/Flex.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ConfigProviderDesign } from '../../ConfigProviderDesign';
import { FlexStyles } from './styles';
import { IFlexProps } from './types';
import { RdFlexProps } from './types';

export const Flex = ({ ...antdProps }: IFlexProps) => {
export const Flex = ({ ...antdProps }: RdFlexProps) => {
return (
<ConfigProviderDesign>
<FlexStyles {...antdProps} />
Expand Down
21 changes: 19 additions & 2 deletions src/atomics/Flex/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import { FlexProps } from 'antd';
import { Flex, GetProps } from 'antd';
import { ComponentToken as FlexComponentTokenAntd } from 'antd/es/flex/style';

export interface IFlexProps extends FlexProps {}
//#region Define Ant Design types
type FlexProps = GetProps<typeof Flex>;
//#endregion

//#region Define extended component tokens
type FlexComponentTokenExtend = {};
//#endregion

//#region Define extended types
type FlexPropsExtend = {};
//#endregion

//#region Export types
export type RdFlexProps = FlexProps & FlexPropsExtend;

export type RdFlexComponentToken = FlexComponentTokenAntd & FlexComponentTokenExtend;
//#endregion
7 changes: 0 additions & 7 deletions src/atomics/TextError/TextError.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/atomics/TextError/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/atomics/TextError/styles.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/atomics/TextError/types.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/Description.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/H1.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/H2.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/H3.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/H4.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/H5.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/H6.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/Text.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/atomics/Typography/Title.tsx

This file was deleted.

11 changes: 11 additions & 0 deletions src/atomics/Typography/Typography.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { TypographyLink } from './TypographyLink';
import { TypographyParagraph } from './TypographyParagraph';
import { TypographyText } from './TypographyText';
import { TypographyTitle } from './TypographyTitle';

export const Typography = {
Link: TypographyLink,
Paragraph: TypographyParagraph,
Text: TypographyText,
Title: TypographyTitle,
};
9 changes: 9 additions & 0 deletions src/atomics/Typography/TypographyLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { forwardRef } from 'react';
import { TypographyLinkStyles } from './styles';
import { RdTypographyLinkProps } from './types';

export const TypographyLink = forwardRef(
({ ...antdProps }: RdTypographyLinkProps, ref: RdTypographyLinkProps['ref']) => {
return <TypographyLinkStyles ref={ref} {...antdProps} />;
}
);
9 changes: 9 additions & 0 deletions src/atomics/Typography/TypographyParagraph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { forwardRef } from 'react';
import { TypographyParagraphStyles } from './styles';
import { RdTypographyParagraphProps } from './types';

export const TypographyParagraph = forwardRef(
({ ...antdProps }: RdTypographyParagraphProps, ref: RdTypographyParagraphProps['ref']) => {
return <TypographyParagraphStyles ref={ref} {...antdProps} />;
}
);
25 changes: 25 additions & 0 deletions src/atomics/Typography/TypographyText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { forwardRef, useMemo } from 'react';
import { TypographyTextStyles } from './styles';
import { RdTypographyTextProps } from './types';

export const TypographyText = forwardRef(
(props: RdTypographyTextProps, ref: RdTypographyTextProps['ref']) => {
const { size = 'normal', editable, autoFocus = false, onChange, ...antdProps } = props;

const editableCustom = useMemo(() => {
if (editable && typeof editable === 'object') {
if (onChange) {
editable.onChange = onChange;
}

return editable;
}

return editable;
}, [editable]);

return (
<TypographyTextStyles ref={ref} editable={editableCustom} size={size} {...antdProps} />
);
}
);
9 changes: 9 additions & 0 deletions src/atomics/Typography/TypographyTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { forwardRef } from 'react';
import { TypographyTitleStyles } from './styles';
import { RdTypographyTitleProps } from './types';

export const TypographyTitle = forwardRef(
({ disableMargin, ...antdProps }: RdTypographyTitleProps, ref: RdTypographyTitleProps['ref']) => {
return <TypographyTitleStyles disableMargin={disableMargin} ref={ref} {...antdProps} />;
}
);
9 changes: 0 additions & 9 deletions src/atomics/Typography/index.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/atomics/Typography/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './Typography';
export * from './types';
64 changes: 35 additions & 29 deletions src/atomics/Typography/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
import styled from '@emotion/styled';
import { config } from '../..';
import { Typography } from 'antd';
import { getComponentOrGlobalToken } from '../../utils/token';
import { RdTypographyTextProps, RdTypographyTitleProps } from './types';
import { css } from '@emotion/react';
import { getExcludeForwardProps } from '../../utils/styles';

export const H1Wrapper = styled.h1`
font-size: ${config.designToken.fontSizeHeading1}px;
`;
export const H2Wrapper = styled.h2`
font-size: ${config.designToken.fontSizeHeading2}px;
`;
export const H3Wrapper = styled.h3`
font-size: ${config.designToken.fontSizeHeading3}px;
`;
export const H4Wrapper = styled.h4`
font-size: ${config.designToken.fontSizeHeading4}px;
`;
export const H5Wrapper = styled.h5`
font-size: ${config.designToken.fontSizeHeading5}px;
`;
export const H6Wrapper = styled.h6`
font-size: ${config.designToken.fontSizeLG}px;
`;
export const TitleWrapper = styled.span`
font-size: ${config.designToken.fontSizeLG}px;
font-weight: ${config.designToken.fontWeightStrong};
`;
export const TextWrapper = styled.span`
font-size: ${config.designToken.fontSize};
export const TypographyLinkStyles = styled(Typography.Link)``;

export const TypographyTitleStyles = styled(Typography.Title, {
shouldForwardProp: prop =>
getExcludeForwardProps<RdTypographyTitleProps>(
['disableMargin'] as (keyof RdTypographyTitleProps)[],
prop
),
})<RdTypographyTitleProps>`
${({ disableMargin }) => {
return (
disableMargin &&
css`
margin-bottom: 0 !important;
`
);
}}
`;
export const DescriptionWrapper = styled.span`
font-size: ${config.designToken.fontSizeSM}px;
color: ${config.designToken.colorTextDescription};
font-style: italic;

export const TypographyTextStyles = styled(Typography.Text)<Pick<RdTypographyTextProps, 'size'>>`
${({ size }) => {
switch (size) {
case 'small':
return `
font-size: ${getComponentOrGlobalToken('Typography', 'fontSizeSM')}px;
`;
// Case normal is the default size
}
}}
`;

export const TypographyParagraphStyles = styled(Typography.Paragraph)``;
Loading
Loading