Skip to content

Commit b2cfaad

Browse files
committed
Merge branch 'master' into feat/timepicker-ut-interactive-test
2 parents fd9847b + c835336 commit b2cfaad

File tree

26 files changed

+4657
-104
lines changed

26 files changed

+4657
-104
lines changed

packages/blade-mcp/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @razorpay/blade-mcp
22

3+
## 1.6.0
4+
5+
### Minor Changes
6+
7+
- ab1773547: feat(blade-mcp): update knowledgebase with AreaChart
8+
39
## 1.5.0
410

511
### Minor Changes
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# AreaChart
2+
3+
## Component Name
4+
5+
AreaChart
6+
7+
## Description
8+
9+
AreaChart is a data visualization component built on top of Recharts that displays quantitative data as filled areas under curves. It supports single and multiple data series, stacked areas, and various styling options. The component is designed for showing trends over time, comparing multiple datasets, and highlighting data patterns with customizable colors and interactive features.
10+
11+
## Important Constraints
12+
13+
- Maximum of 10 areas can be configured in a single chart (throws error if exceeded)
14+
- `ChartAreaWrapper` only accepts `ChartArea` components as direct children for proper indexing
15+
- `dataKey` prop is required for each `ChartArea` component to specify which data field to display
16+
- `name` prop is required for each `ChartArea` component for legend and tooltip display
17+
- Data array must contain objects with consistent key structure across all data points
18+
- `colorTheme` currently only supports 'default' value (other themes will log warning)
19+
20+
## TypeScript Types
21+
22+
These types define the props that the AreaChart component and its subcomponents accept:
23+
24+
```typescript
25+
26+
type ChartAreaProps {
27+
type?: 'step' | 'stepAfter' | 'stepBefore' | 'linear' | 'monotone';
28+
connectNulls?: boolean;
29+
showLegend?: boolean;
30+
dataKey: string;
31+
name: string;
32+
stackId?: string | number;
33+
color?: ChartsCategoricalColorToken;
34+
dot?: RechartAreaProps['dot'];
35+
activeDot?: RechartAreaProps['activeDot'];
36+
}
37+
38+
type data = {
39+
[key: string]: string | number | null;
40+
};
41+
42+
type ChartAreaWrapperProps = {
43+
children?: React.ReactNode;
44+
colorTheme?: colorTheme;
45+
data: data[];
46+
};
47+
48+
type ChartReferenceLineProps = {
49+
/**
50+
* The y-coordinate of the reference line.
51+
*/
52+
y?: RechartsReferenceLineProps['y'];
53+
/**
54+
* The x-coordinate of the reference line.
55+
*/
56+
x?: RechartsReferenceLineProps['x'];
57+
/**
58+
* The label of the reference line.
59+
*/
60+
label: string;
61+
};
62+
63+
type ChartXAxisProps = Omit<RechartsXAxisProps, 'tick' | 'label' | 'dataKey' | 'stroke'> & {
64+
/**
65+
* The label of the x-axis.
66+
*/
67+
label?: string;
68+
/**
69+
* The data key of the x-axis.
70+
*/
71+
dataKey?: string;
72+
};
73+
74+
type ChartYAxisProps = Omit<RechartsYAxisProps, 'tick' | 'label' | 'dataKey' | 'stroke'> & {
75+
/**
76+
* The label of the y-axis.
77+
*/
78+
label?: string;
79+
/**
80+
* The data key of the y-axis.
81+
*/
82+
dataKey?: string;
83+
};
84+
85+
type ChartTooltipProps = ComponentProps<typeof RechartsTooltip>;
86+
87+
type ChartLegendProps = ComponentProps<typeof RechartsLegend>;
88+
89+
type ChartCartesianGridProps = ComponentProps<typeof RechartsCartesianGrid>;
90+
91+
type ChartsCategoricalColorToken = `chart.background.categorical.${ChartColorCategories}.${keyof ChartCategoricalEmphasis}`;
92+
93+
type colorTheme = 'default';
94+
```
95+
96+
## Examples
97+
98+
### Basic Area Chart with Single Data Series
99+
100+
```typescript
101+
import React from 'react';
102+
import {
103+
ChartAreaWrapper,
104+
ChartArea,
105+
ChartXAxis,
106+
ChartYAxis,
107+
ChartCartesianGrid,
108+
ChartTooltip,
109+
Box,
110+
} from '@razorpay/blade/components';
111+
112+
function BasicAreaChart() {
113+
const data = [
114+
{ month: 'Jan', revenue: 4000 },
115+
{ month: 'Feb', revenue: 3000 },
116+
{ month: 'Mar', revenue: 2000 },
117+
{ month: 'Apr', revenue: 2780 },
118+
{ month: 'May', revenue: 1890 },
119+
{ month: 'Jun', revenue: 2390 },
120+
];
121+
122+
return (
123+
<Box width="100%" height="400px">
124+
<ChartAreaWrapper data={data}>
125+
<ChartCartesianGrid />
126+
<CharChartXAxis dataKey="month" />
127+
<ChartYAxis />
128+
<ChartTooltip />
129+
<Area
130+
dataKey="revenue"
131+
name="Revenue"
132+
type="monotone"
133+
color="chart.background.categorical.azure.intense"
134+
/>
135+
</ChartAreaWrapper>
136+
</Box>
137+
);
138+
}
139+
```

