@teamturing/react-kit 2.9.0 → 2.10.1
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/enigma/EnigmaUI/index.d.ts +16 -16
- package/dist/enigma/Layout/SingleColumnLayout/index.d.ts +1 -1
- package/dist/enigma/View/ChipGroupView/index.d.ts +2 -2
- package/dist/enigma/View/GridView/index.d.ts +2 -2
- package/dist/enigma/View/IconView/index.d.ts +2 -2
- package/dist/enigma/View/ImageView/index.d.ts +2 -2
- package/dist/enigma/View/TextView/index.d.ts +2 -2
- package/dist/enigma/types/index.d.ts +34 -34
- package/dist/index.js +67 -49
- package/esm/enigma/View/ChipGroupView/index.js +29 -24
- package/esm/enigma/View/GridView/index.js +25 -20
- package/esm/enigma/View/IconView/index.js +6 -2
- package/esm/enigma/View/ImageView/index.js +4 -2
- package/esm/enigma/View/TextView/index.js +5 -1
- package/package.json +6 -4
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { LayoutContainerType, EnigmaSectionType, ViewContainerType, LayoutType, ViewType } from '../types';
|
|
3
3
|
type Props = {
|
|
4
|
-
section:
|
|
4
|
+
section: EnigmaSectionType;
|
|
5
5
|
};
|
|
6
|
-
export declare const getLayoutComponent: (layoutContainer:
|
|
7
|
-
layout:
|
|
6
|
+
export declare const getLayoutComponent: (layoutContainer: LayoutContainerType) => ComponentType<{
|
|
7
|
+
layout: LayoutType;
|
|
8
8
|
viewsObject: {
|
|
9
|
-
[k: string]:
|
|
9
|
+
[k: string]: ViewType;
|
|
10
10
|
};
|
|
11
11
|
viewComponentsObject: {
|
|
12
12
|
[k: string]: ComponentType<any>;
|
|
13
13
|
};
|
|
14
14
|
}>;
|
|
15
|
-
export declare const getViewComponent: (viewContainer:
|
|
15
|
+
export declare const getViewComponent: (viewContainer: ViewContainerType) => ComponentType<any>;
|
|
16
16
|
declare const _default: (({ section: { views, responsiveLayout } }: Props) => import("react/jsx-runtime").JSX.Element) & {
|
|
17
|
-
TextView: ({ view: { text, textProps } }: {
|
|
18
|
-
view: import("../types").
|
|
17
|
+
TextView: ({ view: { text, textProps, spaceProps } }: {
|
|
18
|
+
view: import("../types").TextViewType;
|
|
19
19
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
ImageView: ({ view: {
|
|
21
|
-
view: import("../types").
|
|
20
|
+
ImageView: ({ view: { spaceProps, ...props } }: {
|
|
21
|
+
view: import("../types").ImageViewType;
|
|
22
22
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
IconView: ({ view: { icon, iconProps } }: {
|
|
24
|
-
view: import("../types").
|
|
23
|
+
IconView: ({ view: { icon, iconProps, spaceProps } }: {
|
|
24
|
+
view: import("../types").IconViewType;
|
|
25
25
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
ChipGroupView: ({ view: { chips, chipGroupProps
|
|
27
|
-
view: import("../types").
|
|
26
|
+
ChipGroupView: ({ view: { chips, chipGroupProps, spaceProps }, }: {
|
|
27
|
+
view: import("../types").ChipGroupViewType;
|
|
28
28
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
GridView: ({ view: { units, gridProps } }: {
|
|
30
|
-
view: import("../types").
|
|
29
|
+
GridView: ({ view: { units, gridProps, spaceProps } }: {
|
|
30
|
+
view: import("../types").GridViewType;
|
|
31
31
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
};
|
|
33
33
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChipGroupViewType } from '../../types';
|
|
2
2
|
type Props = {
|
|
3
3
|
view: ChipGroupViewType;
|
|
4
4
|
};
|
|
5
|
-
declare const ChipGroupView: ({ view: { chips, chipGroupProps
|
|
5
|
+
declare const ChipGroupView: ({ view: { chips, chipGroupProps, spaceProps }, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default ChipGroupView;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GridViewType } from '../../types';
|
|
2
2
|
type Props = {
|
|
3
3
|
view: GridViewType;
|
|
4
4
|
};
|
|
5
|
-
declare const GridView: ({ view: { units, gridProps } }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const GridView: ({ view: { units, gridProps, spaceProps } }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default GridView;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconViewType } from '../../types';
|
|
2
2
|
type Props = {
|
|
3
3
|
view: IconViewType;
|
|
4
4
|
};
|
|
5
|
-
declare const IconView: ({ view: { icon, iconProps } }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const IconView: ({ view: { icon, iconProps, spaceProps } }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default IconView;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImageViewType } from '../../types';
|
|
2
2
|
type Props = {
|
|
3
3
|
view: ImageViewType;
|
|
4
4
|
};
|
|
5
|
-
declare const ImageView: ({ view: {
|
|
5
|
+
declare const ImageView: ({ view: { spaceProps, ...props } }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default ImageView;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextViewType } from '../../types';
|
|
2
2
|
type Props = {
|
|
3
3
|
view: TextViewType;
|
|
4
4
|
};
|
|
5
|
-
declare const TextView: ({ view: { text, textProps } }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const TextView: ({ view: { text, textProps, spaceProps } }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default TextView;
|
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import icons from '@teamturing/icons';
|
|
2
|
-
import { ChipProps, StackProps, TextProps, SpaceProps, GridProps, GridUnitProps, StyledIconProps, ImageProps } from '../..';
|
|
2
|
+
import { ChipProps, StackProps, TextProps, SpaceProps, GridProps, GridUnitProps, StyledIconProps, ImageProps, AsProp } from '../..';
|
|
3
3
|
/**
|
|
4
4
|
* View Related Model
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type TextViewType = {
|
|
7
7
|
text: string;
|
|
8
|
-
textProps?: TextProps;
|
|
8
|
+
textProps?: {} & Pick<TextProps, 'typography' | 'textAlign' | 'color'> & AsProp;
|
|
9
|
+
spaceProps?: Omit<SpaceProps, 'sx'>;
|
|
9
10
|
};
|
|
10
|
-
export type
|
|
11
|
+
export type ImageViewType = {
|
|
11
12
|
src: ImageProps['src'];
|
|
12
13
|
alt: ImageProps['alt'];
|
|
13
14
|
width: ImageProps['width'];
|
|
14
15
|
height: ImageProps['height'];
|
|
15
|
-
|
|
16
|
+
spaceProps?: Omit<SpaceProps, 'sx'>;
|
|
16
17
|
};
|
|
17
|
-
export type
|
|
18
|
+
export type IconViewType = {
|
|
18
19
|
icon: keyof typeof icons;
|
|
19
|
-
iconProps
|
|
20
|
+
iconProps?: {} & Pick<StyledIconProps, 'size' | 'color'>;
|
|
21
|
+
spaceProps?: Omit<SpaceProps, 'sx'>;
|
|
20
22
|
};
|
|
21
|
-
export type
|
|
23
|
+
export type ChipGroupViewType = {
|
|
22
24
|
chips: Array<{
|
|
23
25
|
text: string;
|
|
24
26
|
variant: ChipProps['variant'];
|
|
25
27
|
}>;
|
|
26
|
-
chipGroupProps
|
|
27
|
-
|
|
28
|
-
gapX: StackProps['gapX'];
|
|
29
|
-
gapY: StackProps['gapY'];
|
|
30
|
-
};
|
|
28
|
+
chipGroupProps?: {} & Pick<ChipProps, 'size'> & Pick<StackProps, 'gapX' | 'gapY'>;
|
|
29
|
+
spaceProps?: Omit<SpaceProps, 'sx'>;
|
|
31
30
|
};
|
|
32
|
-
export type
|
|
31
|
+
export type GridViewType = {
|
|
33
32
|
units: Array<{
|
|
34
|
-
views:
|
|
35
|
-
unitProps:
|
|
33
|
+
views: ViewContainerType[];
|
|
34
|
+
unitProps: Pick<GridUnitProps, 'size' | 'order'>;
|
|
36
35
|
}>;
|
|
37
|
-
gridProps
|
|
36
|
+
gridProps?: Pick<GridProps, 'gapX' | 'gapY' | 'alignItems' | 'justifyContent' | 'wrap'>;
|
|
37
|
+
spaceProps?: Omit<SpaceProps, 'sx'>;
|
|
38
38
|
};
|
|
39
|
-
export type
|
|
39
|
+
export type ViewType = TextViewType | ImageViewType | IconViewType | ChipGroupViewType | GridViewType;
|
|
40
40
|
export type ViewComponentType = 'TextView' | 'ImageView' | 'IconView' | 'ChipGroupView' | 'GridView';
|
|
41
|
-
export interface
|
|
41
|
+
export interface ViewContainerType {
|
|
42
42
|
id: string;
|
|
43
43
|
viewComponentType: ViewComponentType;
|
|
44
|
-
view:
|
|
44
|
+
view: ViewType;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Layout Related Model
|
|
48
48
|
*/
|
|
49
|
-
export interface
|
|
49
|
+
export interface ViewContainerDetailType {
|
|
50
50
|
viewContainerId: string;
|
|
51
|
-
spaceProps
|
|
51
|
+
spaceProps?: Omit<SpaceProps, 'sx'>;
|
|
52
52
|
}
|
|
53
|
-
export type
|
|
54
|
-
main:
|
|
53
|
+
export type SingleColumnLayoutType = {
|
|
54
|
+
main: ViewContainerDetailType[];
|
|
55
55
|
};
|
|
56
|
-
export type
|
|
56
|
+
export type LayoutType = SingleColumnLayoutType;
|
|
57
57
|
export type LayoutComponentType = 'SingleColumnLayout';
|
|
58
|
-
export interface
|
|
58
|
+
export interface LayoutContainerType {
|
|
59
59
|
layoutComponentType: LayoutComponentType;
|
|
60
|
-
layout:
|
|
60
|
+
layout: LayoutType;
|
|
61
61
|
}
|
|
62
|
-
export interface
|
|
63
|
-
mobile:
|
|
64
|
-
tablet?:
|
|
65
|
-
desktop?:
|
|
62
|
+
export interface ResponsiveLayoutContainerType {
|
|
63
|
+
mobile: LayoutContainerType;
|
|
64
|
+
tablet?: LayoutContainerType;
|
|
65
|
+
desktop?: LayoutContainerType;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Section Related Model
|
|
69
69
|
*/
|
|
70
|
-
export interface
|
|
70
|
+
export interface EnigmaSectionType {
|
|
71
71
|
id: string;
|
|
72
|
-
views:
|
|
73
|
-
responsiveLayout:
|
|
72
|
+
views: ViewContainerType[];
|
|
73
|
+
responsiveLayout: ResponsiveLayoutContainerType;
|
|
74
74
|
}
|
package/dist/index.js
CHANGED
|
@@ -19133,23 +19133,29 @@ const SingleColumnLayout = ({
|
|
|
19133
19133
|
|
|
19134
19134
|
const ImageView = ({
|
|
19135
19135
|
view: {
|
|
19136
|
-
|
|
19136
|
+
spaceProps,
|
|
19137
19137
|
...props
|
|
19138
19138
|
}
|
|
19139
19139
|
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Image, {
|
|
19140
19140
|
loading: 'lazy',
|
|
19141
19141
|
display: 'block',
|
|
19142
19142
|
...props,
|
|
19143
|
-
|
|
19143
|
+
sx: {
|
|
19144
|
+
...spaceProps
|
|
19145
|
+
}
|
|
19144
19146
|
});
|
|
19145
19147
|
|
|
19146
19148
|
const TextView = ({
|
|
19147
19149
|
view: {
|
|
19148
19150
|
text,
|
|
19149
|
-
textProps
|
|
19151
|
+
textProps,
|
|
19152
|
+
spaceProps
|
|
19150
19153
|
}
|
|
19151
19154
|
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
|
|
19152
19155
|
...textProps,
|
|
19156
|
+
sx: {
|
|
19157
|
+
...spaceProps
|
|
19158
|
+
},
|
|
19153
19159
|
children: text
|
|
19154
19160
|
});
|
|
19155
19161
|
|
|
@@ -19159,68 +19165,80 @@ const IconView = ({
|
|
|
19159
19165
|
iconProps = {
|
|
19160
19166
|
color: 'icon/neutral',
|
|
19161
19167
|
size: 24
|
|
19162
|
-
}
|
|
19168
|
+
},
|
|
19169
|
+
spaceProps
|
|
19163
19170
|
}
|
|
19164
19171
|
}) => /*#__PURE__*/jsxRuntimeExports.jsx(StyledIcon, {
|
|
19165
19172
|
icon: icons[icon],
|
|
19166
|
-
...iconProps
|
|
19173
|
+
...iconProps,
|
|
19174
|
+
sx: {
|
|
19175
|
+
...spaceProps
|
|
19176
|
+
}
|
|
19167
19177
|
});
|
|
19168
19178
|
|
|
19169
19179
|
const ChipGroupView = ({
|
|
19170
19180
|
view: {
|
|
19171
19181
|
chips = [],
|
|
19172
|
-
chipGroupProps
|
|
19173
|
-
size
|
|
19174
|
-
gapX
|
|
19175
|
-
gapY
|
|
19176
|
-
}
|
|
19182
|
+
chipGroupProps = {
|
|
19183
|
+
size: 'm',
|
|
19184
|
+
gapX: 1,
|
|
19185
|
+
gapY: 1
|
|
19186
|
+
},
|
|
19187
|
+
spaceProps
|
|
19177
19188
|
}
|
|
19178
|
-
}) => /*#__PURE__*/jsxRuntimeExports.jsx(
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
|
|
19186
|
-
|
|
19187
|
-
|
|
19188
|
-
|
|
19189
|
-
|
|
19190
|
-
|
|
19191
|
-
|
|
19192
|
-
|
|
19193
|
-
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
|
|
19189
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Space, {
|
|
19190
|
+
...spaceProps,
|
|
19191
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(Stack$1, {
|
|
19192
|
+
gapX: chipGroupProps.gapX,
|
|
19193
|
+
gapY: chipGroupProps.gapY,
|
|
19194
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(ItemList, {
|
|
19195
|
+
items: chips,
|
|
19196
|
+
renderItem: ({
|
|
19197
|
+
text,
|
|
19198
|
+
variant
|
|
19199
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Chip, {
|
|
19200
|
+
size: chipGroupProps.size,
|
|
19201
|
+
variant: variant,
|
|
19202
|
+
children: text
|
|
19203
|
+
}),
|
|
19204
|
+
renderItemWrapper: (children, {
|
|
19205
|
+
text,
|
|
19206
|
+
variant
|
|
19207
|
+
}, i) => /*#__PURE__*/jsxRuntimeExports.jsx(Stack$1.Item, {
|
|
19208
|
+
children: children
|
|
19209
|
+
}, `${text}-${variant}-${i}`)
|
|
19210
|
+
})
|
|
19197
19211
|
})
|
|
19198
19212
|
});
|
|
19199
19213
|
|
|
19200
19214
|
const GridView = ({
|
|
19201
19215
|
view: {
|
|
19202
19216
|
units = [],
|
|
19203
|
-
gridProps
|
|
19217
|
+
gridProps,
|
|
19218
|
+
spaceProps
|
|
19204
19219
|
}
|
|
19205
|
-
}) => /*#__PURE__*/jsxRuntimeExports.jsx(
|
|
19206
|
-
...
|
|
19207
|
-
children:
|
|
19208
|
-
|
|
19209
|
-
|
|
19210
|
-
|
|
19211
|
-
|
|
19212
|
-
|
|
19213
|
-
|
|
19214
|
-
|
|
19215
|
-
|
|
19216
|
-
|
|
19217
|
-
|
|
19218
|
-
|
|
19219
|
-
|
|
19220
|
-
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
19220
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Space, {
|
|
19221
|
+
...spaceProps,
|
|
19222
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(Grid$1, {
|
|
19223
|
+
...gridProps,
|
|
19224
|
+
children: units.map(({
|
|
19225
|
+
views: viewContainers,
|
|
19226
|
+
unitProps
|
|
19227
|
+
}) => {
|
|
19228
|
+
const unitKeySeperator = '_';
|
|
19229
|
+
const unitKey = viewContainers.map(({
|
|
19230
|
+
id
|
|
19231
|
+
}) => id).join(unitKeySeperator);
|
|
19232
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(Grid$1.Unit, {
|
|
19233
|
+
...unitProps,
|
|
19234
|
+
children: viewContainers.map(viewContainer => {
|
|
19235
|
+
const ViewComponent = getViewComponent(viewContainer);
|
|
19236
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ViewComponent, {
|
|
19237
|
+
view: viewContainer.view
|
|
19238
|
+
}, viewContainer.id);
|
|
19239
|
+
})
|
|
19240
|
+
}, unitKey);
|
|
19241
|
+
})
|
|
19224
19242
|
})
|
|
19225
19243
|
});
|
|
19226
19244
|
|
|
@@ -1,36 +1,41 @@
|
|
|
1
1
|
import Chip from '../../../core/Chip/index.js';
|
|
2
2
|
import ItemList from '../../../core/ItemList/index.js';
|
|
3
|
+
import Space from '../../../core/Space/index.js';
|
|
3
4
|
import Stack from '../../../core/Stack/index.js';
|
|
4
5
|
import { j as jsxRuntimeExports } from '../../../node_modules/react/jsx-runtime.js';
|
|
5
6
|
|
|
6
7
|
const ChipGroupView = ({
|
|
7
8
|
view: {
|
|
8
9
|
chips = [],
|
|
9
|
-
chipGroupProps
|
|
10
|
-
size
|
|
11
|
-
gapX
|
|
12
|
-
gapY
|
|
13
|
-
}
|
|
10
|
+
chipGroupProps = {
|
|
11
|
+
size: 'm',
|
|
12
|
+
gapX: 1,
|
|
13
|
+
gapY: 1
|
|
14
|
+
},
|
|
15
|
+
spaceProps
|
|
14
16
|
}
|
|
15
|
-
}) => /*#__PURE__*/jsxRuntimeExports.jsx(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Space, {
|
|
18
|
+
...spaceProps,
|
|
19
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(Stack, {
|
|
20
|
+
gapX: chipGroupProps.gapX,
|
|
21
|
+
gapY: chipGroupProps.gapY,
|
|
22
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(ItemList, {
|
|
23
|
+
items: chips,
|
|
24
|
+
renderItem: ({
|
|
25
|
+
text,
|
|
26
|
+
variant
|
|
27
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Chip, {
|
|
28
|
+
size: chipGroupProps.size,
|
|
29
|
+
variant: variant,
|
|
30
|
+
children: text
|
|
31
|
+
}),
|
|
32
|
+
renderItemWrapper: (children, {
|
|
33
|
+
text,
|
|
34
|
+
variant
|
|
35
|
+
}, i) => /*#__PURE__*/jsxRuntimeExports.jsx(Stack.Item, {
|
|
36
|
+
children: children
|
|
37
|
+
}, `${text}-${variant}-${i}`)
|
|
38
|
+
})
|
|
34
39
|
})
|
|
35
40
|
});
|
|
36
41
|
|
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import Grid from '../../../core/Grid/index.js';
|
|
2
|
+
import Space from '../../../core/Space/index.js';
|
|
2
3
|
import { getViewComponent } from '../../EnigmaUI/index.js';
|
|
3
4
|
import { j as jsxRuntimeExports } from '../../../node_modules/react/jsx-runtime.js';
|
|
4
5
|
|
|
5
6
|
const GridView = ({
|
|
6
7
|
view: {
|
|
7
8
|
units = [],
|
|
8
|
-
gridProps
|
|
9
|
+
gridProps,
|
|
10
|
+
spaceProps
|
|
9
11
|
}
|
|
10
|
-
}) => /*#__PURE__*/jsxRuntimeExports.jsx(
|
|
11
|
-
...
|
|
12
|
-
children:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Space, {
|
|
13
|
+
...spaceProps,
|
|
14
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(Grid, {
|
|
15
|
+
...gridProps,
|
|
16
|
+
children: units.map(({
|
|
17
|
+
views: viewContainers,
|
|
18
|
+
unitProps
|
|
19
|
+
}) => {
|
|
20
|
+
const unitKeySeperator = '_';
|
|
21
|
+
const unitKey = viewContainers.map(({
|
|
22
|
+
id
|
|
23
|
+
}) => id).join(unitKeySeperator);
|
|
24
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(Grid.Unit, {
|
|
25
|
+
...unitProps,
|
|
26
|
+
children: viewContainers.map(viewContainer => {
|
|
27
|
+
const ViewComponent = getViewComponent(viewContainer);
|
|
28
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ViewComponent, {
|
|
29
|
+
view: viewContainer.view
|
|
30
|
+
}, viewContainer.id);
|
|
31
|
+
})
|
|
32
|
+
}, unitKey);
|
|
33
|
+
})
|
|
29
34
|
})
|
|
30
35
|
});
|
|
31
36
|
|
|
@@ -8,11 +8,15 @@ const IconView = ({
|
|
|
8
8
|
iconProps = {
|
|
9
9
|
color: 'icon/neutral',
|
|
10
10
|
size: 24
|
|
11
|
-
}
|
|
11
|
+
},
|
|
12
|
+
spaceProps
|
|
12
13
|
}
|
|
13
14
|
}) => /*#__PURE__*/jsxRuntimeExports.jsx(StyledIcon, {
|
|
14
15
|
icon: index[icon],
|
|
15
|
-
...iconProps
|
|
16
|
+
...iconProps,
|
|
17
|
+
sx: {
|
|
18
|
+
...spaceProps
|
|
19
|
+
}
|
|
16
20
|
});
|
|
17
21
|
|
|
18
22
|
export { IconView as default };
|
|
@@ -3,14 +3,16 @@ import { j as jsxRuntimeExports } from '../../../node_modules/react/jsx-runtime.
|
|
|
3
3
|
|
|
4
4
|
const ImageView = ({
|
|
5
5
|
view: {
|
|
6
|
-
|
|
6
|
+
spaceProps,
|
|
7
7
|
...props
|
|
8
8
|
}
|
|
9
9
|
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Image, {
|
|
10
10
|
loading: 'lazy',
|
|
11
11
|
display: 'block',
|
|
12
12
|
...props,
|
|
13
|
-
|
|
13
|
+
sx: {
|
|
14
|
+
...spaceProps
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
|
|
16
18
|
export { ImageView as default };
|
|
@@ -4,10 +4,14 @@ import { j as jsxRuntimeExports } from '../../../node_modules/react/jsx-runtime.
|
|
|
4
4
|
const TextView = ({
|
|
5
5
|
view: {
|
|
6
6
|
text,
|
|
7
|
-
textProps
|
|
7
|
+
textProps,
|
|
8
|
+
spaceProps
|
|
8
9
|
}
|
|
9
10
|
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
|
|
10
11
|
...textProps,
|
|
12
|
+
sx: {
|
|
13
|
+
...spaceProps
|
|
14
|
+
},
|
|
11
15
|
children: text
|
|
12
16
|
});
|
|
13
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.1",
|
|
4
4
|
"description": "React components, hooks for create teamturing web application",
|
|
5
5
|
"author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
|
|
6
6
|
"homepage": "https://github.com/weareteamturing/bombe#readme",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"check:lint": "eslint ./src --cache",
|
|
26
26
|
"check:type": "tsc --noEmit",
|
|
27
|
-
"build": "rm -rf dist esm && tsc --project tsconfig.cjs.json --declaration --emitDeclarationOnly --declarationDir dist && rollup --config rollup.config.js"
|
|
27
|
+
"build": "rm -rf dist esm && tsc --project tsconfig.cjs.json --declaration --emitDeclarationOnly --declarationDir dist && rollup --config rollup.config.js",
|
|
28
|
+
"generate-enigma-json-schema": "typescript-json-schema ./tsconfig.json EnigmaSectionType --include=./src/enigma/types/index.ts --aliasRefs --topRef --include=EnigmaSectionType --out ./src/enigma/schema/generated.json"
|
|
28
29
|
},
|
|
29
30
|
"bugs": {
|
|
30
31
|
"url": "https://github.com/weareteamturing/bombe/issues"
|
|
@@ -39,7 +40,8 @@
|
|
|
39
40
|
"csstype": "^3.1.2",
|
|
40
41
|
"react": "^18.2.0",
|
|
41
42
|
"rollup-plugin-postcss": "^4.0.2",
|
|
42
|
-
"styled-components": "^6.0.7"
|
|
43
|
+
"styled-components": "^6.0.7",
|
|
44
|
+
"typescript-json-schema": "^0.62.0"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
47
|
"@styled-system/css": "^5.1.5",
|
|
@@ -57,5 +59,5 @@
|
|
|
57
59
|
"react-is": "^18.2.0",
|
|
58
60
|
"styled-system": "^5.1.5"
|
|
59
61
|
},
|
|
60
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "588c13c2b6514cd7f1e9b7ca438ebb63ee0ee1ca"
|
|
61
63
|
}
|