@apify/ui-library 0.68.1-feattabs-4feb6d.72 → 0.68.1-feattabs-4feb6d.95
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/dist/src/components/tabs/tab.d.ts +1 -0
- package/dist/src/components/tabs/tab.d.ts.map +1 -1
- package/dist/src/components/tabs/tab.js +8 -1
- package/dist/src/components/tabs/tab.js.map +1 -1
- package/dist/src/components/tabs/tabs.d.ts +2 -1
- package/dist/src/components/tabs/tabs.d.ts.map +1 -1
- package/dist/src/components/tabs/tabs.js +8 -0
- package/dist/src/components/tabs/tabs.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/tabs/tab.tsx +9 -1
- package/src/components/tabs/tabs.tsx +12 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "0.68.1-feattabs-4feb6d.
|
|
3
|
+
"version": "0.68.1-feattabs-4feb6d.95+80e5c4fa623",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"typescript": "^5.1.6",
|
|
67
67
|
"typescript-eslint": "^8.24.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "80e5c4fa623f29667a54f306849212ffded7ba03"
|
|
70
70
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import { createPath } from 'history';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
4
5
|
import styled, { css } from 'styled-components';
|
|
5
6
|
|
|
@@ -146,6 +147,7 @@ const TabWrapper = styled(Link)<TabWrapperProps>`
|
|
|
146
147
|
align-items: center;
|
|
147
148
|
justify-content: center;
|
|
148
149
|
gap: ${theme.space.space4};
|
|
150
|
+
flex-shrink: 0;
|
|
149
151
|
cursor: pointer;
|
|
150
152
|
position: relative;
|
|
151
153
|
transition: background-color ${theme.transition.fastEaseOut}, border-color ${theme.transition.fastEaseOut}, color ${theme.transition.fastEaseOut};
|
|
@@ -165,6 +167,12 @@ const TabWrapper = styled(Link)<TabWrapperProps>`
|
|
|
165
167
|
transition: color ${theme.transition.fastEaseOut};
|
|
166
168
|
}
|
|
167
169
|
|
|
170
|
+
.Tab-title {
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
text-overflow: ellipsis;
|
|
173
|
+
white-space: nowrap;
|
|
174
|
+
}
|
|
175
|
+
|
|
168
176
|
.Tab-badge {
|
|
169
177
|
flex-shrink: 0;
|
|
170
178
|
text-transform: uppercase;
|
|
@@ -186,7 +194,7 @@ export const Tab = ({ variant = 'default', id, to, Icon, title, chip, rollout, c
|
|
|
186
194
|
$variant={variant}
|
|
187
195
|
>
|
|
188
196
|
{Icon && <Icon size="16" className="Tab-icon" />}
|
|
189
|
-
<Text size={tabVariantTextSize[variant]} weight="bold" as="div">{title}</Text>
|
|
197
|
+
<Text size={tabVariantTextSize[variant]} className="Tab-title" weight="bold" as="div">{title}</Text>
|
|
190
198
|
{chip && <Badge size={tabVariantBadgeSize[variant]} variant={active ? 'primary_black' : 'neutral_subtle'} className="Tab-badge">{chip}</Badge>}
|
|
191
199
|
{rollout && <Badge size={tabVariantBadgeSize[variant]} variant="primary_blue" className="Tab-badge">{rollout}</Badge>}
|
|
192
200
|
</TabWrapper>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import useResizeObserver from '@react-hook/resize-observer';
|
|
2
|
-
import {
|
|
2
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
3
3
|
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
|
|
@@ -7,7 +7,8 @@ import { theme } from '../../design_system/theme.js';
|
|
|
7
7
|
import type { WithTransientProps } from '../../type_utils.js';
|
|
8
8
|
import type { MarginSpacingProps, RegularBoxProps } from '../box.js';
|
|
9
9
|
import { Box } from '../box.js';
|
|
10
|
-
import {
|
|
10
|
+
import type { TabData, TabVariant } from './tab.js';
|
|
11
|
+
import { Tab } from './tab.js';
|
|
11
12
|
|
|
12
13
|
type SharedTabsProps = Omit<RegularBoxProps, 'as' | 'onClick'> & MarginSpacingProps;
|
|
13
14
|
type TabsProps = SharedTabsProps & {
|
|
@@ -56,7 +57,7 @@ const tabsVariantStyle = {
|
|
|
56
57
|
} satisfies Record<TabVariant, FlattenSimpleInterpolation>;
|
|
57
58
|
|
|
58
59
|
type TabsWrapperProps = WithTransientProps<Required<Pick<TabsProps, 'variant'>>> & {
|
|
59
|
-
role?: AriaRole;
|
|
60
|
+
role?: React.AriaRole;
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
const TabsWrapper = styled(Box)<TabsWrapperProps>`
|
|
@@ -70,6 +71,14 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
|
|
|
70
71
|
flex-grow: 1;
|
|
71
72
|
overflow-x: auto;
|
|
72
73
|
${({ $variant }) => tabsVariantStyle[$variant]};
|
|
74
|
+
|
|
75
|
+
/* Scrollbar */
|
|
76
|
+
-ms-overflow-style: none;
|
|
77
|
+
scrollbar-width: none;
|
|
78
|
+
|
|
79
|
+
&::-webkit-scrollbar {
|
|
80
|
+
display: none; /* Chrome, Safari, Opera */
|
|
81
|
+
}
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
& > [role="cell"] {
|