@tap-payments/os-micro-frontend-shared 0.1.172-test.13 → 0.1.172-test.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.
@@ -9,18 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { memo, Children } from 'react';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { memo } from 'react';
14
14
  import Popper from '@mui/material/Popper';
15
- import { Box } from '@mui/material';
16
- import { StyledDropdown } from './style';
17
- import { useScrollWithShadow } from '../Widget/useScrollWithShadow';
18
- import { listShadowBg } from '../../constants/index.js';
15
+ import { StyledContainer } from './style';
19
16
  function Menu(_a) {
20
17
  var { open, anchorEl, children, sx, placement, popperSx } = _a, props = __rest(_a, ["open", "anchorEl", "children", "sx", "placement", "popperSx"]);
21
- const { onScrollHandler, showShadow } = useScrollWithShadow();
22
- const childrenCount = Children.count(children);
23
- const shouldShowShadow = childrenCount > 11 && showShadow;
24
- return (_jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: placement || 'bottom-start', sx: popperSx }, props, { children: _jsxs(StyledDropdown, Object.assign({ onScroll: onScrollHandler, className: "MuiPopper-dropdown", sx: sx }, { children: [children, shouldShowShadow && _jsx(Box, { component: "img", src: listShadowBg, sx: { width: '100%', position: 'fixed', bottom: 0, pointerEvents: 'none' } })] })) }), "menu"));
18
+ return (_jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: placement || 'bottom-start', sx: popperSx }, props, { children: _jsx(StyledContainer, Object.assign({ className: "MuiPopper-dropdown", sx: sx }, { children: children })) }), "menu"));
25
19
  }
26
20
  export default memo(Menu);
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledDropdown: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
+ export declare const StyledContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
3
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
4
  }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  import Box from '@mui/material/Box';
2
2
  import { styled } from '@mui/material/styles';
3
- export const StyledDropdown = styled(Box)(({ theme }) => ({
3
+ export const StyledContainer = styled(Box)(({ theme }) => ({
4
4
  borderRadius: theme.spacing(0.5),
5
5
  background: theme.palette.background.default,
6
6
  width: 'max-content',
@@ -10,6 +10,22 @@ export const StyledDropdown = styled(Box)(({ theme }) => ({
10
10
  flexDirection: 'column',
11
11
  overflowY: 'scroll',
12
12
  maxHeight: '420px',
13
+ boxSizing: 'border-box',
14
+ scrollbarWidth: 'auto',
15
+ '&::-webkit-scrollbar': {
16
+ display: 'block',
17
+ width: '11px',
18
+ },
19
+ '&::-webkit-scrollbar-track': {
20
+ background: 'transparent',
21
+ },
22
+ '&::-webkit-scrollbar-thumb': {
23
+ backgroundColor: '#DADCDF',
24
+ borderRadius: '32px',
25
+ border: '3px solid transparent',
26
+ backgroundClip: 'content-box',
27
+ minHeight: '20px',
28
+ },
13
29
  '.menu-item + .menu-item': {
14
30
  borderTop: `1px solid ${theme.palette.divider}`,
15
31
  },
package/package.json CHANGED
@@ -1,8 +1,8 @@
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.172-test.13",
5
- "testVersion": 13,
4
+ "version": "0.1.172-test.7",
5
+ "testVersion": 7,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",