@rango-dev/ui 0.39.1-next.7 → 0.39.1-next.9
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/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/translations/de.d.ts.map +1 -1
- package/dist/translations/el.d.ts.map +1 -1
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fi.d.ts.map +1 -1
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/it.d.ts.map +1 -1
- package/dist/translations/ja.d.ts.map +1 -1
- package/dist/translations/nl.d.ts.map +1 -1
- package/dist/translations/pl.d.ts.map +1 -1
- package/dist/translations/pt.d.ts.map +1 -1
- package/dist/translations/ru.d.ts.map +1 -1
- package/dist/translations/sv.d.ts.map +1 -1
- package/dist/translations/uk.d.ts.map +1 -1
- package/dist/translations/zh.d.ts.map +1 -1
- package/dist/ui.build.json +1 -1
- package/dist/widget/ui/src/components/IconButton/IconButton.types.d.ts +1 -0
- package/dist/widget/ui/src/components/IconButton/IconButton.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts +2 -0
- package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tabs/Tabs.d.ts.map +1 -1
- package/package.json +2 -2
- package/readme.md +1 -1
- package/src/components/IconButton/IconButton.types.ts +1 -0
- package/src/components/List/List.tsx +1 -1
- package/src/components/ListItem/ListItem.types.ts +2 -0
- package/src/components/ListItemButton/ListItemButton.tsx +1 -0
- package/src/components/Tabs/Tabs.tsx +52 -47
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ButtonPropTypes } from '../Button/Button.types.js';
|
|
2
2
|
import type { CSSProperties } from 'react';
|
|
3
3
|
export type IconButtonPropTypes = {
|
|
4
|
+
id?: ButtonPropTypes['id'];
|
|
4
5
|
size?: ButtonPropTypes['size'];
|
|
5
6
|
type?: ButtonPropTypes['type'];
|
|
6
7
|
variant?: ButtonPropTypes['variant'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/IconButton/IconButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"IconButton.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/IconButton/IconButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export type ListItemPropTypes = {
|
|
3
|
+
id?: string;
|
|
3
4
|
title?: string | React.ReactElement;
|
|
4
5
|
description?: string | React.ReactElement;
|
|
5
6
|
start?: React.ReactNode;
|
|
@@ -9,5 +10,6 @@ export type ListItemPropTypes = {
|
|
|
9
10
|
onKeyUp?: React.KeyboardEventHandler<HTMLLIElement>;
|
|
10
11
|
hasDivider?: boolean;
|
|
11
12
|
tabIndex?: number;
|
|
13
|
+
className?: string;
|
|
12
14
|
};
|
|
13
15
|
//# sourceMappingURL=ListItem.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItem/ListItem.types.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ListItem.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItem/ListItem.types.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemButton.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ListItemButton.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAqBjD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAsC,MAAM,OAAO,CAAC;AAgB3D,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAsC,MAAM,OAAO,CAAC;AAgB3D,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,qBA8MjD"}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,6 +2,7 @@ import type { ButtonPropTypes } from '../Button/Button.types.js';
|
|
|
2
2
|
import type { CSSProperties } from 'react';
|
|
3
3
|
|
|
4
4
|
export type IconButtonPropTypes = {
|
|
5
|
+
id?: ButtonPropTypes['id'];
|
|
5
6
|
size?: ButtonPropTypes['size'];
|
|
6
7
|
type?: ButtonPropTypes['type'];
|
|
7
8
|
variant?: ButtonPropTypes['variant'];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type ListItemPropTypes = {
|
|
2
|
+
id?: string;
|
|
2
3
|
title?: string | React.ReactElement;
|
|
3
4
|
description?: string | React.ReactElement;
|
|
4
5
|
start?: React.ReactNode;
|
|
@@ -8,4 +9,5 @@ export type ListItemPropTypes = {
|
|
|
8
9
|
onKeyUp?: React.KeyboardEventHandler<HTMLLIElement>;
|
|
9
10
|
hasDivider?: boolean;
|
|
10
11
|
tabIndex?: number;
|
|
12
|
+
className?: string;
|
|
11
13
|
};
|
|
@@ -61,14 +61,12 @@ export function TabsComponent(props: TabsPropTypes) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
const updateIndicator = (
|
|
64
|
+
const updateIndicator = () => {
|
|
65
65
|
if (tabRef.current && containerRef.current) {
|
|
66
66
|
const tabRect = tabRef.current.getBoundingClientRect();
|
|
67
67
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
68
68
|
setTabWidth(tabRect.width);
|
|
69
|
-
setTransformPosition(
|
|
70
|
-
scrollable ? tabRef.current.offsetLeft : currentIndex * tabWidth
|
|
71
|
-
);
|
|
69
|
+
setTransformPosition(tabRef.current.offsetLeft);
|
|
72
70
|
const itemPartiallyVisibleOnLeft = tabRect.left < containerRect.left;
|
|
73
71
|
const itemPartiallyVisibleOnRight = tabRect.right > containerRect.right;
|
|
74
72
|
|
|
@@ -96,7 +94,7 @@ export function TabsComponent(props: TabsPropTypes) {
|
|
|
96
94
|
}, []);
|
|
97
95
|
|
|
98
96
|
useEffect(() => {
|
|
99
|
-
updateIndicator(
|
|
97
|
+
updateIndicator();
|
|
100
98
|
|
|
101
99
|
const updateArrowsVisibility = () => {
|
|
102
100
|
if (scrollable && containerRef.current) {
|
|
@@ -119,20 +117,23 @@ export function TabsComponent(props: TabsPropTypes) {
|
|
|
119
117
|
};
|
|
120
118
|
|
|
121
119
|
const resizeHandler: ResizeObserverCallback = (event) => {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
120
|
+
updateIndicator();
|
|
121
|
+
|
|
122
|
+
if (!containerRef.current || !scrollable || !scrollButtons) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
updateArrowsVisibility();
|
|
127
|
+
|
|
128
|
+
const TOTAL_WIDTH_OF_ARROWS = 64;
|
|
129
|
+
const element = event[0].target;
|
|
130
|
+
const tabsContainerOverflown =
|
|
131
|
+
element.scrollWidth - TOTAL_WIDTH_OF_ARROWS > element.clientWidth;
|
|
132
|
+
|
|
133
|
+
if (showArrows && !tabsContainerOverflown) {
|
|
134
|
+
setShowArrows(false);
|
|
135
|
+
} else if (element.scrollWidth > element.clientWidth) {
|
|
136
|
+
setShowArrows(true);
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
|
|
@@ -177,34 +178,38 @@ export function TabsComponent(props: TabsPropTypes) {
|
|
|
177
178
|
type={type}
|
|
178
179
|
borderRadius={borderRadius}
|
|
179
180
|
scrollable={scrollable}>
|
|
180
|
-
{tabItems.map((item, index) =>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
181
|
+
{tabItems.map((item, index) => {
|
|
182
|
+
const isActive = item.id === value;
|
|
183
|
+
return (
|
|
184
|
+
<Tooltip
|
|
185
|
+
key={item.id}
|
|
186
|
+
styles={{ root: { width: '100%' } }}
|
|
187
|
+
container={container}
|
|
188
|
+
side="bottom"
|
|
189
|
+
sideOffset={2}
|
|
190
|
+
content={item.tooltip}
|
|
191
|
+
open={!item.tooltip ? false : undefined}>
|
|
192
|
+
<Tab
|
|
193
|
+
className="_tab"
|
|
194
|
+
ref={index === currentIndex ? tabRef : null}
|
|
195
|
+
type={type}
|
|
196
|
+
fullWidth={scrollable ? false : true}
|
|
197
|
+
disableRipple={true}
|
|
198
|
+
borderRadius={borderRadius}
|
|
199
|
+
onClick={() => onChange(item)}
|
|
200
|
+
size="small"
|
|
201
|
+
isActive={isActive}
|
|
202
|
+
data-active={isActive}
|
|
203
|
+
variant="default">
|
|
204
|
+
{item.icon}
|
|
205
|
+
{!!item.icon && !!item.title && (
|
|
206
|
+
<Divider direction="horizontal" size="2" />
|
|
207
|
+
)}
|
|
208
|
+
{item.title}
|
|
209
|
+
</Tab>
|
|
210
|
+
</Tooltip>
|
|
211
|
+
);
|
|
212
|
+
})}
|
|
208
213
|
<BackdropTab
|
|
209
214
|
type={type}
|
|
210
215
|
borderRadius={borderRadius}
|