Skip to content

Commit 81ff8ec

Browse files
committed
Merge branch 'master' into feat/svelte-impl
2 parents c12fb27 + c999f1e commit 81ff8ec

File tree

26 files changed

+2804
-669
lines changed

26 files changed

+2804
-669
lines changed

packages/blade-coverage-extension/background-scripts/blade-coverage-script.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
/* eslint-disable no-undef */
22
const calculateBladeCoverage = (shouldHighlightNodes) => {
3+
const bladeElementExceptions = [
4+
// table library adds a div internally which we want to skip
5+
'[data-blade-component="table-cell"] > div',
6+
'[data-blade-component="table-header-cell"] > div',
7+
'[data-blade-component="table-footer-cell"] > div'
8+
];
9+
310
/**
411
* Checks if DOM node is hidden or not
512
*/
@@ -64,6 +71,10 @@ const calculateBladeCoverage = (shouldHighlightNodes) => {
6471
return;
6572
}
6673

74+
if (bladeElementExceptions.some((exception) => elm.matches(exception))) {
75+
return;
76+
}
77+
6778
totalNodeElements.push(elm);
6879

6980
// If element has data-blade-component add it

packages/blade-coverage-extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "Blade Coverage Extension",
44
"description": "Extension to calculate coverage and accessibility of blade design system components",
5-
"version": "1.1",
5+
"version": "1.2",
66
"permissions": ["activeTab", "scripting"],
77
"background": {
88
"service_worker": "background_script.js",

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.22.0
4+
5+
### Minor Changes
6+
7+
- b6c2e2563: feat(blade): update charts docs
8+
39
## 1.21.1
410

511
### Patch Changes

packages/blade-mcp/knowledgebase/components/AreaChart.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type ChartReferenceLineProps = {
6060
label: string;
6161
};
6262

63+
6364
type ChartXAxisProps = Omit<RechartsXAxisProps, 'tick' | 'label' | 'dataKey' | 'stroke'> & {
6465
/**
6566
* The label of the x-axis.
@@ -69,8 +70,58 @@ type ChartXAxisProps = Omit<RechartsXAxisProps, 'tick' | 'label' | 'dataKey' | '
6970
* The data key of the x-axis.
7071
*/
7172
dataKey?: string;
73+
/**
74+
* Optional secondary data key for multi-line X-axis labels.
75+
* When provided, the X-axis will display two lines of text:
76+
* - Primary label (from dataKey)
77+
* - Secondary label (from secondaryDataKey)
78+
* @example
79+
* // Data: [{ date: 'Jan', year: '2024' }, { date: 'Feb', year: '2024' }]
80+
* <ChartXAxis dataKey="date" secondaryDataKey="year" />
81+
* // Renders:
82+
* // Jan Feb
83+
* // 2024 2024
84+
*/
85+
secondaryDataKey?: string;
86+
/**
87+
* The interval of the x-axis.
88+
* @default: 0
89+
* @example
90+
* // Data: [{ date: 'Jan', year: '2024' }, { date: 'Feb', year: '2024' }]
91+
* <ChartXAxis dataKey="date" interval={1} />
92+
* // Renders:
93+
* // Jan
94+
* // Feb
95+
*
96+
* note: if you can't see all labels in case of large labels. try setting interval 0
97+
*/
98+
interval?: number;
99+
/**
100+
* Custom formatter function to transform tick values before display.
101+
* Useful for formatting timestamps, currencies, or other numeric values.
102+
*
103+
* @param value - The raw tick value from the data
104+
* @param index - The index of the tick
105+
* @returns The formatted string to display
106+
*
107+
* @example
108+
* // Format timestamp to readable date
109+
* <ChartXAxis
110+
* dataKey="timestamp"
111+
* tickFormatter={(value) => new Date(value).toLocaleDateString()}
112+
* />
113+
*
114+
* @example
115+
* // Format currency values
116+
* <ChartXAxis
117+
* dataKey="amount"
118+
* tickFormatter={(value) => `$${(value / 1000).toFixed(0)}K`}
119+
* />
120+
*/
121+
tickFormatter?: (value: string, index: number) => string;
72122
};
73123

124+
74125
type ChartYAxisProps = Omit<RechartsYAxisProps, 'tick' | 'label' | 'dataKey' | 'stroke'> & {
75126
/**
76127
* The label of the y-axis.

packages/blade-mcp/knowledgebase/components/BarChart.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,55 @@ type ChartXAxisProps = Omit<RechartsXAxisProps, 'tick' | 'label' | 'dataKey' | '
9090
* The data key of the x-axis.
9191
*/
9292
dataKey?: string;
93+
/**
94+
* Optional secondary data key for multi-line X-axis labels.
95+
* When provided, the X-axis will display two lines of text:
96+
* - Primary label (from dataKey)
97+
* - Secondary label (from secondaryDataKey)
98+
* @example
99+
* // Data: [{ date: 'Jan', year: '2024' }, { date: 'Feb', year: '2024' }]
100+
* <ChartXAxis dataKey="date" secondaryDataKey="year" />
101+
* // Renders:
102+
* // Jan Feb
103+
* // 2024 2024
104+
*/
105+
secondaryDataKey?: string;
106+
/**
107+
* The interval of the x-axis.
108+
* @default: 0
109+
* @example
110+
* // Data: [{ date: 'Jan', year: '2024' }, { date: 'Feb', year: '2024' }]
111+
* <ChartXAxis dataKey="date" interval={1} />
112+
* // Renders:
113+
* // Jan
114+
* // Feb
115+
*
116+
* note: if you can't see all labels in case of large labels. try setting interval 0
117+
*/
118+
interval?: number;
119+
/**
120+
* Custom formatter function to transform tick values before display.
121+
* Useful for formatting timestamps, currencies, or other numeric values.
122+
*
123+
* @param value - The raw tick value from the data
124+
* @param index - The index of the tick
125+
* @returns The formatted string to display
126+
*
127+
* @example
128+
* // Format timestamp to readable date
129+
* <ChartXAxis
130+
* dataKey="timestamp"
131+
* tickFormatter={(value) => new Date(value).toLocaleDateString()}
132+
* />
133+
*
134+
* @example
135+
* // Format currency values
136+
* <ChartXAxis
137+
* dataKey="amount"
138+
* tickFormatter={(value) => `$${(value / 1000).toFixed(0)}K`}
139+
* />
140+
*/
141+
tickFormatter?: (value: string, index: number) => string;
93142
};
94143

95144
type ChartYAxisProps = Omit<RechartsYAxisProps, 'tick' | 'label' | 'dataKey' | 'stroke'> & {

packages/blade-mcp/knowledgebase/components/LineChart.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,55 @@ type ChartXAxisProps = Omit<RechartsXAxisProps, 'tick' | 'label' | 'dataKey' | '
103103
* The data key of the x-axis.
104104
*/
105105
dataKey?: string;
106+
/**
107+
* Optional secondary data key for multi-line X-axis labels.
108+
* When provided, the X-axis will display two lines of text:
109+
* - Primary label (from dataKey)
110+
* - Secondary label (from secondaryDataKey)
111+
* @example
112+
* // Data: [{ date: 'Jan', year: '2024' }, { date: 'Feb', year: '2024' }]
113+
* <ChartXAxis dataKey="date" secondaryDataKey="year" />
114+
* // Renders:
115+
* // Jan Feb
116+
* // 2024 2024
117+
*/
118+
secondaryDataKey?: string;
119+
/**
120+
* The interval of the x-axis.
121+
* @default: 0
122+
* @example
123+
* // Data: [{ date: 'Jan', year: '2024' }, { date: 'Feb', year: '2024' }]
124+
* <ChartXAxis dataKey="date" interval={1} />
125+
* // Renders:
126+
* // Jan
127+
* // Feb
128+
*
129+
* note: if you can't see all labels in case of large labels. try setting interval 0
130+
*/
131+
interval?: number;
132+
/**
133+
* Custom formatter function to transform tick values before display.
134+
* Useful for formatting timestamps, currencies, or other numeric values.
135+
*
136+
* @param value - The raw tick value from the data
137+
* @param index - The index of the tick
138+
* @returns The formatted string to display
139+
*
140+
* @example
141+
* // Format timestamp to readable date
142+
* <ChartXAxis
143+
* dataKey="timestamp"
144+
* tickFormatter={(value) => new Date(value).toLocaleDateString()}
145+
* />
146+
*
147+
* @example
148+
* // Format currency values
149+
* <ChartXAxis
150+
* dataKey="amount"
151+
* tickFormatter={(value) => `$${(value / 1000).toFixed(0)}K`}
152+
* />
153+
*/
154+
tickFormatter?: (value: string, index: number) => string;
106155
};
107156

108157
type ChartYAxisProps = Omit<RechartsYAxisProps, 'tick' | 'label' | 'dataKey' | 'stroke'> & {

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.21.1",
3+
"version": "1.22.0",
44
"description": "Model Context Protocol server for Blade",
55
"main": "dist/exports.js",
66
"type": "module",

packages/blade/CHANGELOG.md

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

3+
## 12.71.0
4+
5+
### Minor Changes
6+
7+
- b6c2e2563: feat(blade): expose tick formatter
8+
9+
## 12.70.1
10+
11+
### Patch Changes
12+
13+
- 1005547fa: blade(fix): allow users to modify interval and other props
14+
15+
## 12.70.0
16+
17+
### Minor Changes
18+
19+
- ea3f318d9: feat(blade): add highlight lengends on click
20+
- d4e6866b7: feat(blade): add support for text truncation in x-axis label
21+
- b1d21bf26: feat(blade): add hover on line charts
22+
23+
## 12.69.0
24+
25+
### Minor Changes
26+
27+
- 9f7cbd5ad: feat(blade): bundle recharts
28+
329
## 12.68.1
430

531
### Patch 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.68.1",
4+
"version": "12.71.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18.12.1"

packages/blade/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const nativeExtensions = [
5353
];
5454

5555
const packageJsonDeps = Object.keys(packagejson.dependencies).filter(
56-
(name) => name !== 'patch-package',
56+
(name) => name !== 'patch-package' && name !== 'recharts',
5757
);
5858

5959
const externalDependencies = packageJsonDeps;

0 commit comments

Comments
 (0)