@pushwoosh/dumb-components 1.1.5 → 1.1.7
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/Radio/Radio.js +2 -0
- package/Radio/styles.d.ts +4 -2
- package/Radio/styles.js +9 -1
- package/Radio/types.d.ts +2 -0
- package/Table/components/DataTable/DataTable.js +3 -1
- package/Table/components/DataTable/types.d.ts +2 -0
- package/Table/components/DataTablePagination/DataTablePagination.d.ts +1 -1
- package/Table/components/DataTablePagination/DataTablePagination.js +2 -0
- package/Table/components/DataTablePagination/types.d.ts +1 -0
- package/package.json +1 -1
package/Radio/Radio.js
CHANGED
|
@@ -10,6 +10,7 @@ export function Radio(props) {
|
|
|
10
10
|
color,
|
|
11
11
|
isChecked,
|
|
12
12
|
isDisabled,
|
|
13
|
+
size = 'normal',
|
|
13
14
|
onChange,
|
|
14
15
|
onBlur
|
|
15
16
|
} = props;
|
|
@@ -30,6 +31,7 @@ export function Radio(props) {
|
|
|
30
31
|
name: name,
|
|
31
32
|
checked: isChecked,
|
|
32
33
|
disabled: isDisabled,
|
|
34
|
+
"$size": size,
|
|
33
35
|
onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value),
|
|
34
36
|
onBlur: onBlur
|
|
35
37
|
}), label && React.createElement("span", null, label));
|
package/Radio/styles.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { RadioTextColor } from './types';
|
|
2
|
-
export declare const NativeRadio: import("styled-components").StyledComponent<"input", any, {
|
|
1
|
+
import type { RadioSize, RadioTextColor } from './types';
|
|
2
|
+
export declare const NativeRadio: import("styled-components").StyledComponent<"input", any, {
|
|
3
|
+
$size: RadioSize;
|
|
4
|
+
}, never>;
|
|
3
5
|
export declare const NativeLabel: import("styled-components").StyledComponent<"label", any, {
|
|
4
6
|
$color?: RadioTextColor;
|
|
5
7
|
}, never>;
|
package/Radio/styles.js
CHANGED
|
@@ -4,7 +4,15 @@ import { ColorMap } from './maps';
|
|
|
4
4
|
export const NativeRadio = styled.input.withConfig({
|
|
5
5
|
displayName: "NativeRadio",
|
|
6
6
|
componentId: "sc-34lgtl-0"
|
|
7
|
-
})(["appearance:none;-webkit-appearance:none;-moz-appearance:none;width:
|
|
7
|
+
})(["appearance:none;-webkit-appearance:none;-moz-appearance:none;width:", ";height:", ";border:", ";border-radius:50%;background-color:", ";transition:border 0.1s,background-color 0.1s;cursor:pointer;&:focus{outline:none;}&[type=radio]:hover{border-color:", ";}&[type=radio]:disabled{cursor:not-allowed;border-color:", ";background-color:", ";}&[type=radio]:checked{border:", ";}&[type=radio]:checked:hover{border-color:", ";}&[type=radio]:checked:disabled{border-color:", ";background-color:", ";}"], ({
|
|
8
|
+
$size
|
|
9
|
+
}) => $size === 'compact' ? '12px' : '20px', ({
|
|
10
|
+
$size
|
|
11
|
+
}) => $size === 'compact' ? '12px' : '20px', ({
|
|
12
|
+
$size
|
|
13
|
+
}) => `${$size === 'compact' ? '1px' : '2px'} solid ${Color.PHANTOM}`, Color.CLEAR, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN, ({
|
|
14
|
+
$size
|
|
15
|
+
}) => `${$size === 'compact' ? '4px' : '6px'} solid ${Color.PRIMARY}`, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN);
|
|
8
16
|
export const NativeLabel = styled.label.withConfig({
|
|
9
17
|
displayName: "NativeLabel",
|
|
10
18
|
componentId: "sc-34lgtl-1"
|
package/Radio/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type RadioTextColor = 'main' | 'primary' | 'danger' | 'current' | 'locked';
|
|
2
|
+
export type RadioSize = 'normal' | 'compact';
|
|
2
3
|
export type RadioProps = {
|
|
3
4
|
label?: string;
|
|
4
5
|
id?: string;
|
|
@@ -7,6 +8,7 @@ export type RadioProps = {
|
|
|
7
8
|
color?: RadioTextColor;
|
|
8
9
|
isChecked?: boolean;
|
|
9
10
|
isDisabled?: boolean;
|
|
11
|
+
size?: RadioSize;
|
|
10
12
|
onChange?: (checked: string | number) => void;
|
|
11
13
|
onBlur?: () => void;
|
|
12
14
|
};
|
|
@@ -15,6 +15,7 @@ export function DataTable(props) {
|
|
|
15
15
|
columns,
|
|
16
16
|
width,
|
|
17
17
|
isBordered = true,
|
|
18
|
+
paginationPadding,
|
|
18
19
|
context,
|
|
19
20
|
renderTableTop,
|
|
20
21
|
renderAfter,
|
|
@@ -34,7 +35,8 @@ export function DataTable(props) {
|
|
|
34
35
|
}, renderTableTop === null || renderTableTop === void 0 ? void 0 : renderTableTop(context), 'renderHead' in props && props.renderHead(), 'renderList' in props ? props.renderList(context) : React.createElement(DataTableList, {
|
|
35
36
|
renderItem: props.renderItem
|
|
36
37
|
}), !hidePagination && React.createElement(DataTablePagination, {
|
|
37
|
-
allLimits: [10, 20, 50, 100]
|
|
38
|
+
allLimits: [10, 20, 50, 100],
|
|
39
|
+
padding: paginationPadding
|
|
38
40
|
}, data.loading && React.createElement(Horizontal, {
|
|
39
41
|
"$gap": Spacing.S1,
|
|
40
42
|
"$alignItems": "center"
|
|
@@ -6,6 +6,7 @@ export type DataTableListProps<I, P extends DataTableParams> = {
|
|
|
6
6
|
isBordered?: boolean;
|
|
7
7
|
context: DataTableContextType<I, P>;
|
|
8
8
|
hidePagination?: boolean;
|
|
9
|
+
paginationPadding?: string;
|
|
9
10
|
renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
|
|
10
11
|
renderList: (ctxValue: DataTableContextType<I, P>) => ReactNode;
|
|
11
12
|
renderAfter?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
|
|
@@ -16,6 +17,7 @@ export type DataTableItemProps<I, P extends DataTableParams> = {
|
|
|
16
17
|
isBordered?: boolean;
|
|
17
18
|
context: DataTableContextType<I, P>;
|
|
18
19
|
hidePagination?: boolean;
|
|
20
|
+
paginationPadding?: string;
|
|
19
21
|
renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
|
|
20
22
|
renderHead: () => ReactNode;
|
|
21
23
|
renderItem: (item: I) => ReactNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { DataTablePaginationProps } from './types';
|
|
3
|
-
export declare function DataTablePagination({ allLimits, children }: DataTablePaginationProps): ReactElement;
|
|
3
|
+
export declare function DataTablePagination({ allLimits, padding, children }: DataTablePaginationProps): ReactElement;
|
|
@@ -3,6 +3,7 @@ import { DataTableContext } from '../../context';
|
|
|
3
3
|
import { TablePagination } from '../TablePagination';
|
|
4
4
|
export function DataTablePagination({
|
|
5
5
|
allLimits,
|
|
6
|
+
padding,
|
|
6
7
|
children
|
|
7
8
|
}) {
|
|
8
9
|
var _data$value;
|
|
@@ -22,6 +23,7 @@ export function DataTablePagination({
|
|
|
22
23
|
page
|
|
23
24
|
});
|
|
24
25
|
},
|
|
26
|
+
padding: padding,
|
|
25
27
|
onChangeLimit: perPage => {
|
|
26
28
|
onChangeParams({
|
|
27
29
|
...params,
|