@tap-payments/os-micro-frontend-shared 0.1.268 → 0.1.270

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.
@@ -1 +1 @@
1
- export { default as BrandLogo, BrandLogoProps } from './BrandLogo';
1
+ export { default as BrandLogo, type BrandLogoProps } from './BrandLogo';
@@ -1 +1 @@
1
- export { default as MerchantLogo, MerchantLogoProps } from './MerchantLogo';
1
+ export { default as MerchantLogo, type MerchantLogoProps } from './MerchantLogo';
@@ -1 +1 @@
1
- export { default as OpenFileInNewTab, OpenFileInNewTabProps } from './OpenFileInNewTab';
1
+ export { default as OpenFileInNewTab, type OpenFileInNewTabProps } from './OpenFileInNewTab';
@@ -0,0 +1,2 @@
1
+ import { ViewColumnFilterProps } from './type';
2
+ export default function ViewColumnRadioFilter({ menuLabel, options, selectedValue, onValueChange }: Readonly<ViewColumnFilterProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import { rightArrow } from '../../constants/index.js';
4
+ import { RadioGroup } from '../index.js';
5
+ import { SubMenu, FilterMenuItem } from './style';
6
+ export default function ViewColumnRadioFilter({ menuLabel, options, selectedValue, onValueChange }) {
7
+ const [submenuAnchorEl, setSubmenuAnchorEl] = useState(null);
8
+ const [localSelectedValue, setLocalSelectedValue] = useState(selectedValue);
9
+ const menuItemRef = useRef(null);
10
+ useEffect(() => {
11
+ setLocalSelectedValue(selectedValue);
12
+ }, [selectedValue]);
13
+ const onOpen = (event) => {
14
+ setSubmenuAnchorEl(event.currentTarget);
15
+ };
16
+ const onClose = () => {
17
+ setSubmenuAnchorEl(null);
18
+ };
19
+ const onClick = (event) => {
20
+ event.stopPropagation();
21
+ setSubmenuAnchorEl(event.currentTarget);
22
+ };
23
+ const handleRadioChange = (value) => {
24
+ setLocalSelectedValue(value);
25
+ onValueChange(value);
26
+ };
27
+ return (_jsxs(FilterMenuItem, Object.assign({ ref: menuItemRef, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick, hideCheckbox: true }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: menuLabel })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(SubMenu, Object.assign({ open: Boolean(submenuAnchorEl), anchorEl: submenuAnchorEl, placement: "right-start" }, { children: _jsx(RadioGroup, { options: options, value: localSelectedValue || '', onOptionChange: handleRadioChange, defaultValue: options[0].value }) }))] })));
28
+ }
@@ -0,0 +1 @@
1
+ export { default as ViewColumnRadioFilter } from './ViewColumnRadioFilter';
@@ -0,0 +1 @@
1
+ export { default as ViewColumnRadioFilter } from './ViewColumnRadioFilter';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const SubMenu: import("@emotion/styled").StyledComponent<Omit<import("../Menu/Menu").MenuProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
3
+ export declare const FilterMenuItem: import("@emotion/styled").StyledComponent<import("../MenuItem/MenuItem").MenuItemProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -0,0 +1,20 @@
1
+ import { styled } from '@mui/material/styles';
2
+ import { MenuItem, Menu } from '../index.js';
3
+ export const SubMenu = styled(Menu)(() => ({
4
+ marginTop: '-1px',
5
+ '&:hover': {
6
+ boxShadow: '0px 0px 16px 0px #00000021',
7
+ },
8
+ }));
9
+ export const FilterMenuItem = styled(MenuItem)(({ theme }) => ({
10
+ height: 40,
11
+ flex: 'unset',
12
+ paddingTop: 0,
13
+ paddingBottom: 0,
14
+ borderBottom: `1px solid ${theme.palette.divider}`,
15
+ paddingLeft: '16px',
16
+ maxHeight: '35px',
17
+ '.label': {
18
+ flexGrow: 1,
19
+ },
20
+ }));
@@ -0,0 +1,9 @@
1
+ export interface ViewColumnFilterProps {
2
+ menuLabel: string;
3
+ options: {
4
+ value: string;
5
+ label: string;
6
+ }[];
7
+ selectedValue?: string;
8
+ onValueChange: (value: string) => void;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -137,3 +137,4 @@ export * from './FilePreview';
137
137
  export * from './FileInputPreview';
138
138
  export * from './ReceiptsViewer';
139
139
  export * from './MerchantsDropdown';
140
+ export * from './ViewColumnRadioFilter';
@@ -137,3 +137,4 @@ export * from './FilePreview';
137
137
  export * from './FileInputPreview';
138
138
  export * from './ReceiptsViewer';
139
139
  export * from './MerchantsDropdown';
140
+ export * from './ViewColumnRadioFilter';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.268",
4
+ "version": "0.1.270",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",