@tap-payments/os-micro-frontend-shared 0.1.147-test.4 → 0.1.147

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.
@@ -4,5 +4,4 @@ export declare const statusIcons: {
4
4
  closed: string;
5
5
  expired: string;
6
6
  ready: string;
7
- registered: string;
8
7
  };
@@ -5,5 +5,4 @@ export const statusIcons = {
5
5
  closed: closedLeadStatusIcon,
6
6
  expired: expiredLeadStatusIcon,
7
7
  ready: readyLeadStatusIcon,
8
- registered: completedLeadStatusIcon,
9
8
  };
@@ -19,25 +19,21 @@ import { TableCell } from '../../../TableCells';
19
19
  import { segmentsIcons } from './constant';
20
20
  import { ReferenceTextLabel, ReferenceTextWrapper, ReferenceSourcesContainer, StyledSourceCell, referenceSourceAnimation } from './style';
21
21
  import IconWithBadge from '../../../IconWithBadge';
22
- import { getSegmentTooltip } from './utils';
23
22
  function SegmentsCell(_a) {
24
23
  var { isTextShown, segments } = _a, props = __rest(_a, ["isTextShown", "segments"]);
25
24
  const [isTooltipOpen, setIsTooltipOpen] = useState(false);
26
25
  const theme = useTheme();
27
26
  const ReferenceSources = useMemo(() => segments === null || segments === void 0 ? void 0 : segments.filter((segment) => !!segment.name).map((segment, index) => {
28
- var _a, _b;
29
- const isPlatformSegment = (_b = (_a = segment.type) === null || _a === void 0 ? void 0 : _a.toLowerCase) === null || _b === void 0 ? void 0 : _b.call(_a).includes('platform');
30
- const sourceTooltip = segment.tooltip || getSegmentTooltip(segment);
31
- const segmentType = segment.type;
32
- const icon = isPlatformSegment ? segmentsIcons.platform : segmentsIcons[segmentType];
27
+ const prefixKey = ['technology', 'institution'].includes(segment.type) ? 'Payment' : '';
28
+ const sourceTooltip = segment.tooltip || `${prefixKey} ${startCase(segment.type)} - ${segment.name}`;
33
29
  return (_jsx(Tooltip, Object.assign({ onOpen: () => {
34
30
  setIsTooltipOpen(true);
35
31
  }, onClose: () => {
36
32
  setIsTooltipOpen(false);
37
33
  }, title: sourceTooltip }, { children: _jsx(ImageWrapper, Object.assign({ order: index, variants: referenceSourceAnimation(index, theme.shadows[4], isTextShown ? 83 : 0), sx: {
38
34
  width: isTextShown ? '79px' : '36px',
39
- } }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment.name) }) })) : (_jsx(IconWithBadge, { mainIcon: segment.icon || icon, mainIconSize: 16, containerSize: 16, sx: Object.assign({}, (segment.icon ? { borderRadius: '40px' } : { borderRadius: '0px' })), onError: (e) => {
40
- e.currentTarget.src = segmentsIcons[segmentType];
35
+ } }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment.name) }) })) : (_jsx(IconWithBadge, { mainIcon: segment.icon || segmentsIcons[segment.type], mainIconSize: 16, containerSize: 16, sx: Object.assign({}, (segment.icon ? { borderRadius: '40px' } : { borderRadius: '0px' })), onError: (e) => {
36
+ e.currentTarget.src = segmentsIcons[segment.type];
41
37
  e.currentTarget.style.borderRadius = '0px';
42
38
  }, borderColor: "transparent" })) })) }), `${segment.name}-${index}`));
43
39
  }), [segments, isTextShown, theme]);
@@ -4,7 +4,7 @@ export type SegmentsType = keyof typeof segmentsIcons;
4
4
  export interface SegmentInfo {
5
5
  name?: string;
6
6
  icon?: string;
7
- type: string;
7
+ type: SegmentsType;
8
8
  tooltip?: string;
9
9
  }
10
10
  export interface SegmentsCellProps extends TableCellProps {
@@ -15,4 +15,3 @@ export declare const maskValue: (value: string) => string;
15
15
  * @returns The transformed string with proper case formatting
16
16
  */
17
17
  export declare const transformStringToProperCase: (text: string, separator?: string | RegExp, replacement?: string) => string;
18
- export declare const capitalizeString: (text?: string) => string;
@@ -1,4 +1,3 @@
1
- import { capitalize } from 'lodash';
2
1
  import startCase from 'lodash/startCase';
3
2
  export const removePrefixFromString = (str, prefix) => {
4
3
  if (!prefix) {
@@ -68,6 +67,3 @@ export const transformStringToProperCase = (text, separator = /_/g, replacement
68
67
  // Apply proper case formatting
69
68
  return startCase(updatedText);
70
69
  };
71
- export const capitalizeString = (text) => {
72
- return capitalize(text === null || text === void 0 ? void 0 : text.replace(/_/g, ' '));
73
- };
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.147-test.4",
5
- "testVersion": 4,
4
+ "version": "0.1.147",
5
+ "testVersion": 0,
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
+ }
@@ -1,2 +0,0 @@
1
- import { SegmentInfo } from './type';
2
- export declare const getSegmentTooltip: (segment: SegmentInfo) => string;
@@ -1,14 +0,0 @@
1
- import { capitalizeString } from '../../../../utils/index.js';
2
- export const getSegmentTooltip = (segment) => {
3
- let prefixKey = '';
4
- switch (segment.type) {
5
- case 'technology':
6
- case 'institution':
7
- prefixKey = 'Payment';
8
- break;
9
- default:
10
- prefixKey = '';
11
- break;
12
- }
13
- return `${prefixKey} ${capitalizeString(segment.type)} - ${segment.name}`;
14
- };