@toptal/picasso-page 5.1.6 → 5.1.8
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/PageContent/PageContent.d.ts.map +1 -1
- package/dist-package/src/PageContent/PageContent.js +5 -13
- package/dist-package/src/PageContent/PageContent.js.map +1 -1
- package/dist-package/src/PageContent/styles.d.ts +2 -3
- package/dist-package/src/PageContent/styles.d.ts.map +1 -1
- package/dist-package/src/PageContent/styles.js +9 -28
- package/dist-package/src/PageContent/styles.js.map +1 -1
- package/package.json +5 -5
- package/src/PageContent/PageContent.tsx +10 -19
- package/src/PageContent/styles.ts +12 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageContent.d.ts","sourceRoot":"","sources":["../../../src/PageContent/PageContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAiC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PageContent.d.ts","sourceRoot":"","sources":["../../../src/PageContent/PageContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAiC,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAQvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,oDAAoD;IACpD,QAAQ,EAAE,SAAS,CAAA;IACnB,kBAAkB;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,eAAO,MAAM,WAAW,8EA6BvB,CAAA;AAQD,eAAe,WAAW,CAAA"}
|
|
@@ -10,25 +10,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { useContext, forwardRef } from 'react';
|
|
13
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
14
|
-
import cx from 'classnames';
|
|
15
13
|
import { useSidebar } from '@toptal/picasso-provider';
|
|
14
|
+
import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge';
|
|
16
15
|
import { PageContext } from '../Page';
|
|
17
|
-
import
|
|
18
|
-
const useStyles = makeStyles(styles, {
|
|
19
|
-
name: 'PicassoPageContent',
|
|
20
|
-
});
|
|
16
|
+
import { getMaxWidthClass } from './styles';
|
|
21
17
|
export const PageContent = forwardRef(function PageContent(props, ref) {
|
|
22
18
|
const { children, className, style, flex } = props, rest = __rest(props, ["children", "className", "style", "flex"]);
|
|
23
|
-
const classes = useStyles();
|
|
24
19
|
const { width, fullWidth } = useContext(PageContext);
|
|
25
20
|
const { hasSidebar } = useSidebar();
|
|
26
|
-
const innerClassName =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
[classes.flex]: flex,
|
|
30
|
-
}, classes.content);
|
|
31
|
-
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cx(classes.root, { [classes.hasSidebar]: hasSidebar }, className), style: style }),
|
|
21
|
+
const innerClassName = twJoin('h-full grow bg-[#fcfcfc] bg-clip-content', getMaxWidthClass({ fullWidth, width }), flex && 'flex');
|
|
22
|
+
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: twMerge('flex flex-[1] w-full justify-center', hasSidebar &&
|
|
23
|
+
'bg-[linear-gradient(90deg,rgb(243,244,246)50%,rgb(252,252,252)50%)]', className), style: style }),
|
|
32
24
|
React.createElement("div", { className: innerClassName }, children)));
|
|
33
25
|
});
|
|
34
26
|
PageContent.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageContent.js","sourceRoot":"","sources":["../../../src/PageContent/PageContent.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,EA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AAA;AAED,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC,eAAe,WAAW,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
export default _default;
|
|
1
|
+
import type { PageContextProps } from '../Page/types';
|
|
2
|
+
export declare const getMaxWidthClass: ({ fullWidth, width }: PageContextProps) => "max-w-full" | "max-w-[90em]" | "max-w-[75em]";
|
|
4
3
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PageContent/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PageContent/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,eAAO,MAAM,gBAAgB,yBAA0B,gBAAgB,mDAUtE,CAAA"}
|
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
height: '100%',
|
|
11
|
-
flexGrow: 1,
|
|
12
|
-
maxWidth: layout.contentWidth,
|
|
13
|
-
backgroundColor: palette.grey.lightest,
|
|
14
|
-
backgroundClip: 'content-box',
|
|
15
|
-
},
|
|
16
|
-
hasSidebar: {
|
|
17
|
-
background: `linear-gradient(90deg, ${palette.grey.lighter} 50%, ${palette.grey.lightest} 50%)`,
|
|
18
|
-
},
|
|
19
|
-
wide: {
|
|
20
|
-
maxWidth: layout.contentWidthWide,
|
|
21
|
-
},
|
|
22
|
-
fullWidth: {
|
|
23
|
-
maxWidth: '100%',
|
|
24
|
-
},
|
|
25
|
-
flex: {
|
|
26
|
-
display: 'flex',
|
|
27
|
-
},
|
|
28
|
-
});
|
|
1
|
+
export const getMaxWidthClass = ({ fullWidth, width }) => {
|
|
2
|
+
if (fullWidth || width === 'full') {
|
|
3
|
+
return 'max-w-full';
|
|
4
|
+
}
|
|
5
|
+
if (width === 'wide') {
|
|
6
|
+
return 'max-w-[90em]';
|
|
7
|
+
}
|
|
8
|
+
return 'max-w-[75em]';
|
|
9
|
+
};
|
|
29
10
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PageContent/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PageContent/styles.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAoB,EAAE,EAAE;IACzE,IAAI,SAAS,IAAI,KAAK,KAAK,MAAM,EAAE;QACjC,OAAO,YAAY,CAAA;KACpB;IAED,IAAI,KAAK,KAAK,MAAM,EAAE;QACpB,OAAO,cAAc,CAAA;KACtB;IAED,OAAO,cAAc,CAAA;AACvB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso-page",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.8",
|
|
4
4
|
"description": "Toptal UI components library - Page",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@toptal/picasso-accordion": "3.0.
|
|
26
|
-
"@toptal/picasso-autocomplete": "5.0.
|
|
25
|
+
"@toptal/picasso-accordion": "3.0.10",
|
|
26
|
+
"@toptal/picasso-autocomplete": "5.0.11",
|
|
27
27
|
"@toptal/picasso-avatar": "6.1.3",
|
|
28
28
|
"@toptal/picasso-badge": "3.0.2",
|
|
29
|
-
"@toptal/picasso-button": "4.0.
|
|
29
|
+
"@toptal/picasso-button": "4.0.11",
|
|
30
30
|
"@toptal/picasso-container": "3.1.0",
|
|
31
31
|
"@toptal/picasso-dropdown": "4.2.0",
|
|
32
32
|
"@toptal/picasso-icons": "1.7.0",
|
|
33
33
|
"@toptal/picasso-logo": "2.0.2",
|
|
34
34
|
"@toptal/picasso-menu": "3.0.8",
|
|
35
|
-
"@toptal/picasso-notification": "4.0.
|
|
35
|
+
"@toptal/picasso-notification": "4.0.11",
|
|
36
36
|
"@toptal/picasso-shared": "15.0.0",
|
|
37
37
|
"@toptal/picasso-tag": "4.0.3",
|
|
38
38
|
"@toptal/picasso-tooltip": "2.0.0",
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { ReactNode, HTMLAttributes } from 'react'
|
|
2
2
|
import React, { useContext, forwardRef } from 'react'
|
|
3
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
5
|
-
import cx from 'classnames'
|
|
6
3
|
import type { BaseProps } from '@toptal/picasso-shared'
|
|
7
4
|
import { useSidebar } from '@toptal/picasso-provider'
|
|
5
|
+
import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge'
|
|
8
6
|
|
|
9
7
|
import { PageContext } from '../Page'
|
|
10
8
|
import type { PageContextProps } from '../Page/types'
|
|
11
|
-
import
|
|
9
|
+
import { getMaxWidthClass } from './styles'
|
|
12
10
|
|
|
13
11
|
export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
|
|
14
12
|
/** Custom components that render content of page */
|
|
@@ -17,34 +15,27 @@ export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
|
|
|
17
15
|
flex?: boolean
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
const useStyles = makeStyles<Theme>(styles, {
|
|
21
|
-
name: 'PicassoPageContent',
|
|
22
|
-
})
|
|
23
|
-
|
|
24
18
|
export const PageContent = forwardRef<HTMLDivElement, Props>(
|
|
25
19
|
function PageContent(props, ref) {
|
|
26
20
|
const { children, className, style, flex, ...rest } = props
|
|
27
21
|
|
|
28
|
-
const classes = useStyles()
|
|
29
22
|
const { width, fullWidth } = useContext<PageContextProps>(PageContext)
|
|
30
23
|
const { hasSidebar } = useSidebar()
|
|
31
24
|
|
|
32
|
-
const innerClassName =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
[classes.flex]: flex,
|
|
37
|
-
},
|
|
38
|
-
classes.content
|
|
25
|
+
const innerClassName = twJoin(
|
|
26
|
+
'h-full grow bg-[#fcfcfc] bg-clip-content',
|
|
27
|
+
getMaxWidthClass({ fullWidth, width }),
|
|
28
|
+
flex && 'flex'
|
|
39
29
|
)
|
|
40
30
|
|
|
41
31
|
return (
|
|
42
32
|
<div
|
|
43
33
|
{...rest}
|
|
44
34
|
ref={ref}
|
|
45
|
-
className={
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
className={twMerge(
|
|
36
|
+
'flex flex-[1] w-full justify-center',
|
|
37
|
+
hasSidebar &&
|
|
38
|
+
'bg-[linear-gradient(90deg,rgb(243,244,246)50%,rgb(252,252,252)50%)]',
|
|
48
39
|
className
|
|
49
40
|
)}
|
|
50
41
|
style={style}
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { createStyles } from '@material-ui/core/styles'
|
|
1
|
+
import type { PageContextProps } from '../Page/types'
|
|
3
2
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
maxWidth: layout.contentWidth,
|
|
16
|
-
backgroundColor: palette.grey.lightest,
|
|
17
|
-
backgroundClip: 'content-box',
|
|
18
|
-
},
|
|
19
|
-
hasSidebar: {
|
|
20
|
-
background: `linear-gradient(90deg, ${palette.grey.lighter} 50%, ${palette.grey.lightest} 50%)`,
|
|
21
|
-
},
|
|
22
|
-
wide: {
|
|
23
|
-
maxWidth: layout.contentWidthWide,
|
|
24
|
-
},
|
|
25
|
-
fullWidth: {
|
|
26
|
-
maxWidth: '100%',
|
|
27
|
-
},
|
|
28
|
-
flex: {
|
|
29
|
-
display: 'flex',
|
|
30
|
-
},
|
|
31
|
-
})
|
|
3
|
+
export const getMaxWidthClass = ({ fullWidth, width }: PageContextProps) => {
|
|
4
|
+
if (fullWidth || width === 'full') {
|
|
5
|
+
return 'max-w-full'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (width === 'wide') {
|
|
9
|
+
return 'max-w-[90em]'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return 'max-w-[75em]'
|
|
13
|
+
}
|