@tap-payments/os-micro-frontend-shared 0.1.174 → 0.1.175-test.2

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Tap Payments
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tap Payments
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # os-micro-frontend-shared
2
-
3
- ## Publishing Workflow
4
-
5
- 1. Update version in package.json
6
- 2. Commit changes
7
- 3. Create and push a tag:
8
-
9
- ```bash
10
- npm version patch # or minor, major
11
- git push origin main --tags
12
- ```
1
+ # os-micro-frontend-shared
2
+
3
+ ## Publishing Workflow
4
+
5
+ 1. Update version in package.json
6
+ 2. Commit changes
7
+ 3. Create and push a tag:
8
+
9
+ ```bash
10
+ npm version patch # or minor, major
11
+ git push origin main --tags
12
+ ```
@@ -9,12 +9,17 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { memo } from 'react';
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { memo, Children } from 'react';
14
14
  import Popper from '@mui/material/Popper';
15
- import { Dropdown } from './style';
15
+ import { useScrollWithShadow } from '../Widget/useScrollWithShadow';
16
+ import { listShadowBg } from '../../constants/index.js';
17
+ import { StyledDropdown, ShadowBackground } from './style';
16
18
  function Menu(_a) {
17
19
  var { open, anchorEl, children, sx, placement, popperSx } = _a, props = __rest(_a, ["open", "anchorEl", "children", "sx", "placement", "popperSx"]);
18
- return (_jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: placement || 'bottom-start', sx: popperSx }, props, { children: _jsx(Dropdown, Object.assign({ className: "MuiPopper-dropdown", sx: sx }, { children: children })) }), "menu"));
20
+ const { onScrollHandler, showShadow } = useScrollWithShadow();
21
+ const childrenCount = Children.count(children);
22
+ const shouldShowShadow = childrenCount > 11 && showShadow;
23
+ 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(ShadowBackground, { component: "img", src: listShadowBg })] })) }), "menu"));
19
24
  }
20
25
  export default memo(Menu);
@@ -1,4 +1,9 @@
1
1
  /// <reference types="react" />
2
- export declare const Dropdown: 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 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"> & {
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>, {}, {}>;
5
+ export declare const ShadowBackground: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
8
+ src: string;
9
+ }, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  import Box from '@mui/material/Box';
2
2
  import { styled } from '@mui/material/styles';
3
- export const Dropdown = styled(Box)(({ theme }) => ({
3
+ export const StyledDropdown = styled(Box)(({ theme }) => ({
4
4
  borderRadius: theme.spacing(0.5),
5
5
  background: theme.palette.background.default,
6
6
  width: 'max-content',
@@ -8,7 +8,17 @@ export const Dropdown = styled(Box)(({ theme }) => ({
8
8
  boxShadow: theme.shadows[11],
9
9
  display: 'flex',
10
10
  flexDirection: 'column',
11
+ overflowY: 'scroll',
12
+ maxHeight: '432px',
11
13
  '.menu-item + .menu-item': {
12
14
  borderTop: `1px solid ${theme.palette.divider}`,
13
15
  },
14
16
  }));
17
+ export const ShadowBackground = styled(Box)(() => ({
18
+ width: '100%',
19
+ height: '34px',
20
+ position: 'fixed',
21
+ bottom: 0,
22
+ pointerEvents: 'none',
23
+ zIndex: 999999,
24
+ }));
@@ -9,5 +9,6 @@ export function useScrollWithShadow() {
9
9
  setScrollHeight(target.scrollHeight);
10
10
  setClientHeight(target.clientHeight);
11
11
  };
12
- return { onScrollHandler, showShadow: scrollTop === 0 || clientHeight < scrollHeight - scrollTop };
12
+ const showShadow = scrollTop === 0 || clientHeight < scrollHeight - scrollTop - 1;
13
+ return { onScrollHandler, showShadow };
13
14
  }
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.174",
5
- "testVersion": 0,
4
+ "version": "0.1.175-test.2",
5
+ "testVersion": 2,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -163,4 +163,4 @@
163
163
  "publishConfig": {
164
164
  "registry": "https://registry.npmjs.org/"
165
165
  }
166
- }
166
+ }