@tap-payments/os-micro-frontend-shared 0.1.32-test.1 → 0.1.32

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
+ ```
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { RadioButtonProps } from './type';
3
+ declare function RadioButton({ size, customCheckedIcon, checkedColor, disabledColor, hoverColor, iconSize, showRipple, sx, ...props }: RadioButtonProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: import("react").MemoExoticComponent<typeof RadioButton>;
5
+ export default _default;
@@ -0,0 +1,19 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { memo } from 'react';
14
+ import { StyledRadio, StyledRadioCheckedIcon } from './style';
15
+ function RadioButton(_a) {
16
+ var { size = 'small', customCheckedIcon, checkedColor, disabledColor, hoverColor, iconSize, showRipple = false, sx } = _a, props = __rest(_a, ["size", "customCheckedIcon", "checkedColor", "disabledColor", "hoverColor", "iconSize", "showRipple", "sx"]);
17
+ return (_jsx(StyledRadio, Object.assign({ size: size === 'large' ? 'medium' : size, disableRipple: !showRipple, checkedIcon: customCheckedIcon || _jsx(StyledRadioCheckedIcon, {}), iconSize: iconSize, checkedColor: checkedColor, disabledColor: disabledColor, hoverColor: hoverColor, sx: sx }, props)));
18
+ }
19
+ export default memo(RadioButton);
@@ -0,0 +1,2 @@
1
+ export { default as RadioButton } from './RadioButton';
2
+ export type { RadioButtonProps } from './type';
@@ -0,0 +1 @@
1
+ export { default as RadioButton } from './RadioButton';
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ export declare const DEFAULT_COLORS: {
3
+ readonly color: "#8C9196";
4
+ readonly checkedColor: "#1F88D0";
5
+ readonly disabledColor: "#C7C7CC";
6
+ };
7
+ export declare const SIZE_CONFIG: {
8
+ readonly small: {
9
+ readonly iconSize: 15;
10
+ readonly maxWidth: "24px";
11
+ };
12
+ readonly medium: {
13
+ readonly iconSize: 18;
14
+ readonly maxWidth: "28px";
15
+ };
16
+ readonly large: {
17
+ readonly iconSize: 20;
18
+ readonly maxWidth: "32px";
19
+ };
20
+ };
21
+ export declare const StyledRadioCheckedIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>, {}, {}>;
22
+ export declare const StyledRadio: import("@emotion/styled").StyledComponent<import("@mui/material/Radio").RadioProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
23
+ iconSize?: number | undefined;
24
+ checkedColor?: string | undefined;
25
+ disabledColor?: string | undefined;
26
+ hoverColor?: string | undefined;
27
+ }, {}, {}>;
@@ -0,0 +1,64 @@
1
+ import { styled } from '@mui/material/styles';
2
+ import Radio from '@mui/material/Radio';
3
+ export const DEFAULT_COLORS = {
4
+ color: '#8C9196',
5
+ checkedColor: '#1F88D0',
6
+ disabledColor: '#C7C7CC',
7
+ };
8
+ export const SIZE_CONFIG = {
9
+ small: {
10
+ iconSize: 15,
11
+ maxWidth: '24px',
12
+ },
13
+ medium: {
14
+ iconSize: 18,
15
+ maxWidth: '28px',
16
+ },
17
+ large: {
18
+ iconSize: 20,
19
+ maxWidth: '32px',
20
+ },
21
+ };
22
+ const StyledRadioIcon = styled('span')(() => ({
23
+ borderRadius: '50%',
24
+ width: '12px',
25
+ height: '12px',
26
+ boxSizing: 'border-box',
27
+ boxShadow: 'inset 0 0 0 1px rgba(16,22,26,.2), inset 0 -1px 0 rgba(16,22,26,.1)',
28
+ }));
29
+ export const StyledRadioCheckedIcon = styled(StyledRadioIcon)({
30
+ backgroundColor: DEFAULT_COLORS.checkedColor,
31
+ '&::before': {
32
+ display: 'block',
33
+ width: '12px',
34
+ height: '12px',
35
+ backgroundColor: DEFAULT_COLORS.checkedColor,
36
+ borderRadius: '50%',
37
+ backgroundImage: 'radial-gradient(#fff,#fff 28%,transparent 32%)',
38
+ content: '""',
39
+ },
40
+ });
41
+ export const StyledRadio = styled(Radio, {
42
+ shouldForwardProp: (prop) => !['iconSize', 'checkedColor', 'disabledColor', 'hoverColor'].includes(prop),
43
+ })(({ iconSize, checkedColor, disabledColor, hoverColor }) => {
44
+ return {
45
+ '& .MuiSvgIcon-root': {
46
+ fontSize: iconSize || SIZE_CONFIG.small.iconSize,
47
+ },
48
+ maxWidth: SIZE_CONFIG.small.maxWidth,
49
+ cursor: 'pointer',
50
+ color: DEFAULT_COLORS.color,
51
+ '&.Mui-checked': {
52
+ color: checkedColor || DEFAULT_COLORS.checkedColor,
53
+ },
54
+ '&:hover': hoverColor
55
+ ? {
56
+ backgroundColor: 'transparent',
57
+ color: hoverColor,
58
+ }
59
+ : undefined,
60
+ '&.Mui-disabled': {
61
+ color: disabledColor || DEFAULT_COLORS.disabledColor,
62
+ },
63
+ };
64
+ });
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { RadioProps, SxProps, Theme } from '@mui/material';
3
+ export interface RadioButtonProps extends Omit<RadioProps, 'checkedIcon' | 'icon' | 'color' | 'size'> {
4
+ size?: 'small' | 'medium' | 'large';
5
+ customCheckedIcon?: React.ReactNode;
6
+ checkedColor?: string;
7
+ disabledColor?: string;
8
+ hoverColor?: string;
9
+ iconSize?: number;
10
+ showRipple?: boolean;
11
+ sx?: SxProps<Theme>;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { CustomRadioGroupProps } from './type';
3
+ declare function RadioGroup({ options, onOptionChange, size, customLabelRenderer, layout, spacing, labelPosition, showHoverEffects, customRadioProps, labelSx, onChange, sx, ...props }: CustomRadioGroupProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: import("react").MemoExoticComponent<typeof RadioGroup>;
5
+ export default _default;
@@ -0,0 +1,31 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { memo } from 'react';
14
+ import MuiRadioGroup from '@mui/material/RadioGroup';
15
+ import { StyledFormControlLabel } from './style';
16
+ import { RadioButton } from '../RadioButton';
17
+ function RadioItem(_a) {
18
+ var { option, size = 'small', customLabelRenderer, labelPosition = 'end', showHoverEffects = true, customRadioProps, labelSx } = _a, props = __rest(_a, ["option", "size", "customLabelRenderer", "labelPosition", "showHoverEffects", "customRadioProps", "labelSx"]);
19
+ const label = customLabelRenderer ? customLabelRenderer(option) : option.label;
20
+ return (_jsx(StyledFormControlLabel, Object.assign({ value: option.value, control: _jsx(RadioButton, Object.assign({ size: size }, customRadioProps, option.customProps)), label: label, disabled: option.disabled, size: size, labelPlacement: labelPosition, showHoverEffects: showHoverEffects, labelSx: labelSx }, props)));
21
+ }
22
+ function RadioGroup(_a) {
23
+ var { options, onOptionChange, size = 'small', customLabelRenderer, layout = 'vertical', spacing = 0, labelPosition = 'end', showHoverEffects = true, customRadioProps, labelSx, onChange, sx } = _a, props = __rest(_a, ["options", "onOptionChange", "size", "customLabelRenderer", "layout", "spacing", "labelPosition", "showHoverEffects", "customRadioProps", "labelSx", "onChange", "sx"]);
24
+ const handleChange = (event) => {
25
+ const value = event.target.value;
26
+ onOptionChange === null || onOptionChange === void 0 ? void 0 : onOptionChange(value);
27
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, value);
28
+ };
29
+ return (_jsx(MuiRadioGroup, Object.assign({ onChange: handleChange, sx: Object.assign({ display: 'flex', flexDirection: layout === 'horizontal' ? 'row' : 'column', gap: spacing }, sx) }, props, { children: options.map((option) => (_jsx(RadioItem, { option: option, size: size, customLabelRenderer: customLabelRenderer, labelPosition: labelPosition, showHoverEffects: showHoverEffects, customRadioProps: customRadioProps, labelSx: labelSx }, option.value))) })));
30
+ }
31
+ export default memo(RadioGroup);
@@ -0,0 +1,2 @@
1
+ export { default as RadioGroup } from './RadioGroup';
2
+ export type { CustomRadioGroupProps, RadioOption } from './type';
@@ -0,0 +1 @@
1
+ export { default as RadioGroup } from './RadioGroup';
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledFormControlLabel: import("@emotion/styled").StyledComponent<import("@mui/material/FormControlLabel").FormControlLabelProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
3
+ size?: "medium" | "small" | "large" | undefined;
4
+ showHoverEffects?: boolean | undefined;
5
+ labelSx?: import("react").CSSProperties | undefined;
6
+ }, {}, {}>;
@@ -0,0 +1,15 @@
1
+ import { styled } from '@mui/material/styles';
2
+ import FormControlLabel from '@mui/material/FormControlLabel';
3
+ export const StyledFormControlLabel = styled(FormControlLabel, {
4
+ shouldForwardProp: (prop) => !['size', 'showHoverEffects', 'labelSx'].includes(prop),
5
+ })(({ size = 'small', showHoverEffects = true, labelSx }) => (Object.assign(Object.assign({ margin: '0', width: '100%', cursor: 'pointer', padding: size === 'small' ? '7.5px 16px 7.5px 8px' : size === 'medium' ? '9px 16px 9px 10px' : '11px 16px 11px 12px', maxHeight: size === 'small' ? '35px' : size === 'medium' ? '40px' : '45px' }, (showHoverEffects && {
6
+ '&:hover': {
7
+ boxShadow: '0px 0px 16px 0px #00000021',
8
+ },
9
+ })), { '& .MuiFormControlLabel-label': Object.assign({ fontSize: size === 'small' ? '11px' : size === 'medium' ? '13px' : '15px', fontWeight: '500', color: '#20232B', width: '100%', cursor: 'pointer' }, labelSx), '& .MuiRadio-root': {
10
+ cursor: 'pointer',
11
+ color: '#8C9196',
12
+ '&.Mui-checked': {
13
+ color: '#1F88D0',
14
+ },
15
+ } })));
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { RadioGroupProps } from '@mui/material/RadioGroup';
3
+ import { FormControlLabelProps } from '@mui/material/FormControlLabel';
4
+ import { RadioButtonProps } from '../RadioButton/type';
5
+ export interface RadioOption {
6
+ value: string;
7
+ label: string;
8
+ disabled?: boolean;
9
+ description?: string;
10
+ icon?: ReactNode;
11
+ customProps?: Partial<RadioButtonProps>;
12
+ }
13
+ export interface CustomRadioGroupProps extends Omit<RadioGroupProps, 'children'> {
14
+ options: RadioOption[];
15
+ onOptionChange?: (value: string) => void;
16
+ size?: 'small' | 'medium' | 'large';
17
+ customLabelRenderer?: (option: RadioOption) => ReactNode;
18
+ layout?: 'vertical' | 'horizontal';
19
+ spacing?: number;
20
+ labelPosition?: 'start' | 'end' | 'top' | 'bottom';
21
+ showHoverEffects?: boolean;
22
+ customRadioProps?: Partial<RadioButtonProps>;
23
+ labelSx?: React.CSSProperties;
24
+ }
25
+ export interface RadioItemProps extends Omit<FormControlLabelProps, 'control' | 'label'> {
26
+ option: RadioOption;
27
+ size?: 'small' | 'medium' | 'large';
28
+ customLabelRenderer?: (option: RadioOption) => ReactNode;
29
+ labelPosition?: 'start' | 'end' | 'top' | 'bottom';
30
+ showHoverEffects?: boolean;
31
+ customRadioProps?: Partial<RadioButtonProps>;
32
+ labelSx?: React.CSSProperties;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { ActionCellProps } from '../type';
3
3
  import { TableMode } from '../../../../types/index.js';
4
4
  type ActionsColumnProps = Readonly<Pick<ActionCellProps, 'flag' | 'flagTooltip' | 'flagsCount' | 'row' | 'showJsonViewer' | 'isTextShown' | 'showIdButton' | 'rowId'>> & {
@@ -6,5 +6,5 @@ type ActionsColumnProps = Readonly<Pick<ActionCellProps, 'flag' | 'flagTooltip'
6
6
  tableMode?: TableMode;
7
7
  };
8
8
  declare function ActionsColumn({ flag, flagTooltip, flagsCount, row, showJsonViewer, isTextShown, showIdButton, rowId, onJsonViewClick, tableMode, ...props }: ActionsColumnProps): import("react/jsx-runtime").JSX.Element;
9
- declare const _default: import("react").MemoExoticComponent<typeof ActionsColumn>;
9
+ declare const _default: React.MemoExoticComponent<typeof ActionsColumn>;
10
10
  export default _default;
@@ -24,7 +24,6 @@ function ActionsColumn(_a) {
24
24
  var { flag, flagTooltip, flagsCount, row, showJsonViewer = true, isTextShown, showIdButton = true, rowId, onJsonViewClick, tableMode } = _a, props = __rest(_a, ["flag", "flagTooltip", "flagsCount", "row", "showJsonViewer", "isTextShown", "showIdButton", "rowId", "onJsonViewClick", "tableMode"]);
25
25
  return (_jsx(TableCell, Object.assign({}, props, { sx: {
26
26
  overflow: 'visible',
27
- zIndex: 1,
28
27
  } }, { children: _jsxs(ActionCellContainer, Object.assign({ "data-testid": "ActionsColumn_ActionCellContainer", tableMode: tableMode }, { children: [flag && (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: flagTooltip }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "ActionsColumn_FlagLabel", sx: {
29
28
  textAlign: 'left',
30
29
  justifyContent: 'flex-start',
@@ -98,3 +98,5 @@ export { default as ScrollLoader } from './ScrollLoader';
98
98
  export * from './ScrollLoader';
99
99
  export * from './TooltipChip';
100
100
  export * from './RightLeftExpandingCenterChip';
101
+ export * from './RadioButton';
102
+ export * from './RadioGroup';
@@ -98,3 +98,5 @@ export { default as ScrollLoader } from './ScrollLoader';
98
98
  export * from './ScrollLoader';
99
99
  export * from './TooltipChip';
100
100
  export * from './RightLeftExpandingCenterChip';
101
+ export * from './RadioButton';
102
+ export * from './RadioGroup';
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.32-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.32",
5
+ "testVersion": 4,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -131,4 +131,4 @@
131
131
  "publishConfig": {
132
132
  "registry": "https://registry.npmjs.org/"
133
133
  }
134
- }
134
+ }