@tap-payments/os-micro-frontend-shared 0.0.196 → 0.0.197
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/build/components/StatusGroupChips/StatusGroupChips.d.ts +1 -1
- package/build/components/StatusGroupChips/StatusGroupChips.js +4 -6
- package/build/components/StatusGroupChips/style.d.ts +5 -0
- package/build/components/StatusGroupChips/style.js +18 -0
- package/build/components/StatusGroupChips/type.d.ts +0 -8
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { StatusGroupChipsProps } from './type';
|
|
2
|
-
declare const StatusGroupChips: ({ chips, containerSx,
|
|
2
|
+
declare const StatusGroupChips: ({ chips, containerSx, defaultChipSx, ...containerProps }: StatusGroupChipsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default StatusGroupChips;
|
|
@@ -10,17 +10,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
14
|
-
import StatusChip from '../StatusChip';
|
|
13
|
+
import { StyledContainer, StyledStatusChip } from './style';
|
|
15
14
|
const StatusGroupChips = (_a) => {
|
|
16
|
-
var { chips, containerSx,
|
|
15
|
+
var { chips, containerSx, defaultChipSx } = _a, containerProps = __rest(_a, ["chips", "containerSx", "defaultChipSx"]);
|
|
17
16
|
if (!chips || chips.length === 0) {
|
|
18
17
|
return null;
|
|
19
18
|
}
|
|
20
|
-
return (_jsx(
|
|
21
|
-
alignItems, flexDirection: direction }, containerSx) }, containerProps, { children: chips.map((_a) => {
|
|
19
|
+
return (_jsx(StyledContainer, Object.assign({ sx: containerSx }, containerProps, { children: chips.map((_a) => {
|
|
22
20
|
var { key, content, sx } = _a, chipProps = __rest(_a, ["key", "content", "sx"]);
|
|
23
|
-
return (_jsx(
|
|
21
|
+
return (_jsx(StyledStatusChip, Object.assign({ sx: Object.assign(Object.assign({}, defaultChipSx), sx) }, chipProps, { children: content }), key));
|
|
24
22
|
}) })));
|
|
25
23
|
};
|
|
26
24
|
export default StatusGroupChips;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
+
export declare const StyledStatusChip: import("@emotion/styled").StyledComponent<Omit<import("../StatusChip").StatusChipProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { styled, Box } from '@mui/material';
|
|
2
|
+
import StatusChip from '../StatusChip';
|
|
3
|
+
export const StyledContainer = styled(Box)(() => ({
|
|
4
|
+
display: 'flex',
|
|
5
|
+
gap: '4px',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
}));
|
|
9
|
+
export const StyledStatusChip = styled(StatusChip)(() => ({
|
|
10
|
+
padding: '0.75px 12px',
|
|
11
|
+
maxWidth: '120px',
|
|
12
|
+
overflow: 'hidden',
|
|
13
|
+
textOverflow: 'ellipsis',
|
|
14
|
+
whiteSpace: 'nowrap',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
gap: '4px',
|
|
18
|
+
}));
|
|
@@ -4,18 +4,10 @@ export interface ChipConfig {
|
|
|
4
4
|
key: string;
|
|
5
5
|
content: React.ReactNode;
|
|
6
6
|
sx?: object;
|
|
7
|
-
textColor?: string;
|
|
8
|
-
bgColor?: string;
|
|
9
|
-
borderColor?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
padding?: string;
|
|
12
7
|
onClick?: (event: React.MouseEvent) => void;
|
|
13
8
|
}
|
|
14
9
|
export interface StatusGroupChipsProps extends Omit<BoxProps, 'children'> {
|
|
15
10
|
chips: ChipConfig[];
|
|
16
11
|
containerSx?: object;
|
|
17
|
-
gap?: string | number;
|
|
18
|
-
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
19
|
-
alignItems?: 'center' | 'flex-start' | 'flex-end' | 'stretch' | 'baseline';
|
|
20
12
|
defaultChipSx?: object;
|
|
21
13
|
}
|
package/package.json
CHANGED