@apify/ui-library 0.68.1-feattabs-4feb6d.94 → 0.68.1-feattabs-4feb6d.103
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.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.map +1 -1
- package/dist/src/components/tabs/tabs.js +2 -1
- package/dist/src/components/tabs/tabs.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/components/tabs/tab.tsx +8 -1
- package/src/components/tabs/tabs.tsx +2 -1
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.103+115a161713b",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@apify/ui-icons": "^0.10.0",
|
|
30
30
|
"@floating-ui/react": "^0.26.2",
|
|
31
|
+
"@juggle/resize-observer": "^3.4.0",
|
|
31
32
|
"@react-hook/resize-observer": "^2.0.2",
|
|
32
33
|
"clsx": "^2.0.0",
|
|
33
34
|
"dayjs": "1.11.9",
|
|
@@ -66,5 +67,5 @@
|
|
|
66
67
|
"typescript": "^5.1.6",
|
|
67
68
|
"typescript-eslint": "^8.24.0"
|
|
68
69
|
},
|
|
69
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "115a161713b7c2cc8a7dda7417f9f46836b93d4d"
|
|
70
71
|
}
|
|
@@ -147,6 +147,7 @@ const TabWrapper = styled(Link)<TabWrapperProps>`
|
|
|
147
147
|
align-items: center;
|
|
148
148
|
justify-content: center;
|
|
149
149
|
gap: ${theme.space.space4};
|
|
150
|
+
flex-shrink: 0;
|
|
150
151
|
cursor: pointer;
|
|
151
152
|
position: relative;
|
|
152
153
|
transition: background-color ${theme.transition.fastEaseOut}, border-color ${theme.transition.fastEaseOut}, color ${theme.transition.fastEaseOut};
|
|
@@ -166,6 +167,12 @@ const TabWrapper = styled(Link)<TabWrapperProps>`
|
|
|
166
167
|
transition: color ${theme.transition.fastEaseOut};
|
|
167
168
|
}
|
|
168
169
|
|
|
170
|
+
.Tab-title {
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
text-overflow: ellipsis;
|
|
173
|
+
white-space: nowrap;
|
|
174
|
+
}
|
|
175
|
+
|
|
169
176
|
.Tab-badge {
|
|
170
177
|
flex-shrink: 0;
|
|
171
178
|
text-transform: uppercase;
|
|
@@ -187,7 +194,7 @@ export const Tab = ({ variant = 'default', id, to, Icon, title, chip, rollout, c
|
|
|
187
194
|
$variant={variant}
|
|
188
195
|
>
|
|
189
196
|
{Icon && <Icon size="16" className="Tab-icon" />}
|
|
190
|
-
<Text size={tabVariantTextSize[variant]} weight="bold" as="div">{title}</Text>
|
|
197
|
+
<Text size={tabVariantTextSize[variant]} className="Tab-title" weight="bold" as="div">{title}</Text>
|
|
191
198
|
{chip && <Badge size={tabVariantBadgeSize[variant]} variant={active ? 'primary_black' : 'neutral_subtle'} className="Tab-badge">{chip}</Badge>}
|
|
192
199
|
{rollout && <Badge size={tabVariantBadgeSize[variant]} variant="primary_blue" className="Tab-badge">{rollout}</Badge>}
|
|
193
200
|
</TabWrapper>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ResizeObserver } from '@juggle/resize-observer';
|
|
1
2
|
import useResizeObserver from '@react-hook/resize-observer';
|
|
2
3
|
import React, { useCallback, useRef, useState } from 'react';
|
|
3
4
|
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
@@ -146,7 +147,7 @@ export const Tabs = ({ variant = 'default', tabs, activeTab, onSelect, ...props
|
|
|
146
147
|
const ref = useRef<HTMLDivElement>(null);
|
|
147
148
|
const [overflowState, setOveflowState] = useState<TabOverflowState>();
|
|
148
149
|
|
|
149
|
-
useResizeObserver(ref, (entry) => setOveflowState(isTabsOverflowing(entry.target as HTMLDivElement)));
|
|
150
|
+
useResizeObserver(ref, (entry) => setOveflowState(isTabsOverflowing(entry.target as HTMLDivElement)), { polyfill: ResizeObserver });
|
|
150
151
|
const scrollHandler = useCallback((event: React.SyntheticEvent<HTMLDivElement>) => {
|
|
151
152
|
setOveflowState(isTabsOverflowing(event.currentTarget as HTMLDivElement));
|
|
152
153
|
}, []);
|