Skip to content

Commit 8cd384c

Browse files
authored
fix: support padded tabs (#330)
* fix: support padded tabs * Add stories * Update tests * Simplify logic on mobile * Bump versions * Bump version
1 parent b41d8d3 commit 8cd384c

File tree

24 files changed

+268
-13
lines changed

24 files changed

+268
-13
lines changed

packages/common/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file.
88

99
<!-- template-start -->
1010

11+
## 8.39.1 ((1/28/2026, 06:48 AM PST))
12+
13+
This is an artificial version bump with no new change.
14+
1115
## 8.39.0 ((1/27/2026, 11:17 AM PST))
1216

1317
This is an artificial version bump with no new change.

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coinbase/cds-common",
3-
"version": "8.39.0",
3+
"version": "8.39.1",
44
"description": "Coinbase Design System - Common",
55
"repository": {
66
"type": "git",

packages/mcp-server/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file.
88

99
<!-- template-start -->
1010

11+
## 8.39.1 ((1/28/2026, 06:48 AM PST))
12+
13+
This is an artificial version bump with no new change.
14+
1115
## 8.39.0 ((1/27/2026, 11:17 AM PST))
1216

1317
This is an artificial version bump with no new change.

packages/mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coinbase/cds-mcp-server",
3-
"version": "8.39.0",
3+
"version": "8.39.1",
44
"description": "Coinbase Design System - MCP Server",
55
"repository": {
66
"type": "git",

packages/mobile-visualization/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
88

99
<!-- template-start -->
1010

11+
## 3.4.0-beta.15 (1/27/2026 PST)
12+
13+
#### 🐞 Fixes
14+
15+
- Fix padding on PeriodSelector. [[#330](https://github.com/coinbase/cds/pull/330)]
16+
1117
## 3.4.0-beta.14 (1/22/2026 PST)
1218

1319
#### 🚀 Updates

packages/mobile-visualization/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coinbase/cds-mobile-visualization",
3-
"version": "3.4.0-beta.14",
3+
"version": "3.4.0-beta.15",
44
"description": "Coinbase Design System - Mobile Visualization Native",
55
"repository": {
66
"type": "git",

packages/mobile-visualization/src/chart/PeriodSelector.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const PeriodSelectorActiveIndicator = ({
2020
borderRadius = 1000,
2121
}: TabsActiveIndicatorProps) => {
2222
const theme = useTheme();
23-
const { width, height, x } = activeTabRect;
23+
const { width, height, x, y } = activeTabRect;
2424

2525
// Get the target background color
2626
const backgroundColorKey = background as keyof typeof theme.color;
@@ -31,7 +31,7 @@ export const PeriodSelectorActiveIndicator = ({
3131
const previousColor = React.useRef(targetColor);
3232

3333
// Combined animated value for position, size, and color
34-
const newAnimatedValues = { x, width, backgroundColor: targetColor };
34+
const newAnimatedValues = { x, y, width, backgroundColor: targetColor };
3535
const animatedValues = useSharedValue(newAnimatedValues);
3636

3737
const isFirstRenderWithWidth =
@@ -47,7 +47,7 @@ export const PeriodSelectorActiveIndicator = ({
4747

4848
const animatedStyles = useAnimatedStyle(
4949
() => ({
50-
transform: [{ translateX: animatedValues.value.x }],
50+
transform: [{ translateX: animatedValues.value.x }, { translateY: animatedValues.value.y }],
5151
width: animatedValues.value.width,
5252
backgroundColor: animatedValues.value.backgroundColor,
5353
}),

packages/mobile-visualization/src/chart/__stories__/PeriodSelector.stories.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ const MinWidthPeriodSelectorExample = () => {
5252
);
5353
};
5454

55+
const PaddedPeriodSelectorExample = () => {
56+
const tabs = [
57+
{ id: '1W', label: '1W' },
58+
{ id: '1M', label: '1M' },
59+
{ id: 'YTD', label: 'YTD' },
60+
];
61+
const [activeTab, setActiveTab] = useState<TabValue | null>(tabs[0]);
62+
return (
63+
<PeriodSelector
64+
activeTab={activeTab}
65+
gap={2}
66+
onChange={(tab) => setActiveTab(tab)}
67+
padding={3}
68+
tabs={tabs}
69+
width="fit-content"
70+
/>
71+
);
72+
};
73+
5574
const LivePeriodSelectorExample = () => {
5675
const tabs = useMemo(
5776
() => [
@@ -285,6 +304,9 @@ export default function All() {
285304
<Example title="Colored Excluding Live">
286305
<ColoredExcludingLivePeriodSelectorExample />
287306
</Example>
307+
<Example title="With Padding">
308+
<PaddedPeriodSelectorExample />
309+
</Example>
288310
</ExampleScreen>
289311
);
290312
}

packages/mobile/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
88

99
<!-- template-start -->
1010

11+
## 8.39.1 (1/28/2026 PST)
12+
13+
#### 🐞 Fixes
14+
15+
- Fix padding on Tab components. [[#330](https://github.com/coinbase/cds/pull/330)]
16+
1117
## 8.39.0 (1/27/2026 PST)
1218

1319
#### 🚀 Updates

packages/mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coinbase/cds-mobile",
3-
"version": "8.39.0",
3+
"version": "8.39.1",
44
"description": "Coinbase Design System - Mobile",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)