@capillarytech/blaze-ui 0.1.6-alpha.6 → 0.1.6-alpha.61

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.
Files changed (102) hide show
  1. package/.DS_Store +0 -0
  2. package/CapIcon/CapIcon.js +183 -0
  3. package/CapIcon/index.js +3 -0
  4. package/CapIcon/styles.js +76 -0
  5. package/CapInput/CapInput.js +2 -2
  6. package/CapInput/Number.js +1 -1
  7. package/CapInput/Search.js +1 -1
  8. package/CapInput/TextArea.js +1 -1
  9. package/CapLabel/CapLabel.js +101 -81
  10. package/CapLabel/index.js +3 -1
  11. package/CapLabel/styles.js +250 -212
  12. package/CapRow/CapRow.js +111 -10
  13. package/CapRow/index.js +3 -1
  14. package/CapRow/styles.js +47 -6
  15. package/CapSkeleton/CapSkeleton.js +17 -0
  16. package/CapSkeleton/index.js +1 -0
  17. package/CapSpin/CapSpin.js +23 -0
  18. package/CapSpin/index.js +1 -0
  19. package/CapTable/loadable.js +4 -4
  20. package/CapTable/styles.js +1 -1
  21. package/CapTestSelect/CapTestSelect.js +47 -0
  22. package/CapTestSelect/index.js +1 -0
  23. package/CapTooltip/CapTooltip.js +87 -25
  24. package/CapTooltip/index.js +3 -1
  25. package/CapTooltip/styles.js +19 -27
  26. package/CapTooltipWithInfo/CapTooltipWithInfo.js +82 -0
  27. package/CapTooltipWithInfo/index.js +3 -0
  28. package/CapTooltipWithInfo/styles.js +22 -0
  29. package/CapUnifiedSelect/CapUnifiedSelect.js +415 -74
  30. package/CapUnifiedSelect/index.js +1 -4
  31. package/CapUnifiedSelect/styles.js +300 -168
  32. package/assets/upload.svg +3 -0
  33. package/index.js +12 -1
  34. package/package.json +6 -12
  35. package/utils/index.js +1 -0
  36. package/utils/withMemo.js +33 -0
  37. package/utils/withStyles.js +24 -0
  38. package/CapHeading/CapHeading.js +0 -71
  39. package/CapHeading/index.js +0 -1
  40. package/CapHeading/styles.js +0 -125
  41. package/CapInfoNote/CapInfoNote.js +0 -54
  42. package/CapInfoNote/index.js +0 -1
  43. package/CapInfoNote/styles.js +0 -63
  44. package/CapInput/loadable.js +0 -9
  45. package/CapUnifiedSelect/loadable.js +0 -3
  46. package/dist/235.index.js +0 -2
  47. package/dist/235.index.js.LICENSE.txt +0 -29
  48. package/dist/603.index.js +0 -1
  49. package/dist/CapInput/CapInput.js +0 -66
  50. package/dist/CapInput/Number.js +0 -42
  51. package/dist/CapInput/Search.js +0 -35
  52. package/dist/CapInput/TextArea.js +0 -42
  53. package/dist/CapInput/index.js +0 -15
  54. package/dist/CapInput/messages.js +0 -32
  55. package/dist/CapInput/styles.js +0 -11
  56. package/dist/CapTable/CapTable.js +0 -148
  57. package/dist/CapTable/index.js +0 -9
  58. package/dist/CapTable/loadable.js +0 -23
  59. package/dist/CapTable/styles.js +0 -26
  60. package/dist/LocaleHoc/index.js +0 -40
  61. package/dist/esm/CapHeading/CapHeading.js +0 -41
  62. package/dist/esm/CapHeading/index.js +0 -1
  63. package/dist/esm/CapHeading/styles.js +0 -123
  64. package/dist/esm/CapInfoNote/CapInfoNote.js +0 -62
  65. package/dist/esm/CapInfoNote/index.js +0 -1
  66. package/dist/esm/CapInfoNote/styles.js +0 -6
  67. package/dist/esm/CapInput/CapInput.js +0 -57
  68. package/dist/esm/CapInput/Number.js +0 -35
  69. package/dist/esm/CapInput/Search.js +0 -28
  70. package/dist/esm/CapInput/TextArea.js +0 -35
  71. package/dist/esm/CapInput/index.js +0 -8
  72. package/dist/esm/CapInput/loadable.js +0 -9
  73. package/dist/esm/CapInput/messages.js +0 -25
  74. package/dist/esm/CapInput/styles.js +0 -3
  75. package/dist/esm/CapLabel/CapLabel.js +0 -50
  76. package/dist/esm/CapLabel/index.js +0 -1
  77. package/dist/esm/CapLabel/styles.js +0 -219
  78. package/dist/esm/CapRow/CapRow.js +0 -22
  79. package/dist/esm/CapRow/index.js +0 -1
  80. package/dist/esm/CapRow/styles.js +0 -5
  81. package/dist/esm/CapTable/CapTable.js +0 -140
  82. package/dist/esm/CapTable/index.js +0 -2
  83. package/dist/esm/CapTable/loadable.js +0 -12
  84. package/dist/esm/CapTable/styles.js +0 -17
  85. package/dist/esm/CapTooltip/CapTooltip.js +0 -34
  86. package/dist/esm/CapTooltip/index.js +0 -1
  87. package/dist/esm/CapTooltip/styles.js +0 -6
  88. package/dist/esm/CapUnifiedSelect/CapUnifiedSelect.js +0 -101
  89. package/dist/esm/CapUnifiedSelect/index.js +0 -3
  90. package/dist/esm/CapUnifiedSelect/loadable.js +0 -4
  91. package/dist/esm/CapUnifiedSelect/messages.js +0 -23
  92. package/dist/esm/CapUnifiedSelect/styles.js +0 -15
  93. package/dist/esm/LocaleHoc/index.js +0 -31
  94. package/dist/esm/index.js +0 -11
  95. package/dist/esm/styled/index.js +0 -5
  96. package/dist/esm/styled/variables.js +0 -88
  97. package/dist/esm/translations/en.js +0 -329
  98. package/dist/index.js +0 -39
  99. package/dist/index.js.LICENSE.txt +0 -7
  100. package/dist/styled/index.js +0 -22
  101. package/dist/styled/variables.js +0 -94
  102. package/dist/translations/en.js +0 -335
