@toptal/picasso-container 3.1.5 → 3.1.6-alpha-pf-fix-alpha-release-4de9263c3.0
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.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { PropTypes } from '@material-ui/core';
|
|
2
1
|
import type { SpacingType } from '@toptal/picasso-provider';
|
|
3
|
-
import type {
|
|
2
|
+
import type { BaseProps } from '@toptal/picasso-shared';
|
|
4
3
|
import type { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react';
|
|
5
4
|
import type { AlignItemsType, JustifyContentType, VariantType } from './styles';
|
|
6
5
|
type ContainerType = 'div' | 'span';
|
|
7
6
|
type DirectionType = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
8
7
|
type WrapType = 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
9
8
|
type BorderableType = 'transparent' | 'white';
|
|
10
|
-
|
|
9
|
+
type AlignType = 'inherit' | 'left' | 'center' | 'right' | 'justify';
|
|
10
|
+
export interface Props<V extends VariantType = VariantType> extends BaseProps, HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
|
|
11
11
|
/** Content of Container */
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
/** Whether container should act as inline element `display: inline-block` */
|
|
@@ -31,7 +31,7 @@ export interface Props<V extends VariantType = VariantType> extends StandardProp
|
|
|
31
31
|
/** Component used for the root node */
|
|
32
32
|
as?: ContainerType;
|
|
33
33
|
/** Text align of the inner text */
|
|
34
|
-
align?:
|
|
34
|
+
align?: AlignType;
|
|
35
35
|
/** margin-top for the container transformed to `rem` */
|
|
36
36
|
top?: SpacingType;
|
|
37
37
|
/** margin-bottom for the container transformed to `rem` */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/Container/Container.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Container.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A;IACrD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,oCAAoC;IACpC,OAAO,CAAC,EAAE,CAAC,CAAA;IACX,uCAAuC;IACvC,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,wDAAwD;IACxD,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,yDAAyD;IACzD,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,qDAAqD;IACrD,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,gDAAgD;IAChD,GAAG,CAAC,EAAE,WAAW,CAAA;CAClB;AAED,KAAK,cAAc,GAAG;IACpB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAClC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,GAAG,IAAI,CAAA;KAAE,GACrD,YAAY,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,cAwFvB,CAAA;AAID,eAAe,SAAS,CAAA;AACxB,YAAY,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -18,10 +18,7 @@ import { getSpacingClasses, getSpacingStyles } from './utils';
|
|
|
18
18
|
* Container component used for spacing 2 elements
|
|
19
19
|
*/
|
|
20
20
|
export const Container = documentable(forwardRef((props, ref) => {
|
|
21
|
-
const { children, className, inline, flex, direction, alignItems, justifyContent, wrap, style, bordered = false, rounded = false, variant, align, as: Component = inline ? 'span' : 'div', top, bottom, left, right, padded, gap,
|
|
22
|
-
// Avoid passing external classes inside the rest props
|
|
23
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
24
|
-
classes: externalClasses } = props, rest = __rest(props, ["children", "className", "inline", "flex", "direction", "alignItems", "justifyContent", "wrap", "style", "bordered", "rounded", "variant", "align", "as", "top", "bottom", "left", "right", "padded", "gap", "classes"]);
|
|
21
|
+
const { children, className, inline, flex, direction, alignItems, justifyContent, wrap, style, bordered = false, rounded = false, variant, align, as: Component = inline ? 'span' : 'div', top, bottom, left, right, padded, gap } = props, rest = __rest(props, ["children", "className", "inline", "flex", "direction", "alignItems", "justifyContent", "wrap", "style", "bordered", "rounded", "variant", "align", "as", "top", "bottom", "left", "right", "padded", "gap"]);
|
|
25
22
|
const spacingProps = { gap, padded, top, bottom, right, left };
|
|
26
23
|
const isBorderedVariant = !variant || variant === 'white' || variant === 'transparent';
|
|
27
24
|
const getDisplayValue = (isInline, isFlex) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.js","sourceRoot":"","sources":["../../../src/Container/Container.tsx"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Container.js","sourceRoot":"","sources":["../../../src/Container/Container.tsx"],"names":[],"mappings":";;;;;;;;;;;AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAGxD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA6D7D;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAmB,YAAY,CACnD,UAAU,CACR,CACE,KAAe,EACf,GAA+B,EAC/B,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACN,IAAI,EACJ,SAAS,EACT,UAAU,EACV,cAAc,EACd,IAAI,EACJ,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,OAAO,G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AS;YACP,SAAS,KAAK,KAAK;YACnB,gBAAgB,CAAC,SAAS,CAAC,SAAS,CAAC,EAEvC,SAAS,CACV,EACD,KAAK,kCAEA,gBAAgB,CAAC,YAAY,CAAC,GAC9B,KAAK,MAGT,QAAQ,CACC,CACb,CAAA;AACH,CAAC,CACgB,CACpB,CAAA;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,eAAe,SAAS,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso-container",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6-alpha-pf-fix-alpha-release-4de9263c3.0",
|
|
4
4
|
"description": "Toptal UI components library - Container",
|
|
5
5
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"main": "./dist-package/src/index.js",
|
|
23
23
|
"module": "./dist-package/src/index.js",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@toptal/picasso-utils": "4.0.
|
|
25
|
+
"@toptal/picasso-utils": "4.0.2-alpha-pf-fix-alpha-release-4de9263c3.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@toptal/picasso-provider": "
|
|
29
|
-
"@toptal/picasso-tailwind": "
|
|
30
|
-
"@toptal/picasso-tailwind-merge": "^2.0.0",
|
|
31
|
-
"react": ">=16.12.0
|
|
28
|
+
"@toptal/picasso-provider": "6.0.1-alpha-pf-fix-alpha-release-4de9263c3.0",
|
|
29
|
+
"@toptal/picasso-tailwind": "4.0.1-alpha-pf-fix-alpha-release-4de9263c3.0",
|
|
30
|
+
"@toptal/picasso-tailwind-merge": "^2.0.6-alpha-pf-fix-alpha-release-4de9263c3.0",
|
|
31
|
+
"react": ">=16.12.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@toptal/picasso-provider": "6.0.0",
|
|
35
|
-
"@toptal/picasso-test-utils": "2.0.
|
|
34
|
+
"@toptal/picasso-provider": "6.0.1-alpha-pf-fix-alpha-release-4de9263c3.0",
|
|
35
|
+
"@toptal/picasso-test-utils": "2.0.2-alpha-pf-fix-alpha-release-4de9263c3.0"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable complexity */
|
|
2
|
-
import type { PropTypes } from '@material-ui/core'
|
|
3
2
|
import type { SpacingType } from '@toptal/picasso-provider'
|
|
4
|
-
import type {
|
|
3
|
+
import type { BaseProps } from '@toptal/picasso-shared'
|
|
5
4
|
import type { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react'
|
|
6
5
|
import React from 'react'
|
|
7
6
|
import { documentable, forwardRef } from '@toptal/picasso-utils'
|
|
@@ -19,8 +18,10 @@ type WrapType = 'wrap' | 'nowrap' | 'wrap-reverse'
|
|
|
19
18
|
|
|
20
19
|
type BorderableType = 'transparent' | 'white'
|
|
21
20
|
|
|
21
|
+
type AlignType = 'inherit' | 'left' | 'center' | 'right' | 'justify'
|
|
22
|
+
|
|
22
23
|
export interface Props<V extends VariantType = VariantType>
|
|
23
|
-
extends
|
|
24
|
+
extends BaseProps,
|
|
24
25
|
HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
|
|
25
26
|
/** Content of Container */
|
|
26
27
|
children?: ReactNode
|
|
@@ -46,7 +47,7 @@ export interface Props<V extends VariantType = VariantType>
|
|
|
46
47
|
/** Component used for the root node */
|
|
47
48
|
as?: ContainerType
|
|
48
49
|
/** Text align of the inner text */
|
|
49
|
-
align?:
|
|
50
|
+
align?: AlignType
|
|
50
51
|
/** margin-top for the container transformed to `rem` */
|
|
51
52
|
top?: SpacingType
|
|
52
53
|
/** margin-bottom for the container transformed to `rem` */
|
|
@@ -98,9 +99,6 @@ export const Container: ContainerProps = documentable(
|
|
|
98
99
|
right,
|
|
99
100
|
padded,
|
|
100
101
|
gap,
|
|
101
|
-
// Avoid passing external classes inside the rest props
|
|
102
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
103
|
-
classes: externalClasses,
|
|
104
102
|
...rest
|
|
105
103
|
} = props
|
|
106
104
|
|