vpt-sebraeds 0.0.86 → 0.0.88
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/components/Input/index.jsx +7 -4
- package/components/SelectableOption/SelectableOption.stories.jsx +139 -0
- package/components/SelectableOption/index.jsx +214 -0
- package/components/StackedBar/StackedBar.stories.jsx +122 -0
- package/components/StackedBar/index.jsx +241 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +4 -4
- package/dist/components/SelectableOption/index.d.ts +90 -0
- package/dist/components/SelectableOption/index.d.ts.map +1 -0
- package/dist/components/SelectableOption/index.js +160 -0
- package/dist/components/StackedBar/index.d.ts +45 -0
- package/dist/components/StackedBar/index.d.ts.map +1 -0
- package/dist/components/StackedBar/index.js +179 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
|
@@ -39,6 +39,9 @@ const Input = React.forwardRef((
|
|
|
39
39
|
labelIconStyle = {},
|
|
40
40
|
onLabelIconPress = null,
|
|
41
41
|
labelStyle,
|
|
42
|
+
inputStyle,
|
|
43
|
+
containerStyle,
|
|
44
|
+
showInfoIcon = true,
|
|
42
45
|
...textInputProps
|
|
43
46
|
} = props;
|
|
44
47
|
|
|
@@ -188,10 +191,10 @@ const Input = React.forwardRef((
|
|
|
188
191
|
return (
|
|
189
192
|
<View style={styles.wrapper}>
|
|
190
193
|
{renderLabel()}
|
|
191
|
-
<View style={getContainerStyle()}>
|
|
194
|
+
<View style={[getContainerStyle(), containerStyle]}>
|
|
192
195
|
<TextInput
|
|
193
196
|
ref={ref}
|
|
194
|
-
style={getInputStyle()}
|
|
197
|
+
style={[getInputStyle(), inputStyle]}
|
|
195
198
|
placeholder={placeholder}
|
|
196
199
|
value={value}
|
|
197
200
|
onChangeText={handleChangeText}
|
|
@@ -203,14 +206,14 @@ const Input = React.forwardRef((
|
|
|
203
206
|
placeholderTextColor="#BFBFBF"
|
|
204
207
|
{...textInputProps}
|
|
205
208
|
/>
|
|
206
|
-
{!disabled && tooltipProps ? (
|
|
209
|
+
{showInfoIcon && !disabled && tooltipProps ? (
|
|
207
210
|
<TooltipCard
|
|
208
211
|
{...tooltipProps}
|
|
209
212
|
trigger={
|
|
210
213
|
<Icon name="information-line" size={20} color="#687499" />
|
|
211
214
|
}
|
|
212
215
|
/>
|
|
213
|
-
) : !disabled && (
|
|
216
|
+
) : showInfoIcon && !disabled && (
|
|
214
217
|
<Icon name="information-line" size={20} color="#687499" />
|
|
215
218
|
)}
|
|
216
219
|
{error && <Icon name="close-line" size={20} color="#FF4D4F" />}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import SelectableOption from './index';
|
|
4
|
+
import SEText from '../SEText';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Molecules/SelectableOption',
|
|
8
|
+
component: SelectableOption,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
export const Default = {
|
|
14
|
+
render: () => {
|
|
15
|
+
const [selected, setSelected] = useState({ '2x': true, '3x': true, '5x': true });
|
|
16
|
+
|
|
17
|
+
const toggle = (key) => setSelected((prev) => ({ ...prev, [key]: !prev[key] }));
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<View style={{ padding: 16, gap: 24 }}>
|
|
21
|
+
<SEText type="ns-heading-5">Todas as opcoes</SEText>
|
|
22
|
+
<SelectableOption gap={8}>
|
|
23
|
+
<SelectableOption.Item
|
|
24
|
+
label="A vista"
|
|
25
|
+
backgroundColor="#FDECD0"
|
|
26
|
+
checked={!!selected['avista']}
|
|
27
|
+
onPress={() => toggle('avista')}
|
|
28
|
+
/>
|
|
29
|
+
<SelectableOption.Item
|
|
30
|
+
label="Em 30 dias"
|
|
31
|
+
backgroundColor="#FFF8E1"
|
|
32
|
+
checked={!!selected['30d']}
|
|
33
|
+
onPress={() => toggle('30d')}
|
|
34
|
+
/>
|
|
35
|
+
<SelectableOption.Item
|
|
36
|
+
label="2x"
|
|
37
|
+
value="50%"
|
|
38
|
+
backgroundColor="#E8F5E9"
|
|
39
|
+
checkColor="#7B1FA2"
|
|
40
|
+
checked={!!selected['2x']}
|
|
41
|
+
onPress={() => toggle('2x')}
|
|
42
|
+
/>
|
|
43
|
+
<SelectableOption.Item
|
|
44
|
+
label="3x"
|
|
45
|
+
value="30%"
|
|
46
|
+
backgroundColor="#E8F5E9"
|
|
47
|
+
checkColor="#388E3C"
|
|
48
|
+
checked={!!selected['3x']}
|
|
49
|
+
onPress={() => toggle('3x')}
|
|
50
|
+
/>
|
|
51
|
+
<SelectableOption.Item
|
|
52
|
+
label="4x"
|
|
53
|
+
backgroundColor="#EDE7F6"
|
|
54
|
+
checked={!!selected['4x']}
|
|
55
|
+
onPress={() => toggle('4x')}
|
|
56
|
+
/>
|
|
57
|
+
<SelectableOption.Item
|
|
58
|
+
label="5x"
|
|
59
|
+
value="20%"
|
|
60
|
+
backgroundColor="#FFEBEE"
|
|
61
|
+
checkColor="#C62828"
|
|
62
|
+
checked={!!selected['5x']}
|
|
63
|
+
onPress={() => toggle('5x')}
|
|
64
|
+
/>
|
|
65
|
+
</SelectableOption>
|
|
66
|
+
|
|
67
|
+
<SEText type="ns-heading-5">Somente selecionados</SEText>
|
|
68
|
+
<SelectableOption gap={8}>
|
|
69
|
+
<SelectableOption.Item
|
|
70
|
+
label="2x"
|
|
71
|
+
value="50%"
|
|
72
|
+
backgroundColor="#E8F5E9"
|
|
73
|
+
checkColor="#7B1FA2"
|
|
74
|
+
checked
|
|
75
|
+
/>
|
|
76
|
+
<SelectableOption.Item
|
|
77
|
+
label="3x"
|
|
78
|
+
value="30%"
|
|
79
|
+
backgroundColor="#E8F5E9"
|
|
80
|
+
checkColor="#388E3C"
|
|
81
|
+
checked
|
|
82
|
+
/>
|
|
83
|
+
<SelectableOption.Item
|
|
84
|
+
label="5x"
|
|
85
|
+
value="20%"
|
|
86
|
+
backgroundColor="#FFEBEE"
|
|
87
|
+
checkColor="#C62828"
|
|
88
|
+
checked
|
|
89
|
+
/>
|
|
90
|
+
</SelectableOption>
|
|
91
|
+
|
|
92
|
+
<SEText type="ns-heading-5">Sem valores (simples)</SEText>
|
|
93
|
+
<SelectableOption gap={8}>
|
|
94
|
+
<SelectableOption.Item
|
|
95
|
+
label="A vista"
|
|
96
|
+
backgroundColor="#FDECD0"
|
|
97
|
+
/>
|
|
98
|
+
<SelectableOption.Item
|
|
99
|
+
label="Em 30 dias"
|
|
100
|
+
backgroundColor="#FFF8E1"
|
|
101
|
+
/>
|
|
102
|
+
</SelectableOption>
|
|
103
|
+
|
|
104
|
+
<SEText type="ns-heading-5">Com valores em R$</SEText>
|
|
105
|
+
<SelectableOption gap={8}>
|
|
106
|
+
<SelectableOption.Item
|
|
107
|
+
label="Entrada"
|
|
108
|
+
value="R$ 500,00"
|
|
109
|
+
backgroundColor="#E3F2FD"
|
|
110
|
+
checkColor="#1565C0"
|
|
111
|
+
checked
|
|
112
|
+
/>
|
|
113
|
+
<SelectableOption.Item
|
|
114
|
+
label="Parcela"
|
|
115
|
+
value="R$ 250,00"
|
|
116
|
+
backgroundColor="#E3F2FD"
|
|
117
|
+
checkColor="#1565C0"
|
|
118
|
+
checked
|
|
119
|
+
/>
|
|
120
|
+
</SelectableOption>
|
|
121
|
+
|
|
122
|
+
<SEText type="ns-heading-5">Customizado (altura, radius, tipografia)</SEText>
|
|
123
|
+
<SelectableOption gap={4}>
|
|
124
|
+
<SelectableOption.Item
|
|
125
|
+
label="Opcao grande"
|
|
126
|
+
value="100%"
|
|
127
|
+
backgroundColor="#F3E5F5"
|
|
128
|
+
checkColor="#6A1B9A"
|
|
129
|
+
checked
|
|
130
|
+
height={72}
|
|
131
|
+
borderRadius={20}
|
|
132
|
+
labelStyle={{ fontSize: 18, fontWeight: '700' }}
|
|
133
|
+
valueStyle={{ fontSize: 16, color: '#6A1B9A' }}
|
|
134
|
+
/>
|
|
135
|
+
</SelectableOption>
|
|
136
|
+
</View>
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { View, Pressable, StyleSheet } from 'react-native';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import SEText from '../SEText';
|
|
6
|
+
import { fontFamily } from '../utils/fontFamily';
|
|
7
|
+
|
|
8
|
+
const SelectableOption = ({ children, gap = 8, style }) => {
|
|
9
|
+
return (
|
|
10
|
+
<View style={[{ gap }, style]}>
|
|
11
|
+
{children}
|
|
12
|
+
</View>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Item = ({
|
|
17
|
+
label,
|
|
18
|
+
value,
|
|
19
|
+
checked = false,
|
|
20
|
+
disabled = false,
|
|
21
|
+
onPress,
|
|
22
|
+
// Item container
|
|
23
|
+
backgroundColor = '#F5F5F5',
|
|
24
|
+
borderLeftColor,
|
|
25
|
+
borderLeftWidth = 4,
|
|
26
|
+
height = 56,
|
|
27
|
+
borderRadius = 12,
|
|
28
|
+
padding = 4,
|
|
29
|
+
style,
|
|
30
|
+
// Checkbox
|
|
31
|
+
checkColor = '#687499',
|
|
32
|
+
checkIconSize = 10,
|
|
33
|
+
checkBoxSize = 13,
|
|
34
|
+
checkBorderRadius = 0,
|
|
35
|
+
checkIcon = 'check-line',
|
|
36
|
+
checkBorderColor,
|
|
37
|
+
checkBorderWidth = 2,
|
|
38
|
+
checkBackgroundColor,
|
|
39
|
+
checkUncheckedBackgroundColor,
|
|
40
|
+
// Label
|
|
41
|
+
labelStyle,
|
|
42
|
+
// Value card
|
|
43
|
+
valueBorderColor = '#E2E9FC',
|
|
44
|
+
valueBorderWidth = 2,
|
|
45
|
+
valueBorderRadius = 8,
|
|
46
|
+
valueBackgroundColor = '#FFFFFF',
|
|
47
|
+
valueWidth = 161,
|
|
48
|
+
valueHeight = 48,
|
|
49
|
+
valuePaddingHorizontal = 8,
|
|
50
|
+
valuePaddingVertical = 8,
|
|
51
|
+
valueStyle,
|
|
52
|
+
valueContainerStyle,
|
|
53
|
+
// Test
|
|
54
|
+
testID,
|
|
55
|
+
}) => {
|
|
56
|
+
const resolvedCheckBorderColor = checkBorderColor || checkColor;
|
|
57
|
+
const resolvedCheckBg = checked
|
|
58
|
+
? (checkBackgroundColor || checkColor)
|
|
59
|
+
: (checkUncheckedBackgroundColor || backgroundColor);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<Pressable
|
|
63
|
+
onPress={onPress}
|
|
64
|
+
disabled={disabled}
|
|
65
|
+
style={({ pressed }) => [
|
|
66
|
+
styles.item,
|
|
67
|
+
{
|
|
68
|
+
height,
|
|
69
|
+
borderRadius,
|
|
70
|
+
paddingVertical: padding,
|
|
71
|
+
backgroundColor,
|
|
72
|
+
opacity: pressed ? 0.8 : disabled ? 0.5 : 1,
|
|
73
|
+
},
|
|
74
|
+
borderLeftColor && {
|
|
75
|
+
borderLeftWidth,
|
|
76
|
+
borderLeftColor,
|
|
77
|
+
},
|
|
78
|
+
style,
|
|
79
|
+
]}
|
|
80
|
+
testID={testID}
|
|
81
|
+
>
|
|
82
|
+
<View style={styles.leftContent}>
|
|
83
|
+
<View
|
|
84
|
+
style={[
|
|
85
|
+
styles.checkbox,
|
|
86
|
+
{
|
|
87
|
+
width: checkBoxSize,
|
|
88
|
+
height: checkBoxSize,
|
|
89
|
+
borderRadius: checkBorderRadius,
|
|
90
|
+
borderWidth: checkBorderWidth,
|
|
91
|
+
borderColor: resolvedCheckBorderColor,
|
|
92
|
+
backgroundColor: resolvedCheckBg,
|
|
93
|
+
},
|
|
94
|
+
]}
|
|
95
|
+
>
|
|
96
|
+
{checked && (
|
|
97
|
+
<Icon name={checkIcon} size={checkIconSize} color="#FFFFFF" />
|
|
98
|
+
)}
|
|
99
|
+
</View>
|
|
100
|
+
<SEText type="ns-sm-body" style={[styles.label, labelStyle]}>
|
|
101
|
+
{label}
|
|
102
|
+
</SEText>
|
|
103
|
+
</View>
|
|
104
|
+
{value !== undefined && value !== null && (
|
|
105
|
+
<View
|
|
106
|
+
style={[
|
|
107
|
+
styles.valueContainer,
|
|
108
|
+
{
|
|
109
|
+
borderColor: valueBorderColor,
|
|
110
|
+
borderWidth: valueBorderWidth,
|
|
111
|
+
borderRadius: valueBorderRadius,
|
|
112
|
+
backgroundColor: valueBackgroundColor,
|
|
113
|
+
width: valueWidth,
|
|
114
|
+
height: valueHeight,
|
|
115
|
+
paddingHorizontal: valuePaddingHorizontal,
|
|
116
|
+
paddingVertical: valuePaddingVertical,
|
|
117
|
+
},
|
|
118
|
+
valueContainerStyle,
|
|
119
|
+
]}
|
|
120
|
+
>
|
|
121
|
+
<SEText type="ns-sm-body" style={[styles.value, valueStyle]}>
|
|
122
|
+
{value}
|
|
123
|
+
</SEText>
|
|
124
|
+
</View>
|
|
125
|
+
)}
|
|
126
|
+
</Pressable>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
Item.propTypes = {
|
|
131
|
+
label: PropTypes.string.isRequired,
|
|
132
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
133
|
+
checked: PropTypes.bool,
|
|
134
|
+
disabled: PropTypes.bool,
|
|
135
|
+
onPress: PropTypes.func,
|
|
136
|
+
backgroundColor: PropTypes.string,
|
|
137
|
+
borderLeftColor: PropTypes.string,
|
|
138
|
+
borderLeftWidth: PropTypes.number,
|
|
139
|
+
height: PropTypes.number,
|
|
140
|
+
borderRadius: PropTypes.number,
|
|
141
|
+
padding: PropTypes.number,
|
|
142
|
+
style: PropTypes.object,
|
|
143
|
+
checkColor: PropTypes.string,
|
|
144
|
+
checkIconSize: PropTypes.number,
|
|
145
|
+
checkBoxSize: PropTypes.number,
|
|
146
|
+
checkBorderRadius: PropTypes.number,
|
|
147
|
+
checkIcon: PropTypes.string,
|
|
148
|
+
checkBorderColor: PropTypes.string,
|
|
149
|
+
checkBorderWidth: PropTypes.number,
|
|
150
|
+
checkBackgroundColor: PropTypes.string,
|
|
151
|
+
checkUncheckedBackgroundColor: PropTypes.string,
|
|
152
|
+
labelStyle: PropTypes.object,
|
|
153
|
+
valueBorderColor: PropTypes.string,
|
|
154
|
+
valueBorderWidth: PropTypes.number,
|
|
155
|
+
valueBorderRadius: PropTypes.number,
|
|
156
|
+
valueBackgroundColor: PropTypes.string,
|
|
157
|
+
valueWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
158
|
+
valueHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
159
|
+
valuePaddingHorizontal: PropTypes.number,
|
|
160
|
+
valuePaddingVertical: PropTypes.number,
|
|
161
|
+
valueStyle: PropTypes.object,
|
|
162
|
+
valueContainerStyle: PropTypes.object,
|
|
163
|
+
testID: PropTypes.string,
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
SelectableOption.Item = Item;
|
|
167
|
+
|
|
168
|
+
SelectableOption.propTypes = {
|
|
169
|
+
children: PropTypes.node,
|
|
170
|
+
gap: PropTypes.number,
|
|
171
|
+
style: PropTypes.object,
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const styles = StyleSheet.create({
|
|
175
|
+
item: {
|
|
176
|
+
flexDirection: 'row',
|
|
177
|
+
alignItems: 'center',
|
|
178
|
+
justifyContent: 'space-between',
|
|
179
|
+
paddingLeft: 14,
|
|
180
|
+
paddingRight: 4,
|
|
181
|
+
width: '100%',
|
|
182
|
+
},
|
|
183
|
+
leftContent: {
|
|
184
|
+
flexDirection: 'row',
|
|
185
|
+
alignItems: 'center',
|
|
186
|
+
gap: 10,
|
|
187
|
+
flex: 1,
|
|
188
|
+
},
|
|
189
|
+
checkbox: {
|
|
190
|
+
justifyContent: 'center',
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
},
|
|
193
|
+
label: {
|
|
194
|
+
fontSize: 16,
|
|
195
|
+
lineHeight: 24,
|
|
196
|
+
fontFamily: fontFamily.regular,
|
|
197
|
+
fontWeight: '500',
|
|
198
|
+
color: '#1B244B',
|
|
199
|
+
},
|
|
200
|
+
valueContainer: {
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
alignItems: 'center',
|
|
203
|
+
},
|
|
204
|
+
value: {
|
|
205
|
+
fontSize: 18,
|
|
206
|
+
lineHeight: 28,
|
|
207
|
+
fontFamily: fontFamily.regular,
|
|
208
|
+
fontWeight: '400',
|
|
209
|
+
color: '#1B244B',
|
|
210
|
+
textAlign: 'center',
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
export default SelectableOption;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import StackedBar from './index';
|
|
4
|
+
import SEText from '../SEText';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Molecules/StackedBar',
|
|
8
|
+
component: StackedBar,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
export const TresSegmentos = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<View style={{ padding: 16 }}>
|
|
16
|
+
<SEText type="ns-heading-5">3 segmentos</SEText>
|
|
17
|
+
<View style={{ marginTop: 16 }}>
|
|
18
|
+
<StackedBar
|
|
19
|
+
segments={[
|
|
20
|
+
{ label: '2x', value: '50%', percentage: 50, backgroundColor: '#E8D5F5', valueColor: '#7B1FA2', labelColor: '#7B1FA2' },
|
|
21
|
+
{ label: '3x', value: '30%', percentage: 30, backgroundColor: '#E8F5E9', valueColor: '#388E3C', labelColor: '#388E3C' },
|
|
22
|
+
{ label: '5x', value: '20%', percentage: 20, backgroundColor: '#FFEBEE', valueColor: '#C62828', labelColor: '#C62828' },
|
|
23
|
+
]}
|
|
24
|
+
/>
|
|
25
|
+
</View>
|
|
26
|
+
</View>
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const BarraVazia = {
|
|
31
|
+
render: () => (
|
|
32
|
+
<View style={{ padding: 16 }}>
|
|
33
|
+
<SEText type="ns-heading-5">Barra vazia (0%)</SEText>
|
|
34
|
+
<View style={{ marginTop: 16 }}>
|
|
35
|
+
<StackedBar
|
|
36
|
+
showLabels={false}
|
|
37
|
+
showStartDivider
|
|
38
|
+
segments={[
|
|
39
|
+
{ value: '0%', percentage: 0, backgroundColor: '#F0F2F8', valueColor: '#687499' },
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
</View>
|
|
43
|
+
</View>
|
|
44
|
+
),
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const AVista = {
|
|
48
|
+
render: () => (
|
|
49
|
+
<View style={{ padding: 16 }}>
|
|
50
|
+
<SEText type="ns-heading-5">A vista (50%) + resto</SEText>
|
|
51
|
+
<View style={{ marginTop: 16 }}>
|
|
52
|
+
<StackedBar
|
|
53
|
+
segments={[
|
|
54
|
+
{ label: 'A vista', value: '50%', percentage: 50, backgroundColor: '#E8D5F5', valueColor: '#7B1FA2' },
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
</View>
|
|
58
|
+
</View>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const NaoFechaCem = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<View style={{ padding: 16 }}>
|
|
65
|
+
<SEText type="ns-heading-5">Nao fecha 100% (?)</SEText>
|
|
66
|
+
<View style={{ marginTop: 16 }}>
|
|
67
|
+
<StackedBar
|
|
68
|
+
segments={[
|
|
69
|
+
{ label: '?', value: '50%', percentage: 50, backgroundColor: '#E3E9FF', valueColor: '#485274' },
|
|
70
|
+
{ label: '3x', value: '30%', percentage: 30, backgroundColor: '#E8F5E9', valueColor: '#388E3C', labelColor: '#388E3C' },
|
|
71
|
+
{ label: '5x', value: '20%', percentage: 20, backgroundColor: '#FFEBEE', valueColor: '#C62828', labelColor: '#C62828' },
|
|
72
|
+
]}
|
|
73
|
+
/>
|
|
74
|
+
</View>
|
|
75
|
+
</View>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const DozeParcelas = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<View style={{ padding: 16 }}>
|
|
82
|
+
<SEText type="ns-heading-5">12 parcelas (7% cada)</SEText>
|
|
83
|
+
<View style={{ marginTop: 16 }}>
|
|
84
|
+
<StackedBar
|
|
85
|
+
segments={[
|
|
86
|
+
{ label: 'a.v.', value: '7%', percentage: 7, backgroundColor: '#FDECD0', valueColor: '#C62828' },
|
|
87
|
+
{ label: '30d', value: '7%', percentage: 7, backgroundColor: '#FFF8E1', valueColor: '#E65100' },
|
|
88
|
+
{ label: '2x', value: '7%', percentage: 7, backgroundColor: '#E8F5E9', valueColor: '#2E7D32' },
|
|
89
|
+
{ label: '3x', value: '7%', percentage: 7, backgroundColor: '#C8E6C9', valueColor: '#1565C0' },
|
|
90
|
+
{ label: '4x', value: '7%', percentage: 8, backgroundColor: '#B2DFDB', valueColor: '#4527A0' },
|
|
91
|
+
{ label: '5x', value: '7%', percentage: 8, backgroundColor: '#B3E5FC', valueColor: '#C62828' },
|
|
92
|
+
{ label: '6x', value: '7%', percentage: 8, backgroundColor: '#BBDEFB', valueColor: '#E65100' },
|
|
93
|
+
{ label: '7x', value: '7%', percentage: 8, backgroundColor: '#C5CAE9', valueColor: '#2E7D32' },
|
|
94
|
+
{ label: '8x', value: '7%', percentage: 8, backgroundColor: '#D1C4E9', valueColor: '#1565C0' },
|
|
95
|
+
{ label: '9x', value: '7%', percentage: 8, backgroundColor: '#F8BBD0', valueColor: '#4527A0' },
|
|
96
|
+
{ label: '10x', value: '7%', percentage: 8, backgroundColor: '#FFCDD2', valueColor: '#C62828' },
|
|
97
|
+
{ label: '11x', value: '7%', percentage: 8, backgroundColor: '#BBDEFB', valueColor: '#E65100' },
|
|
98
|
+
{ label: '12x', value: '7%', percentage: 8, backgroundColor: '#F3E5F5', valueColor: '#7B1FA2' },
|
|
99
|
+
]}
|
|
100
|
+
/>
|
|
101
|
+
</View>
|
|
102
|
+
</View>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const SemDivider = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<View style={{ padding: 16 }}>
|
|
109
|
+
<SEText type="ns-heading-5">Sem divider (customizado)</SEText>
|
|
110
|
+
<View style={{ marginTop: 16 }}>
|
|
111
|
+
<StackedBar
|
|
112
|
+
height={24}
|
|
113
|
+
showDividers={false}
|
|
114
|
+
segments={[
|
|
115
|
+
{ label: 'A', value: '60%', percentage: 60, backgroundColor: '#C5CAE9', valueColor: '#1A237E' },
|
|
116
|
+
{ label: 'B', value: '40%', percentage: 40, backgroundColor: '#FFECB3', valueColor: '#E65100' },
|
|
117
|
+
]}
|
|
118
|
+
/>
|
|
119
|
+
</View>
|
|
120
|
+
</View>
|
|
121
|
+
),
|
|
122
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { View, StyleSheet } from 'react-native';
|
|
4
|
+
import SEText from '../SEText';
|
|
5
|
+
import { fontFamily } from '../utils/fontFamily';
|
|
6
|
+
|
|
7
|
+
const StackedBar = ({
|
|
8
|
+
segments = [],
|
|
9
|
+
height = 16,
|
|
10
|
+
borderRadius = 100,
|
|
11
|
+
showLabels = true,
|
|
12
|
+
showValues = true,
|
|
13
|
+
showDividers,
|
|
14
|
+
showStartDivider = false,
|
|
15
|
+
maxSegmentsForDividers = 5,
|
|
16
|
+
dividerWidth = 2,
|
|
17
|
+
dividerHeight = 48,
|
|
18
|
+
dividerColor = '#C0C9E5',
|
|
19
|
+
dividerBorderWidth = 2,
|
|
20
|
+
dividerBorderColor = '#FFFFFF',
|
|
21
|
+
labelGap = 12,
|
|
22
|
+
labelStyle,
|
|
23
|
+
valueStyle,
|
|
24
|
+
style,
|
|
25
|
+
testID,
|
|
26
|
+
}) => {
|
|
27
|
+
if (!segments || segments.length === 0) return null;
|
|
28
|
+
|
|
29
|
+
const totalPercentage = segments.reduce((sum, s) => sum + (s.percentage || 0), 0);
|
|
30
|
+
const hasDividers = showDividers !== undefined
|
|
31
|
+
? showDividers
|
|
32
|
+
: segments.length <= maxSegmentsForDividers;
|
|
33
|
+
|
|
34
|
+
const dividerTotalWidth = dividerWidth + dividerBorderWidth * 2;
|
|
35
|
+
const topOffset = hasDividers ? (dividerHeight - height) / 2 : 0;
|
|
36
|
+
const resolvedLabelGap = hasDividers ? Math.max(0, labelGap - topOffset) : labelGap;
|
|
37
|
+
|
|
38
|
+
const dividerPositions = [];
|
|
39
|
+
if (hasDividers && showStartDivider) {
|
|
40
|
+
dividerPositions.push(0);
|
|
41
|
+
}
|
|
42
|
+
let cumulative = 0;
|
|
43
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
44
|
+
cumulative += segments[i].percentage || 0;
|
|
45
|
+
if (hasDividers) {
|
|
46
|
+
dividerPositions.push(cumulative);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<View style={[styles.container, style]} testID={testID}>
|
|
52
|
+
{showLabels && (
|
|
53
|
+
<View style={[styles.labelsRow, { marginBottom: resolvedLabelGap }]}>
|
|
54
|
+
{segments.map((seg, i) => (
|
|
55
|
+
<View
|
|
56
|
+
key={`label-${i}`}
|
|
57
|
+
style={{ width: `${seg.percentage || 0}%`, alignItems: 'center' }}
|
|
58
|
+
>
|
|
59
|
+
<SEText
|
|
60
|
+
style={[
|
|
61
|
+
styles.label,
|
|
62
|
+
{ color: seg.labelColor || '#687499' },
|
|
63
|
+
labelStyle,
|
|
64
|
+
seg.labelStyle,
|
|
65
|
+
]}
|
|
66
|
+
numberOfLines={1}
|
|
67
|
+
>
|
|
68
|
+
{seg.label || ''}
|
|
69
|
+
</SEText>
|
|
70
|
+
</View>
|
|
71
|
+
))}
|
|
72
|
+
</View>
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
<View style={[styles.barWrapper, { height: hasDividers ? dividerHeight : height }]}>
|
|
76
|
+
<View
|
|
77
|
+
style={[
|
|
78
|
+
styles.barContainer,
|
|
79
|
+
{ height, borderRadius, top: topOffset },
|
|
80
|
+
]}
|
|
81
|
+
>
|
|
82
|
+
{segments.map((seg, i) => {
|
|
83
|
+
const isFirst = i === 0;
|
|
84
|
+
const pct = seg.percentage || 0;
|
|
85
|
+
const isLast = i === segments.length - 1 && totalPercentage >= 100;
|
|
86
|
+
const isEmpty = pct === 0;
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<View
|
|
90
|
+
key={`seg-${i}`}
|
|
91
|
+
style={[
|
|
92
|
+
styles.segment,
|
|
93
|
+
{
|
|
94
|
+
width: isEmpty ? '100%' : `${pct}%`,
|
|
95
|
+
height,
|
|
96
|
+
backgroundColor: isEmpty ? '#F0F2F8' : (seg.backgroundColor || '#E3E9FF'),
|
|
97
|
+
},
|
|
98
|
+
isFirst && { borderTopLeftRadius: borderRadius, borderBottomLeftRadius: borderRadius },
|
|
99
|
+
(isLast || isEmpty) && { borderTopRightRadius: borderRadius, borderBottomRightRadius: borderRadius },
|
|
100
|
+
isEmpty && { alignItems: 'flex-start', paddingLeft: 12 },
|
|
101
|
+
seg.style,
|
|
102
|
+
]}
|
|
103
|
+
>
|
|
104
|
+
{showValues && seg.value !== undefined && seg.value !== null && (
|
|
105
|
+
<SEText
|
|
106
|
+
style={[
|
|
107
|
+
styles.value,
|
|
108
|
+
{ color: seg.valueColor || '#1B244B' },
|
|
109
|
+
valueStyle,
|
|
110
|
+
seg.valueStyle,
|
|
111
|
+
]}
|
|
112
|
+
numberOfLines={1}
|
|
113
|
+
>
|
|
114
|
+
{seg.value}
|
|
115
|
+
</SEText>
|
|
116
|
+
)}
|
|
117
|
+
</View>
|
|
118
|
+
);
|
|
119
|
+
})}
|
|
120
|
+
|
|
121
|
+
{totalPercentage < 100 && totalPercentage > 0 && (
|
|
122
|
+
<View
|
|
123
|
+
style={[
|
|
124
|
+
styles.segment,
|
|
125
|
+
{
|
|
126
|
+
width: `${100 - totalPercentage}%`,
|
|
127
|
+
height,
|
|
128
|
+
backgroundColor: '#F0F2F8',
|
|
129
|
+
borderTopRightRadius: borderRadius,
|
|
130
|
+
borderBottomRightRadius: borderRadius,
|
|
131
|
+
},
|
|
132
|
+
]}
|
|
133
|
+
/>
|
|
134
|
+
)}
|
|
135
|
+
</View>
|
|
136
|
+
|
|
137
|
+
{dividerPositions.map((pct, i) => (
|
|
138
|
+
<View
|
|
139
|
+
key={`div-${i}`}
|
|
140
|
+
style={[
|
|
141
|
+
styles.divider,
|
|
142
|
+
{
|
|
143
|
+
left: `${pct}%`,
|
|
144
|
+
width: dividerTotalWidth,
|
|
145
|
+
height: dividerHeight,
|
|
146
|
+
backgroundColor: dividerColor,
|
|
147
|
+
borderWidth: dividerBorderWidth,
|
|
148
|
+
borderColor: dividerBorderColor,
|
|
149
|
+
marginLeft: -dividerTotalWidth / 2,
|
|
150
|
+
},
|
|
151
|
+
]}
|
|
152
|
+
/>
|
|
153
|
+
))}
|
|
154
|
+
</View>
|
|
155
|
+
</View>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
StackedBar.propTypes = {
|
|
160
|
+
segments: PropTypes.arrayOf(
|
|
161
|
+
PropTypes.shape({
|
|
162
|
+
label: PropTypes.string,
|
|
163
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
164
|
+
percentage: PropTypes.number.isRequired,
|
|
165
|
+
backgroundColor: PropTypes.string,
|
|
166
|
+
valueColor: PropTypes.string,
|
|
167
|
+
labelColor: PropTypes.string,
|
|
168
|
+
labelStyle: PropTypes.object,
|
|
169
|
+
valueStyle: PropTypes.object,
|
|
170
|
+
style: PropTypes.object,
|
|
171
|
+
})
|
|
172
|
+
),
|
|
173
|
+
height: PropTypes.number,
|
|
174
|
+
borderRadius: PropTypes.number,
|
|
175
|
+
showLabels: PropTypes.bool,
|
|
176
|
+
showValues: PropTypes.bool,
|
|
177
|
+
showDividers: PropTypes.bool,
|
|
178
|
+
showStartDivider: PropTypes.bool,
|
|
179
|
+
maxSegmentsForDividers: PropTypes.number,
|
|
180
|
+
dividerWidth: PropTypes.number,
|
|
181
|
+
dividerHeight: PropTypes.number,
|
|
182
|
+
dividerColor: PropTypes.string,
|
|
183
|
+
dividerBorderWidth: PropTypes.number,
|
|
184
|
+
dividerBorderColor: PropTypes.string,
|
|
185
|
+
labelGap: PropTypes.number,
|
|
186
|
+
labelStyle: PropTypes.object,
|
|
187
|
+
valueStyle: PropTypes.object,
|
|
188
|
+
style: PropTypes.object,
|
|
189
|
+
testID: PropTypes.string,
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const styles = StyleSheet.create({
|
|
193
|
+
container: {
|
|
194
|
+
width: '100%',
|
|
195
|
+
},
|
|
196
|
+
labelsRow: {
|
|
197
|
+
flexDirection: 'row',
|
|
198
|
+
},
|
|
199
|
+
barWrapper: {
|
|
200
|
+
width: '100%',
|
|
201
|
+
position: 'relative',
|
|
202
|
+
},
|
|
203
|
+
barContainer: {
|
|
204
|
+
flexDirection: 'row',
|
|
205
|
+
alignItems: 'center',
|
|
206
|
+
width: '100%',
|
|
207
|
+
overflow: 'hidden',
|
|
208
|
+
position: 'absolute',
|
|
209
|
+
left: 0,
|
|
210
|
+
right: 0,
|
|
211
|
+
},
|
|
212
|
+
segment: {
|
|
213
|
+
justifyContent: 'center',
|
|
214
|
+
alignItems: 'center',
|
|
215
|
+
overflow: 'hidden',
|
|
216
|
+
},
|
|
217
|
+
divider: {
|
|
218
|
+
position: 'absolute',
|
|
219
|
+
top: 0,
|
|
220
|
+
zIndex: 2,
|
|
221
|
+
borderRadius: 2,
|
|
222
|
+
},
|
|
223
|
+
label: {
|
|
224
|
+
fontSize: 12,
|
|
225
|
+
lineHeight: 18,
|
|
226
|
+
fontFamily: fontFamily.regular,
|
|
227
|
+
fontWeight: '400',
|
|
228
|
+
color: '#687499',
|
|
229
|
+
textAlign: 'center',
|
|
230
|
+
},
|
|
231
|
+
value: {
|
|
232
|
+
fontSize: 12,
|
|
233
|
+
lineHeight: 16,
|
|
234
|
+
fontFamily: fontFamily.bold,
|
|
235
|
+
fontWeight: '700',
|
|
236
|
+
color: '#1B244B',
|
|
237
|
+
textAlign: 'center',
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
export default StackedBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Input/index.jsx"],"names":[],"mappings":";AAQA;;;;;GAKG;AACH,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Input/index.jsx"],"names":[],"mappings":";AAQA;;;;;GAKG;AACH,+EAkNG;kBAhO0C,OAAO"}
|
|
@@ -16,7 +16,7 @@ const Input = React.forwardRef((props, ref) => {
|
|
|
16
16
|
const { label, placeholder, value, onChangeText, error, success, disabled, supportText, mask, maskType, tooltipProps, // <-- Adicione esta prop para receber o tooltip]
|
|
17
17
|
variant = 'default',
|
|
18
18
|
// Props para ícone ao lado do label
|
|
19
|
-
labelIcon = false, labelIconName = 'information-line', labelIconSize = 16, labelIconColor = null, labelIconStyle = {}, onLabelIconPress = null, labelStyle, ...textInputProps } = props;
|
|
19
|
+
labelIcon = false, labelIconName = 'information-line', labelIconSize = 16, labelIconColor = null, labelIconStyle = {}, onLabelIconPress = null, labelStyle, inputStyle, containerStyle, showInfoIcon = true, ...textInputProps } = props;
|
|
20
20
|
const handleChangeText = (text) => {
|
|
21
21
|
const maskedText = applyMask(text, maskType);
|
|
22
22
|
if (onChangeText) {
|
|
@@ -156,9 +156,9 @@ const Input = React.forwardRef((props, ref) => {
|
|
|
156
156
|
};
|
|
157
157
|
return (<View style={styles.wrapper}>
|
|
158
158
|
{renderLabel()}
|
|
159
|
-
<View style={getContainerStyle()}>
|
|
160
|
-
<TextInput ref={ref} style={getInputStyle()} placeholder={placeholder} value={value} onChangeText={handleChangeText} onFocus={() => setIsFocused(true)} onBlur={() => setIsFocused(false)} editable={!disabled} keyboardType={getKeyboardType()} maxLength={getMaxLength()} placeholderTextColor="#BFBFBF" {...textInputProps}/>
|
|
161
|
-
{!disabled && tooltipProps ? (<TooltipCard {...tooltipProps} trigger={<Icon name="information-line" size={20} color="#687499"/>}/>) : !disabled && (<Icon name="information-line" size={20} color="#687499"/>)}
|
|
159
|
+
<View style={[getContainerStyle(), containerStyle]}>
|
|
160
|
+
<TextInput ref={ref} style={[getInputStyle(), inputStyle]} placeholder={placeholder} value={value} onChangeText={handleChangeText} onFocus={() => setIsFocused(true)} onBlur={() => setIsFocused(false)} editable={!disabled} keyboardType={getKeyboardType()} maxLength={getMaxLength()} placeholderTextColor="#BFBFBF" {...textInputProps}/>
|
|
161
|
+
{showInfoIcon && !disabled && tooltipProps ? (<TooltipCard {...tooltipProps} trigger={<Icon name="information-line" size={20} color="#687499"/>}/>) : showInfoIcon && !disabled && (<Icon name="information-line" size={20} color="#687499"/>)}
|
|
162
162
|
{error && <Icon name="close-line" size={20} color="#FF4D4F"/>}
|
|
163
163
|
{success && <Icon name="check-line" size={20} color="#52C41A"/>}
|
|
164
164
|
</View>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export default SelectableOption;
|
|
2
|
+
declare function SelectableOption({ children, gap, style }: {
|
|
3
|
+
children: any;
|
|
4
|
+
gap?: number | undefined;
|
|
5
|
+
style: any;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare namespace SelectableOption {
|
|
8
|
+
export { Item };
|
|
9
|
+
export namespace propTypes {
|
|
10
|
+
let children: any;
|
|
11
|
+
let gap: any;
|
|
12
|
+
let style: any;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
import React from 'react';
|
|
16
|
+
declare function Item({ label, value, checked, disabled, onPress, backgroundColor, borderLeftColor, borderLeftWidth, height, borderRadius, padding, style, checkColor, checkIconSize, checkBoxSize, checkBorderRadius, checkIcon, checkBorderColor, checkBorderWidth, checkBackgroundColor, checkUncheckedBackgroundColor, labelStyle, valueBorderColor, valueBorderWidth, valueBorderRadius, valueBackgroundColor, valueWidth, valueHeight, valuePaddingHorizontal, valuePaddingVertical, valueStyle, valueContainerStyle, testID, }: {
|
|
17
|
+
label: any;
|
|
18
|
+
value: any;
|
|
19
|
+
checked?: boolean | undefined;
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
onPress: any;
|
|
22
|
+
backgroundColor?: string | undefined;
|
|
23
|
+
borderLeftColor: any;
|
|
24
|
+
borderLeftWidth?: number | undefined;
|
|
25
|
+
height?: number | undefined;
|
|
26
|
+
borderRadius?: number | undefined;
|
|
27
|
+
padding?: number | undefined;
|
|
28
|
+
style: any;
|
|
29
|
+
checkColor?: string | undefined;
|
|
30
|
+
checkIconSize?: number | undefined;
|
|
31
|
+
checkBoxSize?: number | undefined;
|
|
32
|
+
checkBorderRadius?: number | undefined;
|
|
33
|
+
checkIcon?: string | undefined;
|
|
34
|
+
checkBorderColor: any;
|
|
35
|
+
checkBorderWidth?: number | undefined;
|
|
36
|
+
checkBackgroundColor: any;
|
|
37
|
+
checkUncheckedBackgroundColor: any;
|
|
38
|
+
labelStyle: any;
|
|
39
|
+
valueBorderColor?: string | undefined;
|
|
40
|
+
valueBorderWidth?: number | undefined;
|
|
41
|
+
valueBorderRadius?: number | undefined;
|
|
42
|
+
valueBackgroundColor?: string | undefined;
|
|
43
|
+
valueWidth?: number | undefined;
|
|
44
|
+
valueHeight?: number | undefined;
|
|
45
|
+
valuePaddingHorizontal?: number | undefined;
|
|
46
|
+
valuePaddingVertical?: number | undefined;
|
|
47
|
+
valueStyle: any;
|
|
48
|
+
valueContainerStyle: any;
|
|
49
|
+
testID: any;
|
|
50
|
+
}): React.JSX.Element;
|
|
51
|
+
declare namespace Item {
|
|
52
|
+
export namespace propTypes_1 {
|
|
53
|
+
export let label: any;
|
|
54
|
+
export let value: any;
|
|
55
|
+
export let checked: any;
|
|
56
|
+
export let disabled: any;
|
|
57
|
+
export let onPress: any;
|
|
58
|
+
export let backgroundColor: any;
|
|
59
|
+
export let borderLeftColor: any;
|
|
60
|
+
export let borderLeftWidth: any;
|
|
61
|
+
export let height: any;
|
|
62
|
+
export let borderRadius: any;
|
|
63
|
+
export let padding: any;
|
|
64
|
+
let style_1: any;
|
|
65
|
+
export { style_1 as style };
|
|
66
|
+
export let checkColor: any;
|
|
67
|
+
export let checkIconSize: any;
|
|
68
|
+
export let checkBoxSize: any;
|
|
69
|
+
export let checkBorderRadius: any;
|
|
70
|
+
export let checkIcon: any;
|
|
71
|
+
export let checkBorderColor: any;
|
|
72
|
+
export let checkBorderWidth: any;
|
|
73
|
+
export let checkBackgroundColor: any;
|
|
74
|
+
export let checkUncheckedBackgroundColor: any;
|
|
75
|
+
export let labelStyle: any;
|
|
76
|
+
export let valueBorderColor: any;
|
|
77
|
+
export let valueBorderWidth: any;
|
|
78
|
+
export let valueBorderRadius: any;
|
|
79
|
+
export let valueBackgroundColor: any;
|
|
80
|
+
export let valueWidth: any;
|
|
81
|
+
export let valueHeight: any;
|
|
82
|
+
export let valuePaddingHorizontal: any;
|
|
83
|
+
export let valuePaddingVertical: any;
|
|
84
|
+
export let valueStyle: any;
|
|
85
|
+
export let valueContainerStyle: any;
|
|
86
|
+
export let testID: any;
|
|
87
|
+
}
|
|
88
|
+
export { propTypes_1 as propTypes };
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/SelectableOption/index.jsx"],"names":[],"mappings":";AAOA;;;;sBAMC;;;;;;;;;kBAbiB,OAAO;AAezB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgHC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { View, Pressable, StyleSheet } from 'react-native';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import SEText from '../SEText';
|
|
6
|
+
import { fontFamily } from '../utils/fontFamily';
|
|
7
|
+
const SelectableOption = ({ children, gap = 8, style }) => {
|
|
8
|
+
return (<View style={[{ gap }, style]}>
|
|
9
|
+
{children}
|
|
10
|
+
</View>);
|
|
11
|
+
};
|
|
12
|
+
const Item = ({ label, value, checked = false, disabled = false, onPress,
|
|
13
|
+
// Item container
|
|
14
|
+
backgroundColor = '#F5F5F5', borderLeftColor, borderLeftWidth = 4, height = 56, borderRadius = 12, padding = 4, style,
|
|
15
|
+
// Checkbox
|
|
16
|
+
checkColor = '#687499', checkIconSize = 10, checkBoxSize = 13, checkBorderRadius = 0, checkIcon = 'check-line', checkBorderColor, checkBorderWidth = 2, checkBackgroundColor, checkUncheckedBackgroundColor,
|
|
17
|
+
// Label
|
|
18
|
+
labelStyle,
|
|
19
|
+
// Value card
|
|
20
|
+
valueBorderColor = '#E2E9FC', valueBorderWidth = 2, valueBorderRadius = 8, valueBackgroundColor = '#FFFFFF', valueWidth = 161, valueHeight = 48, valuePaddingHorizontal = 8, valuePaddingVertical = 8, valueStyle, valueContainerStyle,
|
|
21
|
+
// Test
|
|
22
|
+
testID, }) => {
|
|
23
|
+
const resolvedCheckBorderColor = checkBorderColor || checkColor;
|
|
24
|
+
const resolvedCheckBg = checked
|
|
25
|
+
? (checkBackgroundColor || checkColor)
|
|
26
|
+
: (checkUncheckedBackgroundColor || backgroundColor);
|
|
27
|
+
return (<Pressable onPress={onPress} disabled={disabled} style={({ pressed }) => [
|
|
28
|
+
styles.item,
|
|
29
|
+
{
|
|
30
|
+
height,
|
|
31
|
+
borderRadius,
|
|
32
|
+
paddingVertical: padding,
|
|
33
|
+
backgroundColor,
|
|
34
|
+
opacity: pressed ? 0.8 : disabled ? 0.5 : 1,
|
|
35
|
+
},
|
|
36
|
+
borderLeftColor && {
|
|
37
|
+
borderLeftWidth,
|
|
38
|
+
borderLeftColor,
|
|
39
|
+
},
|
|
40
|
+
style,
|
|
41
|
+
]} testID={testID}>
|
|
42
|
+
<View style={styles.leftContent}>
|
|
43
|
+
<View style={[
|
|
44
|
+
styles.checkbox,
|
|
45
|
+
{
|
|
46
|
+
width: checkBoxSize,
|
|
47
|
+
height: checkBoxSize,
|
|
48
|
+
borderRadius: checkBorderRadius,
|
|
49
|
+
borderWidth: checkBorderWidth,
|
|
50
|
+
borderColor: resolvedCheckBorderColor,
|
|
51
|
+
backgroundColor: resolvedCheckBg,
|
|
52
|
+
},
|
|
53
|
+
]}>
|
|
54
|
+
{checked && (<Icon name={checkIcon} size={checkIconSize} color="#FFFFFF"/>)}
|
|
55
|
+
</View>
|
|
56
|
+
<SEText type="ns-sm-body" style={[styles.label, labelStyle]}>
|
|
57
|
+
{label}
|
|
58
|
+
</SEText>
|
|
59
|
+
</View>
|
|
60
|
+
{value !== undefined && value !== null && (<View style={[
|
|
61
|
+
styles.valueContainer,
|
|
62
|
+
{
|
|
63
|
+
borderColor: valueBorderColor,
|
|
64
|
+
borderWidth: valueBorderWidth,
|
|
65
|
+
borderRadius: valueBorderRadius,
|
|
66
|
+
backgroundColor: valueBackgroundColor,
|
|
67
|
+
width: valueWidth,
|
|
68
|
+
height: valueHeight,
|
|
69
|
+
paddingHorizontal: valuePaddingHorizontal,
|
|
70
|
+
paddingVertical: valuePaddingVertical,
|
|
71
|
+
},
|
|
72
|
+
valueContainerStyle,
|
|
73
|
+
]}>
|
|
74
|
+
<SEText type="ns-sm-body" style={[styles.value, valueStyle]}>
|
|
75
|
+
{value}
|
|
76
|
+
</SEText>
|
|
77
|
+
</View>)}
|
|
78
|
+
</Pressable>);
|
|
79
|
+
};
|
|
80
|
+
Item.propTypes = {
|
|
81
|
+
label: PropTypes.string.isRequired,
|
|
82
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
83
|
+
checked: PropTypes.bool,
|
|
84
|
+
disabled: PropTypes.bool,
|
|
85
|
+
onPress: PropTypes.func,
|
|
86
|
+
backgroundColor: PropTypes.string,
|
|
87
|
+
borderLeftColor: PropTypes.string,
|
|
88
|
+
borderLeftWidth: PropTypes.number,
|
|
89
|
+
height: PropTypes.number,
|
|
90
|
+
borderRadius: PropTypes.number,
|
|
91
|
+
padding: PropTypes.number,
|
|
92
|
+
style: PropTypes.object,
|
|
93
|
+
checkColor: PropTypes.string,
|
|
94
|
+
checkIconSize: PropTypes.number,
|
|
95
|
+
checkBoxSize: PropTypes.number,
|
|
96
|
+
checkBorderRadius: PropTypes.number,
|
|
97
|
+
checkIcon: PropTypes.string,
|
|
98
|
+
checkBorderColor: PropTypes.string,
|
|
99
|
+
checkBorderWidth: PropTypes.number,
|
|
100
|
+
checkBackgroundColor: PropTypes.string,
|
|
101
|
+
checkUncheckedBackgroundColor: PropTypes.string,
|
|
102
|
+
labelStyle: PropTypes.object,
|
|
103
|
+
valueBorderColor: PropTypes.string,
|
|
104
|
+
valueBorderWidth: PropTypes.number,
|
|
105
|
+
valueBorderRadius: PropTypes.number,
|
|
106
|
+
valueBackgroundColor: PropTypes.string,
|
|
107
|
+
valueWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
108
|
+
valueHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
109
|
+
valuePaddingHorizontal: PropTypes.number,
|
|
110
|
+
valuePaddingVertical: PropTypes.number,
|
|
111
|
+
valueStyle: PropTypes.object,
|
|
112
|
+
valueContainerStyle: PropTypes.object,
|
|
113
|
+
testID: PropTypes.string,
|
|
114
|
+
};
|
|
115
|
+
SelectableOption.Item = Item;
|
|
116
|
+
SelectableOption.propTypes = {
|
|
117
|
+
children: PropTypes.node,
|
|
118
|
+
gap: PropTypes.number,
|
|
119
|
+
style: PropTypes.object,
|
|
120
|
+
};
|
|
121
|
+
const styles = StyleSheet.create({
|
|
122
|
+
item: {
|
|
123
|
+
flexDirection: 'row',
|
|
124
|
+
alignItems: 'center',
|
|
125
|
+
justifyContent: 'space-between',
|
|
126
|
+
paddingLeft: 14,
|
|
127
|
+
paddingRight: 4,
|
|
128
|
+
width: '100%',
|
|
129
|
+
},
|
|
130
|
+
leftContent: {
|
|
131
|
+
flexDirection: 'row',
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
gap: 10,
|
|
134
|
+
flex: 1,
|
|
135
|
+
},
|
|
136
|
+
checkbox: {
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
},
|
|
140
|
+
label: {
|
|
141
|
+
fontSize: 16,
|
|
142
|
+
lineHeight: 24,
|
|
143
|
+
fontFamily: fontFamily.regular,
|
|
144
|
+
fontWeight: '500',
|
|
145
|
+
color: '#1B244B',
|
|
146
|
+
},
|
|
147
|
+
valueContainer: {
|
|
148
|
+
justifyContent: 'center',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
},
|
|
151
|
+
value: {
|
|
152
|
+
fontSize: 18,
|
|
153
|
+
lineHeight: 28,
|
|
154
|
+
fontFamily: fontFamily.regular,
|
|
155
|
+
fontWeight: '400',
|
|
156
|
+
color: '#1B244B',
|
|
157
|
+
textAlign: 'center',
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
export default SelectableOption;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export default StackedBar;
|
|
2
|
+
declare function StackedBar({ segments, height, borderRadius, showLabels, showValues, showDividers, showStartDivider, maxSegmentsForDividers, dividerWidth, dividerHeight, dividerColor, dividerBorderWidth, dividerBorderColor, labelGap, labelStyle, valueStyle, style, testID, }: {
|
|
3
|
+
segments?: never[] | undefined;
|
|
4
|
+
height?: number | undefined;
|
|
5
|
+
borderRadius?: number | undefined;
|
|
6
|
+
showLabels?: boolean | undefined;
|
|
7
|
+
showValues?: boolean | undefined;
|
|
8
|
+
showDividers: any;
|
|
9
|
+
showStartDivider?: boolean | undefined;
|
|
10
|
+
maxSegmentsForDividers?: number | undefined;
|
|
11
|
+
dividerWidth?: number | undefined;
|
|
12
|
+
dividerHeight?: number | undefined;
|
|
13
|
+
dividerColor?: string | undefined;
|
|
14
|
+
dividerBorderWidth?: number | undefined;
|
|
15
|
+
dividerBorderColor?: string | undefined;
|
|
16
|
+
labelGap?: number | undefined;
|
|
17
|
+
labelStyle: any;
|
|
18
|
+
valueStyle: any;
|
|
19
|
+
style: any;
|
|
20
|
+
testID: any;
|
|
21
|
+
}): React.JSX.Element | null;
|
|
22
|
+
declare namespace StackedBar {
|
|
23
|
+
namespace propTypes {
|
|
24
|
+
let segments: any;
|
|
25
|
+
let height: any;
|
|
26
|
+
let borderRadius: any;
|
|
27
|
+
let showLabels: any;
|
|
28
|
+
let showValues: any;
|
|
29
|
+
let showDividers: any;
|
|
30
|
+
let showStartDivider: any;
|
|
31
|
+
let maxSegmentsForDividers: any;
|
|
32
|
+
let dividerWidth: any;
|
|
33
|
+
let dividerHeight: any;
|
|
34
|
+
let dividerColor: any;
|
|
35
|
+
let dividerBorderWidth: any;
|
|
36
|
+
let dividerBorderColor: any;
|
|
37
|
+
let labelGap: any;
|
|
38
|
+
let labelStyle: any;
|
|
39
|
+
let valueStyle: any;
|
|
40
|
+
let style: any;
|
|
41
|
+
let testID: any;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
import React from 'react';
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/StackedBar/index.jsx"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;;;6BAsJC;;;;;;;;;;;;;;;;;;;;;;;kBA5JiB,OAAO"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { View, StyleSheet } from 'react-native';
|
|
4
|
+
import SEText from '../SEText';
|
|
5
|
+
import { fontFamily } from '../utils/fontFamily';
|
|
6
|
+
const StackedBar = ({ segments = [], height = 16, borderRadius = 100, showLabels = true, showValues = true, showDividers, showStartDivider = false, maxSegmentsForDividers = 5, dividerWidth = 2, dividerHeight = 48, dividerColor = '#C0C9E5', dividerBorderWidth = 2, dividerBorderColor = '#FFFFFF', labelGap = 12, labelStyle, valueStyle, style, testID, }) => {
|
|
7
|
+
if (!segments || segments.length === 0)
|
|
8
|
+
return null;
|
|
9
|
+
const totalPercentage = segments.reduce((sum, s) => sum + (s.percentage || 0), 0);
|
|
10
|
+
const hasDividers = showDividers !== undefined
|
|
11
|
+
? showDividers
|
|
12
|
+
: segments.length <= maxSegmentsForDividers;
|
|
13
|
+
const dividerTotalWidth = dividerWidth + dividerBorderWidth * 2;
|
|
14
|
+
const topOffset = hasDividers ? (dividerHeight - height) / 2 : 0;
|
|
15
|
+
const resolvedLabelGap = hasDividers ? Math.max(0, labelGap - topOffset) : labelGap;
|
|
16
|
+
const dividerPositions = [];
|
|
17
|
+
if (hasDividers && showStartDivider) {
|
|
18
|
+
dividerPositions.push(0);
|
|
19
|
+
}
|
|
20
|
+
let cumulative = 0;
|
|
21
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
22
|
+
cumulative += segments[i].percentage || 0;
|
|
23
|
+
if (hasDividers) {
|
|
24
|
+
dividerPositions.push(cumulative);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return (<View style={[styles.container, style]} testID={testID}>
|
|
28
|
+
{showLabels && (<View style={[styles.labelsRow, { marginBottom: resolvedLabelGap }]}>
|
|
29
|
+
{segments.map((seg, i) => (<View key={`label-${i}`} style={{ width: `${seg.percentage || 0}%`, alignItems: 'center' }}>
|
|
30
|
+
<SEText style={[
|
|
31
|
+
styles.label,
|
|
32
|
+
{ color: seg.labelColor || '#687499' },
|
|
33
|
+
labelStyle,
|
|
34
|
+
seg.labelStyle,
|
|
35
|
+
]} numberOfLines={1}>
|
|
36
|
+
{seg.label || ''}
|
|
37
|
+
</SEText>
|
|
38
|
+
</View>))}
|
|
39
|
+
</View>)}
|
|
40
|
+
|
|
41
|
+
<View style={[styles.barWrapper, { height: hasDividers ? dividerHeight : height }]}>
|
|
42
|
+
<View style={[
|
|
43
|
+
styles.barContainer,
|
|
44
|
+
{ height, borderRadius, top: topOffset },
|
|
45
|
+
]}>
|
|
46
|
+
{segments.map((seg, i) => {
|
|
47
|
+
const isFirst = i === 0;
|
|
48
|
+
const pct = seg.percentage || 0;
|
|
49
|
+
const isLast = i === segments.length - 1 && totalPercentage >= 100;
|
|
50
|
+
const isEmpty = pct === 0;
|
|
51
|
+
return (<View key={`seg-${i}`} style={[
|
|
52
|
+
styles.segment,
|
|
53
|
+
{
|
|
54
|
+
width: isEmpty ? '100%' : `${pct}%`,
|
|
55
|
+
height,
|
|
56
|
+
backgroundColor: isEmpty ? '#F0F2F8' : (seg.backgroundColor || '#E3E9FF'),
|
|
57
|
+
},
|
|
58
|
+
isFirst && { borderTopLeftRadius: borderRadius, borderBottomLeftRadius: borderRadius },
|
|
59
|
+
(isLast || isEmpty) && { borderTopRightRadius: borderRadius, borderBottomRightRadius: borderRadius },
|
|
60
|
+
isEmpty && { alignItems: 'flex-start', paddingLeft: 12 },
|
|
61
|
+
seg.style,
|
|
62
|
+
]}>
|
|
63
|
+
{showValues && seg.value !== undefined && seg.value !== null && (<SEText style={[
|
|
64
|
+
styles.value,
|
|
65
|
+
{ color: seg.valueColor || '#1B244B' },
|
|
66
|
+
valueStyle,
|
|
67
|
+
seg.valueStyle,
|
|
68
|
+
]} numberOfLines={1}>
|
|
69
|
+
{seg.value}
|
|
70
|
+
</SEText>)}
|
|
71
|
+
</View>);
|
|
72
|
+
})}
|
|
73
|
+
|
|
74
|
+
{totalPercentage < 100 && totalPercentage > 0 && (<View style={[
|
|
75
|
+
styles.segment,
|
|
76
|
+
{
|
|
77
|
+
width: `${100 - totalPercentage}%`,
|
|
78
|
+
height,
|
|
79
|
+
backgroundColor: '#F0F2F8',
|
|
80
|
+
borderTopRightRadius: borderRadius,
|
|
81
|
+
borderBottomRightRadius: borderRadius,
|
|
82
|
+
},
|
|
83
|
+
]}/>)}
|
|
84
|
+
</View>
|
|
85
|
+
|
|
86
|
+
{dividerPositions.map((pct, i) => (<View key={`div-${i}`} style={[
|
|
87
|
+
styles.divider,
|
|
88
|
+
{
|
|
89
|
+
left: `${pct}%`,
|
|
90
|
+
width: dividerTotalWidth,
|
|
91
|
+
height: dividerHeight,
|
|
92
|
+
backgroundColor: dividerColor,
|
|
93
|
+
borderWidth: dividerBorderWidth,
|
|
94
|
+
borderColor: dividerBorderColor,
|
|
95
|
+
marginLeft: -dividerTotalWidth / 2,
|
|
96
|
+
},
|
|
97
|
+
]}/>))}
|
|
98
|
+
</View>
|
|
99
|
+
</View>);
|
|
100
|
+
};
|
|
101
|
+
StackedBar.propTypes = {
|
|
102
|
+
segments: PropTypes.arrayOf(PropTypes.shape({
|
|
103
|
+
label: PropTypes.string,
|
|
104
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
105
|
+
percentage: PropTypes.number.isRequired,
|
|
106
|
+
backgroundColor: PropTypes.string,
|
|
107
|
+
valueColor: PropTypes.string,
|
|
108
|
+
labelColor: PropTypes.string,
|
|
109
|
+
labelStyle: PropTypes.object,
|
|
110
|
+
valueStyle: PropTypes.object,
|
|
111
|
+
style: PropTypes.object,
|
|
112
|
+
})),
|
|
113
|
+
height: PropTypes.number,
|
|
114
|
+
borderRadius: PropTypes.number,
|
|
115
|
+
showLabels: PropTypes.bool,
|
|
116
|
+
showValues: PropTypes.bool,
|
|
117
|
+
showDividers: PropTypes.bool,
|
|
118
|
+
showStartDivider: PropTypes.bool,
|
|
119
|
+
maxSegmentsForDividers: PropTypes.number,
|
|
120
|
+
dividerWidth: PropTypes.number,
|
|
121
|
+
dividerHeight: PropTypes.number,
|
|
122
|
+
dividerColor: PropTypes.string,
|
|
123
|
+
dividerBorderWidth: PropTypes.number,
|
|
124
|
+
dividerBorderColor: PropTypes.string,
|
|
125
|
+
labelGap: PropTypes.number,
|
|
126
|
+
labelStyle: PropTypes.object,
|
|
127
|
+
valueStyle: PropTypes.object,
|
|
128
|
+
style: PropTypes.object,
|
|
129
|
+
testID: PropTypes.string,
|
|
130
|
+
};
|
|
131
|
+
const styles = StyleSheet.create({
|
|
132
|
+
container: {
|
|
133
|
+
width: '100%',
|
|
134
|
+
},
|
|
135
|
+
labelsRow: {
|
|
136
|
+
flexDirection: 'row',
|
|
137
|
+
},
|
|
138
|
+
barWrapper: {
|
|
139
|
+
width: '100%',
|
|
140
|
+
position: 'relative',
|
|
141
|
+
},
|
|
142
|
+
barContainer: {
|
|
143
|
+
flexDirection: 'row',
|
|
144
|
+
alignItems: 'center',
|
|
145
|
+
width: '100%',
|
|
146
|
+
overflow: 'hidden',
|
|
147
|
+
position: 'absolute',
|
|
148
|
+
left: 0,
|
|
149
|
+
right: 0,
|
|
150
|
+
},
|
|
151
|
+
segment: {
|
|
152
|
+
justifyContent: 'center',
|
|
153
|
+
alignItems: 'center',
|
|
154
|
+
overflow: 'hidden',
|
|
155
|
+
},
|
|
156
|
+
divider: {
|
|
157
|
+
position: 'absolute',
|
|
158
|
+
top: 0,
|
|
159
|
+
zIndex: 2,
|
|
160
|
+
borderRadius: 2,
|
|
161
|
+
},
|
|
162
|
+
label: {
|
|
163
|
+
fontSize: 12,
|
|
164
|
+
lineHeight: 18,
|
|
165
|
+
fontFamily: fontFamily.regular,
|
|
166
|
+
fontWeight: '400',
|
|
167
|
+
color: '#687499',
|
|
168
|
+
textAlign: 'center',
|
|
169
|
+
},
|
|
170
|
+
value: {
|
|
171
|
+
fontSize: 12,
|
|
172
|
+
lineHeight: 16,
|
|
173
|
+
fontFamily: fontFamily.bold,
|
|
174
|
+
fontWeight: '700',
|
|
175
|
+
color: '#1B244B',
|
|
176
|
+
textAlign: 'center',
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
export default StackedBar;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -51,11 +51,13 @@ export { default as ScrollBar } from '../components/ScrollBar';
|
|
|
51
51
|
export { default as Search } from '../components/Search';
|
|
52
52
|
export { default as SegmentedButton } from '../components/SegmentedButton';
|
|
53
53
|
export { default as Select } from '../components/Select';
|
|
54
|
+
export { default as SelectableOption } from '../components/SelectableOption';
|
|
54
55
|
export { default as SelectItem } from '../components/SelectItem';
|
|
55
56
|
export { default as Shortcut } from '../components/Shortcut';
|
|
56
57
|
export { default as ShowMore } from '../components/ShowMore';
|
|
57
58
|
export { default as ShuffleItem } from '../components/ShuffleItem';
|
|
58
59
|
export { default as Slider } from '../components/Slider';
|
|
60
|
+
export { default as StackedBar } from '../components/StackedBar';
|
|
59
61
|
export { default as Tab } from '../components/Tab';
|
|
60
62
|
export { default as Table } from '../components/Table';
|
|
61
63
|
export { default as Tag } from '../components/Tag';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,0BAA0B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E,OAAO,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAMzD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAChE,YAAY,EAAG,MAAM,6BAA6B,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -61,11 +61,13 @@ export { default as ScrollBar } from '../components/ScrollBar';
|
|
|
61
61
|
export { default as Search } from '../components/Search';
|
|
62
62
|
export { default as SegmentedButton } from '../components/SegmentedButton';
|
|
63
63
|
export { default as Select } from '../components/Select';
|
|
64
|
+
export { default as SelectableOption } from '../components/SelectableOption';
|
|
64
65
|
export { default as SelectItem } from '../components/SelectItem';
|
|
65
66
|
export { default as Shortcut } from '../components/Shortcut';
|
|
66
67
|
export { default as ShowMore } from '../components/ShowMore';
|
|
67
68
|
export { default as ShuffleItem } from '../components/ShuffleItem';
|
|
68
69
|
export { default as Slider } from '../components/Slider';
|
|
70
|
+
export { default as StackedBar } from '../components/StackedBar';
|
|
69
71
|
// Componentes T
|
|
70
72
|
export { default as Tab } from '../components/Tab';
|
|
71
73
|
export { default as Table } from '../components/Table';
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -68,11 +68,13 @@ export { default as ScrollBar } from '../components/ScrollBar';
|
|
|
68
68
|
export { default as Search } from '../components/Search';
|
|
69
69
|
export { default as SegmentedButton } from '../components/SegmentedButton';
|
|
70
70
|
export { default as Select } from '../components/Select';
|
|
71
|
+
export { default as SelectableOption } from '../components/SelectableOption';
|
|
71
72
|
export { default as SelectItem } from '../components/SelectItem';
|
|
72
73
|
export { default as Shortcut } from '../components/Shortcut';
|
|
73
74
|
export { default as ShowMore } from '../components/ShowMore';
|
|
74
75
|
export { default as ShuffleItem } from '../components/ShuffleItem';
|
|
75
76
|
export { default as Slider } from '../components/Slider';
|
|
77
|
+
export { default as StackedBar } from '../components/StackedBar';
|
|
76
78
|
|
|
77
79
|
// Componentes T
|
|
78
80
|
export { default as Tab } from '../components/Tab';
|