@@ -1,221 +1,259 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import * as styledVars from '../styled/variables';
3
3
 
4
- const labels = {
5
- label1: {
6
- color: styledVars.CAP_G04,
7
- fontSize: '12px',
8
- fontWeight: 'normal',
9
- lineHeight: 'normal',
10
- },
11
- label2: {
12
- color: styledVars.CAP_G01,
13
- fontSize: '12px',
14
- fontWeight: 'normal',
15
- lineHeight: 'normal',
16
- },
17
- label3: {
18
- color: styledVars.CAP_G05,
19
- fontSize: '12px',
20
- fontWeight: 'normal',
21
- lineHeight: 'normal',
22
- },
23
- label4: {
24
- color: styledVars.CAP_G01,
25
- fontSize: '12px',
26
- fontWeight: '500',
27
- lineHeight: 'normal',
28
- },
29
- label5: {
30
- color: styledVars.CAP_G01,
31
- fontSize: '10px',
32
- fontWeight: 'normal',
33
- lineHeight: 'normal',
34
- },
35
- label6: {
36
- color: styledVars.CAP_G06,
37
- fontSize: '12px',
38
- fontWeight: 'normal',
39
- lineHeight: 'normal',
40
- },
41
- label7: {
42
- color: styledVars.CAP_G04,
43
- fontSize: '14px',
44
- fontWeight: '500',
45
- lineHeight: 'normal',
46
- },
47
- label8: {
48
- color: styledVars.CAP_G01,
49
- fontSize: '12px',
50
- fontWeight: '500',
51
- lineHeight: 'normal',
52
- },
53
- label9: {
54
- color: styledVars.CAP_G01,
55
- fontSize: '12px',
56
- fontWeight: 'normal',
57
- lineHeight: '16px',
58
- },
59
- label10: {
60
- color: styledVars.CAP_WHITE,
61
- fontSize: '12px',
62
- fontWeight: 'normal',
63
- lineHeight: '16px',
64
- },
65
- label11: {
66
- color: styledVars.CAP_G04,
67
- fontSize: '10px',
68
- fontWeight: 'normal',
69
- lineHeight: 'normal',
70
- },
71
- label12: {
72
- color: styledVars.CAP_WHITE,
73
- fontSize: '12px',
74
- fontWeight: 'normal',
75
- lineHeight: 'normal',
76
- },
77
- label13: {
78
- color: styledVars.CAP_G05,
79
- fontSize: '10px',
80
- fontWeight: 'normal',
81
- lineHeight: 'normal',
82
- },
83
- label14: {
84
- color: styledVars.CAP_G03,
85
- fontSize: '14px',
86
- fontWeight: 'normal',
87
- lineHeight: 'normal',
88
- },
89
- label15: {
90
- color: styledVars.CAP_G01,
91
- fontSize: '14px',
92
- fontWeight: 'normal',
93
- lineHeight: 'normal',
94
- },
95
- label16: {
96
- color: styledVars.CAP_G01,
97
- fontSize: '14px',
98
- fontWeight: '500',
99
- lineHeight: 'normal',
100
- },
101
- label17: {
102
- color: styledVars.CAP_G01,
103
- fontSize: '16px',
104
- fontWeight: '500',
105
- lineHeight: 'normal',
106
- },
107
- label18: {
108
- color: styledVars.CAP_G04,
109
- fontSize: '14px',
110
- fontWeight: 'normal',
111
- lineHeight: 'normal',
112
- },
113
- label19: {
114
- color: 'rgba(0, 0, 0, 0.87)',
115
- fontSize: '12px',
116
- fontWeight: 'normal',
117
- lineHeight: '16px',
118
- },
119
- label20: {
120
- color: styledVars.CAP_SECONDARY.base,
121
- fontSize: '14px',
122
- fontWeight: '500',
123
- lineHeight: 'normal',
124
- },
125
- label21: {
126
- color: styledVars.CAP_SECONDARY.base,
127
- fontSize: '12px',
128
- fontWeight: 'normal',
129
- lineHeight: 'normal',
130
- },
131
- label22: {
132
- color: styledVars.CAP_G04,
133
- fontSize: '24px',
134
- fontWeight: 'normal',
135
- lineHeight: '28px',
136
- },
137
- label23: {
138
- color: styledVars.CAP_WHITE,
139
- fontSize: '14px',
140
- fontWeight: 'normal',
141
- lineHeight: 'normal',
142
- },
143
- label24: {
144
- fontSize: '14px',
145
- fontWeight: '400',
146
- color: styledVars.CAP_G04,
147
- lineHeight: '20px',
148
- },
149
- label25: {
150
- fontSize: '14px',
151
- fontWeight: '500',
152
- color: styledVars.CAP_G04,
153
- lineHeight: '20px',
154
- },
155
- label26: {
156
- fontSize: '10px',
157
- fontWeight: '400',
158
- color: styledVars.CAP_G01,
159
- lineHeight: '12px',
160
- },
161
- label27: {
162
- fontSize: '12px',
163
- fontWeight: '500',
164
- color: styledVars.CAP_SECONDARY.base,
165
- lineHeight: '16px',
166
- },
167
- label28: {
168
- fontSize: '12px',
169
- fontWeight: '500',
170
- color: styledVars.CAP_WHITE,
171
- lineHeight: '16px',
172
- },
173
- label29: {
174
- fontSize: '10px',
175
- fontWeight: '400',
176
- color: styledVars.CAP_WHITE,
177
- lineHeight: '12px',
178
- },
179
- label30: {
180
- fontSize: '10px',
181
- fontWeight: '400',
182
- color: styledVars.CAP_WHITE,
183
- lineHeight: '12px',
184
- },
185
- label31: {
186
- color: styledVars.CAP_G01,
187
- fontSize: '12px',
188
- fontWeight: '400',
189
- lineHeight: '16px',
190
- },
191
- label32: {
192
- color: styledVars.CAP_WHITE,
193
- fontSize: '14px',
194
- fontWeight: '500',
195
- lineHeight: '20px',
196
- },
197
- label33: {
198
- color: styledVars.CAP_SECONDARY.base,
199
- fontSize: '14px',
200
- fontWeight: '500',
201
- lineHeight: '20px',
202
- },
203
- };
204
-
205
- const labelStyles = css`
206
- font-size: ${props => labels[props.type].fontSize};
207
- font-weight: ${props => props.fontWeight || labels[props.type].fontWeight};
208
- color: ${props => labels[props.type].color};
209
- line-height: ${props => props.lineHeight || labels[props.type].lineHeight || 'initial'};
4
+ export const StyledLabelDiv = styled.div`
5
+ font-family: ${styledVars.FONT_FAMILY};
6
+ font-size: ${({ typeStyles }) => typeStyles?.fontSize || '12px'};
7
+ font-weight: ${({ typeStyles, fontWeight }) => fontWeight || typeStyles?.fontWeight || 'normal'};
8
+ color: ${({ typeStyles }) => typeStyles?.color || styledVars.CAP_G04};
9
+ line-height: ${({ typeStyles, lineHeight }) => lineHeight || typeStyles?.lineHeight || 'normal'};
210
10
  margin: 0;
