@teamturing/react-kit 1.2.1 → 1.2.2
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 +1294 -88
- package/esm/_virtual/jsx-runtime.js +3 -0
- package/esm/_virtual/react-jsx-runtime.development.js +3 -0
- package/esm/_virtual/react-jsx-runtime.production.min.js +3 -0
- package/esm/core/Button/index.js +31 -27
- package/esm/core/Chip/index.js +5 -3
- package/esm/core/Grid/index.js +19 -14
- package/esm/core/IconButton/index.js +8 -6
- package/esm/core/IconToggleButton/index.js +6 -4
- package/esm/core/ItemList/index.js +5 -1
- package/esm/core/Stack/index.js +10 -5
- package/esm/core/StyledIcon/index.js +6 -4
- package/esm/node_modules/react/cjs/react-jsx-runtime.development.js +1140 -0
- package/esm/node_modules/react/cjs/react-jsx-runtime.production.min.js +53 -0
- package/esm/node_modules/react/jsx-runtime.js +12 -0
- package/package.json +2 -2
- package/esm/_virtual/_rollupPluginBabelHelpers.js +0 -16
package/esm/core/Button/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
3
2
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
4
3
|
import typography from '../../packages/token-studio/esm/token/typography/index.js';
|
|
@@ -8,6 +7,7 @@ import '../../node_modules/styled-system/dist/index.esm.js';
|
|
|
8
7
|
import Spinner from '../Spinner/index.js';
|
|
9
8
|
import View from '../View/index.js';
|
|
10
9
|
import UnstyledButton from '../_UnstyledButton.js';
|
|
10
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
11
11
|
import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
|
|
12
12
|
|
|
13
13
|
const Button = /*#__PURE__*/forwardRef(({
|
|
@@ -21,7 +21,7 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
21
21
|
children,
|
|
22
22
|
...props
|
|
23
23
|
}, ref) => {
|
|
24
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseButton, {
|
|
25
25
|
ref: ref,
|
|
26
26
|
size: size,
|
|
27
27
|
disabled: disabled || loading,
|
|
@@ -30,31 +30,35 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
30
30
|
variant: variant,
|
|
31
31
|
leadingIcon: LeadingIcon,
|
|
32
32
|
trailingIcon: TrailingIcon,
|
|
33
|
-
fillWidth: fillWidth
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
fillWidth: fillWidth,
|
|
34
|
+
...props,
|
|
35
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
36
|
+
sx: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
justifyContent: 'center',
|
|
41
|
+
columnGap: 1,
|
|
42
|
+
visibility: !loading ? 'initial' : 'hidden'
|
|
43
|
+
},
|
|
44
|
+
children: [LeadingIcon ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingIcon, {}) : null, children, TrailingIcon ? /*#__PURE__*/jsxRuntimeExports.jsx(TrailingIcon, {}) : null]
|
|
45
|
+
}), loading ? /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
46
|
+
sx: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
top: 0,
|
|
49
|
+
right: 0,
|
|
50
|
+
bottom: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
justifyContent: 'center'
|
|
55
|
+
},
|
|
56
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(BaseSpinner, {
|
|
57
|
+
size: size,
|
|
58
|
+
variant: variant
|
|
59
|
+
})
|
|
60
|
+
}) : null]
|
|
61
|
+
});
|
|
58
62
|
});
|
|
59
63
|
const BaseButton = Qe(UnstyledButton)(({
|
|
60
64
|
$loading,
|
package/esm/core/Chip/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import typography from '../../packages/token-studio/esm/token/typography/index.j
|
|
|
4
4
|
import Qe from '../../node_modules/styled-components/dist/styled-components.esm.js';
|
|
5
5
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
6
6
|
import { sx } from '../../utils/styled-system/index.js';
|
|
7
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
7
8
|
import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
|
|
8
9
|
|
|
9
10
|
const Chip = ({
|
|
@@ -13,13 +14,14 @@ const Chip = ({
|
|
|
13
14
|
leadingIcon: LeadingIcon,
|
|
14
15
|
trailingIcon: TrailingIcon,
|
|
15
16
|
sx
|
|
16
|
-
}) => /*#__PURE__*/
|
|
17
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsxs(BaseChip, {
|
|
17
18
|
sx: sx,
|
|
18
19
|
size: size,
|
|
19
20
|
variant: variant,
|
|
20
21
|
leadingIcon: LeadingIcon,
|
|
21
|
-
trailingIcon: TrailingIcon
|
|
22
|
-
|
|
22
|
+
trailingIcon: TrailingIcon,
|
|
23
|
+
children: [LeadingIcon ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingIcon, {}) : null, children, TrailingIcon ? /*#__PURE__*/jsxRuntimeExports.jsx(TrailingIcon, {}) : null]
|
|
24
|
+
});
|
|
23
25
|
const BaseChip = Qe.span({
|
|
24
26
|
position: 'relative',
|
|
25
27
|
width: 'fit-content',
|
package/esm/core/Grid/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
3
2
|
import { forwardRef } from 'react';
|
|
4
3
|
import Qe from '../../node_modules/styled-components/dist/styled-components.esm.js';
|
|
@@ -7,6 +6,7 @@ import { forcePixelValue } from '../../utils/forcePixelValue.js';
|
|
|
7
6
|
import { isArray } from '../../utils/isArray.js';
|
|
8
7
|
import { isNullable } from '../../utils/isNullable.js';
|
|
9
8
|
import View from '../View/index.js';
|
|
9
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
10
10
|
import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
|
|
11
11
|
|
|
12
12
|
const Grid = /*#__PURE__*/forwardRef(({
|
|
@@ -18,13 +18,15 @@ const Grid = /*#__PURE__*/forwardRef(({
|
|
|
18
18
|
...props
|
|
19
19
|
}, ref) => {
|
|
20
20
|
const wrap = Array.isArray(propWrap) ? propWrap.map(value => value === true ? 'true' : 'false') : propWrap === true ? 'true' : 'false';
|
|
21
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(BaseGrid, {
|
|
22
22
|
ref: ref,
|
|
23
23
|
gapX: gapX,
|
|
24
24
|
gapY: gapY,
|
|
25
25
|
wrap: wrap,
|
|
26
|
-
as: as
|
|
27
|
-
|
|
26
|
+
as: as,
|
|
27
|
+
...props,
|
|
28
|
+
children: children
|
|
29
|
+
});
|
|
28
30
|
});
|
|
29
31
|
const BaseGrid = Qe(View)({
|
|
30
32
|
display: 'flex',
|
|
@@ -88,16 +90,19 @@ const Unit = ({
|
|
|
88
90
|
const percentage = Math.round(size * 100 * 10000) / 10000;
|
|
89
91
|
return size === 'max' ? '100%' : size === 'min' ? 'none' : `${percentage}%`;
|
|
90
92
|
};
|
|
91
|
-
return /*#__PURE__*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
94
|
+
...mapValueToResponsiveValueProps(size, value => ({
|
|
95
|
+
display: value === 0 ? 'none' : 'initial',
|
|
96
|
+
flowGrow: getFlexGrowBySize(value),
|
|
97
|
+
flex: getFlexBySize(value),
|
|
98
|
+
flexBasis: getFlexBasisBySize(value),
|
|
99
|
+
width: getWidthBySize(value),
|
|
100
|
+
maxWidth: getMaxWidthBySize(value)
|
|
101
|
+
})),
|
|
102
|
+
as: as,
|
|
103
|
+
...props,
|
|
104
|
+
children: children
|
|
105
|
+
});
|
|
101
106
|
};
|
|
102
107
|
var index = Object.assign(Grid, {
|
|
103
108
|
Unit
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
3
2
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
@@ -6,6 +5,7 @@ import Qe from '../../node_modules/styled-components/dist/styled-components.esm.
|
|
|
6
5
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
7
6
|
import Spinner from '../Spinner/index.js';
|
|
8
7
|
import UnstyledButton from '../_UnstyledButton.js';
|
|
8
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
9
9
|
import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
|
|
10
10
|
|
|
11
11
|
const IconButton = /*#__PURE__*/forwardRef(({
|
|
@@ -17,7 +17,7 @@ const IconButton = /*#__PURE__*/forwardRef(({
|
|
|
17
17
|
type = 'button',
|
|
18
18
|
...props
|
|
19
19
|
}, ref) => {
|
|
20
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(BaseIconButton, {
|
|
21
21
|
ref: ref,
|
|
22
22
|
type: type,
|
|
23
23
|
icon: Icon,
|
|
@@ -25,10 +25,12 @@ const IconButton = /*#__PURE__*/forwardRef(({
|
|
|
25
25
|
variant: variant,
|
|
26
26
|
disabled: disabled || loading,
|
|
27
27
|
$disabled: disabled,
|
|
28
|
-
$loading: loading
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
$loading: loading,
|
|
29
|
+
...props,
|
|
30
|
+
children: !loading ? /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {}) : /*#__PURE__*/jsxRuntimeExports.jsx(Spinner, {
|
|
31
|
+
color: 'currentColor'
|
|
32
|
+
})
|
|
33
|
+
});
|
|
32
34
|
});
|
|
33
35
|
const BaseIconButton = Qe(UnstyledButton)(({
|
|
34
36
|
$loading,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
3
2
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
4
3
|
import Qe from '../../node_modules/styled-components/dist/styled-components.esm.js';
|
|
5
4
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
6
5
|
import { sx } from '../../utils/styled-system/index.js';
|
|
7
6
|
import UnstyledButton from '../_UnstyledButton.js';
|
|
7
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
8
8
|
import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
|
|
9
9
|
|
|
10
10
|
const IconToggleButton = ({
|
|
@@ -16,7 +16,7 @@ const IconToggleButton = ({
|
|
|
16
16
|
sx,
|
|
17
17
|
...props
|
|
18
18
|
}) => {
|
|
19
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(BaseIconToggleButton, {
|
|
20
20
|
icon: Icon,
|
|
21
21
|
size: size,
|
|
22
22
|
variant: variant,
|
|
@@ -24,8 +24,10 @@ const IconToggleButton = ({
|
|
|
24
24
|
type: 'button',
|
|
25
25
|
disabled: disabled,
|
|
26
26
|
$disabled: disabled,
|
|
27
|
-
sx: sx
|
|
28
|
-
|
|
27
|
+
sx: sx,
|
|
28
|
+
...props,
|
|
29
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {})
|
|
30
|
+
});
|
|
29
31
|
};
|
|
30
32
|
const BaseIconToggleButton = Qe(UnstyledButton)(({
|
|
31
33
|
$disabled
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
2
|
+
|
|
1
3
|
const ItemList = ({
|
|
2
4
|
items,
|
|
3
5
|
renderItem,
|
|
@@ -5,7 +7,9 @@ const ItemList = ({
|
|
|
5
7
|
emptyState = null
|
|
6
8
|
}) => {
|
|
7
9
|
if (items.length === 0) return emptyState;
|
|
8
|
-
return /*#__PURE__*/
|
|
10
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
11
|
+
children: items.map((item, i) => renderItemWrapper(renderItem(item, i), item, i))
|
|
12
|
+
});
|
|
9
13
|
};
|
|
10
14
|
|
|
11
15
|
export { ItemList as default };
|
package/esm/core/Stack/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
3
2
|
import { forwardRef } from 'react';
|
|
4
3
|
import Qe from '../../node_modules/styled-components/dist/styled-components.esm.js';
|
|
5
4
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
6
5
|
import { forcePixelValue } from '../../utils/forcePixelValue.js';
|
|
7
6
|
import View from '../View/index.js';
|
|
7
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
8
8
|
import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
|
|
9
9
|
|
|
10
10
|
const Stack = /*#__PURE__*/forwardRef(({
|
|
@@ -13,12 +13,14 @@ const Stack = /*#__PURE__*/forwardRef(({
|
|
|
13
13
|
children,
|
|
14
14
|
alignItems = 'center',
|
|
15
15
|
...props
|
|
16
|
-
}, ref) => /*#__PURE__*/
|
|
16
|
+
}, ref) => /*#__PURE__*/jsxRuntimeExports.jsx(BaseStack, {
|
|
17
17
|
ref: ref,
|
|
18
18
|
alignItems: alignItems,
|
|
19
19
|
gapX: gapX,
|
|
20
|
-
gapY: gapY
|
|
21
|
-
|
|
20
|
+
gapY: gapY,
|
|
21
|
+
...props,
|
|
22
|
+
children: children
|
|
23
|
+
}));
|
|
22
24
|
const BaseStack = Qe(View)({
|
|
23
25
|
display: 'flex',
|
|
24
26
|
flexDirection: 'row',
|
|
@@ -49,7 +51,10 @@ const BaseStack = Qe(View)({
|
|
|
49
51
|
const Item = ({
|
|
50
52
|
children,
|
|
51
53
|
...props
|
|
52
|
-
}) => /*#__PURE__*/
|
|
54
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
55
|
+
...props,
|
|
56
|
+
children: children
|
|
57
|
+
});
|
|
53
58
|
var index = Object.assign(Stack, {
|
|
54
59
|
Item
|
|
55
60
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import View from '../View/index.js';
|
|
2
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
3
3
|
|
|
4
4
|
const StyledIcon = ({
|
|
5
5
|
icon: Icon,
|
|
6
6
|
sx,
|
|
7
7
|
...props
|
|
8
|
-
}) => /*#__PURE__*/
|
|
8
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
9
|
+
...props,
|
|
9
10
|
color: props.color,
|
|
10
11
|
sx: {
|
|
11
12
|
'& svg': {
|
|
@@ -14,7 +15,8 @@ const StyledIcon = ({
|
|
|
14
15
|
height: '100%'
|
|
15
16
|
},
|
|
16
17
|
...sx
|
|
17
|
-
}
|
|
18
|
-
|
|
18
|
+
},
|
|
19
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {})
|
|
20
|
+
});
|
|
19
21
|
|
|
20
22
|
export { StyledIcon as default };
|