@croquiscom/pds 3.7.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/components/radio/Radio.d.ts +5 -6
- package/dist/components/radio/RadioGroup.d.ts +7 -2
- package/dist/components/radio/styles.d.ts +8 -4
- package/dist/components/radio/types.d.ts +6 -0
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
-
import { RadioItemType } from './RadioGroup';
|
|
3
2
|
import { AriaFocusProps } from '../../types/common';
|
|
4
|
-
|
|
3
|
+
import { RadioCategoryType, RadioItemType } from './RadioGroup';
|
|
4
|
+
interface RadioBaseType extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'>, AriaFocusProps {
|
|
5
|
+
}
|
|
6
|
+
export interface RadioProps extends RadioBaseType, RadioCategoryType<RadioItemType> {
|
|
5
7
|
/**
|
|
6
8
|
* @default false
|
|
7
9
|
*/
|
|
8
10
|
fill?: boolean;
|
|
9
11
|
className?: string;
|
|
10
|
-
/**
|
|
11
|
-
* @default default
|
|
12
|
-
*/
|
|
13
|
-
radioItemType?: RadioItemType;
|
|
14
12
|
}
|
|
15
13
|
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
export {};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AriaFocusProps } from '../../types/common';
|
|
3
|
+
import { RadioSizeUnion } from './types';
|
|
3
4
|
export type AlignType = 'horizontal' | 'vertical';
|
|
4
5
|
export type RadioItemType = 'default' | 'box';
|
|
6
|
+
export type RadioSizeType = RadioItemType extends 'box' ? RadioSizeUnion : RadioItemType extends 'default' ? number : never;
|
|
7
|
+
export interface RadioCategoryType<T> {
|
|
8
|
+
radioItemType?: T;
|
|
9
|
+
size?: T extends 'box' ? RadioSizeUnion : number;
|
|
10
|
+
}
|
|
5
11
|
interface RadioItem<RadioValue> {
|
|
6
12
|
label: React.ReactNode;
|
|
7
13
|
value: RadioValue;
|
|
8
14
|
disabled?: boolean;
|
|
9
15
|
}
|
|
10
|
-
export interface RadioGroupProps<RadioValue> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'value' | 'onChange'>, AriaFocusProps {
|
|
16
|
+
export interface RadioGroupProps<RadioValue> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'value' | 'onChange'>, AriaFocusProps, RadioCategoryType<RadioItemType> {
|
|
11
17
|
className?: string;
|
|
12
18
|
defaultValue?: RadioValue;
|
|
13
19
|
value?: RadioValue;
|
|
@@ -24,7 +30,6 @@ export interface RadioGroupProps<RadioValue> extends Omit<React.HTMLAttributes<H
|
|
|
24
30
|
* @default horizontal
|
|
25
31
|
*/
|
|
26
32
|
align?: AlignType;
|
|
27
|
-
radioItemType?: RadioItemType;
|
|
28
33
|
keyExtractor?: (item: RadioItem<RadioValue>, index: number) => string | number;
|
|
29
34
|
onChange?: (value: RadioValue) => void;
|
|
30
35
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { RadioItemType, AlignType } from './RadioGroup';
|
|
1
|
+
import { RadioItemType, AlignType, RadioCategoryType } from './RadioGroup';
|
|
2
|
+
import { RadioSizeUnion } from './types';
|
|
2
3
|
export declare const getRadioGroupStyleByProps: ({ radio_item_type, align, spacing, }: {
|
|
3
4
|
radio_item_type?: RadioItemType;
|
|
4
5
|
align?: AlignType;
|
|
5
6
|
spacing?: Number;
|
|
6
7
|
}) => import("@emotion/utils").SerializedStyles;
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
8
|
+
export declare const radio_size_css: Record<RadioSizeUnion, string>;
|
|
9
|
+
export declare const getRadioWidthBySize: (size: RadioSizeUnion) => number;
|
|
10
|
+
interface RadioStyleProps extends RadioCategoryType<RadioItemType> {
|
|
9
11
|
fill?: boolean;
|
|
10
12
|
disabled?: boolean;
|
|
11
13
|
checked?: boolean;
|
|
12
14
|
focused?: boolean;
|
|
13
|
-
}
|
|
15
|
+
}
|
|
16
|
+
export declare const getRadioStyleByProps: ({ radioItemType, fill, size, disabled, checked, focused }: RadioStyleProps) => import("@emotion/utils").SerializedStyles;
|
|
17
|
+
export {};
|