packages/blade-mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@razorpay/blade-mcp",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "Model Context Protocol server for Blade",
55
"main": "dist/server.js",
66
"type": "module",

packages/blade/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# @razorpay/blade
22

3+
## 12.53.1
4+
5+
### Patch Changes
6+
7+
- 0ff0152b2: fix(ActionListItem): support non-string values in item
8+
9+
## 12.53.0
10+
11+
### Minor Changes
12+
13+
- ab1773547: feat(blade): add AreaChart component
14+
15+
[Docs Link](https://blade.razorpay.com/?path=/docs/components-charts-areachart--docs)
16+
317
## 12.52.0
418

519
### Minor Changes

packages/blade/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@razorpay/blade",
33
"description": "The Design System that powers Razorpay",
4-
"version": "12.52.0",
4+
"version": "12.53.1",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18.12.1"

packages/blade/src/components/BottomSheet/BottomSheet.web.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,17 @@ const _BottomSheet = ({
250250
lastOffset: [_, lastOffsetY],
251251
down,
252252
dragging,
253+
event,
253254
args: [{ isContentDragging = false } = {}] = [],
254255
}) => {
256+
// Check if the touch started on a scrollable element (e.g., SpinWheel in TimePicker)
257+
// This prevents BottomSheet drag gestures from interfering with internal scrolling
258+
const touchTarget = event?.target as Element | undefined;
259+
const isScrollableContent = touchTarget?.closest('[data-allow-scroll]');
260+
261+
if (isScrollableContent) {
262+
return;
263+
}
255264
setIsDragging(Boolean(dragging));
256265
// lastOffsetY is the previous position user stopped dragging the sheet
257266
// movementY is the drag amount from the bottom of the screen, so as you drag up the movementY goes into negatives
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { ChartAreaWrapperProps, ChartAreaProps } from './types';
2+
import { throwBladeError } from '~utils/logger';
3+
import { Text } from '~components/Typography';
4+
5+
const ChartAreaWrapper = (_prop: ChartAreaProps): React.ReactElement => {
6+
throwBladeError({
7+
message: 'ChartAreaWrapper is not yet implemented for native',
8+
moduleName: 'ChartAreaWrapper',
9+
});
10+
11+
return <Text>AreaChartWrapper is not available for Native mobile apps.</Text>;
12+
};
13+
14+
const ChartArea = (_prop: ChartAreaWrapperProps): React.ReactElement => {
15+
throwBladeError({
16+
message: 'ChartArea is not yet implemented for native',
17+
moduleName: 'ChartArea',
18+
});
19+
20+
return <Text>ChartArea is not available for Native mobile apps.</Text>;
21+
};
22+
23+
export { ChartAreaWrapper, ChartArea };

0 commit comments

Comments
 (0)