diff --git a/package.json b/package.json index 8c118ef..a23c092 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "1byte-react-design", - "version": "1.6.3-1", + "version": "1.6.3-2", "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts", @@ -10,10 +10,12 @@ "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", @@ -26,6 +28,9 @@ "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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dfe780d..93cc050 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@ant-design/cssinjs': specifier: ^1.24.0 version: 1.24.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@ant-design/cssinjs-utils': + specifier: ^1.1.3 + version: 1.1.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@ant-design/icons': specifier: ^6.0.1 version: 6.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -32,6 +35,9 @@ importers: '@emotion/styled': specifier: ^11.13.0 version: 11.14.1(@emotion/react@11.14.0(@types/react@18.3.24)(react@18.3.1))(@types/react@18.3.24)(react@18.3.1) + Slider: + specifier: link:rc-slider/lib/Slider + version: link:rc-slider/lib/Slider antd: specifier: ^5.21.2 version: 5.27.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -47,6 +53,15 @@ importers: rc-field-form: specifier: ^2.7.0 version: 2.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-image: + specifier: ^7.12.0 + version: 7.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-input-number: + specifier: ^9.5.0 + version: 9.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-slider: + specifier: ^11.1.8 + version: 11.1.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-table: specifier: ^7.53.0 version: 7.53.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) diff --git a/src/molecules/ColorPicker/ColorPicker.tsx b/src/molecules/ColorPicker/ColorPicker.tsx index 60c28eb..2f1b056 100644 --- a/src/molecules/ColorPicker/ColorPicker.tsx +++ b/src/molecules/ColorPicker/ColorPicker.tsx @@ -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 ; }; + +export const ColorPicker = ColorPickerInternal as RdColorPickerCompoundedComponent; + diff --git a/src/molecules/ColorPicker/styles.tsx b/src/molecules/ColorPicker/styles.tsx index 9c18be2..98f5ad4 100644 --- a/src/molecules/ColorPicker/styles.tsx +++ b/src/molecules/ColorPicker/styles.tsx @@ -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 = styled(ColorPicker, { shouldForwardProp: prop => getExcludeForwardProps( ['readonly'] as (keyof RdColorPickerProps)[], diff --git a/src/molecules/ColorPicker/types.ts b/src/molecules/ColorPicker/types.ts index a346d43..19dc668 100644 --- a/src/molecules/ColorPicker/types.ts +++ b/src/molecules/ColorPicker/types.ts @@ -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; +type ColorPickerPropsAntd = ColorPickerProps; //#endregion //#region Define extended component tokens @@ -29,5 +30,7 @@ export type RdColorPickerComponentToken = ColorPickerComponentTokenAntd & //#endregion //#region Define component types -export type RdColorPickerComponent = React.FC; +export type RdColorPickerInternalComponent = React.FC; + +export type RdColorPickerCompoundedComponent = typeof ColorPickerInternal & {}; //#endregion diff --git a/src/molecules/DatePicker/styles.tsx b/src/molecules/DatePicker/styles.tsx index 4b5c684..0d7b743 100644 --- a/src/molecules/DatePicker/styles.tsx +++ b/src/molecules/DatePicker/styles.tsx @@ -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 = styled(DatePicker)``; + +export const WeekPickerStyles: StyledComponent = styled(DatePicker.WeekPicker)``; +export const MonthPickerStyles: StyledComponent = styled( + DatePicker.MonthPicker +)``; +export const YearPickerStyles: StyledComponent = styled(DatePicker.YearPicker)``; +export const RangePickerStyles: StyledComponent = styled( + DatePicker.RangePicker +)``; +export const TimePickerStyles: StyledComponent = styled(DatePicker.TimePicker)``; +export const QuarterPickerStyles: StyledComponent = styled( + DatePicker.QuarterPicker +)``; diff --git a/src/molecules/Image/Image.tsx b/src/molecules/Image/Image.tsx index 7ea3b6c..a6dca06 100644 --- a/src/molecules/Image/Image.tsx +++ b/src/molecules/Image/Image.tsx @@ -1,8 +1,9 @@ import { Skeleton } from '../Skeleton'; -import { ImageStyles } from './styles'; -import { RdImageComponent } from './types'; +import { PreviewGroup } from './PreviewGroup'; +import { ImageStyled } from './styles'; +import { RdImageCompositionComponent, RdImageInternalComponent } from './types'; -export const Image: RdImageComponent = props => { +const ImageInternal: RdImageInternalComponent = props => { const { loading = false, ...antdProps } = props; return ( @@ -10,7 +11,7 @@ export const Image: RdImageComponent = props => { {/** * Note: * Previously, when `loading = true`, the component only rendered the `Skeleton.Node` - * and skipped rendering the `ImageStyles` completely. + * and skipped rendering the `ImageStyled` completely. * * However, in that case, the `img` element was never created, so the browser wouldn't start downloading the image, * and we couldn't catch the `onLoad` event. @@ -31,7 +32,11 @@ export const Image: RdImageComponent = props => { }} /> )} -