@toptal/picasso-tabs 3.0.2-alpha-fx-null-revert-tabs-b3f67a2fa.31 → 3.0.2-alpha-fx-null-revert-tabs-96315ad16.40
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-package/src/Tabs/Tabs.d.ts +5 -2
- package/dist-package/src/Tabs/Tabs.d.ts.map +1 -1
- package/dist-package/src/Tabs/Tabs.js +1 -6
- package/dist-package/src/Tabs/Tabs.js.map +1 -1
- package/dist-package/src/TabsCompound/index.d.ts +3 -1
- package/dist-package/src/TabsCompound/index.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/Tab/__snapshots__/test.tsx.snap +9 -9
- package/src/Tabs/Tabs.tsx +6 -10
@@ -1,5 +1,6 @@
|
|
1
|
-
import type { ReactNode } from 'react';
|
1
|
+
import type { ForwardedRef, ReactNode } from 'react';
|
2
2
|
import React from 'react';
|
3
|
+
import { Tabs as MUITabs } from '@material-ui/core';
|
3
4
|
import type { BaseProps } from '@toptal/picasso-shared';
|
4
5
|
export declare type TabsValueType = string | number | null;
|
5
6
|
export interface Props<V extends TabsValueType> extends BaseProps {
|
@@ -15,6 +16,8 @@ export interface Props<V extends TabsValueType> extends BaseProps {
|
|
15
16
|
variant?: 'scrollable' | 'fullWidth';
|
16
17
|
}
|
17
18
|
export declare const TabsOrientationContext: React.Context<"horizontal" | "vertical">;
|
18
|
-
export declare const Tabs:
|
19
|
+
export declare const Tabs: <V extends TabsValueType = TabsValueType>(props: Props<V> & {
|
20
|
+
ref?: ForwardedRef<HTMLDivElement> | undefined;
|
21
|
+
}) => ReturnType<typeof MUITabs>;
|
19
22
|
export default Tabs;
|
20
23
|
//# sourceMappingURL=Tabs.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAMvD,oBAAY,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;AAElD,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,aAAa,CAAE,SAAQ,SAAS;IAC/D,6CAA6C;IAC7C,QAAQ,EAAE,SAAS,CAAA;IAEnB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;IAElE,uHAAuH;IACvH,KAAK,EAAE,CAAC,CAAA;IAER,oDAAoD;IACpD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAEvC,yDAAyD;IACzD,OAAO,CAAC,EAAE,YAAY,GAAG,WAAW,CAAA;CACrC;AAMD,eAAO,MAAM,sBAAsB,0CAEpB,CAAA;AAEf,eAAO,MAAM,IAAI;;MAqCZ,WAAW,cAAc,CAAC,CAAA;AAE/B,eAAe,IAAI,CAAA"}
|
@@ -19,17 +19,12 @@ const useStyles = makeStyles(styles, {
|
|
19
19
|
name: 'Tabs',
|
20
20
|
});
|
21
21
|
export const TabsOrientationContext = React.createContext('horizontal');
|
22
|
-
// eslint-disable-next-line react/display-name
|
23
22
|
export const Tabs = forwardRef((props, ref) => {
|
24
|
-
const { children, orientation, onChange, value, variant = 'scrollable' } = props, rest = __rest(props, ["children", "orientation", "onChange", "value", "variant"]);
|
23
|
+
const { children, orientation = 'horizontal', onChange, value, variant = 'scrollable' } = props, rest = __rest(props, ["children", "orientation", "onChange", "value", "variant"]);
|
25
24
|
const classes = useStyles(props);
|
26
25
|
const action = useTabAction();
|
27
26
|
return (React.createElement(TabsOrientationContext.Provider, { value: orientation },
|
28
27
|
React.createElement(MUITabs, Object.assign({}, rest, { classes: { root: classes[orientation] }, ref: ref, onChange: onChange, value: value, action: action, scrollButtons: 'auto', ScrollButtonComponent: TabScrollButton, orientation: orientation, variant: variant }), children)));
|
29
28
|
});
|
30
|
-
Tabs.displayName = 'Tabs';
|
31
|
-
Tabs.defaultProps = {
|
32
|
-
orientation: 'horizontal',
|
33
|
-
};
|
34
29
|
export default Tabs;
|
35
30
|
//# sourceMappingURL=Tabs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/Tabs/Tabs.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,YAAY,MAAM,kBAAkB,CAAA;AAqB3C,MAAM,SAAS,GAAG,UAAU,CAAQ,MAAM,EAAE;IAC1C,IAAI,EAAE,MAAM;CACb,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAEvD,YAAY,CAAC,CAAA;AAEf,
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/Tabs/Tabs.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,C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
|
+
export declare const TabsCompound: (<V extends import("../Tabs").TabsValueType = import("../Tabs").TabsValueType>(props: import("../Tabs/Tabs").Props<V> & {
|
3
|
+
ref?: import("react").ForwardedRef<HTMLDivElement> | undefined;
|
4
|
+
}) => JSX.Element) & {
|
3
5
|
Tab: import("react").ForwardRefExoticComponent<import("../Tab/Tab").Props & import("react").RefAttributes<HTMLDivElement>>;
|
4
6
|
};
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TabsCompound/index.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,YAAY
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TabsCompound/index.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,YAAY;;;;CAEvB,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@toptal/picasso-tabs",
|
3
|
-
"version": "3.0.2-alpha-fx-null-revert-tabs-
|
3
|
+
"version": "3.0.2-alpha-fx-null-revert-tabs-96315ad16.40+96315ad16",
|
4
4
|
"description": "Toptal UI components library - Tabs",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -22,13 +22,13 @@
|
|
22
22
|
},
|
23
23
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
|
24
24
|
"dependencies": {
|
25
|
-
"@toptal/picasso-container": "2.0.1-alpha-fx-null-revert-tabs-
|
26
|
-
"@toptal/picasso-icons": "1.6.1-alpha-fx-null-revert-tabs-
|
27
|
-
"@toptal/picasso-shared": "15.0.1-alpha-fx-null-revert-tabs-
|
28
|
-
"@toptal/picasso-typography": "3.0.1-alpha-fx-null-revert-tabs-
|
29
|
-
"@toptal/picasso-typography-overflow": "2.0.5-alpha-fx-null-revert-tabs-
|
30
|
-
"@toptal/picasso-user-badge": "3.0.2-alpha-fx-null-revert-tabs-
|
31
|
-
"@toptal/picasso-utils": "1.0.4-alpha-fx-null-revert-tabs-
|
25
|
+
"@toptal/picasso-container": "2.0.1-alpha-fx-null-revert-tabs-96315ad16.54+96315ad16",
|
26
|
+
"@toptal/picasso-icons": "1.6.1-alpha-fx-null-revert-tabs-96315ad16.40+96315ad16",
|
27
|
+
"@toptal/picasso-shared": "15.0.1-alpha-fx-null-revert-tabs-96315ad16.133+96315ad16",
|
28
|
+
"@toptal/picasso-typography": "3.0.1-alpha-fx-null-revert-tabs-96315ad16.54+96315ad16",
|
29
|
+
"@toptal/picasso-typography-overflow": "2.0.5-alpha-fx-null-revert-tabs-96315ad16.54+96315ad16",
|
30
|
+
"@toptal/picasso-user-badge": "3.0.2-alpha-fx-null-revert-tabs-96315ad16.40+96315ad16",
|
31
|
+
"@toptal/picasso-utils": "1.0.4-alpha-fx-null-revert-tabs-96315ad16.133+96315ad16",
|
32
32
|
"ap-style-title-case": "^1.1.2",
|
33
33
|
"classnames": "^2.5.1"
|
34
34
|
},
|
@@ -46,14 +46,14 @@
|
|
46
46
|
".": "./dist-package/src/index.js"
|
47
47
|
},
|
48
48
|
"devDependencies": {
|
49
|
-
"@toptal/picasso-provider": "5.0.1-alpha-fx-null-revert-tabs-
|
50
|
-
"@toptal/picasso-tailwind-merge": "1.2.1-alpha-fx-null-revert-tabs-
|
51
|
-
"@toptal/picasso-test-utils": "1.1.2-alpha-fx-null-revert-tabs-
|
49
|
+
"@toptal/picasso-provider": "5.0.1-alpha-fx-null-revert-tabs-96315ad16.54+96315ad16",
|
50
|
+
"@toptal/picasso-tailwind-merge": "1.2.1-alpha-fx-null-revert-tabs-96315ad16.54+96315ad16",
|
51
|
+
"@toptal/picasso-test-utils": "1.1.2-alpha-fx-null-revert-tabs-96315ad16.133+96315ad16"
|
52
52
|
},
|
53
53
|
"files": [
|
54
54
|
"dist-package/**",
|
55
55
|
"!dist-package/tsconfig.tsbuildinfo",
|
56
56
|
"src"
|
57
57
|
],
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "96315ad160eabd6ec2f07fd7c70fbc5f69c04016"
|
59
59
|
}
|
@@ -6,7 +6,7 @@ exports[`Tab Tab disabled tab 1`] = `
|
|
6
6
|
class="Picasso-root"
|
7
7
|
>
|
8
8
|
<div
|
9
|
-
class="MuiTabs-root
|
9
|
+
class="MuiTabs-root"
|
10
10
|
>
|
11
11
|
<div
|
12
12
|
class="MuiTabs-scrollable"
|
@@ -22,7 +22,7 @@ exports[`Tab Tab disabled tab 1`] = `
|
|
22
22
|
>
|
23
23
|
<button
|
24
24
|
aria-selected="false"
|
25
|
-
class="MuiButtonBase-root MuiTab-root
|
25
|
+
class="MuiButtonBase-root MuiTab-root MuiTab-textColorInherit Mui-disabled Mui-disabled"
|
26
26
|
disabled=""
|
27
27
|
role="tab"
|
28
28
|
tabindex="-1"
|
@@ -32,7 +32,7 @@ exports[`Tab Tab disabled tab 1`] = `
|
|
32
32
|
class="MuiTab-wrapper PicassoTab-wrapper"
|
33
33
|
>
|
34
34
|
<div
|
35
|
-
class="m-0 text-
|
35
|
+
class="m-0 text-md text-inherit font-semibold whitespace-nowrap overflow-ellipsis overflow-hidden inline TypographyOverflow-wrapper !block !whitespace-nowrap"
|
36
36
|
>
|
37
37
|
Tab Label
|
38
38
|
</div>
|
@@ -55,7 +55,7 @@ exports[`Tab Tab renders 1`] = `
|
|
55
55
|
class="Picasso-root"
|
56
56
|
>
|
57
57
|
<div
|
58
|
-
class="MuiTabs-root
|
58
|
+
class="MuiTabs-root"
|
59
59
|
>
|
60
60
|
<div
|
61
61
|
class="MuiTabs-scrollable"
|
@@ -71,7 +71,7 @@ exports[`Tab Tab renders 1`] = `
|
|
71
71
|
>
|
72
72
|
<button
|
73
73
|
aria-selected="false"
|
74
|
-
class="MuiButtonBase-root MuiTab-root
|
74
|
+
class="MuiButtonBase-root MuiTab-root MuiTab-textColorInherit"
|
75
75
|
role="tab"
|
76
76
|
tabindex="0"
|
77
77
|
type="button"
|
@@ -80,7 +80,7 @@ exports[`Tab Tab renders 1`] = `
|
|
80
80
|
class="MuiTab-wrapper PicassoTab-wrapper"
|
81
81
|
>
|
82
82
|
<div
|
83
|
-
class="m-0 text-
|
83
|
+
class="m-0 text-md text-inherit font-semibold whitespace-nowrap overflow-ellipsis overflow-hidden inline TypographyOverflow-wrapper !block !whitespace-nowrap"
|
84
84
|
>
|
85
85
|
Tab Label
|
86
86
|
</div>
|
@@ -103,7 +103,7 @@ exports[`Tab Tab tab with icon 1`] = `
|
|
103
103
|
class="Picasso-root"
|
104
104
|
>
|
105
105
|
<div
|
106
|
-
class="MuiTabs-root
|
106
|
+
class="MuiTabs-root"
|
107
107
|
>
|
108
108
|
<div
|
109
109
|
class="MuiTabs-scrollable"
|
@@ -119,7 +119,7 @@ exports[`Tab Tab tab with icon 1`] = `
|
|
119
119
|
>
|
120
120
|
<button
|
121
121
|
aria-selected="false"
|
122
|
-
class="MuiButtonBase-root MuiTab-root
|
122
|
+
class="MuiButtonBase-root MuiTab-root MuiTab-textColorInherit MuiTab-labelIcon"
|
123
123
|
role="tab"
|
124
124
|
tabindex="0"
|
125
125
|
type="button"
|
@@ -131,7 +131,7 @@ exports[`Tab Tab tab with icon 1`] = `
|
|
131
131
|
id="Icon"
|
132
132
|
/>
|
133
133
|
<div
|
134
|
-
class="m-0 text-
|
134
|
+
class="m-0 text-md text-inherit font-semibold whitespace-nowrap overflow-ellipsis overflow-hidden inline TypographyOverflow-wrapper !block !whitespace-nowrap"
|
135
135
|
>
|
136
136
|
Tab Label
|
137
137
|
</div>
|
package/src/Tabs/Tabs.tsx
CHANGED
@@ -36,7 +36,6 @@ export const TabsOrientationContext = React.createContext<
|
|
36
36
|
'horizontal' | 'vertical'
|
37
37
|
>('horizontal')
|
38
38
|
|
39
|
-
// eslint-disable-next-line react/display-name
|
40
39
|
export const Tabs = forwardRef(
|
41
40
|
<V extends TabsValueType = TabsValueType>(
|
42
41
|
props: Props<V>,
|
@@ -44,7 +43,7 @@ export const Tabs = forwardRef(
|
|
44
43
|
) => {
|
45
44
|
const {
|
46
45
|
children,
|
47
|
-
orientation,
|
46
|
+
orientation = 'horizontal',
|
48
47
|
onChange,
|
49
48
|
value,
|
50
49
|
variant = 'scrollable',
|
@@ -54,10 +53,10 @@ export const Tabs = forwardRef(
|
|
54
53
|
const action = useTabAction()
|
55
54
|
|
56
55
|
return (
|
57
|
-
<TabsOrientationContext.Provider value={orientation
|
56
|
+
<TabsOrientationContext.Provider value={orientation}>
|
58
57
|
<MUITabs
|
59
58
|
{...rest}
|
60
|
-
classes={{ root: classes[orientation
|
59
|
+
classes={{ root: classes[orientation] }}
|
61
60
|
ref={ref}
|
62
61
|
onChange={onChange}
|
63
62
|
value={value}
|
@@ -72,11 +71,8 @@ export const Tabs = forwardRef(
|
|
72
71
|
</TabsOrientationContext.Provider>
|
73
72
|
)
|
74
73
|
}
|
75
|
-
)
|
76
|
-
|
77
|
-
|
78
|
-
Tabs.defaultProps = {
|
79
|
-
orientation: 'horizontal',
|
80
|
-
}
|
74
|
+
) as <V extends TabsValueType = TabsValueType>(
|
75
|
+
props: Props<V> & { ref?: ForwardedRef<HTMLDivElement> }
|
76
|
+
) => ReturnType<typeof MUITabs>
|
81
77
|
|
82
78
|
export default Tabs
|