Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
04a9839
Merge pull request #8 from 1Byte-Software/develop
KennethWise Nov 29, 2024
71661ea
Create node.js.yml
KennethWise Feb 2, 2025
656c0c0
Update node.js.yml
KennethWise Feb 2, 2025
5769b31
Update node.js.yml
KennethWise Feb 2, 2025
ad62f9c
Merge pull request #10 from 1Byte-Software/develop
KennethWise Feb 25, 2025
d4c71f4
Merge pull request #11 from 1Byte-Software/develop
KennethWise Mar 31, 2025
ec793ab
Merge pull request #12 from 1Byte-Software/develop
KennethWise Apr 23, 2025
66026c2
Merge pull request #13 from 1Byte-Software/develop
KennethWise May 5, 2025
77bfa97
Merge pull request #14 from 1Byte-Software/develop
KennethWise May 5, 2025
53e470f
Merge pull request #15 from 1Byte-Software/develop
KennethWise May 13, 2025
5639467
Merge pull request #16 from 1Byte-Software/develop
KennethWise May 22, 2025
7043e2a
Merge pull request #17 from 1Byte-Software/develop
KennethWise Sep 7, 2025
5d16cb9
Merge pull request #18 from 1Byte-Software/develop
KennethWise Sep 9, 2025
3870297
build: change ci/cd github actions
KennethWise Sep 9, 2025
563383f
Merge pull request #19 from 1Byte-Software/develop
KennethWise Sep 9, 2025
2f5e69e
fix: fix variant prop in card component
Sep 9, 2025
46871ac
Merge pull request #20 from 1Byte-Software/hotfix/fix_variant_in_card…
KennethWise Sep 9, 2025
1134c44
fix: fix variant prop in Card component
KennethWise Sep 9, 2025
fbd0a5a
build: add build before publish to npm
KennethWise Sep 9, 2025
f31457f
build: update package.json for ci/cd with pnpm
Sep 9, 2025
5e6712b
Merge pull request #21 from 1Byte-Software/hotfix/fix-cicd
KennethWise Sep 9, 2025
8843437
build: change version
Sep 9, 2025
bfc3e36
Merge pull request #22 from 1Byte-Software/hotfix/fix-cicd
KennethWise Sep 9, 2025
0010340
fix: fix package.json and pnpm-lock.yaml
Sep 9, 2025
2247049
Merge pull request #23 from 1Byte-Software/hotfix/fix-cicd
KennethWise Sep 9, 2025
0fc0b06
fix: fix type for pnpm build ci/cd
Sep 9, 2025
ee27094
Merge pull request #24 from 1Byte-Software/hotfix/fix-cicd
KennethWise Sep 9, 2025
fd1d237
build: remove Slider in pnpm-lock.yalm
Sep 9, 2025
2b83883
Merge pull request #25 from 1Byte-Software/hotfix/fix-cicd
KennethWise Sep 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Publish to npm

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Example: 1.0.0, 2.1.3

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org/'

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9 # đổi sang version pnpm bạn muốn

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build project
run: pnpm build

- name: Publish to npm
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.3]

### Fixed

- Fixed `variant` prop in `Card` component.

## [1.6.2]

