@hero-design/rn 7.23.0 → 7.25.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/.turbo/turbo-build.log +2 -2
- package/assets/fonts/hero-icons.ttf +0 -0
- package/es/index.js +1364 -9239
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +1368 -9238
- package/package.json +7 -4
- package/rollup.config.js +1 -0
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +4 -4
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/Attachment/StyledAttachment.tsx +44 -0
- package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +158 -0
- package/src/components/Attachment/__tests__/index.spec.tsx +59 -0
- package/src/components/Attachment/index.tsx +77 -0
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Badge/Status.tsx +1 -1
- package/src/components/Badge/StyledBadge.tsx +8 -1
- package/src/components/Badge/__tests__/Badge.spec.tsx +9 -0
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +44 -0
- package/src/components/Badge/index.tsx +1 -1
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/BottomSheet/Header.tsx +2 -1
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +52 -52
- package/src/components/BottomSheet/index.tsx +4 -4
- package/src/components/Button/Button.tsx +0 -11
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +4 -4
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/Button/LoadingIndicator/index.tsx +1 -1
- package/src/components/Button/StyledButton.tsx +24 -63
- package/src/components/Button/UtilityButton/__tests__/index.spec.tsx +2 -2
- package/src/components/Button/__tests__/Button.spec.tsx +10 -5
- package/src/components/Button/__tests__/StyledButton.spec.tsx +0 -70
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +301 -1206
- package/src/components/Calendar/CalendarRowItem.tsx +1 -4
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +5 -5
- package/src/components/Calendar/index.tsx +4 -3
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +1 -1
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Checkbox/StyledCheckbox.tsx +7 -5
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -12
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +95 -42
- package/src/components/Checkbox/index.tsx +4 -2
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/ContentNavigator/index.tsx +14 -9
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +2 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +29 -27
- package/src/components/Drawer/DragableDrawer/index.tsx +0 -2
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Empty/index.tsx +1 -2
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +1 -1
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Icon/HeroIcon/fonts/hero-icons.ttf +0 -0
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -0
- package/src/components/Icon/HeroIcon/index.tsx +3 -7
- package/src/components/Icon/IconList.ts +36 -6
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Icon/index.tsx +1 -0
- package/src/components/List/BasicListItem.tsx +13 -8
- package/src/components/List/ListItem.tsx +8 -6
- package/src/components/List/StyledBasicListItem.tsx +2 -2
- package/src/components/List/StyledListItem.tsx +2 -2
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +24 -36
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +39 -59
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +40 -44
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +50 -50
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
- package/src/components/Progress/ProgressBar.tsx +1 -1
- package/src/components/Progress/ProgressCircle.tsx +1 -1
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +10 -10
- package/src/components/Progress/types.ts +7 -1
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +20 -32
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +30 -48
- package/src/components/RefreshControl/__tests__/index.spec.tsx +1 -3
- package/src/components/RefreshControl/index.tsx +4 -2
- package/src/components/RichTextEditor/MentionList.tsx +12 -3
- package/src/components/RichTextEditor/RichTextEditor.tsx +4 -8
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +6 -4
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +13 -20
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +154 -238
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +435 -650
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +11 -18
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +144 -228
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +414 -629
- package/src/components/Select/StyledOptionList.tsx +0 -1
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
- package/src/components/Spinner/AnimatedSpinner.tsx +22 -7
- package/src/components/Spinner/StyledSpinner.tsx +15 -11
- package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +3 -1
- package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +42 -31
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +12 -8
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +543 -83
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +12 -8
- package/src/components/Spinner/index.tsx +6 -1
- package/src/components/Swipeable/StyledSwipeable.tsx +11 -0
- package/src/components/Swipeable/SwipeableAction.tsx +45 -0
- package/src/components/Swipeable/__tests__/SwipeableAction.spec.tsx +37 -0
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +130 -0
- package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +33 -0
- package/src/components/Swipeable/__tests__/index.spec.tsx +34 -0
- package/src/components/Swipeable/index.tsx +160 -0
- package/src/components/Switch/SelectorSwitch/Option.tsx +1 -5
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +3 -3
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Switch/SelectorSwitch/__tests__/index.spec.tsx +1 -0
- package/src/components/Switch/SelectorSwitch/index.tsx +4 -1
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
- package/src/components/Tabs/StyledTabs.tsx +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +2 -2
- package/src/components/TextInput/StyledTextInput.tsx +7 -12
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +12 -6
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +31 -146
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +40 -14
- package/src/components/TextInput/__tests__/index.spec.tsx +114 -124
- package/src/components/TextInput/index.tsx +8 -6
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +2 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +29 -27
- package/src/components/Toast/Toast.tsx +0 -3
- package/src/components/Toast/ToastProvider.tsx +1 -0
- package/src/components/Toast/__tests__/index.spec.tsx +1 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +4 -4
- package/src/emotion.d.ts +1 -0
- package/src/index.ts +10 -0
- package/src/theme/ThemeSwitcher.tsx +7 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +96 -78
- package/src/theme/__tests__/ensureCompatibleWithV7.spec.tsx +13 -0
- package/src/theme/components/alert.ts +1 -1
- package/src/theme/components/attachment.ts +28 -0
- package/src/theme/components/avatar.ts +1 -1
- package/src/theme/components/badge.ts +2 -1
- package/src/theme/components/bottomNavigation.ts +1 -1
- package/src/theme/components/bottomSheet.ts +2 -2
- package/src/theme/components/button.ts +4 -20
- package/src/theme/components/calendar.ts +3 -3
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/checkbox.ts +2 -2
- package/src/theme/components/divider.ts +1 -1
- package/src/theme/components/drawer.ts +2 -2
- package/src/theme/components/empty.ts +3 -3
- package/src/theme/components/fab.ts +7 -7
- package/src/theme/components/icon.ts +4 -4
- package/src/theme/components/list.ts +0 -2
- package/src/theme/components/pinInput.ts +4 -4
- package/src/theme/components/progress.ts +6 -5
- package/src/theme/components/radio.ts +1 -1
- package/src/theme/components/richTextEditor.ts +2 -2
- package/src/theme/components/slider.ts +2 -2
- package/src/theme/components/spinner.ts +4 -1
- package/src/theme/components/swipeable.ts +13 -0
- package/src/theme/components/switch.ts +4 -4
- package/src/theme/components/tabs.ts +6 -5
- package/src/theme/components/tag.ts +2 -2
- package/src/theme/components/textInput.ts +23 -33
- package/src/theme/components/toast.ts +3 -3
- package/src/theme/components/toolbar.ts +3 -3
- package/src/theme/components/typography.ts +7 -7
- package/src/theme/getTheme.ts +7 -1
- package/src/theme/global/colors/eBens.ts +23 -0
- package/src/theme/global/colors/global.ts +15 -6
- package/src/theme/global/colors/jobs.ts +15 -10
- package/src/theme/global/colors/legacySystemPalette.ts +6 -6
- package/src/theme/global/colors/swag.ts +32 -53
- package/src/theme/global/colors/types.ts +35 -15
- package/src/theme/global/colors/wallet.ts +23 -0
- package/src/theme/global/colors/work.ts +15 -11
- package/src/theme/global/index.ts +4 -0
- package/src/theme/index.ts +4 -0
- package/src/types.ts +2 -0
- package/src/utils/functions.ts +2 -0
- package/src/utils/scale.ts +1 -1
- package/testUtils/setup.tsx +13 -0
- package/tsconfig.json +8 -2
- package/types/components/Accordion/StyledAccordion.d.ts +14 -14
- package/types/components/Alert/StyledAlert.d.ts +15 -15
- package/types/components/Attachment/StyledAttachment.d.ts +28 -0
- package/types/components/Attachment/index.d.ts +37 -0
- package/types/components/Avatar/StyledAvatar.d.ts +15 -15
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/Badge/Status.d.ts +1 -1
- package/types/components/Badge/StyledBadge.d.ts +8 -8
- package/types/components/Badge/index.d.ts +1 -1
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
- package/types/components/BottomSheet/Header.d.ts +1 -1
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +22 -22
- package/types/components/Box/StyledBox.d.ts +4 -4
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
- package/types/components/Button/StyledButton.d.ts +15 -18
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
- package/types/components/Calendar/StyledCalendar.d.ts +25 -25
- package/types/components/Calendar/helpers.d.ts +2 -2
- package/types/components/Card/DataCard/StyledDataCard.d.ts +6 -6
- package/types/components/Card/StyledCard.d.ts +7 -7
- package/types/components/Checkbox/StyledCheckbox.d.ts +16 -10
- package/types/components/Collapse/StyledCollapse.d.ts +8 -8
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
- package/types/components/ContentNavigator/index.d.ts +2 -1
- package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
- package/types/components/Divider/StyledDivider.d.ts +5 -5
- package/types/components/Drawer/StyledDrawer.d.ts +19 -19
- package/types/components/Empty/StyledEmpty.d.ts +9 -9
- package/types/components/Empty/index.d.ts +1 -2
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
- package/types/components/FAB/StyledFAB.d.ts +8 -8
- package/types/components/Icon/HeroIcon/index.d.ts +3 -3
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +4 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/List/StyledBasicListItem.d.ts +16 -16
- package/types/components/List/StyledListItem.d.ts +25 -25
- package/types/components/PinInput/StyledPinInput.d.ts +30 -30
- package/types/components/Progress/ProgressBar.d.ts +1 -1
- package/types/components/Progress/ProgressCircle.d.ts +1 -1
- package/types/components/Progress/StyledProgressBar.d.ts +5 -5
- package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
- package/types/components/Progress/types.d.ts +1 -1
- package/types/components/Radio/StyledRadio.d.ts +9 -9
- package/types/components/RefreshControl/index.d.ts +1 -2
- package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
- package/types/components/RichTextEditor/MentionList.d.ts +1 -1
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
- package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
- package/types/components/RichTextEditor/index.d.ts +2 -2
- package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
- package/types/components/Select/MultiSelect/Option.d.ts +1 -1
- package/types/components/Select/SingleSelect/Option.d.ts +1 -1
- package/types/components/Select/StyledSelect.d.ts +11 -11
- package/types/components/Select/helpers.d.ts +1 -1
- package/types/components/Spinner/AnimatedSpinner.d.ts +2 -1
- package/types/components/Spinner/StyledSpinner.d.ts +13 -12
- package/types/components/Spinner/index.d.ts +5 -1
- package/types/components/Swipeable/StyledSwipeable.d.ts +10 -0
- package/types/components/Swipeable/SwipeableAction.d.ts +27 -0
- package/types/components/Swipeable/index.d.ts +45 -0
- package/types/components/Switch/SelectorSwitch/Option.d.ts +3 -1
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +9 -9
- package/types/components/Switch/StyledSwitch.d.ts +5 -5
- package/types/components/Tabs/StyledScrollableTabs.d.ts +23 -23
- package/types/components/Tabs/StyledTabs.d.ts +22 -22
- package/types/components/Tag/StyledTag.d.ts +6 -6
- package/types/components/TextInput/StyledTextInput.d.ts +46 -45
- package/types/components/TextInput/index.d.ts +6 -6
- package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
- package/types/components/Toast/StyledToast.d.ts +17 -17
- package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
- package/types/components/Typography/Text/StyledText.d.ts +3 -3
- package/types/index.d.ts +4 -2
- package/types/testHelpers/renderWithTheme.d.ts +1 -1
- package/types/theme/ThemeSwitcher.d.ts +2 -2
- package/types/theme/components/attachment.d.ts +21 -0
- package/types/theme/components/badge.d.ts +1 -0
- package/types/theme/components/button.d.ts +0 -15
- package/types/theme/components/list.d.ts +0 -1
- package/types/theme/components/progress.d.ts +1 -0
- package/types/theme/components/spinner.d.ts +4 -1
- package/types/theme/components/swipeable.d.ts +9 -0
- package/types/theme/components/tabs.d.ts +1 -0
- package/types/theme/components/tag.d.ts +2 -2
- package/types/theme/components/textInput.d.ts +0 -10
- package/types/theme/getTheme.d.ts +4 -0
- package/types/theme/global/colors/eBens.d.ts +3 -0
- package/types/theme/global/colors/types.d.ts +23 -16
- package/types/theme/global/colors/wallet.d.ts +3 -0
- package/types/theme/global/index.d.ts +26 -12
- package/types/theme/index.d.ts +2 -2
- package/types/types.d.ts +2 -1
- package/types/utils/functions.d.ts +1 -0
- package/types/utils/hooks.d.ts +1 -1
- package/src/components/Icon/HeroIcon/selection.json +0 -7029
|
@@ -45,7 +45,6 @@ const StyledOptionList = <V, T extends OptionType<V>>({
|
|
|
45
45
|
keyExtractor={keyExtractor}
|
|
46
46
|
onEndReachedThreshold={0.1}
|
|
47
47
|
onEndReached={() => setOnEndReachedCalled(true)}
|
|
48
|
-
onScrollToIndexFailed={() => {}}
|
|
49
48
|
onMomentumScrollBegin={() => {
|
|
50
49
|
if (onEndReached && onEndReachedCalled && !loading) onEndReached();
|
|
51
50
|
setOnEndReachedCalled(false);
|
|
@@ -7,7 +7,13 @@ const AnimatedRow = Animated.createAnimatedComponent(StyledSpinnerRow);
|
|
|
7
7
|
|
|
8
8
|
const AnimatedDot = Animated.createAnimatedComponent(StyledSpinnerDot);
|
|
9
9
|
|
|
10
|
-
const AnimatedSpinner = ({
|
|
10
|
+
const AnimatedSpinner = ({
|
|
11
|
+
size,
|
|
12
|
+
intent,
|
|
13
|
+
}: {
|
|
14
|
+
size: 'small' | 'medium';
|
|
15
|
+
intent: 'primary' | 'inverted';
|
|
16
|
+
}) => {
|
|
11
17
|
const rotateAnimation = useRef<Animated.Value>(new Animated.Value(0));
|
|
12
18
|
|
|
13
19
|
useEffect(() => {
|
|
@@ -32,6 +38,15 @@ const AnimatedSpinner = ({ size = 'medium' }: { size: 'small' | 'medium' }) => {
|
|
|
32
38
|
outputRange: ['0deg', '360deg'],
|
|
33
39
|
});
|
|
34
40
|
|
|
41
|
+
const rowProps = {
|
|
42
|
+
themeSize: size,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const dotProps = {
|
|
46
|
+
themeSize: size,
|
|
47
|
+
themeIntent: intent,
|
|
48
|
+
};
|
|
49
|
+
|
|
35
50
|
return (
|
|
36
51
|
<Animated.View
|
|
37
52
|
style={StyleSheet.flatten([
|
|
@@ -40,13 +55,13 @@ const AnimatedSpinner = ({ size = 'medium' }: { size: 'small' | 'medium' }) => {
|
|
|
40
55
|
},
|
|
41
56
|
])}
|
|
42
57
|
>
|
|
43
|
-
<AnimatedRow themePosition="top"
|
|
44
|
-
<AnimatedDot themePosition="topLeft"
|
|
45
|
-
<AnimatedDot themePosition="topRight"
|
|
58
|
+
<AnimatedRow themePosition="top" {...rowProps}>
|
|
59
|
+
<AnimatedDot themePosition="topLeft" {...dotProps} />
|
|
60
|
+
<AnimatedDot themePosition="topRight" {...dotProps} />
|
|
46
61
|
</AnimatedRow>
|
|
47
|
-
<AnimatedRow themePosition="bottom"
|
|
48
|
-
<AnimatedDot themePosition="bottomLeft"
|
|
49
|
-
<AnimatedDot themePosition="bottomRight"
|
|
62
|
+
<AnimatedRow themePosition="bottom" {...rowProps}>
|
|
63
|
+
<AnimatedDot themePosition="bottomLeft" {...dotProps} />
|
|
64
|
+
<AnimatedDot themePosition="bottomRight" {...dotProps} />
|
|
50
65
|
</AnimatedRow>
|
|
51
66
|
</Animated.View>
|
|
52
67
|
);
|
|
@@ -25,30 +25,34 @@ const StyledSpinnerRow = styled(View)<{
|
|
|
25
25
|
const StyledSpinnerDot = styled(View)<{
|
|
26
26
|
themePosition: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
27
27
|
themeSize: 'small' | 'medium';
|
|
28
|
-
|
|
28
|
+
themeIntent: 'primary' | 'inverted';
|
|
29
|
+
}>(({ themePosition, themeSize, themeIntent, theme }) => {
|
|
29
30
|
const themeStyling = () => {
|
|
31
|
+
const backgroundColor = theme.__hd__.spinner.colors.dot[themeIntent];
|
|
32
|
+
const dotPadding = theme.__hd__.spinner.space.spinnerDotPadding[themeSize];
|
|
33
|
+
|
|
30
34
|
switch (themePosition) {
|
|
31
35
|
case 'topLeft':
|
|
32
36
|
return {
|
|
33
|
-
backgroundColor
|
|
34
|
-
opacity:
|
|
37
|
+
backgroundColor,
|
|
38
|
+
opacity: 0.9,
|
|
35
39
|
};
|
|
36
40
|
case 'topRight':
|
|
37
41
|
return {
|
|
38
|
-
marginLeft:
|
|
39
|
-
backgroundColor
|
|
40
|
-
opacity: 0.
|
|
42
|
+
marginLeft: dotPadding,
|
|
43
|
+
backgroundColor,
|
|
44
|
+
opacity: 0.675,
|
|
41
45
|
};
|
|
42
46
|
case 'bottomLeft':
|
|
43
47
|
return {
|
|
44
|
-
backgroundColor
|
|
45
|
-
opacity: 0.
|
|
48
|
+
backgroundColor,
|
|
49
|
+
opacity: 0.45,
|
|
46
50
|
};
|
|
47
51
|
case 'bottomRight':
|
|
48
52
|
return {
|
|
49
|
-
marginLeft:
|
|
50
|
-
backgroundColor
|
|
51
|
-
opacity: 0.
|
|
53
|
+
marginLeft: dotPadding,
|
|
54
|
+
backgroundColor,
|
|
55
|
+
opacity: 0.225,
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
58
|
};
|
|
@@ -4,7 +4,9 @@ import { AnimatedSpinner } from '../AnimatedSpinner';
|
|
|
4
4
|
|
|
5
5
|
describe('AnimatedSpinner', () => {
|
|
6
6
|
it('renders correctly', () => {
|
|
7
|
-
const { toJSON } = renderWithTheme(
|
|
7
|
+
const { toJSON } = renderWithTheme(
|
|
8
|
+
<AnimatedSpinner size="medium" intent="primary" />
|
|
9
|
+
);
|
|
8
10
|
|
|
9
11
|
expect(toJSON()).toMatchSnapshot();
|
|
10
12
|
});
|
|
@@ -8,25 +8,24 @@ import {
|
|
|
8
8
|
} from '../StyledSpinner';
|
|
9
9
|
|
|
10
10
|
describe('StyledSpinnerContainer', () => {
|
|
11
|
-
it
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</StyledSpinnerContainer>
|
|
26
|
-
);
|
|
11
|
+
it.each`
|
|
12
|
+
intent | size
|
|
13
|
+
${'primary'} | ${'small'}
|
|
14
|
+
${'inverted'} | ${'small'}
|
|
15
|
+
${'primary'} | ${'medium'}
|
|
16
|
+
${'inverted'} | ${'medium'}
|
|
17
|
+
`(
|
|
18
|
+
'renders correctly when intent is $themeIntent, and size is $themeSize',
|
|
19
|
+
({ intent, size }) => {
|
|
20
|
+
const { toJSON } = renderWithTheme(
|
|
21
|
+
<StyledSpinnerContainer>
|
|
22
|
+
<AnimatedSpinner size={size} intent={intent} />
|
|
23
|
+
</StyledSpinnerContainer>
|
|
24
|
+
);
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
expect(toJSON()).toMatchSnapshot();
|
|
27
|
+
}
|
|
28
|
+
);
|
|
30
29
|
});
|
|
31
30
|
|
|
32
31
|
describe('StyledSpinnerRow', () => {
|
|
@@ -48,22 +47,34 @@ describe('StyledSpinnerRow', () => {
|
|
|
48
47
|
);
|
|
49
48
|
});
|
|
50
49
|
|
|
51
|
-
describe('
|
|
50
|
+
describe('StyledSpinnerDot', () => {
|
|
52
51
|
it.each`
|
|
53
|
-
themePosition | themeSize
|
|
54
|
-
${'topLeft'} | ${'small'}
|
|
55
|
-
${'topRight'} | ${'small'}
|
|
56
|
-
${'bottomLeft'} | ${'small'}
|
|
57
|
-
${'bottomRight'} | ${'small'}
|
|
58
|
-
${'topLeft'} | ${'medium'}
|
|
59
|
-
${'topRight'} | ${'medium'}
|
|
60
|
-
${'bottomLeft'} | ${'medium'}
|
|
61
|
-
${'bottomRight'} | ${'medium'}
|
|
52
|
+
themePosition | themeSize | themeIntent
|
|
53
|
+
${'topLeft'} | ${'small'} | ${'primary'}
|
|
54
|
+
${'topRight'} | ${'small'} | ${'primary'}
|
|
55
|
+
${'bottomLeft'} | ${'small'} | ${'primary'}
|
|
56
|
+
${'bottomRight'} | ${'small'} | ${'primary'}
|
|
57
|
+
${'topLeft'} | ${'medium'} | ${'primary'}
|
|
58
|
+
${'topRight'} | ${'medium'} | ${'primary'}
|
|
59
|
+
${'bottomLeft'} | ${'medium'} | ${'primary'}
|
|
60
|
+
${'bottomRight'} | ${'medium'} | ${'primary'}
|
|
61
|
+
${'topLeft'} | ${'small'} | ${'inverted'}
|
|
62
|
+
${'topRight'} | ${'small'} | ${'inverted'}
|
|
63
|
+
${'bottomLeft'} | ${'small'} | ${'inverted'}
|
|
64
|
+
${'bottomRight'} | ${'small'} | ${'inverted'}
|
|
65
|
+
${'topLeft'} | ${'medium'} | ${'inverted'}
|
|
66
|
+
${'topRight'} | ${'medium'} | ${'inverted'}
|
|
67
|
+
${'bottomLeft'} | ${'medium'} | ${'inverted'}
|
|
68
|
+
${'bottomRight'} | ${'medium'} | ${'inverted'}
|
|
62
69
|
`(
|
|
63
|
-
'renders correctly when position is $themePosition, size is $themeSize',
|
|
64
|
-
({ themePosition, themeSize }) => {
|
|
70
|
+
'renders correctly when position is $themePosition, size is $themeSize, intent is $themeIntent',
|
|
71
|
+
({ themePosition, themeSize, themeIntent }) => {
|
|
65
72
|
const { toJSON } = renderWithTheme(
|
|
66
|
-
<StyledSpinnerDot
|
|
73
|
+
<StyledSpinnerDot
|
|
74
|
+
themePosition={themePosition}
|
|
75
|
+
themeSize={themeSize}
|
|
76
|
+
themeIntent={themeIntent}
|
|
77
|
+
/>
|
|
67
78
|
);
|
|
68
79
|
|
|
69
80
|
expect(toJSON()).toMatchSnapshot();
|
|
@@ -35,15 +35,16 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
35
35
|
style={
|
|
36
36
|
Array [
|
|
37
37
|
Object {
|
|
38
|
-
"backgroundColor": "#
|
|
38
|
+
"backgroundColor": "#401960",
|
|
39
39
|
"borderRadius": 999,
|
|
40
40
|
"height": 16,
|
|
41
|
-
"opacity":
|
|
41
|
+
"opacity": 0.9,
|
|
42
42
|
"width": 16,
|
|
43
43
|
},
|
|
44
44
|
Object {},
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
|
+
themeIntent="primary"
|
|
47
48
|
themePosition="topLeft"
|
|
48
49
|
themeSize="medium"
|
|
49
50
|
/>
|
|
@@ -53,16 +54,17 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
53
54
|
style={
|
|
54
55
|
Array [
|
|
55
56
|
Object {
|
|
56
|
-
"backgroundColor": "#
|
|
57
|
+
"backgroundColor": "#401960",
|
|
57
58
|
"borderRadius": 999,
|
|
58
59
|
"height": 16,
|
|
59
60
|
"marginLeft": 8,
|
|
60
|
-
"opacity": 0.
|
|
61
|
+
"opacity": 0.675,
|
|
61
62
|
"width": 16,
|
|
62
63
|
},
|
|
63
64
|
Object {},
|
|
64
65
|
]
|
|
65
66
|
}
|
|
67
|
+
themeIntent="primary"
|
|
66
68
|
themePosition="topRight"
|
|
67
69
|
themeSize="medium"
|
|
68
70
|
/>
|
|
@@ -88,15 +90,16 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
88
90
|
style={
|
|
89
91
|
Array [
|
|
90
92
|
Object {
|
|
91
|
-
"backgroundColor": "#
|
|
93
|
+
"backgroundColor": "#401960",
|
|
92
94
|
"borderRadius": 999,
|
|
93
95
|
"height": 16,
|
|
94
|
-
"opacity": 0.
|
|
96
|
+
"opacity": 0.45,
|
|
95
97
|
"width": 16,
|
|
96
98
|
},
|
|
97
99
|
Object {},
|
|
98
100
|
]
|
|
99
101
|
}
|
|
102
|
+
themeIntent="primary"
|
|
100
103
|
themePosition="bottomLeft"
|
|
101
104
|
themeSize="medium"
|
|
102
105
|
/>
|
|
@@ -106,16 +109,17 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
106
109
|
style={
|
|
107
110
|
Array [
|
|
108
111
|
Object {
|
|
109
|
-
"backgroundColor": "#
|
|
112
|
+
"backgroundColor": "#401960",
|
|
110
113
|
"borderRadius": 999,
|
|
111
114
|
"height": 16,
|
|
112
115
|
"marginLeft": 8,
|
|
113
|
-
"opacity": 0.
|
|
116
|
+
"opacity": 0.225,
|
|
114
117
|
"width": 16,
|
|
115
118
|
},
|
|
116
119
|
Object {},
|
|
117
120
|
]
|
|
118
121
|
}
|
|
122
|
+
themeIntent="primary"
|
|
119
123
|
themePosition="bottomRight"
|
|
120
124
|
themeSize="medium"
|
|
121
125
|
/>
|