211
11
  padding: 0;
212
12
  `;
213
13
 
214
- export const LabelWrapper = styled.div`
215
- ${labelStyles}
14
+ export const StyledLabelSpan = styled.span`
15
+ font-family: ${styledVars.FONT_FAMILY};
16
+ font-size: ${({ typeStyles }) => typeStyles?.fontSize || '12px'};
17
+ font-weight: ${({ typeStyles, fontWeight }) => fontWeight || typeStyles?.fontWeight || 'normal'};
18
+ color: ${({ typeStyles }) => typeStyles?.color || styledVars.CAP_G04};
19
+ line-height: ${({ typeStyles, lineHeight }) => lineHeight || typeStyles?.lineHeight || 'normal'};
20
+ margin: 0;
21
+ padding: 0;
216
22
  `;
217
23
 
218
- export const LabelInline = styled.span`
219
- ${labelStyles}
220
- display: inline-block;
221
- `;
24
+ export const labelStyles = css`
25
+ &.cap-label {
26
+ font-family: ${styledVars.FONT_FAMILY};
27
+
28
+ &.label1 {
29
+ font-size: 12px;
30
+ color: ${styledVars.CAP_G04};
31
+ font-weight: normal;
32
+ line-height: normal;
33
+ }
34
+
35
+ &.label2 {
36
+ font-size: 12px;
37
+ color: ${styledVars.CAP_G01};
38
+ font-weight: normal;
39
+ line-height: normal;
40
+ }
41
+
42
+ &.label3 {
43
+ font-size: 12px;
44
+ color: ${styledVars.CAP_G05};
45
+ font-weight: normal;
46
+ line-height: normal;
47
+ }
48
+
49
+ &.label4 {
50
+ font-size: 12px;
51
+ color: ${styledVars.CAP_G01};
52
+ font-weight: 500;
53
+ line-height: normal;
54
+ }
55
+
56
+ &.label5 {
57
+ font-size: 10px;
58
+ color: ${styledVars.CAP_G01};
59
+ font-weight: normal;
60
+ line-height: normal;
61
+ }
62
+
63
+ &.label6 {
64
+ font-size: 12px;
65
+ color: ${styledVars.CAP_G06};
66
+ font-weight: normal;
67
+ line-height: normal;
68
+ }
69
+
70
+ &.label7 {
71
+ font-size: 14px;
72
+ color: ${styledVars.CAP_G04};
73
+ font-weight: 500;
74
+ line-height: normal;
75
+ }
76
+
77
+ &.label8 {
78
+ font-size: 12px;
79
+ color: ${styledVars.CAP_G01};
80
+ font-weight: 500;
81
+ line-height: normal;
82
+ }
83
+
84
+ &.label9 {
85
+ font-size: 12px;
86
+ color: ${styledVars.CAP_G01};
87
+ line-height: 16px;
88
+ font-weight: normal;
89
+ }
90
+
91
+ &.label10 {
92
+ font-size: 12px;
93
+ color: ${styledVars.CAP_WHITE};
94
+ line-height: 16px;
95
+ font-weight: normal;
96
+ }
97
+
98
+ &.label11 {
99
+ font-size: 10px;
100
+ color: ${styledVars.CAP_G04};
101
+ font-weight: normal;
102
+ line-height: normal;
103
+ }
104
+
105
+ &.label12 {
106
+ font-size: 12px;
107
+ color: ${styledVars.CAP_WHITE};
108
+ font-weight: normal;
109
+ line-height: normal;
110
+ }
111
+
112
+ &.label13 {
113
+ font-size: 10px;
114
+ color: ${styledVars.CAP_G05};
115
+ font-weight: normal;
116
+ line-height: normal;
117
+ }
118
+
119
+ &.label14 {
120
+ font-size: 14px;
121
+ color: #676e7c;
122
+ font-weight: normal;
123
+ line-height: normal;
124
+ }
125
+
126
+ &.label15 {
127
+ font-size: 14px;
128
+ color: ${styledVars.CAP_G01};
129
+ font-weight: normal;
130
+ line-height: normal;
131
+ }
132
+
133
+ &.label16 {
134
+ font-size: 14px;
135
+ color: ${styledVars.CAP_G01};
136
+ font-weight: 500;
137
+ line-height: normal;
138
+ }
139
+
140
+ &.label17 {
141
+ font-size: 16px;
142
+ color: ${styledVars.CAP_G01};
143
+ font-weight: 500;
144
+ line-height: normal;
145
+ }
146
+
147
+ &.label18 {
148
+ font-size: 14px;
149
+ color: ${styledVars.CAP_G04};
150
+ font-weight: normal;
151
+ line-height: normal;
152
+ }
153
+
154
+ &.label19 {
155
+ font-size: 12px;
156
+ line-height: 16px;
157
+ font-weight: normal;
158
+ color: rgba(0, 0, 0, 0.87);
159
+ }
160
+
161
+ &.label20 {
162
+ font-size: 14px;
163
+ color: ${styledVars.CAP_BLUE01};
164
+ font-weight: 500;
165
+ line-height: normal;
166
+ }
167
+
168
+ &.label21 {
169
+ font-size: 12px;
170
+ color: ${styledVars.CAP_BLUE01};
171
+ font-weight: normal;
172
+ line-height: normal;
173
+ }
174
+
175
+ &.label22 {
176
+ font-size: 24px;
177
+ color: ${styledVars.CAP_G04};
178
+ line-height: 28px;
179
+ font-weight: normal;
180
+ }
181
+
182
+ &.label23 {
183
+ font-size: 14px;
184
+ color: ${styledVars.CAP_WHITE};
185
+ font-weight: normal;
186
+ line-height: normal;
187
+ }
188
+
189
+ &.label24 {
190
+ font-size: 14px;
191
+ color: ${styledVars.CAP_G04};
192
+ font-weight: 400;
193
+ line-height: 20px;
194
+ }
195
+
196
+ &.label25 {
197
+ font-size: 14px;
198
+ color: ${styledVars.CAP_G04};
199
+ font-weight: 500;
200
+ line-height: 20px;
201
+ }
202
+
203
+ &.label26 {
204
+ font-size: 10px;
205
+ color: ${styledVars.CAP_G01};
206
+ font-weight: 400;
207
+ line-height: 12px;
208
+ }
209
+
210
+ &.label27 {
211
+ font-size: 12px;
212
+ color: ${styledVars.CAP_BLUE01};
213
+ font-weight: 500;
214
+ line-height: 16px;
215
+ }
216
+
217
+ &.label28 {
218
+ color: ${styledVars.CAP_WHITE};
219
+ font-size: 12px;
220
+ font-weight: 500;
221
+ line-height: 16px;
222
+ }
223
+
224
+ &.label29 {
225
+ color: ${styledVars.CAP_WHITE};
226
+ font-size: 10px;
227
+ font-weight: 400;
228
+ line-height: 12px;
229
+ }
230
+
231
+ &.label30 {
232
+ color: ${styledVars.CAP_WHITE};
233
+ font-size: 10px;
234
+ font-weight: 400;
235
+ line-height: 12px;
236
+ }
237
+
238
+ &.label31 {
239
+ font-size: 12px;
240
+ color: ${styledVars.CAP_G01};
241
+ font-weight: 400;
242
+ line-height: 16px;
243
+ }
244
+
245
+ &.label32 {
246
+ line-height: 20px;
247
+ font-size: 14px;
248
+ color: ${styledVars.CAP_WHITE};
249
+ font-weight: 500;
250
+ }
251
+
252
+ &.label33 {
253
+ font-size: 14px;
254
+ color: ${styledVars.CAP_BLUE01};
255
+ font-weight: 500;
256
+ line-height: 20px;
257
+ }
258
+ }
259
+ `;
package/CapRow/CapRow.js CHANGED
@@ -1,22 +1,123 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Row } from 'antd';
4
- import classNames from 'classnames';
5
- import { RowWrapper } from './styles';
3
+ import classnames from 'classnames';
4
+ import styled from 'styled-components';
5
+ import { StyledRow, rowStyles } from './styles';
6
+ import withStyles from '../utils/withStyles';
7
+
8
+ const CapRow = ({
9
+ children,
10
+ className = '',
11
+ style = {},
12
+ justify = 'start',
13
+ align = 'top',
14
+ gutter = 0,
15
+ wrap = true,
16
+ type,
17
+ width,
18
+ height,
19
+ margin,
20
+ padding,
21
+ prefixCls = 'ant-row',
22
+ fullWidth = false,
23
+ fullHeight = false,
24
+ fillSpace = false,
25
+ responsive = true,
26
+ vertical = false,
27
+ noWrap = false,
28
+ gap = null,
29
+ ...rest
30
+ }) => {
31
+ // Use either the gap property or gutter for spacing
32
+ const gutterValue = gap !== null ? null : gutter;
33
+ const wrapValue = noWrap ? false : wrap;
6
34
 
7
- const CapRow = ({ className, children, ...rest }) => {
8
35
  return (
9
- <RowWrapper>
10
- <Row {...rest} className={classNames('cap-row', className)}>
11
- {React.Children.toArray(children)}
12
- </Row>
13
- </RowWrapper>
36
+ <StyledRow
37
+ className={classnames(
38
+ 'cap-row-v2',
39
+ {
40
+ 'with-custom-width': width,
41
+ 'with-custom-height': height,
42
+ 'fill-space': fillSpace,
43
+ 'full-width': fullWidth,
44
+ 'full-height': fullHeight,
45
+ 'ant-row-no-wrap': noWrap,
46
+ 'with-gap': gap !== null,
47
+ },
48
+ className
49
+ )}
50
+ style={{
51
+ ...(gap !== null ? { gap: typeof gap === 'number' ? `${gap}px` : gap } : {}),
52
+ ...style,
53
+ }}
54
+ justify={justify}
55
+ align={align}
56
+ gutter={gutterValue}
57
+ wrap={wrapValue}
58
+ type={type}
59
+ width={width}
60
+ height={height}
61
+ margin={margin}
62
+ padding={padding}
63
+ prefixCls={prefixCls}
64
+ fullWidth={fullWidth}
65
+ fullHeight={fullHeight}
66
+ fillSpace={fillSpace}
67
+ responsive={responsive}
68
+ vertical={vertical}
69
+ {...rest}
70
+ >
71
+ {children}
72
+ </StyledRow>
14
73
  );
15
74
  };
16
75
 
17
76
  CapRow.propTypes = {
18
77
  children: PropTypes.node,
19
78
  className: PropTypes.string,
79
+ style: PropTypes.object,
80
+ justify: PropTypes.oneOf(['start', 'end', 'center', 'space-around', 'space-between', 'space-evenly']),
81
+ align: PropTypes.oneOf(['top', 'middle', 'bottom', 'stretch']),
82
+ gutter: PropTypes.oneOfType([
83
+ PropTypes.number,
84
+ PropTypes.object,
85
+ PropTypes.arrayOf(PropTypes.number),
86
+ ]),
87
+ wrap: PropTypes.bool,
88
+ type: PropTypes.string,
89
+ width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
90
+ height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
91
+ margin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
92
+ padding: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
93
+ prefixCls: PropTypes.string,
94
+ fullWidth: PropTypes.bool,
95
+ fullHeight: PropTypes.bool,
96
+ fillSpace: PropTypes.bool,
97
+ responsive: PropTypes.bool,
98
+ vertical: PropTypes.bool,
99
+ noWrap: PropTypes.bool,
100
+ gap: PropTypes.oneOfType([
101
+ PropTypes.number,
102
+ PropTypes.arrayOf(PropTypes.number),
103
+ PropTypes.string,
104
+ ]),
105
+ };
106
+
107
+ CapRow.defaultProps = {
108
+ className: '',
109
+ style: {},
110
+ justify: 'start',
111
+ align: 'top',
112
+ gutter: 0,
113
+ wrap: true,
114
+ prefixCls: 'ant-row',
115
+ fullWidth: false,
116
+ fullHeight: false,
117
+ fillSpace: false,
118
+ responsive: true,
119
+ vertical: false,
120
+ noWrap: false,
20
121
  };
21
122
 
22
- export default CapRow;
123
+ export default withStyles(CapRow, rowStyles);
package/CapRow/index.js CHANGED
@@ -1 +1,3 @@
1
- export { default } from './CapRow';
1
+ import CapRow from './CapRow';
2
+
3
+ export default CapRow;
package/CapRow/styles.js CHANGED
@@ -1,9 +1,50 @@
1
- import styled from 'styled-components';
1
+ import styled, { css } from 'styled-components';
2
+ import { Row } from 'antd-v5';
3
+ import * as styledVars from '../styled/variables';
2
4
 
3
- export const RowWrapper = styled.div`
4
- .cap-row {
5
+ export const StyledRow = styled(Row)`
6
+ width: ${({ width, fullWidth }) => (fullWidth ? '100%' : width || 'auto')};
7
+ height: ${({ height, fullHeight }) => (fullHeight ? '100%' : height || 'auto')};
8
+ margin: ${({ margin }) => margin || 'inherit'};
9
+ padding: ${({ padding }) => padding || 'inherit'};
10
+ ${({ responsive }) => !responsive && css`
5
11
  display: flex;
6
- flex-flow: row wrap;
7
- min-width: 0;
12
+ flex-wrap: wrap;
13
+ `};
14
+ ${({ fillSpace }) => fillSpace && css`
15
+ flex: 1;
16
+ `};
17
+ `;
18
+
19
+ export const rowStyles = css`
20
+ &.cap-row-v2 {
21
+ &.with-custom-width {
22
+ width: auto;
23
+ }
24
+
25
+ &.with-custom-height {
26
+ height: auto;
27
+ }
28
+
29
+ &.fill-space {
30
+ flex: 1;
31
+ }
32
+
33
+ &.full-width {
34
+ width: 100%;
35
+ }
36
+
37
+ &.full-height {
38
+ height: 100%;
39
+ }
40
+
41
+ &.ant-row-no-wrap {
42
+ flex-wrap: nowrap;
43
+ }
44
+
45
+ &.with-gap {
46
+ display: grid;
47
+ grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
48
+ }
8
49
  }
9
- `;
50
+ `;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * CapSkeleton - Migrated to Ant Design v5
3
+ */
4
+ import React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { Skeleton } from 'antd-v5';
7
+
8
+ const CapSkeleton = ({ className, ...rest }) => {
9
+ const combinedClassName = `cap-skeleton-v2 ${className || ''}`.trim();
10
+ return <Skeleton className={combinedClassName} {...rest} />;
11
+ };
12
+
13
+ CapSkeleton.propTypes = {
14
+ className: PropTypes.string
15
+ };
16
+
17
+ export default CapSkeleton;
@@ -0,0 +1 @@
1
+ export { default } from './CapSkeleton';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * CapSpin - Migrated to Ant Design v5
3
+ */
4
+ import React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { Spin } from 'antd-v5';
7
+
8
+ const CapSpin = ({ className, ...rest }) => (
9
+ <Spin className={className} {...rest} />
10
+ );
11
+
12
+ CapSpin.propTypes = {
13
+ className: PropTypes.string,
14
+ size: PropTypes.oneOf(['small', 'default', 'large']),
15
+ spinning: PropTypes.bool,
16
+ tip: PropTypes.string,
17
+ delay: PropTypes.number,
18
+ indicator: PropTypes.node,
19
+ fullscreen: PropTypes.bool,
20
+ wrapperClassName: PropTypes.string
21
+ };
22
+
23
+ export default CapSpin;
@@ -0,0 +1 @@
1
+ export { default } from './CapSpin';