### Added
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "1byte-react-design",
"version": "1.6.2-3",
"version": "1.6.3-2",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -10,9 +10,13 @@
"license": "MIT",
"scripts": {
"build": "webpack --config webpack.config.js",
"test": "yalc publish --push --no-scripts --files ."
"test": "yalc publish --push --no-scripts --files .",
"tsc": "tsc -p tsconfig.json"
},
"dependencies": {
"@ant-design/cssinjs": "^1.24.0",
"@ant-design/cssinjs-utils": "^1.1.3",
"@ant-design/icons": "^6.0.1",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/modifiers": "^9.0.0",
"@dnd-kit/sortable": "^10.0.0",
Expand All @@ -23,6 +27,12 @@
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"polished": "^4.3.1",
"rc-field-form": "^2.7.0",
"rc-image": "^7.12.0",
"rc-input-number": "^9.5.0",
"rc-slider": "^11.1.8",
"rc-table": "^7.53.0",
"rc-tree": "^5.13.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
Expand Down
92 changes: 92 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/molecules/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ import { MetaCard } from './Meta';
import { CardStyles } from './styles';
import { RdCardCompoundedComponent, RdCardProps } from './types';

export const CardInternal = ({ className, variant = 'default', ...antdProps }: RdCardProps) => {
export const CardInternal: React.FC<RdCardProps> = ({
className,
variant = 'default',
...antdProps
}) => {
const variantClass: Record<NonNullable<RdCardProps['variant']>, string> = {
compact: 'rd-card-variant-compact',
default: '',
default: 'rd-card-variant-default',
borderless: 'rd-card-variant-borderless',
outlined: 'rd-card-variant-outlined',
};

return <CardStyles className={clsx(className, variantClass[variant])} {...antdProps} />;
Expand Down
4 changes: 2 additions & 2 deletions src/molecules/Card/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ type CardPropsExtend = {
*
* This property allows you to customize the appearance of the card to match specific design requirements.
*/
variant?: 'default' | 'compact';
variant?: 'default' | 'compact' | CardPropsAntd['variant'];
};

type GridCardPropsExtend = {};
type MetaCardPropsExtend = {};
//#endregion

//#region Export types
export type RdCardProps = CardPropsAntd & CardPropsExtend;
export type RdCardProps = Omit<CardPropsAntd, 'variant'> & CardPropsExtend;
export type RdGridCardProps = GridCardPropsAntd & GridCardPropsExtend;
export type RdMetaCardProps = MetaCardPropsAntd & MetaCardPropsExtend;

Expand Down
7 changes: 5 additions & 2 deletions src/molecules/ColorPicker/ColorPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { ColorPickerStyles } from './styles';
import { RdColorPickerComponent } from './types';
import { RdColorPickerCompoundedComponent, RdColorPickerInternalComponent } from './types';

export const ColorPicker: RdColorPickerComponent = props => {
export const ColorPickerInternal: RdColorPickerInternalComponent = props => {
return <ColorPickerStyles {...props} />;
};

export const ColorPicker = ColorPickerInternal as RdColorPickerCompoundedComponent;

4 changes: 2 additions & 2 deletions src/molecules/ColorPicker/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import styled from '@emotion/styled';
import styled, { StyledComponent } from '@emotion/styled';
import { ColorPicker } from 'antd';
import { getExcludeForwardProps } from '../../utils';
import { RdColorPickerProps } from './types';

export const ColorPickerStyles = styled(ColorPicker, {
export const ColorPickerStyles: StyledComponent<RdColorPickerProps> = styled(ColorPicker, {
shouldForwardProp: prop =>
getExcludeForwardProps<RdColorPickerProps>(
['readonly'] as (keyof RdColorPickerProps)[],
Expand Down
9 changes: 6 additions & 3 deletions src/molecules/ColorPicker/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ColorPicker, GetProps } from 'antd';
import { ColorPickerProps } from 'antd';
import { ComponentToken as ColorPickerComponentTokenAntd } from 'antd/es/color-picker/style';
import { ColorPickerInternal } from './ColorPicker';

//#region Define Ant Design types
type ColorPickerPropsAntd = GetProps<typeof ColorPicker>;
type ColorPickerPropsAntd = ColorPickerProps;
//#endregion

//#region Define extended component tokens
Expand All @@ -29,5 +30,7 @@ export type RdColorPickerComponentToken = ColorPickerComponentTokenAntd &
//#endregion

//#region Define component types
export type RdColorPickerComponent = React.FC<RdColorPickerProps>;
export type RdColorPickerInternalComponent = React.FC<RdColorPickerProps>;

export type RdColorPickerCompoundedComponent = typeof ColorPickerInternal & {};
//#endregion
32 changes: 24 additions & 8 deletions src/molecules/DatePicker/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import styled from '@emotion/styled';
import styled, { StyledComponent } from '@emotion/styled';
import { DatePicker } from 'antd';
import {
RdDatePickerProps,
RdMonthPickerProps,
RdQuarterPickerProps,
RdRangePickerProps,
RdTimePickerProps,
RdWeekPickerProps,
RdYearPickerProps,
} from './types';

export const DatePickerStyles = styled(DatePicker)``;
export const WeekPickerStyles = styled(DatePicker.WeekPicker)``;
export const MonthPickerStyles = styled(DatePicker.MonthPicker)``;
export const YearPickerStyles = styled(DatePicker.YearPicker)``;
export const RangePickerStyles = styled(DatePicker.RangePicker)``;
export const TimePickerStyles = styled(DatePicker.TimePicker)``;
export const QuarterPickerStyles = styled(DatePicker.QuarterPicker)``;
export const DatePickerStyles: StyledComponent<RdDatePickerProps> = styled(DatePicker)``;

export const WeekPickerStyles: StyledComponent<RdWeekPickerProps> = styled(DatePicker.WeekPicker)``;
export const MonthPickerStyles: StyledComponent<RdMonthPickerProps> = styled(
DatePicker.MonthPicker
)``;
export const YearPickerStyles: StyledComponent<RdYearPickerProps> = styled(DatePicker.YearPicker)``;
export const RangePickerStyles: StyledComponent<RdRangePickerProps> = styled(
DatePicker.RangePicker
)``;
export const TimePickerStyles: StyledComponent<RdTimePickerProps> = styled(DatePicker.TimePicker)``;
export const QuarterPickerStyles: StyledComponent<RdQuarterPickerProps> = styled(
DatePicker.QuarterPicker
)``;
Loading