@hero-design/rn 7.20.0 → 7.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -0
- package/.turbo/turbo-build.log +2 -2
- package/es/index.js +410 -285
- package/lib/index.js +410 -282
- package/package.json +4 -2
- package/rollup.config.js +1 -0
- package/src/components/BottomSheet/index.tsx +6 -1
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -4
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +13 -13
- package/src/components/Empty/StyledEmpty.tsx +1 -9
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +58 -5
- package/src/components/Empty/__tests__/index.spec.tsx +13 -0
- package/src/components/Empty/index.tsx +38 -18
- package/src/components/Image/__tests__/__snapshots__/index.spec.tsx.snap +81 -0
- package/src/components/Image/__tests__/index.spec.tsx +29 -0
- package/src/components/Image/index.tsx +46 -0
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +5 -5
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +60 -60
- package/src/components/RichTextEditor/EditorToolbar.tsx +19 -18
- package/src/components/RichTextEditor/RichTextEditor.tsx +7 -2
- package/src/components/RichTextEditor/StyledRichTextEditor.ts +0 -2
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +7 -4
- package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +2 -2
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +4 -12
- package/src/components/RichTextEditor/constants.ts +0 -11
- package/src/components/RichTextEditor/index.tsx +0 -3
- package/src/components/RichTextEditor/types.ts +9 -0
- package/src/components/Select/MultiSelect/OptionList.tsx +4 -6
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +21 -0
- package/src/components/Select/MultiSelect/index.tsx +33 -3
- package/src/components/Select/SingleSelect/OptionList.tsx +4 -5
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +16 -0
- package/src/components/Select/SingleSelect/index.tsx +34 -4
- package/src/components/Select/StyledOptionList.tsx +3 -9
- package/src/components/Slider/__tests__/__snapshots__/index.spec.tsx.snap +43 -0
- package/src/components/Slider/__tests__/index.spec.tsx +33 -0
- package/src/components/Slider/index.tsx +89 -0
- package/src/components/Switch/StyledSwitch.tsx +4 -4
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +10 -10
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +8 -8
- package/src/components/Switch/index.tsx +5 -4
- package/src/components/TextInput/index.tsx +43 -37
- package/src/index.ts +4 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +56 -11
- package/src/theme/components/alert.ts +1 -2
- package/src/theme/components/avatar.ts +8 -8
- package/src/theme/components/badge.ts +4 -4
- package/src/theme/components/bottomNavigation.ts +1 -1
- package/src/theme/components/bottomSheet.ts +2 -3
- package/src/theme/components/calendar.ts +9 -7
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/checkbox.ts +2 -5
- package/src/theme/components/datePicker.ts +3 -3
- package/src/theme/components/drawer.ts +2 -3
- package/src/theme/components/empty.ts +3 -8
- package/src/theme/components/fab.ts +2 -2
- package/src/theme/components/image.ts +12 -0
- package/src/theme/components/pinInput.ts +3 -3
- package/src/theme/components/progress.ts +2 -3
- package/src/theme/components/radio.ts +7 -3
- package/src/theme/components/richTextEditor.ts +4 -4
- package/src/theme/components/slider.ts +13 -0
- package/src/theme/components/switch.ts +16 -1
- package/src/theme/components/tabs.ts +1 -1
- package/src/theme/components/timePicker.ts +3 -3
- package/src/theme/components/toast.ts +1 -2
- package/src/theme/getTheme.ts +9 -2
- package/src/theme/global/colors/swag.ts +2 -0
- package/src/theme/global/colors/types.ts +2 -0
- package/src/theme/global/index.ts +3 -0
- package/src/theme/global/scale.ts +3 -0
- package/src/theme/global/sizes.ts +29 -0
- package/src/types.ts +0 -2
- package/testUtils/setup.tsx +14 -0
- package/types/components/BottomSheet/index.d.ts +5 -1
- package/types/components/Empty/StyledEmpty.d.ts +1 -7
- package/types/components/Empty/index.d.ts +8 -2
- package/types/components/Image/__tests__/index.spec.d.ts +1 -0
- package/types/components/Image/index.d.ts +17 -0
- package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
- package/types/components/RichTextEditor/RichTextEditor.d.ts +4 -0
- package/types/components/RichTextEditor/constants.d.ts +0 -10
- package/types/components/RichTextEditor/index.d.ts +0 -2
- package/types/components/RichTextEditor/types.d.ts +1 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +5 -2
- package/types/components/Select/MultiSelect/index.d.ts +7 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +5 -2
- package/types/components/Select/SingleSelect/index.d.ts +8 -2
- package/types/components/Select/StyledOptionList.d.ts +4 -3
- package/types/components/Select/index.d.ts +1 -1
- package/types/components/Slider/__tests__/index.spec.d.ts +1 -0
- package/types/components/Slider/index.d.ts +52 -0
- package/types/components/TextInput/index.d.ts +2 -1
- package/types/index.d.ts +3 -1
- package/types/theme/components/datePicker.d.ts +2 -1
- package/types/theme/components/empty.d.ts +2 -5
- package/types/theme/components/image.d.ts +8 -0
- package/types/theme/components/slider.d.ts +9 -0
- package/types/theme/components/switch.d.ts +14 -1
- package/types/theme/components/timePicker.d.ts +2 -1
- package/types/theme/getTheme.d.ts +4 -0
- package/types/theme/global/colors/types.d.ts +2 -0
- package/types/theme/global/index.d.ts +3 -0
- package/types/theme/global/scale.d.ts +1 -0
- package/types/theme/global/sizes.d.ts +14 -0
- package/types/types.d.ts +1 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
3
|
import type {
|
|
4
4
|
TextInputProps as NativeTextInputProps,
|
|
5
5
|
StyleProp,
|
|
@@ -92,6 +92,10 @@ export interface TextInputProps extends NativeTextInputProps {
|
|
|
92
92
|
* The helper text to display.
|
|
93
93
|
*/
|
|
94
94
|
helpText?: string;
|
|
95
|
+
/*
|
|
96
|
+
* Customise input value renderer
|
|
97
|
+
*/
|
|
98
|
+
renderInputValue?: (inputProps: NativeTextInputProps) => React.ReactNode;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
export const getVariant = ({
|
|
@@ -144,9 +148,9 @@ const TextInput = ({
|
|
|
144
148
|
helpText,
|
|
145
149
|
value,
|
|
146
150
|
defaultValue,
|
|
151
|
+
renderInputValue,
|
|
147
152
|
...nativeProps
|
|
148
153
|
}: TextInputProps): JSX.Element => {
|
|
149
|
-
const textInputReference = useRef<RNTextInput | null>(null);
|
|
150
154
|
const displayText = (value !== undefined ? value : defaultValue) ?? '';
|
|
151
155
|
const isEmptyValue = displayText.length === 0;
|
|
152
156
|
const actualSuffix = loading ? 'loading' : suffix;
|
|
@@ -165,6 +169,37 @@ const TextInput = ({
|
|
|
165
169
|
const shouldShowMaxLength = maxLength !== undefined;
|
|
166
170
|
|
|
167
171
|
const theme = useTheme();
|
|
172
|
+
|
|
173
|
+
const nativeInputProps: NativeTextInputProps = {
|
|
174
|
+
style: StyleSheet.flatten([
|
|
175
|
+
{ color: theme.__hd__.textInput.colors.text },
|
|
176
|
+
textStyle,
|
|
177
|
+
]),
|
|
178
|
+
testID: 'text-input',
|
|
179
|
+
accessibilityState: {
|
|
180
|
+
disabled: variant === 'disabled' || variant === 'readonly',
|
|
181
|
+
},
|
|
182
|
+
// @ts-ignore
|
|
183
|
+
accessibilityLabelledBy,
|
|
184
|
+
...nativeProps,
|
|
185
|
+
onFocus: event => {
|
|
186
|
+
setIsFocused(true);
|
|
187
|
+
nativeProps.onFocus?.(event);
|
|
188
|
+
},
|
|
189
|
+
onBlur: event => {
|
|
190
|
+
setIsFocused(false);
|
|
191
|
+
nativeProps.onBlur?.(event);
|
|
192
|
+
},
|
|
193
|
+
editable,
|
|
194
|
+
maxLength,
|
|
195
|
+
value,
|
|
196
|
+
onChangeText: text => {
|
|
197
|
+
nativeProps.onChangeText?.(text);
|
|
198
|
+
},
|
|
199
|
+
defaultValue,
|
|
200
|
+
placeholder: variant === 'focused' ? nativeProps.placeholder : undefined,
|
|
201
|
+
};
|
|
202
|
+
|
|
168
203
|
return (
|
|
169
204
|
<StyledContainer
|
|
170
205
|
style={style}
|
|
@@ -224,40 +259,11 @@ const TextInput = ({
|
|
|
224
259
|
)}
|
|
225
260
|
</StyledLabelContainerInsideTextInput>
|
|
226
261
|
)}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
textStyle,
|
|
233
|
-
])}
|
|
234
|
-
testID="text-input"
|
|
235
|
-
accessibilityState={{
|
|
236
|
-
disabled: variant === 'disabled' || variant === 'readonly',
|
|
237
|
-
}}
|
|
238
|
-
// @ts-ignore
|
|
239
|
-
accessibilityLabelledBy={accessibilityLabelledBy}
|
|
240
|
-
{...nativeProps}
|
|
241
|
-
onFocus={event => {
|
|
242
|
-
setIsFocused(true);
|
|
243
|
-
nativeProps.onFocus?.(event);
|
|
244
|
-
}}
|
|
245
|
-
onBlur={event => {
|
|
246
|
-
setIsFocused(false);
|
|
247
|
-
nativeProps.onBlur?.(event);
|
|
248
|
-
}}
|
|
249
|
-
ref={textInputReference}
|
|
250
|
-
editable={editable}
|
|
251
|
-
maxLength={maxLength}
|
|
252
|
-
value={value}
|
|
253
|
-
onChangeText={text => {
|
|
254
|
-
nativeProps.onChangeText?.(text);
|
|
255
|
-
}}
|
|
256
|
-
defaultValue={defaultValue}
|
|
257
|
-
placeholder={
|
|
258
|
-
variant === 'focused' ? nativeProps.placeholder : undefined
|
|
259
|
-
}
|
|
260
|
-
/>
|
|
262
|
+
{renderInputValue ? (
|
|
263
|
+
renderInputValue(nativeInputProps)
|
|
264
|
+
) : (
|
|
265
|
+
<StyledTextInput {...nativeInputProps} />
|
|
266
|
+
)}
|
|
261
267
|
</StyledTextInputAndLabelContainer>
|
|
262
268
|
{typeof actualSuffix === 'string' ? (
|
|
263
269
|
<Icon
|
package/src/index.ts
CHANGED
|
@@ -26,9 +26,11 @@ import Drawer from './components/Drawer';
|
|
|
26
26
|
import Empty from './components/Empty';
|
|
27
27
|
import FAB from './components/FAB';
|
|
28
28
|
import Icon from './components/Icon';
|
|
29
|
+
import Image from './components/Image';
|
|
29
30
|
import List from './components/List';
|
|
30
31
|
import PinInput from './components/PinInput';
|
|
31
32
|
import Progress from './components/Progress';
|
|
33
|
+
import Slider from './components/Slider';
|
|
32
34
|
import Spinner from './components/Spinner';
|
|
33
35
|
import Radio from './components/Radio';
|
|
34
36
|
import SectionHeading from './components/SectionHeading';
|
|
@@ -70,9 +72,11 @@ export {
|
|
|
70
72
|
Empty,
|
|
71
73
|
FAB,
|
|
72
74
|
Icon,
|
|
75
|
+
Image,
|
|
73
76
|
List,
|
|
74
77
|
PinInput,
|
|
75
78
|
Progress,
|
|
79
|
+
Slider,
|
|
76
80
|
Spinner,
|
|
77
81
|
Radio,
|
|
78
82
|
SectionHeading,
|
|
@@ -262,11 +262,11 @@ Object {
|
|
|
262
262
|
"wrapper": 8,
|
|
263
263
|
},
|
|
264
264
|
"sizes": Object {
|
|
265
|
-
"icon":
|
|
265
|
+
"icon": 24,
|
|
266
266
|
},
|
|
267
267
|
"space": Object {
|
|
268
268
|
"iconDescriptionPadding": 12,
|
|
269
|
-
"iconTop":
|
|
269
|
+
"iconTop": 0,
|
|
270
270
|
"wrapperPadding": 16,
|
|
271
271
|
},
|
|
272
272
|
},
|
|
@@ -338,14 +338,11 @@ Object {
|
|
|
338
338
|
"description": "BeVietnamPro-Light",
|
|
339
339
|
"title": "BeVietnamPro-SemiBold",
|
|
340
340
|
},
|
|
341
|
-
"radii": Object {
|
|
342
|
-
"illustration": 999,
|
|
343
|
-
},
|
|
344
341
|
"sizes": Object {
|
|
345
|
-
"
|
|
342
|
+
"image": 168,
|
|
346
343
|
},
|
|
347
344
|
"space": Object {
|
|
348
|
-
"
|
|
345
|
+
"imageMargin": 24,
|
|
349
346
|
"titleMargin": 16,
|
|
350
347
|
"wrapperPadding": 16,
|
|
351
348
|
},
|
|
@@ -419,6 +416,12 @@ Object {
|
|
|
419
416
|
"xsmall": 16,
|
|
420
417
|
},
|
|
421
418
|
},
|
|
419
|
+
"image": Object {
|
|
420
|
+
"sizes": Object {
|
|
421
|
+
"15xlarge": 144,
|
|
422
|
+
"6xlarge": 72,
|
|
423
|
+
},
|
|
424
|
+
},
|
|
422
425
|
"list": Object {
|
|
423
426
|
"colors": Object {
|
|
424
427
|
"checkedListItemContainerBackground": "#f3e6f6",
|
|
@@ -507,7 +510,7 @@ Object {
|
|
|
507
510
|
},
|
|
508
511
|
"sizes": Object {
|
|
509
512
|
"barHeight": 4,
|
|
510
|
-
"circleWidth":
|
|
513
|
+
"circleWidth": 72,
|
|
511
514
|
},
|
|
512
515
|
},
|
|
513
516
|
"radio": Object {
|
|
@@ -539,10 +542,10 @@ Object {
|
|
|
539
542
|
"editor": 14,
|
|
540
543
|
},
|
|
541
544
|
"sizes": Object {
|
|
542
|
-
"editorMinHeight":
|
|
545
|
+
"editorMinHeight": 24,
|
|
543
546
|
"toolbarButtonSize": 48,
|
|
544
547
|
"toolbarSeparatorHeight": 16,
|
|
545
|
-
"toolbarSeparatorWidth":
|
|
548
|
+
"toolbarSeparatorWidth": 2,
|
|
546
549
|
},
|
|
547
550
|
"space": Object {
|
|
548
551
|
"editorPadding": 16,
|
|
@@ -578,6 +581,13 @@ Object {
|
|
|
578
581
|
"sectionSpacing": 12,
|
|
579
582
|
},
|
|
580
583
|
},
|
|
584
|
+
"slider": Object {
|
|
585
|
+
"colors": Object {
|
|
586
|
+
"maximumTrackTint": "#ece8ef",
|
|
587
|
+
"minimumTrackTint": "#401960",
|
|
588
|
+
"thumbTint": "#e6e9e9",
|
|
589
|
+
},
|
|
590
|
+
},
|
|
581
591
|
"spinner": Object {
|
|
582
592
|
"colors": Object {
|
|
583
593
|
"dot1": "#795e90",
|
|
@@ -620,8 +630,21 @@ Object {
|
|
|
620
630
|
"radii": Object {
|
|
621
631
|
"rounded": 999,
|
|
622
632
|
},
|
|
633
|
+
"sizes": Object {
|
|
634
|
+
"heights": Object {
|
|
635
|
+
"medium": 32,
|
|
636
|
+
"small": 24,
|
|
637
|
+
},
|
|
638
|
+
"thumbs": Object {
|
|
639
|
+
"medium": 24,
|
|
640
|
+
"small": 16,
|
|
641
|
+
},
|
|
642
|
+
"widths": Object {
|
|
643
|
+
"medium": 64,
|
|
644
|
+
"small": 48,
|
|
645
|
+
},
|
|
646
|
+
},
|
|
623
647
|
"spaces": Object {
|
|
624
|
-
"inactive": 0,
|
|
625
648
|
"medium": 4,
|
|
626
649
|
"small": 4,
|
|
627
650
|
},
|
|
@@ -888,6 +911,8 @@ Object {
|
|
|
888
911
|
"__alpha__globalNeutral3": "#f6f6f7",
|
|
889
912
|
"__alpha__globalPrimary": "#001f23",
|
|
890
913
|
"__alpha__globalSecondary1": "#4d6265",
|
|
914
|
+
"__alpha__globalSecondary4": "#e6e9e9",
|
|
915
|
+
"__alpha__primary1": "#401960",
|
|
891
916
|
"__alpha__primary2": "#c38cee",
|
|
892
917
|
"__alpha__secondary1": "#795e90",
|
|
893
918
|
"__alpha__secondary2": "#a08cb0",
|
|
@@ -971,6 +996,26 @@ Object {
|
|
|
971
996
|
"rounded": 999,
|
|
972
997
|
"xlarge": 16,
|
|
973
998
|
},
|
|
999
|
+
"sizes": Object {
|
|
1000
|
+
"14xlarge": 136,
|
|
1001
|
+
"15xlarge": 144,
|
|
1002
|
+
"18xlarge": 168,
|
|
1003
|
+
"19xlarge": 176,
|
|
1004
|
+
"6xlarge": 72,
|
|
1005
|
+
"7xlarge": 80,
|
|
1006
|
+
"9xlarge": 96,
|
|
1007
|
+
"large": 24,
|
|
1008
|
+
"medium": 16,
|
|
1009
|
+
"small": 8,
|
|
1010
|
+
"smallMedium": 12,
|
|
1011
|
+
"xlarge": 32,
|
|
1012
|
+
"xsmall": 4,
|
|
1013
|
+
"xxlarge": 40,
|
|
1014
|
+
"xxsmall": 2,
|
|
1015
|
+
"xxxlarge": 48,
|
|
1016
|
+
"xxxxlarge": 56,
|
|
1017
|
+
"xxxxxlarge": 64,
|
|
1018
|
+
},
|
|
974
1019
|
"space": Object {
|
|
975
1020
|
"large": 24,
|
|
976
1021
|
"medium": 16,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getAlertTheme = (theme: GlobalTheme) => {
|
|
@@ -12,7 +11,7 @@ const getAlertTheme = (theme: GlobalTheme) => {
|
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
const sizes = {
|
|
15
|
-
height:
|
|
14
|
+
height: theme.sizes.xxxlarge,
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
const space = {
|
|
@@ -10,14 +10,14 @@ const getAvatarTheme = (theme: GlobalTheme) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const sizes = {
|
|
13
|
-
small: theme.
|
|
14
|
-
medium: theme.
|
|
15
|
-
large: theme.
|
|
16
|
-
xlarge: theme.
|
|
17
|
-
xxlarge: theme.
|
|
18
|
-
xxxlarge: theme.
|
|
19
|
-
xxxxlarge: theme.
|
|
20
|
-
xxxxxlarge: theme.
|
|
13
|
+
small: theme.sizes.xlarge,
|
|
14
|
+
medium: theme.sizes.xxlarge,
|
|
15
|
+
large: theme.sizes.xxxlarge,
|
|
16
|
+
xlarge: theme.sizes.xxxxlarge,
|
|
17
|
+
xxlarge: theme.sizes.xxxxxlarge,
|
|
18
|
+
xxxlarge: theme.sizes['7xlarge'],
|
|
19
|
+
xxxxlarge: theme.sizes['9xlarge'],
|
|
20
|
+
xxxxxlarge: theme.sizes['14xlarge'],
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const fontSizes = {
|
|
@@ -19,10 +19,10 @@ const getBadgeTheme = (theme: GlobalTheme) => {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const sizes = {
|
|
22
|
-
height: theme.fontSizes.small + theme.
|
|
23
|
-
minWidth: theme.fontSizes.small + theme.
|
|
24
|
-
statusHeight: theme.
|
|
25
|
-
statusWidth: theme.
|
|
22
|
+
height: theme.fontSizes.small + theme.sizes.small,
|
|
23
|
+
minWidth: theme.fontSizes.small + theme.sizes.small,
|
|
24
|
+
statusHeight: theme.sizes.small,
|
|
25
|
+
statusWidth: theme.sizes.small,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const space = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getBottomSheetTheme = (theme: GlobalTheme) => {
|
|
@@ -9,8 +8,8 @@ const getBottomSheetTheme = (theme: GlobalTheme) => {
|
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
const sizes = {
|
|
12
|
-
sectionHeight:
|
|
13
|
-
closeIcon:
|
|
11
|
+
sectionHeight: theme.sizes.xxxxxlarge,
|
|
12
|
+
closeIcon: theme.sizes.xxxlarge,
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
const space = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getCalendarTheme = (theme: GlobalTheme) => {
|
|
@@ -9,13 +8,16 @@ const getCalendarTheme = (theme: GlobalTheme) => {
|
|
|
9
8
|
inverted: theme.colors.invertedText,
|
|
10
9
|
};
|
|
11
10
|
|
|
11
|
+
const cellSize = theme.sizes.xxxlarge;
|
|
12
|
+
const markSize = theme.sizes.xsmall;
|
|
13
|
+
|
|
12
14
|
const sizes = {
|
|
13
|
-
cellWidth:
|
|
14
|
-
cellHeight:
|
|
15
|
-
cellCircleWidth:
|
|
16
|
-
cellCircleHeight:
|
|
17
|
-
markWidth:
|
|
18
|
-
markHeight:
|
|
15
|
+
cellWidth: cellSize,
|
|
16
|
+
cellHeight: cellSize,
|
|
17
|
+
cellCircleWidth: cellSize - markSize,
|
|
18
|
+
cellCircleHeight: cellSize - markSize,
|
|
19
|
+
markWidth: markSize,
|
|
20
|
+
markHeight: markSize,
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
const space = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { GlobalTheme } from '../global';
|
|
2
|
-
import { scale } from '../../utils/scale';
|
|
3
2
|
|
|
4
3
|
const getCheckboxTheme = (theme: GlobalTheme) => {
|
|
5
4
|
const colors = {
|
|
@@ -8,15 +7,13 @@ const getCheckboxTheme = (theme: GlobalTheme) => {
|
|
|
8
7
|
};
|
|
9
8
|
|
|
10
9
|
const space = {
|
|
11
|
-
|
|
12
|
-
// and also to center the check mark
|
|
13
|
-
iconTop: -scale(3),
|
|
10
|
+
iconTop: 0,
|
|
14
11
|
wrapperPadding: theme.space.medium,
|
|
15
12
|
iconDescriptionPadding: theme.space.smallMedium,
|
|
16
13
|
};
|
|
17
14
|
|
|
18
15
|
const sizes = {
|
|
19
|
-
icon:
|
|
16
|
+
icon: theme.sizes.large,
|
|
20
17
|
};
|
|
21
18
|
|
|
22
19
|
const radii = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
|
-
const getDatePickerTheme = () => {
|
|
3
|
+
const getDatePickerTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const sizes = {
|
|
5
|
-
height:
|
|
5
|
+
height: theme.sizes['19xlarge'],
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
return { sizes };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getDrawerTheme = (theme: GlobalTheme) => {
|
|
@@ -19,8 +18,8 @@ const getDrawerTheme = (theme: GlobalTheme) => {
|
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
const sizes = {
|
|
22
|
-
handlerWidth:
|
|
23
|
-
handlerHeight:
|
|
21
|
+
handlerWidth: theme.sizes.xxxxlarge,
|
|
22
|
+
handlerHeight: theme.sizes.xsmall,
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
const shadows = {
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getEmptyTheme = (theme: GlobalTheme) => {
|
|
5
4
|
const space = {
|
|
6
5
|
titleMargin: theme.space.medium,
|
|
7
|
-
|
|
6
|
+
imageMargin: theme.space.large,
|
|
8
7
|
wrapperPadding: theme.space.medium,
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
const sizes = {
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const radii = {
|
|
16
|
-
illustration: theme.radii.rounded,
|
|
11
|
+
image: theme.sizes['18xlarge'],
|
|
17
12
|
};
|
|
18
13
|
|
|
19
14
|
const colors = {
|
|
@@ -33,7 +28,7 @@ const getEmptyTheme = (theme: GlobalTheme) => {
|
|
|
33
28
|
description: theme.fonts.light,
|
|
34
29
|
};
|
|
35
30
|
|
|
36
|
-
return { fontSizes, colors, sizes, space, fonts
|
|
31
|
+
return { fontSizes, colors, sizes, space, fonts };
|
|
37
32
|
};
|
|
38
33
|
|
|
39
34
|
export default getEmptyTheme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
|
+
|
|
3
|
+
const getImageTheme = (theme: GlobalTheme) => {
|
|
4
|
+
const sizes = {
|
|
5
|
+
'6xlarge': theme.sizes['6xlarge'],
|
|
6
|
+
'15xlarge': theme.sizes['15xlarge'],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
return { sizes };
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default getImageTheme;
|
|
@@ -24,9 +24,9 @@ const getPinInputTheme = (theme: GlobalTheme) => {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const sizes = {
|
|
27
|
-
cellWidth: theme.
|
|
28
|
-
cellHeight: theme.
|
|
29
|
-
mask: theme.
|
|
27
|
+
cellWidth: theme.sizes.xxlarge,
|
|
28
|
+
cellHeight: theme.sizes.xxxlarge,
|
|
29
|
+
mask: theme.sizes.medium,
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
const space = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getProgressTheme = (theme: GlobalTheme) => {
|
|
@@ -13,8 +12,8 @@ const getProgressTheme = (theme: GlobalTheme) => {
|
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
const sizes = {
|
|
16
|
-
circleWidth:
|
|
17
|
-
barHeight:
|
|
15
|
+
circleWidth: theme.sizes['6xlarge'],
|
|
16
|
+
barHeight: theme.sizes.xsmall,
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
const radii = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getRadioTheme = (theme: GlobalTheme) => {
|
|
@@ -11,9 +10,14 @@ const getRadioTheme = (theme: GlobalTheme) => {
|
|
|
11
10
|
groupTopMargin: theme.space.xsmall,
|
|
12
11
|
};
|
|
13
12
|
|
|
13
|
+
const boundingBoxSize = theme.sizes.large;
|
|
14
|
+
const innerPadding = theme.space.xsmall;
|
|
15
|
+
const circle = boundingBoxSize - innerPadding;
|
|
16
|
+
const innerCircle = circle / 2;
|
|
17
|
+
|
|
14
18
|
const sizes = {
|
|
15
|
-
circle
|
|
16
|
-
innerCircle
|
|
19
|
+
circle,
|
|
20
|
+
innerCircle,
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
const borderWidths = {
|
|
@@ -12,10 +12,10 @@ const getRichTextEditorTheme = (theme: GlobalTheme) => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const sizes = {
|
|
15
|
-
editorMinHeight:
|
|
16
|
-
toolbarButtonSize: theme.
|
|
17
|
-
toolbarSeparatorWidth:
|
|
18
|
-
toolbarSeparatorHeight: theme.
|
|
15
|
+
editorMinHeight: theme.sizes.large,
|
|
16
|
+
toolbarButtonSize: theme.sizes.xxxlarge,
|
|
17
|
+
toolbarSeparatorWidth: theme.sizes.xxsmall,
|
|
18
|
+
toolbarSeparatorHeight: theme.sizes.medium,
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const fontSizes = {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
|
+
|
|
3
|
+
const getSliderTheme = (theme: GlobalTheme) => {
|
|
4
|
+
const colors = {
|
|
5
|
+
minimumTrackTint: theme.colors.__alpha__primary1,
|
|
6
|
+
thumbTint: theme.colors.__alpha__globalSecondary4,
|
|
7
|
+
maximumTrackTint: theme.colors.__alpha__secondary4,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return { colors };
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default getSliderTheme;
|
|
@@ -26,10 +26,24 @@ const getSwitchTheme = (theme: GlobalTheme) => {
|
|
|
26
26
|
medium: theme.space.large * 1.2,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
const sizes = {
|
|
30
|
+
thumbs: {
|
|
31
|
+
small: theme.sizes.medium,
|
|
32
|
+
medium: theme.sizes.large,
|
|
33
|
+
},
|
|
34
|
+
widths: {
|
|
35
|
+
small: theme.sizes.xxxlarge,
|
|
36
|
+
medium: theme.sizes.xxxxxlarge,
|
|
37
|
+
},
|
|
38
|
+
heights: {
|
|
39
|
+
small: theme.sizes.large,
|
|
40
|
+
medium: theme.sizes.xlarge,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
29
44
|
const spaces = {
|
|
30
45
|
small: theme.space.xsmall,
|
|
31
46
|
medium: theme.space.xsmall,
|
|
32
|
-
inactive: 0,
|
|
33
47
|
};
|
|
34
48
|
|
|
35
49
|
const radii = {
|
|
@@ -38,6 +52,7 @@ const getSwitchTheme = (theme: GlobalTheme) => {
|
|
|
38
52
|
|
|
39
53
|
return {
|
|
40
54
|
colors,
|
|
55
|
+
sizes,
|
|
41
56
|
thumbSizes,
|
|
42
57
|
widths,
|
|
43
58
|
heights,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
|
-
const getTimePickerTheme = () => {
|
|
3
|
+
const getTimePickerTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const sizes = {
|
|
5
|
-
height:
|
|
5
|
+
height: theme.sizes['19xlarge'],
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
return { sizes };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scale } from '../../utils/scale';
|
|
2
1
|
import type { GlobalTheme } from '../global';
|
|
3
2
|
|
|
4
3
|
const getToastTheme = (theme: GlobalTheme) => {
|
|
@@ -14,7 +13,7 @@ const getToastTheme = (theme: GlobalTheme) => {
|
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
const sizes = {
|
|
17
|
-
height:
|
|
16
|
+
height: theme.sizes.xxxlarge,
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
const space = {
|