@razorpay/blade 12.32.2 → 12.33.1
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/build/lib/native/components/ActionList/ActionListNoResults.js +2 -2
- package/build/lib/native/components/Alert/Alert.js +2 -2
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +3 -3
- package/build/lib/native/components/BottomSheet/BottomSheetCommon.js +3 -3
- package/build/lib/native/components/Carousel/NavigationButton/NavigationButton.js +2 -2
- package/build/lib/native/components/Collapsible/CollapsibleChevronIcon.native.js +2 -2
- package/build/lib/native/components/Form/FormHint.js +2 -2
- package/build/lib/native/components/Form/Selector/SelectorGroupField.js +7 -2
- package/build/lib/native/components/Form/Selector/SelectorGroupField.js.map +1 -1
- package/build/lib/native/components/Icons/useIconProps/iconSizeMap.js +8 -0
- package/build/lib/native/components/Icons/useIconProps/iconSizeMap.js.map +1 -0
- package/build/lib/native/components/Icons/useIconProps/useIconProps.js +2 -4
- package/build/lib/native/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/native/components/InfoGroup/InfoGroup.native.js +7 -0
- package/build/lib/native/components/InfoGroup/InfoGroup.native.js.map +1 -0
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js +2 -2
- package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +2 -2
- package/build/lib/native/components/Input/SearchInput/SearchInput.js +2 -2
- package/build/lib/native/components/Input/TextArea/TextArea.js +2 -2
- package/build/lib/native/components/Input/TextInput/TextInput.js +2 -2
- package/build/lib/native/components/Popover/PopoverCloseButton.js +2 -2
- package/build/lib/native/components/Table/tokens.js +2 -2
- package/build/lib/native/components/index.js +1 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorGroupField.js +12 -3
- package/build/lib/web/development/components/Form/Selector/SelectorGroupField.js.map +1 -1
- package/build/lib/web/development/components/Icons/useIconProps/iconSizeMap.js +14 -0
- package/build/lib/web/development/components/Icons/useIconProps/iconSizeMap.js.map +1 -0
- package/build/lib/web/development/components/Icons/useIconProps/useIconProps.js +3 -12
- package/build/lib/web/development/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js +448 -0
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/InfoGroupContext.js +26 -0
- package/build/lib/web/development/components/InfoGroup/InfoGroupContext.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/index.js +3 -0
- package/build/lib/web/development/components/InfoGroup/index.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/infoGroupTokens.js +49 -0
- package/build/lib/web/development/components/InfoGroup/infoGroupTokens.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/types.js +2 -0
- package/build/lib/web/development/components/InfoGroup/types.js.map +1 -0
- package/build/lib/web/development/components/Table/commonStyles/tableBodyStyles.js +1 -1
- package/build/lib/web/development/components/Table/commonStyles/tableBodyStyles.js.map +1 -1
- package/build/lib/web/development/components/index.js +2 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +5 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorGroupField.js +12 -3
- package/build/lib/web/production/components/Form/Selector/SelectorGroupField.js.map +1 -1
- package/build/lib/web/production/components/Icons/useIconProps/iconSizeMap.js +14 -0
- package/build/lib/web/production/components/Icons/useIconProps/iconSizeMap.js.map +1 -0
- package/build/lib/web/production/components/Icons/useIconProps/useIconProps.js +3 -12
- package/build/lib/web/production/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js +448 -0
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/InfoGroupContext.js +26 -0
- package/build/lib/web/production/components/InfoGroup/InfoGroupContext.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/index.js +3 -0
- package/build/lib/web/production/components/InfoGroup/index.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/infoGroupTokens.js +49 -0
- package/build/lib/web/production/components/InfoGroup/infoGroupTokens.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/types.js +2 -0
- package/build/lib/web/production/components/InfoGroup/types.js.map +1 -0
- package/build/lib/web/production/components/Table/commonStyles/tableBodyStyles.js +1 -1
- package/build/lib/web/production/components/Table/commonStyles/tableBodyStyles.js.map +1 -1
- package/build/lib/web/production/components/index.js +2 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +5 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/types/components/index.d.ts +1331 -1
- package/build/types/components/index.native.d.ts +89 -1
- package/package.json +1 -1
|
@@ -1,19 +1,10 @@
|
|
|
1
|
+
import { iconSizeMap } from './iconSizeMap.js';
|
|
1
2
|
import getIn from '../../../utils/lodashButBetter/get.js';
|
|
2
3
|
import '../../BladeProvider/index.js';
|
|
3
|
-
import '../../../tokens/global/index.js';
|
|
4
4
|
import '../../../utils/makeSize/index.js';
|
|
5
|
-
import { size } from '../../../tokens/global/size.js';
|
|
6
5
|
import useTheme from '../../BladeProvider/useTheme.js';
|
|
7
6
|
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
8
7
|
|
|
9
|
-
var iconSize = {
|
|
10
|
-
xsmall: size[8],
|
|
11
|
-
small: size[12],
|
|
12
|
-
medium: size[16],
|
|
13
|
-
large: size[20],
|
|
14
|
-
xlarge: size[24],
|
|
15
|
-
'2xlarge': size[32]
|
|
16
|
-
};
|
|
17
8
|
function useIconProps(_ref) {
|
|
18
9
|
var _ref$size = _ref.size,
|
|
19
10
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
@@ -21,8 +12,8 @@ function useIconProps(_ref) {
|
|
|
21
12
|
color = _ref$color === void 0 ? 'surface.icon.gray.normal' : _ref$color;
|
|
22
13
|
var _useTheme = useTheme(),
|
|
23
14
|
theme = _useTheme.theme;
|
|
24
|
-
var height = makeSize(
|
|
25
|
-
var width = makeSize(
|
|
15
|
+
var height = makeSize(iconSizeMap[size]);
|
|
16
|
+
var width = makeSize(iconSizeMap[size]);
|
|
26
17
|
var iconColor = color === 'currentColor' ? 'currentColor' : getIn(theme.colors, color, '');
|
|
27
18
|
return {
|
|
28
19
|
height: height,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIconProps.js","sources":["../../../../../../../src/components/Icons/useIconProps/useIconProps.tsx"],"sourcesContent":["import type { IconProps } from '..';\nimport get from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport {
|
|
1
|
+
{"version":3,"file":"useIconProps.js","sources":["../../../../../../../src/components/Icons/useIconProps/useIconProps.tsx"],"sourcesContent":["import type { IconProps } from '..';\nimport { iconSizeMap } from './iconSizeMap';\nimport get from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeSize } from '~utils/makeSize';\n\nfunction useIconProps({\n size = 'medium',\n color = 'surface.icon.gray.normal',\n}: IconProps): {\n height: `${typeof iconSizeMap[keyof typeof iconSizeMap]}px`;\n width: `${typeof iconSizeMap[keyof typeof iconSizeMap]}px`;\n iconColor: string;\n} {\n const { theme } = useTheme();\n const height = makeSize(iconSizeMap[size]);\n const width = makeSize(iconSizeMap[size]);\n const iconColor = color === 'currentColor' ? 'currentColor' : get(theme.colors, color, '');\n\n return { height, width, iconColor };\n}\n\nexport default useIconProps;\n"],"names":["useIconProps","_ref","_ref$size","size","_ref$color","color","_useTheme","useTheme","theme","height","makeSize","iconSizeMap","width","iconColor","get","colors"],"mappings":";;;;;;;AAMA,SAASA,YAAYA,CAAAC,IAAA,EAOnB;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CANAE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,SAAA;IAAAE,UAAA,GAAAH,IAAA,CACfI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,0BAA0B,GAAAA,UAAA,CAAA;AAMlC,EAAA,IAAAE,SAAA,GAAkBC,QAAQ,EAAE;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK,CAAA;EACb,IAAMC,MAAM,GAAGC,QAAQ,CAACC,WAAW,CAACR,IAAI,CAAC,CAAC,CAAA;EAC1C,IAAMS,KAAK,GAAGF,QAAQ,CAACC,WAAW,CAACR,IAAI,CAAC,CAAC,CAAA;AACzC,EAAA,IAAMU,SAAS,GAAGR,KAAK,KAAK,cAAc,GAAG,cAAc,GAAGS,KAAG,CAACN,KAAK,CAACO,MAAM,EAAEV,KAAK,EAAE,EAAE,CAAC,CAAA;EAE1F,OAAO;AAAEI,IAAAA,MAAM,EAANA,MAAM;AAAEG,IAAAA,KAAK,EAALA,KAAK;AAAEC,IAAAA,SAAS,EAATA,SAAAA;GAAW,CAAA;AACrC;;;;"}
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import { itemTitleHeight, iconSize, elementGap, titleTextSize, helpTextSize, avatarAdjustmentPaddingY } from './infoGroupTokens.js';
|
|
6
|
+
import { useInfoGroup, useInfoItem, InfoItemContext, InfoGroupContext } from './InfoGroupContext.js';
|
|
7
|
+
import '../Box/BaseBox/index.js';
|
|
8
|
+
import '../Typography/index.js';
|
|
9
|
+
import '../../utils/metaAttribute/index.js';
|
|
10
|
+
import '../Box/styledProps/index.js';
|
|
11
|
+
import '../../utils/assignWithoutSideEffects/index.js';
|
|
12
|
+
import '../../utils/index.js';
|
|
13
|
+
import '../Divider/index.js';
|
|
14
|
+
import '../../utils/isValidAllowedChildren/index.js';
|
|
15
|
+
import { useIsomorphicLayoutEffect } from '../../utils/useIsomorphicLayoutEffect.js';
|
|
16
|
+
import '../../utils/useTruncationTitle/index.js';
|
|
17
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
18
|
+
import { makeSize } from '../../utils/makeSize/makeSize.js';
|
|
19
|
+
import { getComponentId } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
|
|
20
|
+
import { useTruncationTitle } from '../../utils/useTruncationTitle/useTruncationTitle.web.js';
|
|
21
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
22
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
23
|
+
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
|
|
24
|
+
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
25
|
+
import { Divider } from '../Divider/Divider.js';
|
|
26
|
+
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
27
|
+
import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
28
|
+
|
|
29
|
+
var _excluded = ["children", "itemOrientation", "size", "valueAlign", "isHighlighted", "gridTemplateColumns", "width", "maxWidth", "minWidth", "testID", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "padding", "paddingX", "paddingY"];
|
|
30
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
+
var getCenterBoxProps = function getCenterBoxProps(size) {
|
|
33
|
+
var strictHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
34
|
+
return _objectSpread({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'flex-start'
|
|
38
|
+
}, strictHeight ? {
|
|
39
|
+
height: makeSize(itemTitleHeight[size])
|
|
40
|
+
} : {
|
|
41
|
+
minHeight: makeSize(itemTitleHeight[size])
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Helper function to render leading/trailing elements (icons or JSX)
|
|
46
|
+
var renderElement = function renderElement(element, size) {
|
|
47
|
+
if (!element) return null;
|
|
48
|
+
|
|
49
|
+
// Check if it's already a JSX element (React element)
|
|
50
|
+
if ( /*#__PURE__*/React__default.isValidElement(element)) {
|
|
51
|
+
return element;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Otherwise, it's a component function - render it with size prop
|
|
55
|
+
var IconComponent = element;
|
|
56
|
+
return /*#__PURE__*/jsx(IconComponent, {
|
|
57
|
+
size: iconSize[size],
|
|
58
|
+
color: "surface.icon.gray.muted"
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var TitleCollection = function TitleCollection(_ref) {
|
|
62
|
+
var children = _ref.children,
|
|
63
|
+
leading = _ref.leading,
|
|
64
|
+
trailing = _ref.trailing,
|
|
65
|
+
helpText = _ref.helpText,
|
|
66
|
+
titleWeight = _ref.titleWeight,
|
|
67
|
+
titleColor = _ref.titleColor,
|
|
68
|
+
paddingLeft = _ref.paddingLeft,
|
|
69
|
+
paddingRight = _ref.paddingRight,
|
|
70
|
+
truncateAfterLines = _ref.truncateAfterLines;
|
|
71
|
+
var _useInfoGroup = useInfoGroup(),
|
|
72
|
+
size = _useInfoGroup.size;
|
|
73
|
+
var _useInfoItem = useInfoItem(),
|
|
74
|
+
setHasAvatar = _useInfoItem.setHasAvatar;
|
|
75
|
+
var isAvatar = getComponentId( /*#__PURE__*/React__default.isValidElement(leading) ? leading : undefined) === 'Avatar';
|
|
76
|
+
|
|
77
|
+
// Set hasAvatar context when an avatar is detected
|
|
78
|
+
useIsomorphicLayoutEffect(function () {
|
|
79
|
+
if (isAvatar) {
|
|
80
|
+
setHasAvatar(true);
|
|
81
|
+
}
|
|
82
|
+
}, [isAvatar, setHasAvatar]);
|
|
83
|
+
var _useTruncationTitle = useTruncationTitle({
|
|
84
|
+
content: typeof children === 'string' ? children : undefined
|
|
85
|
+
}),
|
|
86
|
+
containerRef = _useTruncationTitle.containerRef,
|
|
87
|
+
textRef = _useTruncationTitle.textRef;
|
|
88
|
+
return /*#__PURE__*/jsxs(BaseBox, {
|
|
89
|
+
display: "flex",
|
|
90
|
+
alignItems: "flex-start",
|
|
91
|
+
gap: elementGap[size],
|
|
92
|
+
paddingLeft: paddingLeft,
|
|
93
|
+
paddingRight: paddingRight,
|
|
94
|
+
children: [leading && /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, getCenterBoxProps(size, true)), {}, {
|
|
95
|
+
children: renderElement(leading, size)
|
|
96
|
+
})), /*#__PURE__*/jsxs(BaseBox, {
|
|
97
|
+
display: "flex",
|
|
98
|
+
flexDirection: "column",
|
|
99
|
+
flex: "1",
|
|
100
|
+
children: [/*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
|
|
101
|
+
ref: containerRef
|
|
102
|
+
}, getCenterBoxProps(size)), {}, {
|
|
103
|
+
children: typeof children === 'string' ? /*#__PURE__*/jsx(Text, {
|
|
104
|
+
ref: textRef,
|
|
105
|
+
variant: "body",
|
|
106
|
+
size: titleTextSize[size],
|
|
107
|
+
weight: titleWeight,
|
|
108
|
+
color: titleColor,
|
|
109
|
+
truncateAfterLines: truncateAfterLines,
|
|
110
|
+
children: children
|
|
111
|
+
}) : children
|
|
112
|
+
})), helpText && /*#__PURE__*/jsx(Text, {
|
|
113
|
+
variant: "body",
|
|
114
|
+
size: helpTextSize[size],
|
|
115
|
+
weight: "regular",
|
|
116
|
+
color: "surface.text.gray.muted",
|
|
117
|
+
children: helpText
|
|
118
|
+
})]
|
|
119
|
+
}), trailing && /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, getCenterBoxProps(size, true)), {}, {
|
|
120
|
+
children: renderElement(trailing, size)
|
|
121
|
+
}))]
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
var _InfoItemKey = function _InfoItemKey(_ref2, ref) {
|
|
125
|
+
var children = _ref2.children,
|
|
126
|
+
leading = _ref2.leading,
|
|
127
|
+
trailing = _ref2.trailing,
|
|
128
|
+
helpText = _ref2.helpText,
|
|
129
|
+
truncateAfterLines = _ref2.truncateAfterLines,
|
|
130
|
+
testID = _ref2.testID;
|
|
131
|
+
var _useInfoGroup2 = useInfoGroup(),
|
|
132
|
+
itemOrientation = _useInfoGroup2.itemOrientation,
|
|
133
|
+
size = _useInfoGroup2.size;
|
|
134
|
+
var _useInfoItem2 = useInfoItem(),
|
|
135
|
+
hasAvatar = _useInfoItem2.hasAvatar,
|
|
136
|
+
isHighlighted = _useInfoItem2.isHighlighted;
|
|
137
|
+
return /*#__PURE__*/jsxs(BaseBox, _objectSpread(_objectSpread({
|
|
138
|
+
ref: ref,
|
|
139
|
+
as: "dt",
|
|
140
|
+
display: "flex",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
alignSelf: "flex-start",
|
|
143
|
+
justifyContent: "flex-start",
|
|
144
|
+
paddingY: hasAvatar ? avatarAdjustmentPaddingY[size] : undefined
|
|
145
|
+
}, metaAttribute({
|
|
146
|
+
name: MetaConstants.InfoItemKey,
|
|
147
|
+
testID: testID
|
|
148
|
+
})), {}, {
|
|
149
|
+
children: [itemOrientation === 'horizontal' && isHighlighted ? /*#__PURE__*/jsx(Divider, {
|
|
150
|
+
orientation: "vertical"
|
|
151
|
+
}) : null, /*#__PURE__*/jsx(TitleCollection, {
|
|
152
|
+
leading: leading,
|
|
153
|
+
trailing: trailing,
|
|
154
|
+
helpText: helpText,
|
|
155
|
+
titleWeight: "medium",
|
|
156
|
+
titleColor: "surface.text.gray.muted",
|
|
157
|
+
truncateAfterLines: truncateAfterLines,
|
|
158
|
+
paddingLeft: isHighlighted ? 'spacing.4' : 'spacing.0',
|
|
159
|
+
paddingRight: "spacing.0",
|
|
160
|
+
children: children
|
|
161
|
+
})]
|
|
162
|
+
}));
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* InfoItemKey
|
|
167
|
+
*
|
|
168
|
+
* Displays the key portion of a key-value pair within an InfoItem.
|
|
169
|
+
* Supports leading/trailing elements and customizable text alignment.
|
|
170
|
+
*
|
|
171
|
+
* ----
|
|
172
|
+
*
|
|
173
|
+
* #### Usage
|
|
174
|
+
*
|
|
175
|
+
* ```tsx
|
|
176
|
+
* <InfoItemKey leading={UserIcon}>Account Holder</InfoItemKey>
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* ----
|
|
180
|
+
* Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}
|
|
181
|
+
*/
|
|
182
|
+
var InfoItemKey = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_InfoItemKey), {
|
|
183
|
+
displayName: 'InfoItemKey',
|
|
184
|
+
componentId: 'InfoItemKey'
|
|
185
|
+
});
|
|
186
|
+
var _InfoItemValue = function _InfoItemValue(_ref3, ref) {
|
|
187
|
+
var children = _ref3.children,
|
|
188
|
+
leading = _ref3.leading,
|
|
189
|
+
trailing = _ref3.trailing,
|
|
190
|
+
helpText = _ref3.helpText,
|
|
191
|
+
truncateAfterLines = _ref3.truncateAfterLines,
|
|
192
|
+
testID = _ref3.testID;
|
|
193
|
+
var _useInfoGroup3 = useInfoGroup(),
|
|
194
|
+
itemOrientation = _useInfoGroup3.itemOrientation,
|
|
195
|
+
valueAlign = _useInfoGroup3.valueAlign,
|
|
196
|
+
size = _useInfoGroup3.size;
|
|
197
|
+
var _useInfoItem3 = useInfoItem(),
|
|
198
|
+
hasAvatar = _useInfoItem3.hasAvatar,
|
|
199
|
+
isHighlighted = _useInfoItem3.isHighlighted;
|
|
200
|
+
return /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
|
|
201
|
+
ref: ref,
|
|
202
|
+
as: "dd",
|
|
203
|
+
margin: "spacing.0",
|
|
204
|
+
display: "flex",
|
|
205
|
+
alignItems: "center",
|
|
206
|
+
alignSelf: "flex-start",
|
|
207
|
+
justifyContent: valueAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
208
|
+
paddingY: hasAvatar ? avatarAdjustmentPaddingY[size] : undefined
|
|
209
|
+
}, metaAttribute({
|
|
210
|
+
name: MetaConstants.InfoItemValue,
|
|
211
|
+
testID: testID
|
|
212
|
+
})), {}, {
|
|
213
|
+
children: /*#__PURE__*/jsx(TitleCollection, {
|
|
214
|
+
leading: leading,
|
|
215
|
+
trailing: trailing,
|
|
216
|
+
helpText: helpText,
|
|
217
|
+
titleWeight: "semibold",
|
|
218
|
+
titleColor: "surface.text.gray.subtle",
|
|
219
|
+
truncateAfterLines: truncateAfterLines,
|
|
220
|
+
paddingLeft: isHighlighted && itemOrientation === 'vertical' ? 'spacing.4' : 'spacing.0',
|
|
221
|
+
paddingRight: isHighlighted ? 'spacing.4' : 'spacing.0',
|
|
222
|
+
children: children
|
|
223
|
+
})
|
|
224
|
+
}));
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* InfoItemValue
|
|
229
|
+
*
|
|
230
|
+
* Displays the value portion of a key-value pair within an InfoItem.
|
|
231
|
+
* Supports leading/trailing elements and customizable text alignment.
|
|
232
|
+
*
|
|
233
|
+
* ----
|
|
234
|
+
*
|
|
235
|
+
* #### Usage
|
|
236
|
+
*
|
|
237
|
+
* ```tsx
|
|
238
|
+
* <InfoItemValue helpText="Customer name" trailing={CheckIcon}>
|
|
239
|
+
* Saurabh Daware
|
|
240
|
+
* </InfoItemValue>
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* ----
|
|
244
|
+
* Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}
|
|
245
|
+
*/
|
|
246
|
+
var InfoItemValue = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_InfoItemValue), {
|
|
247
|
+
displayName: 'InfoItemValue',
|
|
248
|
+
componentId: 'InfoItemValue'
|
|
249
|
+
});
|
|
250
|
+
var ContentsItemBox = /*#__PURE__*/React__default.forwardRef(function (_ref4, ref) {
|
|
251
|
+
var children = _ref4.children,
|
|
252
|
+
testID = _ref4.testID;
|
|
253
|
+
return /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
|
|
254
|
+
display: "contents",
|
|
255
|
+
ref: ref
|
|
256
|
+
}, metaAttribute({
|
|
257
|
+
name: MetaConstants.InfoItem,
|
|
258
|
+
testID: testID
|
|
259
|
+
})), {}, {
|
|
260
|
+
children: children
|
|
261
|
+
}));
|
|
262
|
+
});
|
|
263
|
+
var FlexItemBox = /*#__PURE__*/React__default.forwardRef(function (_ref5, ref) {
|
|
264
|
+
var children = _ref5.children,
|
|
265
|
+
testID = _ref5.testID,
|
|
266
|
+
_ref5$isHighlighted = _ref5.isHighlighted,
|
|
267
|
+
isHighlighted = _ref5$isHighlighted === void 0 ? false : _ref5$isHighlighted;
|
|
268
|
+
return /*#__PURE__*/jsxs(BaseBox, _objectSpread(_objectSpread({
|
|
269
|
+
display: "flex",
|
|
270
|
+
ref: ref
|
|
271
|
+
}, metaAttribute({
|
|
272
|
+
name: MetaConstants.InfoItem,
|
|
273
|
+
testID: testID
|
|
274
|
+
})), {}, {
|
|
275
|
+
children: [isHighlighted && /*#__PURE__*/jsx(Divider, {
|
|
276
|
+
orientation: "vertical"
|
|
277
|
+
}), /*#__PURE__*/jsx(BaseBox, {
|
|
278
|
+
display: "flex",
|
|
279
|
+
flexDirection: "column",
|
|
280
|
+
gap: "spacing.2",
|
|
281
|
+
children: children
|
|
282
|
+
})]
|
|
283
|
+
}));
|
|
284
|
+
});
|
|
285
|
+
var _InfoItem = function _InfoItem(_ref6, ref) {
|
|
286
|
+
var children = _ref6.children,
|
|
287
|
+
testID = _ref6.testID,
|
|
288
|
+
isHighlighted = _ref6.isHighlighted;
|
|
289
|
+
var _useInfoGroup4 = useInfoGroup(),
|
|
290
|
+
itemOrientation = _useInfoGroup4.itemOrientation,
|
|
291
|
+
contextIsHighlighted = _useInfoGroup4.isHighlighted;
|
|
292
|
+
var _React$useState = React__default.useState(false),
|
|
293
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
294
|
+
hasAvatar = _React$useState2[0],
|
|
295
|
+
setHasAvatar = _React$useState2[1];
|
|
296
|
+
var isVertical = itemOrientation === 'vertical';
|
|
297
|
+
var shouldHighlight = isHighlighted !== null && isHighlighted !== void 0 ? isHighlighted : contextIsHighlighted;
|
|
298
|
+
var infoItemContextValue = React__default.useMemo(function () {
|
|
299
|
+
return {
|
|
300
|
+
hasAvatar: hasAvatar,
|
|
301
|
+
setHasAvatar: setHasAvatar,
|
|
302
|
+
isHighlighted: shouldHighlight
|
|
303
|
+
};
|
|
304
|
+
}, [hasAvatar, shouldHighlight]);
|
|
305
|
+
if (isVertical) {
|
|
306
|
+
return /*#__PURE__*/jsx(InfoItemContext.Provider, {
|
|
307
|
+
value: infoItemContextValue,
|
|
308
|
+
children: /*#__PURE__*/jsx(FlexItemBox, {
|
|
309
|
+
ref: ref,
|
|
310
|
+
testID: testID,
|
|
311
|
+
isHighlighted: shouldHighlight,
|
|
312
|
+
children: children
|
|
313
|
+
})
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return /*#__PURE__*/jsx(InfoItemContext.Provider, {
|
|
317
|
+
value: infoItemContextValue,
|
|
318
|
+
children: /*#__PURE__*/jsx(ContentsItemBox, {
|
|
319
|
+
ref: ref,
|
|
320
|
+
testID: testID,
|
|
321
|
+
children: children
|
|
322
|
+
})
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* InfoItem
|
|
328
|
+
*
|
|
329
|
+
* Container component that wraps InfoItemKey and InfoItemValue pairs.
|
|
330
|
+
* Manages the layout and visual connection between key-value elements.
|
|
331
|
+
*
|
|
332
|
+
* ----
|
|
333
|
+
*
|
|
334
|
+
* #### Usage
|
|
335
|
+
*
|
|
336
|
+
* ```tsx
|
|
337
|
+
* <InfoItem>
|
|
338
|
+
* <InfoItemKey>Account Holder</InfoItemKey>
|
|
339
|
+
* <InfoItemValue>Saurabh Daware</InfoItemValue>
|
|
340
|
+
* </InfoItem>
|
|
341
|
+
* ```
|
|
342
|
+
*
|
|
343
|
+
* ----
|
|
344
|
+
* Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}
|
|
345
|
+
*/
|
|
346
|
+
var InfoItem = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_InfoItem), {
|
|
347
|
+
displayName: 'InfoItem',
|
|
348
|
+
componentId: 'InfoItem'
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// InfoGroup Component
|
|
352
|
+
var _InfoGroup = function _InfoGroup(_ref7, ref) {
|
|
353
|
+
var children = _ref7.children,
|
|
354
|
+
_ref7$itemOrientation = _ref7.itemOrientation,
|
|
355
|
+
itemOrientation = _ref7$itemOrientation === void 0 ? 'horizontal' : _ref7$itemOrientation,
|
|
356
|
+
_ref7$size = _ref7.size,
|
|
357
|
+
size = _ref7$size === void 0 ? 'medium' : _ref7$size,
|
|
358
|
+
_ref7$valueAlign = _ref7.valueAlign,
|
|
359
|
+
valueAlign = _ref7$valueAlign === void 0 ? 'left' : _ref7$valueAlign,
|
|
360
|
+
_ref7$isHighlighted = _ref7.isHighlighted,
|
|
361
|
+
isHighlighted = _ref7$isHighlighted === void 0 ? false : _ref7$isHighlighted,
|
|
362
|
+
gridTemplateColumns = _ref7.gridTemplateColumns,
|
|
363
|
+
width = _ref7.width,
|
|
364
|
+
maxWidth = _ref7.maxWidth,
|
|
365
|
+
minWidth = _ref7.minWidth,
|
|
366
|
+
testID = _ref7.testID,
|
|
367
|
+
paddingLeft = _ref7.paddingLeft,
|
|
368
|
+
paddingRight = _ref7.paddingRight,
|
|
369
|
+
paddingTop = _ref7.paddingTop,
|
|
370
|
+
paddingBottom = _ref7.paddingBottom,
|
|
371
|
+
padding = _ref7.padding,
|
|
372
|
+
paddingX = _ref7.paddingX,
|
|
373
|
+
paddingY = _ref7.paddingY,
|
|
374
|
+
rest = _objectWithoutProperties(_ref7, _excluded);
|
|
375
|
+
var contextValue = React__default.useMemo(function () {
|
|
376
|
+
return {
|
|
377
|
+
size: size,
|
|
378
|
+
itemOrientation: itemOrientation,
|
|
379
|
+
valueAlign: valueAlign,
|
|
380
|
+
isHighlighted: isHighlighted
|
|
381
|
+
};
|
|
382
|
+
}, [size, itemOrientation, valueAlign, isHighlighted]);
|
|
383
|
+
var defaultGridTemplateColumns = itemOrientation === 'horizontal' ? 'max-content 1fr' : "repeat(min(4, ".concat(React__default.Children.count(children), "), 1fr)");
|
|
384
|
+
|
|
385
|
+
// Use provided gridTemplateColumns or default based on itemOrientation
|
|
386
|
+
var templateColumns = gridTemplateColumns !== null && gridTemplateColumns !== void 0 ? gridTemplateColumns : defaultGridTemplateColumns;
|
|
387
|
+
return /*#__PURE__*/jsx(InfoGroupContext.Provider, {
|
|
388
|
+
value: contextValue,
|
|
389
|
+
children: /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread(_objectSpread({
|
|
390
|
+
ref: ref,
|
|
391
|
+
as: "dl",
|
|
392
|
+
display: "grid",
|
|
393
|
+
gridTemplateColumns: templateColumns,
|
|
394
|
+
rowGap: "spacing.4",
|
|
395
|
+
columnGap: {
|
|
396
|
+
base: 'spacing.6',
|
|
397
|
+
m: 'spacing.10'
|
|
398
|
+
},
|
|
399
|
+
flexDirection: "column",
|
|
400
|
+
margin: "spacing.0",
|
|
401
|
+
width: width,
|
|
402
|
+
maxWidth: maxWidth,
|
|
403
|
+
minWidth: minWidth,
|
|
404
|
+
paddingLeft: paddingLeft,
|
|
405
|
+
paddingRight: paddingRight,
|
|
406
|
+
paddingTop: paddingTop,
|
|
407
|
+
paddingBottom: paddingBottom,
|
|
408
|
+
padding: padding,
|
|
409
|
+
paddingX: paddingX,
|
|
410
|
+
paddingY: paddingY
|
|
411
|
+
}, metaAttribute({
|
|
412
|
+
name: MetaConstants.InfoGroup,
|
|
413
|
+
testID: testID
|
|
414
|
+
})), getStyledProps(rest)), {}, {
|
|
415
|
+
children: children
|
|
416
|
+
}))
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* InfoGroup
|
|
422
|
+
*
|
|
423
|
+
* A structured component for displaying key-value pairs in a consistent, organized format.
|
|
424
|
+
* Provides standardized presentation for transaction details, user data, or any related data pairs.
|
|
425
|
+
*
|
|
426
|
+
* ----
|
|
427
|
+
*
|
|
428
|
+
* #### Usage
|
|
429
|
+
*
|
|
430
|
+
* ```tsx
|
|
431
|
+
* <InfoGroup itemOrientation="horizontal" size="medium">
|
|
432
|
+
* <InfoItem>
|
|
433
|
+
* <InfoItemKey leading={UserIcon}>Account Holder</InfoItemKey>
|
|
434
|
+
* <InfoItemValue>Saurabh Daware</InfoItemValue>
|
|
435
|
+
* </InfoItem>
|
|
436
|
+
* </InfoGroup>
|
|
437
|
+
* ```
|
|
438
|
+
*
|
|
439
|
+
* ----
|
|
440
|
+
* Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}
|
|
441
|
+
*/
|
|
442
|
+
var InfoGroup = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_InfoGroup), {
|
|
443
|
+
displayName: 'InfoGroup',
|
|
444
|
+
componentId: 'InfoGroup'
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
export { InfoGroup, InfoItem, InfoItemKey, InfoItemValue };
|
|
448
|
+
//# sourceMappingURL=InfoGroup.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoGroup.web.js","sources":["../../../../../../src/components/InfoGroup/InfoGroup.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport type {\n InfoGroupProps,\n InfoItemProps,\n InfoItemKeyProps,\n InfoItemValueProps,\n TitleCollectionProps,\n} from './types';\nimport {\n elementGap,\n titleTextSize,\n helpTextSize,\n iconSize,\n itemTitleHeight,\n avatarAdjustmentPaddingY,\n} from './infoGroupTokens';\nimport { InfoGroupContext, useInfoGroup, InfoItemContext, useInfoItem } from './InfoGroupContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BladeElementRef } from '~utils/types';\nimport type { IconComponent } from '~components/Icons';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils';\nimport type { BoxProps } from '~components/Box';\nimport { Divider } from '~components/Divider';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTruncationTitle } from '~utils/useTruncationTitle';\n\nconst getCenterBoxProps = (\n size: NonNullable<InfoGroupProps['size']>,\n strictHeight = false,\n): BoxProps => {\n return {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n ...(strictHeight\n ? { height: makeSize(itemTitleHeight[size]) }\n : {\n minHeight: makeSize(itemTitleHeight[size]),\n }),\n };\n};\n\n// Helper function to render leading/trailing elements (icons or JSX)\nconst renderElement = (\n element: IconComponent | React.ReactElement | undefined,\n size: NonNullable<InfoGroupProps['size']>,\n): React.ReactNode => {\n if (!element) return null;\n\n // Check if it's already a JSX element (React element)\n if (React.isValidElement(element)) {\n return element;\n }\n\n // Otherwise, it's a component function - render it with size prop\n const IconComponent = element as IconComponent;\n return <IconComponent size={iconSize[size]} color=\"surface.icon.gray.muted\" />;\n};\n\nconst TitleCollection = ({\n children,\n leading,\n trailing,\n helpText,\n titleWeight,\n titleColor,\n paddingLeft,\n paddingRight,\n truncateAfterLines,\n}: TitleCollectionProps): React.ReactElement => {\n const { size } = useInfoGroup();\n const { setHasAvatar } = useInfoItem();\n\n const isAvatar = getComponentId(React.isValidElement(leading) ? leading : undefined) === 'Avatar';\n\n // Set hasAvatar context when an avatar is detected\n useIsomorphicLayoutEffect(() => {\n if (isAvatar) {\n setHasAvatar(true);\n }\n }, [isAvatar, setHasAvatar]);\n\n const { containerRef, textRef } = useTruncationTitle({\n content: typeof children === 'string' ? children : undefined,\n });\n\n return (\n <BaseBox\n display=\"flex\"\n alignItems=\"flex-start\"\n gap={elementGap[size]}\n paddingLeft={paddingLeft}\n paddingRight={paddingRight}\n >\n {leading && (\n <BaseBox {...getCenterBoxProps(size, true)}>{renderElement(leading, size)}</BaseBox>\n )}\n <BaseBox display=\"flex\" flexDirection=\"column\" flex=\"1\">\n <BaseBox ref={containerRef} {...getCenterBoxProps(size)}>\n {typeof children === 'string' ? (\n <Text\n ref={textRef}\n variant=\"body\"\n size={titleTextSize[size]}\n weight={titleWeight}\n color={titleColor}\n truncateAfterLines={truncateAfterLines}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </BaseBox>\n\n {helpText && (\n <Text\n variant=\"body\"\n size={helpTextSize[size]}\n weight=\"regular\"\n color=\"surface.text.gray.muted\"\n >\n {helpText}\n </Text>\n )}\n </BaseBox>\n {trailing && (\n <BaseBox {...getCenterBoxProps(size, true)}>{renderElement(trailing, size)}</BaseBox>\n )}\n </BaseBox>\n );\n};\n\nconst _InfoItemKey = (\n { children, leading, trailing, helpText, truncateAfterLines, testID }: InfoItemKeyProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const { itemOrientation, size } = useInfoGroup();\n\n const { hasAvatar, isHighlighted } = useInfoItem();\n\n return (\n <BaseBox\n ref={ref as never}\n as=\"dt\"\n display=\"flex\"\n alignItems=\"center\"\n alignSelf=\"flex-start\"\n justifyContent=\"flex-start\"\n paddingY={hasAvatar ? avatarAdjustmentPaddingY[size] : undefined}\n {...metaAttribute({ name: MetaConstants.InfoItemKey, testID })}\n >\n {itemOrientation === 'horizontal' && isHighlighted ? (\n <Divider orientation=\"vertical\" />\n ) : null}\n <TitleCollection\n leading={leading}\n trailing={trailing}\n helpText={helpText}\n titleWeight=\"medium\"\n titleColor=\"surface.text.gray.muted\"\n truncateAfterLines={truncateAfterLines}\n paddingLeft={isHighlighted ? 'spacing.4' : 'spacing.0'}\n paddingRight=\"spacing.0\"\n >\n {children}\n </TitleCollection>\n </BaseBox>\n );\n};\n\n/**\n * InfoItemKey\n *\n * Displays the key portion of a key-value pair within an InfoItem.\n * Supports leading/trailing elements and customizable text alignment.\n *\n * ----\n *\n * #### Usage\n *\n * ```tsx\n * <InfoItemKey leading={UserIcon}>Account Holder</InfoItemKey>\n * ```\n *\n * ----\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}\n */\nconst InfoItemKey = assignWithoutSideEffects(React.forwardRef(_InfoItemKey), {\n displayName: 'InfoItemKey',\n componentId: 'InfoItemKey',\n});\n\nconst _InfoItemValue = (\n { children, leading, trailing, helpText, truncateAfterLines, testID }: InfoItemValueProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const { itemOrientation, valueAlign, size } = useInfoGroup();\n\n const { hasAvatar, isHighlighted } = useInfoItem();\n\n return (\n <BaseBox\n ref={ref as never}\n as=\"dd\"\n margin=\"spacing.0\"\n display=\"flex\"\n alignItems=\"center\"\n alignSelf=\"flex-start\"\n justifyContent={valueAlign === 'right' ? 'flex-end' : 'flex-start'}\n paddingY={hasAvatar ? avatarAdjustmentPaddingY[size] : undefined}\n {...metaAttribute({ name: MetaConstants.InfoItemValue, testID })}\n >\n <TitleCollection\n leading={leading}\n trailing={trailing}\n helpText={helpText}\n titleWeight=\"semibold\"\n titleColor=\"surface.text.gray.subtle\"\n truncateAfterLines={truncateAfterLines}\n paddingLeft={isHighlighted && itemOrientation === 'vertical' ? 'spacing.4' : 'spacing.0'}\n paddingRight={isHighlighted ? 'spacing.4' : 'spacing.0'}\n >\n {children}\n </TitleCollection>\n </BaseBox>\n );\n};\n\n/**\n * InfoItemValue\n *\n * Displays the value portion of a key-value pair within an InfoItem.\n * Supports leading/trailing elements and customizable text alignment.\n *\n * ----\n *\n * #### Usage\n *\n * ```tsx\n * <InfoItemValue helpText=\"Customer name\" trailing={CheckIcon}>\n * Saurabh Daware\n * </InfoItemValue>\n * ```\n *\n * ----\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}\n */\nconst InfoItemValue = assignWithoutSideEffects(React.forwardRef(_InfoItemValue), {\n displayName: 'InfoItemValue',\n componentId: 'InfoItemValue',\n});\n\nconst ContentsItemBox = React.forwardRef<\n BladeElementRef,\n {\n children: React.ReactNode;\n testID?: string;\n }\n>(\n ({ children, testID }, ref): React.ReactElement => {\n return (\n <BaseBox\n display=\"contents\"\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.InfoItem, testID })}\n >\n {children}\n </BaseBox>\n );\n },\n);\n\nconst FlexItemBox = React.forwardRef<\n BladeElementRef,\n { children: React.ReactNode; testID?: string; isHighlighted?: boolean }\n>(\n ({ children, testID, isHighlighted = false }, ref): React.ReactElement => {\n return (\n <BaseBox\n display=\"flex\"\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.InfoItem, testID })}\n >\n {isHighlighted && <Divider orientation=\"vertical\" />}\n <BaseBox display=\"flex\" flexDirection=\"column\" gap=\"spacing.2\">\n {children}\n </BaseBox>\n </BaseBox>\n );\n },\n);\n\nconst _InfoItem = (\n { children, testID, isHighlighted }: InfoItemProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const { itemOrientation, isHighlighted: contextIsHighlighted } = useInfoGroup();\n const [hasAvatar, setHasAvatar] = React.useState(false);\n const isVertical = itemOrientation === 'vertical';\n const shouldHighlight = isHighlighted ?? contextIsHighlighted;\n\n const infoItemContextValue = React.useMemo(\n () => ({\n hasAvatar,\n setHasAvatar,\n isHighlighted: shouldHighlight,\n }),\n [hasAvatar, shouldHighlight],\n );\n\n if (isVertical) {\n return (\n <InfoItemContext.Provider value={infoItemContextValue}>\n <FlexItemBox ref={ref as never} testID={testID} isHighlighted={shouldHighlight}>\n {children}\n </FlexItemBox>\n </InfoItemContext.Provider>\n );\n }\n\n return (\n <InfoItemContext.Provider value={infoItemContextValue}>\n <ContentsItemBox ref={ref as never} testID={testID}>\n {children}\n </ContentsItemBox>\n </InfoItemContext.Provider>\n );\n};\n\n/**\n * InfoItem\n *\n * Container component that wraps InfoItemKey and InfoItemValue pairs.\n * Manages the layout and visual connection between key-value elements.\n *\n * ----\n *\n * #### Usage\n *\n * ```tsx\n * <InfoItem>\n * <InfoItemKey>Account Holder</InfoItemKey>\n * <InfoItemValue>Saurabh Daware</InfoItemValue>\n * </InfoItem>\n * ```\n *\n * ----\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}\n */\nconst InfoItem = assignWithoutSideEffects(React.forwardRef(_InfoItem), {\n displayName: 'InfoItem',\n componentId: 'InfoItem',\n});\n\n// InfoGroup Component\nconst _InfoGroup = (\n {\n children,\n itemOrientation = 'horizontal',\n size = 'medium',\n valueAlign = 'left',\n isHighlighted = false,\n gridTemplateColumns,\n width,\n maxWidth,\n minWidth,\n testID,\n paddingLeft,\n paddingRight,\n paddingTop,\n paddingBottom,\n padding,\n paddingX,\n paddingY,\n ...rest\n }: InfoGroupProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const contextValue = React.useMemo(\n () => ({\n size,\n itemOrientation,\n valueAlign,\n isHighlighted,\n }),\n [size, itemOrientation, valueAlign, isHighlighted],\n );\n\n const defaultGridTemplateColumns =\n itemOrientation === 'horizontal'\n ? 'max-content 1fr'\n : `repeat(min(4, ${React.Children.count(children)}), 1fr)`;\n\n // Use provided gridTemplateColumns or default based on itemOrientation\n const templateColumns = gridTemplateColumns ?? defaultGridTemplateColumns;\n\n return (\n <InfoGroupContext.Provider value={contextValue}>\n <BaseBox\n ref={ref as never}\n as=\"dl\"\n display=\"grid\"\n gridTemplateColumns={templateColumns}\n rowGap=\"spacing.4\"\n columnGap={{ base: 'spacing.6', m: 'spacing.10' }}\n flexDirection=\"column\"\n margin=\"spacing.0\"\n width={width}\n maxWidth={maxWidth}\n minWidth={minWidth}\n paddingLeft={paddingLeft}\n paddingRight={paddingRight}\n paddingTop={paddingTop}\n paddingBottom={paddingBottom}\n padding={padding}\n paddingX={paddingX}\n paddingY={paddingY}\n {...metaAttribute({ name: MetaConstants.InfoGroup, testID })}\n {...getStyledProps(rest)}\n >\n {children}\n </BaseBox>\n </InfoGroupContext.Provider>\n );\n};\n\n/**\n * InfoGroup\n *\n * A structured component for displaying key-value pairs in a consistent, organized format.\n * Provides standardized presentation for transaction details, user data, or any related data pairs.\n *\n * ----\n *\n * #### Usage\n *\n * ```tsx\n * <InfoGroup itemOrientation=\"horizontal\" size=\"medium\">\n * <InfoItem>\n * <InfoItemKey leading={UserIcon}>Account Holder</InfoItemKey>\n * <InfoItemValue>Saurabh Daware</InfoItemValue>\n * </InfoItem>\n * </InfoGroup>\n * ```\n *\n * ----\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-infogroup InfoGroup Documentation}\n */\nconst InfoGroup = assignWithoutSideEffects(React.forwardRef(_InfoGroup), {\n displayName: 'InfoGroup',\n componentId: 'InfoGroup',\n});\n\nexport type { InfoGroupProps, InfoItemProps, InfoItemKeyProps, InfoItemValueProps };\n\nexport { InfoGroup, InfoItem, InfoItemKey, InfoItemValue };\n"],"names":["getCenterBoxProps","size","strictHeight","arguments","length","undefined","_objectSpread","display","alignItems","justifyContent","height","makeSize","itemTitleHeight","minHeight","renderElement","element","React","isValidElement","IconComponent","_jsx","iconSize","color","TitleCollection","_ref","children","leading","trailing","helpText","titleWeight","titleColor","paddingLeft","paddingRight","truncateAfterLines","_useInfoGroup","useInfoGroup","_useInfoItem","useInfoItem","setHasAvatar","isAvatar","getComponentId","useIsomorphicLayoutEffect","_useTruncationTitle","useTruncationTitle","content","containerRef","textRef","_jsxs","BaseBox","gap","elementGap","flexDirection","flex","ref","Text","variant","titleTextSize","weight","helpTextSize","_InfoItemKey","_ref2","testID","_useInfoGroup2","itemOrientation","_useInfoItem2","hasAvatar","isHighlighted","as","alignSelf","paddingY","avatarAdjustmentPaddingY","metaAttribute","name","MetaConstants","InfoItemKey","Divider","orientation","assignWithoutSideEffects","forwardRef","displayName","componentId","_InfoItemValue","_ref3","_useInfoGroup3","valueAlign","_useInfoItem3","margin","InfoItemValue","ContentsItemBox","_ref4","InfoItem","FlexItemBox","_ref5","_ref5$isHighlighted","_InfoItem","_ref6","_useInfoGroup4","contextIsHighlighted","_React$useState","useState","_React$useState2","_slicedToArray","isVertical","shouldHighlight","infoItemContextValue","useMemo","InfoItemContext","Provider","value","_InfoGroup","_ref7","_ref7$itemOrientation","_ref7$size","_ref7$valueAlign","_ref7$isHighlighted","gridTemplateColumns","width","maxWidth","minWidth","paddingTop","paddingBottom","padding","paddingX","rest","_objectWithoutProperties","_excluded","contextValue","defaultGridTemplateColumns","concat","Children","count","templateColumns","InfoGroupContext","rowGap","columnGap","base","m","InfoGroup","getStyledProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CACrBC,IAAyC,EAE5B;AAAA,EAAA,IADbC,YAAY,GAAAC,SAAA,CAAA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Context = /*#__PURE__*/React__default.createContext({
|
|
4
|
+
size: 'medium',
|
|
5
|
+
itemOrientation: 'horizontal',
|
|
6
|
+
valueAlign: 'left',
|
|
7
|
+
isHighlighted: false
|
|
8
|
+
});
|
|
9
|
+
var InfoItemContext = /*#__PURE__*/React__default.createContext({
|
|
10
|
+
hasAvatar: false,
|
|
11
|
+
setHasAvatar: function setHasAvatar() {
|
|
12
|
+
// no-op default implementation
|
|
13
|
+
},
|
|
14
|
+
isHighlighted: false
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// Add hooks to use the context
|
|
18
|
+
var useInfoGroup = function useInfoGroup() {
|
|
19
|
+
return React__default.useContext(InfoGroupContext);
|
|
20
|
+
};
|
|
21
|
+
var useInfoItem = function useInfoItem() {
|
|
22
|
+
return React__default.useContext(InfoItemContext);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { InfoGroupContext, InfoItemContext, useInfoGroup, useInfoItem };
|
|
26
|
+
//# sourceMappingURL=InfoGroupContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoGroupContext.js","sources":["../../../../../../src/components/InfoGroup/InfoGroupContext.ts"],"sourcesContent":["import React from 'react';\nimport type { InfoGroupProps } from './types';\n\ntype InfoGroupContextType = {\n size: NonNullable<InfoGroupProps['size']>;\n itemOrientation: NonNullable<InfoGroupProps['itemOrientation']>;\n valueAlign: NonNullable<InfoGroupProps['valueAlign']>;\n isHighlighted: NonNullable<InfoGroupProps['isHighlighted']>;\n};\n\ntype InfoItemContextType = {\n hasAvatar: boolean;\n setHasAvatar: (hasAvatar: boolean) => void;\n isHighlighted: boolean;\n};\n\nconst InfoGroupContext = React.createContext<InfoGroupContextType>({\n size: 'medium',\n itemOrientation: 'horizontal',\n valueAlign: 'left',\n isHighlighted: false,\n});\n\nconst InfoItemContext = React.createContext<InfoItemContextType>({\n hasAvatar: false,\n setHasAvatar: () => {\n // no-op default implementation\n },\n isHighlighted: false,\n});\n\n// Add hooks to use the context\nconst useInfoGroup = (): InfoGroupContextType => React.useContext(InfoGroupContext);\nconst useInfoItem = (): InfoItemContextType => React.useContext(InfoItemContext);\n\nexport { InfoGroupContext, InfoItemContext, useInfoGroup, useInfoItem };\n"],"names":["InfoGroupContext","React","createContext","size","itemOrientation","valueAlign","isHighlighted","InfoItemContext","hasAvatar","setHasAvatar","useInfoGroup","useContext","useInfoItem"],"mappings":";;AAgBA,IAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAa,CAAuB;AACjEC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,eAAe,EAAE,YAAY;AAC7BC,EAAAA,UAAU,EAAE,MAAM;AAClBC,EAAAA,aAAa,EAAE,KAAA;AACjB,CAAC,EAAC;AAEF,IAAMC,eAAe,gBAAGN,cAAK,CAACC,aAAa,CAAsB;AAC/DM,EAAAA,SAAS,EAAE,KAAK;EAChBC,YAAY,EAAE,SAAAA,YAAAA,GAAM;AAClB;GACD;AACDH,EAAAA,aAAa,EAAE,KAAA;AACjB,CAAC,EAAC;;AAEF;AACA,IAAMI,YAAY,GAAG,SAAfA,YAAYA,GAAA;AAAA,EAAA,OAA+BT,cAAK,CAACU,UAAU,CAACX,gBAAgB,CAAC,CAAA;AAAA,EAAA;AACnF,IAAMY,WAAW,GAAG,SAAdA,WAAWA,GAAA;AAAA,EAAA,OAA8BX,cAAK,CAACU,UAAU,CAACJ,eAAe,CAAC,CAAA;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import '../../tokens/global/index.js';
|
|
2
|
+
import { size } from '../../tokens/global/size.js';
|
|
3
|
+
|
|
4
|
+
// Gap between leading/trailing elements and content
|
|
5
|
+
var elementGap = {
|
|
6
|
+
xsmall: 'spacing.1',
|
|
7
|
+
small: 'spacing.2',
|
|
8
|
+
medium: 'spacing.2',
|
|
9
|
+
large: 'spacing.3'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Size mapping for InfoItemKey
|
|
13
|
+
var titleTextSize = {
|
|
14
|
+
xsmall: 'xsmall',
|
|
15
|
+
small: 'small',
|
|
16
|
+
medium: 'medium',
|
|
17
|
+
large: 'large'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Text sizes for help text (has different mapping)
|
|
21
|
+
var helpTextSize = {
|
|
22
|
+
xsmall: 'xsmall',
|
|
23
|
+
small: 'xsmall',
|
|
24
|
+
medium: 'xsmall',
|
|
25
|
+
large: 'small'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Icon sizes for different InfoGroup sizes
|
|
29
|
+
var iconSize = {
|
|
30
|
+
xsmall: 'xsmall',
|
|
31
|
+
small: 'small',
|
|
32
|
+
medium: 'medium',
|
|
33
|
+
large: 'large'
|
|
34
|
+
};
|
|
35
|
+
var itemTitleHeight = {
|
|
36
|
+
xsmall: size['14'],
|
|
37
|
+
small: size['18'],
|
|
38
|
+
medium: size['20'],
|
|
39
|
+
large: size['24']
|
|
40
|
+
};
|
|
41
|
+
var avatarAdjustmentPaddingY = {
|
|
42
|
+
xsmall: 'spacing.1',
|
|
43
|
+
small: 'spacing.2',
|
|
44
|
+
medium: 'spacing.2',
|
|
45
|
+
large: 'spacing.3'
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { avatarAdjustmentPaddingY, elementGap, helpTextSize, iconSize, itemTitleHeight, titleTextSize };
|
|
49
|
+
//# sourceMappingURL=infoGroupTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoGroupTokens.js","sources":["../../../../../../src/components/InfoGroup/infoGroupTokens.ts"],"sourcesContent":["import { size } from '~tokens/global';\n\n// Gap between leading/trailing elements and content\nconst elementGap = {\n xsmall: 'spacing.1',\n small: 'spacing.2',\n medium: 'spacing.2',\n large: 'spacing.3',\n} as const;\n\n// Size mapping for InfoItemKey\nconst titleTextSize = {\n xsmall: 'xsmall',\n small: 'small',\n medium: 'medium',\n large: 'large',\n} as const;\n\n// Text sizes for help text (has different mapping)\nconst helpTextSize = {\n xsmall: 'xsmall',\n small: 'xsmall',\n medium: 'xsmall',\n large: 'small',\n} as const;\n\n// Icon sizes for different InfoGroup sizes\nconst iconSize = {\n xsmall: 'xsmall',\n small: 'small',\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst itemTitleHeight = {\n xsmall: size['14'],\n small: size['18'],\n medium: size['20'],\n large: size['24'],\n};\n\nconst avatarAdjustmentPaddingY = {\n xsmall: 'spacing.1',\n small: 'spacing.2',\n medium: 'spacing.2',\n large: 'spacing.3',\n} as const;\n\nexport {\n elementGap,\n titleTextSize,\n helpTextSize,\n iconSize,\n itemTitleHeight,\n avatarAdjustmentPaddingY,\n};\n"],"names":["elementGap","xsmall","small","medium","large","titleTextSize","helpTextSize","iconSize","itemTitleHeight","size","avatarAdjustmentPaddingY"],"mappings":";;;AAEA;AACA,IAAMA,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT,EAAU;;AAEV;AACA,IAAMC,aAAa,GAAG;AACpBJ,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT,EAAU;;AAEV;AACA,IAAME,YAAY,GAAG;AACnBL,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT,EAAU;;AAEV;AACA,IAAMG,QAAQ,GAAG;AACfN,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT,EAAU;AAEV,IAAMI,eAAe,GAAG;AACtBP,EAAAA,MAAM,EAAEQ,IAAI,CAAC,IAAI,CAAC;AAClBP,EAAAA,KAAK,EAAEO,IAAI,CAAC,IAAI,CAAC;AACjBN,EAAAA,MAAM,EAAEM,IAAI,CAAC,IAAI,CAAC;EAClBL,KAAK,EAAEK,IAAI,CAAC,IAAI,CAAA;AAClB,EAAC;AAED,IAAMC,wBAAwB,GAAG;AAC/BT,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT;;;;"}
|