@hero-design/rn 7.18.0 → 7.19.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/es/index.js +155 -143
- package/lib/index.js +155 -143
- package/package.json +2 -2
- package/src/components/Accordion/AccordionItem.tsx +5 -4
- package/src/components/Accordion/__tests__/index.spec.tsx +2 -1
- package/src/components/Accordion/index.tsx +3 -2
- package/src/components/Alert/StyledAlert.tsx +3 -2
- package/src/components/Alert/index.tsx +5 -3
- package/src/components/Avatar/index.tsx +2 -2
- package/src/components/Badge/Status.tsx +4 -2
- package/src/components/Badge/index.tsx +2 -1
- package/src/components/BottomNavigation/__tests__/index.spec.tsx +4 -2
- package/src/components/BottomNavigation/index.tsx +6 -8
- package/src/components/BottomSheet/Footer.tsx +2 -1
- package/src/components/BottomSheet/Header.tsx +2 -1
- package/src/components/BottomSheet/StyledBottomSheet.tsx +2 -2
- package/src/components/BottomSheet/index.tsx +4 -8
- package/src/components/Button/Button.tsx +5 -6
- package/src/components/Button/IconButton.tsx +4 -7
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +5 -3
- package/src/components/Button/LoadingIndicator/index.tsx +2 -8
- package/src/components/Button/StyledButton.tsx +4 -5
- package/src/components/Button/UtilityButton/index.tsx +5 -4
- package/src/components/Button/index.tsx +3 -2
- package/src/components/Calendar/StyledCalendar.tsx +2 -1
- package/src/components/Card/DataCard/index.tsx +3 -2
- package/src/components/Card/index.tsx +3 -2
- package/src/components/Checkbox/StyledCheckbox.tsx +44 -14
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +28 -3
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +95 -9
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +337 -23
- package/src/components/Checkbox/__tests__/index.spec.tsx +38 -7
- package/src/components/Checkbox/index.tsx +35 -18
- package/src/components/Collapse/index.tsx +4 -8
- package/src/components/ContentNavigator/index.tsx +1 -1
- package/src/components/DatePicker/DatePickerAndroid.tsx +1 -1
- package/src/components/DatePicker/DatePickerIOS.tsx +1 -1
- package/src/components/DatePicker/StyledDatePicker.tsx +2 -1
- package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +1 -2
- package/src/components/DatePicker/index.tsx +1 -1
- package/src/components/DatePicker/types.ts +1 -1
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Drawer/DragableDrawer/index.tsx +3 -2
- package/src/components/Drawer/StyledDrawer.tsx +3 -2
- package/src/components/Drawer/index.tsx +2 -1
- package/src/components/Empty/index.tsx +1 -2
- package/src/components/FAB/ActionGroup/ActionItem.tsx +3 -2
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +4 -3
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +4 -2
- package/src/components/FAB/ActionGroup/index.tsx +5 -3
- package/src/components/FAB/AnimatedFABIcon.tsx +1 -1
- package/src/components/FAB/FAB.tsx +2 -2
- package/src/components/FAB/StyledFAB.tsx +4 -7
- package/src/components/Icon/AnimatedIcon.tsx +2 -1
- package/src/components/Icon/index.tsx +1 -1
- package/src/components/List/BasicListItem.tsx +3 -3
- package/src/components/List/ListItem.tsx +6 -3
- package/src/components/List/StyledListItem.tsx +2 -1
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +13 -27
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -0
- package/src/components/PinInput/PinCell.tsx +1 -1
- package/src/components/PinInput/index.tsx +3 -7
- package/src/components/Progress/ProgressBar.tsx +2 -1
- package/src/components/Progress/ProgressCircle.tsx +3 -9
- package/src/components/Progress/StyledProgressBar.tsx +3 -3
- package/src/components/Progress/StyledProgressCircle.tsx +3 -3
- package/src/components/Radio/Radio.tsx +20 -14
- package/src/components/Radio/RadioGroup.tsx +5 -3
- package/src/components/Radio/StyledRadio.tsx +12 -29
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +84 -50
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +124 -73
- package/src/components/RichTextEditor/EditorToolbar.tsx +4 -8
- package/src/components/RichTextEditor/RichTextEditor.tsx +5 -14
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +2 -6
- package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +2 -6
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -7
- package/src/components/RichTextEditor/index.tsx +6 -6
- package/src/components/SectionHeading/index.tsx +5 -4
- package/src/components/Select/MultiSelect/Option.tsx +2 -1
- package/src/components/Select/MultiSelect/OptionList.tsx +3 -3
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +605 -585
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +1 -1
- package/src/components/Select/MultiSelect/index.tsx +20 -16
- package/src/components/Select/SingleSelect/Option.tsx +2 -1
- package/src/components/Select/SingleSelect/OptionList.tsx +3 -3
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +602 -582
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +1 -1
- package/src/components/Select/SingleSelect/index.tsx +20 -16
- package/src/components/Select/StyledOptionList.tsx +11 -9
- package/src/components/Select/helpers.tsx +1 -1
- package/src/components/Select/index.tsx +6 -4
- package/src/components/Select/types.ts +3 -3
- package/src/components/Spinner/StyledSpinner.tsx +2 -1
- package/src/components/Spinner/index.tsx +3 -3
- package/src/components/Switch/StyledSwitch.tsx +10 -26
- package/src/components/Switch/__tests__/StyledSwitch.spec.tsx +25 -0
- package/src/components/Switch/__tests__/__snapshots__/{StyledHeading.spec.tsx.snap → StyledSwitch.spec.tsx.snap} +45 -18
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +26 -52
- package/src/components/Switch/index.tsx +23 -20
- package/src/components/Tabs/ScrollableTabs.tsx +1 -1
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +4 -2
- package/src/components/Tabs/__tests__/index.spec.tsx +4 -2
- package/src/components/Tabs/index.tsx +7 -13
- package/src/components/Tag/index.tsx +1 -1
- package/src/components/TextInput/index.tsx +5 -5
- package/src/components/TimePicker/StyledTimePicker.tsx +2 -1
- package/src/components/TimePicker/TimePickerAndroid.tsx +1 -1
- package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
- package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +1 -2
- package/src/components/TimePicker/index.tsx +1 -1
- package/src/components/TimePicker/types.ts +1 -1
- package/src/components/Toast/StyledToast.tsx +3 -8
- package/src/components/Toast/Toast.tsx +3 -2
- package/src/components/Toast/ToastContainer.tsx +2 -2
- package/src/components/Toast/ToastContext.ts +1 -1
- package/src/components/Toast/ToastProvider.tsx +5 -7
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +1 -1
- package/src/components/Toast/types.ts +3 -3
- package/src/components/Toolbar/StyledToolbar.tsx +2 -1
- package/src/components/Toolbar/ToolbarGroup.tsx +2 -1
- package/src/components/Toolbar/ToolbarItem.tsx +2 -1
- package/src/components/Toolbar/index.tsx +2 -1
- package/src/components/Typography/Text/index.tsx +3 -2
- package/src/testHelpers/renderWithTheme.tsx +2 -1
- package/src/theme/ThemeProvider.ts +1 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +24 -26
- package/src/theme/components/accordion.ts +1 -1
- package/src/theme/components/alert.ts +1 -1
- package/src/theme/components/avatar.ts +1 -1
- package/src/theme/components/badge.ts +1 -1
- package/src/theme/components/bottomNavigation.ts +1 -1
- package/src/theme/components/bottomSheet.ts +1 -1
- package/src/theme/components/button.ts +1 -1
- package/src/theme/components/calendar.ts +1 -1
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/checkbox.ts +12 -8
- package/src/theme/components/contentNavigator.ts +1 -1
- package/src/theme/components/divider.ts +1 -1
- package/src/theme/components/drawer.ts +1 -1
- package/src/theme/components/empty.ts +1 -1
- package/src/theme/components/fab.ts +1 -1
- package/src/theme/components/icon.ts +1 -1
- package/src/theme/components/list.ts +5 -4
- package/src/theme/components/pinInput.ts +1 -1
- package/src/theme/components/progress.ts +1 -1
- package/src/theme/components/radio.ts +3 -11
- package/src/theme/components/richTextEditor.ts +1 -1
- package/src/theme/components/sectionHeading.ts +1 -1
- package/src/theme/components/select.ts +1 -1
- package/src/theme/components/spinner.ts +1 -1
- package/src/theme/components/switch.ts +7 -8
- package/src/theme/components/tabs.ts +1 -1
- package/src/theme/components/tag.ts +1 -1
- package/src/theme/components/textInput.ts +1 -1
- package/src/theme/components/toast.ts +1 -1
- package/src/theme/components/toolbar.ts +1 -1
- package/src/theme/components/typography.ts +1 -1
- package/src/theme/getTheme.ts +4 -11
- package/src/theme/global/borders.ts +2 -1
- package/src/theme/global/colors/swag.ts +2 -3
- package/src/theme/global/colors/work.ts +1 -2
- package/src/theme/global/index.ts +6 -11
- package/src/theme/global/scale.ts +2 -1
- package/src/theme/global/space.ts +2 -1
- package/src/theme/global/typography.ts +2 -8
- package/src/theme/index.ts +5 -2
- package/src/types.ts +9 -10
- package/testUtils/setup.tsx +2 -0
- package/tsconfig.json +4 -9
- package/types/components/Accordion/AccordionItem.d.ts +3 -3
- package/types/components/Accordion/index.d.ts +3 -2
- package/types/components/Alert/StyledAlert.d.ts +2 -1
- package/types/components/Alert/index.d.ts +3 -3
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/Badge/Status.d.ts +2 -2
- package/types/components/Badge/index.d.ts +2 -1
- package/types/components/BottomNavigation/index.d.ts +3 -3
- package/types/components/BottomSheet/Footer.d.ts +1 -1
- package/types/components/BottomSheet/Header.d.ts +1 -1
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +2 -1
- package/types/components/BottomSheet/index.d.ts +2 -2
- package/types/components/Button/Button.d.ts +4 -4
- package/types/components/Button/IconButton.d.ts +2 -2
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +3 -2
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +3 -2
- package/types/components/Button/UtilityButton/index.d.ts +3 -3
- package/types/components/Button/index.d.ts +2 -2
- package/types/components/Calendar/StyledCalendar.d.ts +2 -1
- package/types/components/Card/DataCard/index.d.ts +2 -2
- package/types/components/Card/index.d.ts +2 -2
- package/types/components/Checkbox/StyledCheckbox.d.ts +21 -3
- package/types/components/Checkbox/index.d.ts +11 -3
- package/types/components/Collapse/index.d.ts +2 -2
- package/types/components/ContentNavigator/index.d.ts +1 -1
- package/types/components/DatePicker/DatePickerAndroid.d.ts +1 -1
- package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
- package/types/components/DatePicker/StyledDatePicker.d.ts +2 -1
- package/types/components/DatePicker/index.d.ts +1 -1
- package/types/components/DatePicker/types.d.ts +1 -1
- package/types/components/Divider/index.d.ts +1 -1
- package/types/components/Drawer/DragableDrawer/index.d.ts +1 -1
- package/types/components/Drawer/StyledDrawer.d.ts +2 -1
- package/types/components/Drawer/index.d.ts +1 -1
- package/types/components/Empty/index.d.ts +1 -1
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +2 -2
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +3 -2
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +3 -2
- package/types/components/FAB/ActionGroup/index.d.ts +3 -3
- package/types/components/FAB/AnimatedFABIcon.d.ts +1 -1
- package/types/components/FAB/FAB.d.ts +2 -2
- package/types/components/FAB/StyledFAB.d.ts +3 -2
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/List/BasicListItem.d.ts +2 -2
- package/types/components/List/ListItem.d.ts +4 -3
- package/types/components/PinInput/PinCell.d.ts +1 -1
- package/types/components/PinInput/index.d.ts +2 -2
- 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 +3 -2
- package/types/components/Progress/StyledProgressCircle.d.ts +3 -2
- package/types/components/Radio/Radio.d.ts +2 -2
- package/types/components/Radio/RadioGroup.d.ts +3 -3
- package/types/components/Radio/StyledRadio.d.ts +2 -12
- package/types/components/RichTextEditor/RichTextEditor.d.ts +3 -2
- package/types/components/RichTextEditor/index.d.ts +3 -2
- package/types/components/SectionHeading/index.d.ts +3 -3
- package/types/components/Select/MultiSelect/Option.d.ts +1 -1
- package/types/components/Select/MultiSelect/OptionList.d.ts +2 -2
- package/types/components/Select/MultiSelect/index.d.ts +1 -1
- package/types/components/Select/SingleSelect/Option.d.ts +1 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +2 -2
- package/types/components/Select/SingleSelect/index.d.ts +1 -1
- package/types/components/Select/StyledOptionList.d.ts +4 -4
- package/types/components/Select/helpers.d.ts +1 -1
- package/types/components/Select/index.d.ts +4 -3
- package/types/components/Select/types.d.ts +3 -3
- package/types/components/Spinner/StyledSpinner.d.ts +2 -1
- package/types/components/Spinner/index.d.ts +2 -2
- package/types/components/Switch/StyledSwitch.d.ts +3 -18
- package/types/components/{Radio/__tests__/StyledRadio.spec.d.ts → Switch/__tests__/StyledSwitch.spec.d.ts} +0 -0
- package/types/components/Switch/index.d.ts +3 -2
- package/types/components/Tabs/ScrollableTabs.d.ts +1 -1
- package/types/components/Tabs/index.d.ts +3 -3
- package/types/components/Tag/index.d.ts +1 -1
- package/types/components/TextInput/index.d.ts +3 -3
- package/types/components/TimePicker/StyledTimePicker.d.ts +2 -1
- package/types/components/TimePicker/TimePickerAndroid.d.ts +1 -1
- package/types/components/TimePicker/TimePickerIOS.d.ts +1 -1
- package/types/components/TimePicker/index.d.ts +1 -1
- package/types/components/TimePicker/types.d.ts +1 -1
- package/types/components/Toast/StyledToast.d.ts +2 -1
- package/types/components/Toast/Toast.d.ts +1 -1
- package/types/components/Toast/ToastContainer.d.ts +2 -2
- package/types/components/Toast/ToastContext.d.ts +1 -1
- package/types/components/Toast/ToastProvider.d.ts +2 -2
- package/types/components/Toast/types.d.ts +3 -3
- package/types/components/Toolbar/StyledToolbar.d.ts +2 -1
- package/types/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/components/Toolbar/index.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +2 -2
- package/types/testHelpers/renderWithTheme.d.ts +1 -1
- package/types/theme/ThemeProvider.d.ts +1 -1
- package/types/theme/components/accordion.d.ts +1 -1
- package/types/theme/components/alert.d.ts +1 -1
- package/types/theme/components/avatar.d.ts +1 -1
- package/types/theme/components/badge.d.ts +1 -1
- package/types/theme/components/bottomNavigation.d.ts +1 -1
- package/types/theme/components/bottomSheet.d.ts +1 -1
- package/types/theme/components/button.d.ts +1 -1
- package/types/theme/components/calendar.d.ts +1 -1
- package/types/theme/components/card.d.ts +1 -1
- package/types/theme/components/checkbox.d.ts +10 -7
- package/types/theme/components/contentNavigator.d.ts +1 -1
- package/types/theme/components/divider.d.ts +1 -1
- package/types/theme/components/drawer.d.ts +1 -1
- package/types/theme/components/empty.d.ts +1 -1
- package/types/theme/components/fab.d.ts +1 -1
- package/types/theme/components/icon.d.ts +1 -1
- package/types/theme/components/list.d.ts +8 -7
- package/types/theme/components/pinInput.d.ts +1 -1
- package/types/theme/components/progress.d.ts +1 -1
- package/types/theme/components/radio.d.ts +1 -8
- package/types/theme/components/richTextEditor.d.ts +1 -1
- package/types/theme/components/sectionHeading.d.ts +1 -1
- package/types/theme/components/select.d.ts +1 -1
- package/types/theme/components/spinner.d.ts +1 -1
- package/types/theme/components/switch.d.ts +7 -6
- package/types/theme/components/tabs.d.ts +1 -1
- package/types/theme/components/tag.d.ts +1 -1
- package/types/theme/components/textInput.d.ts +1 -1
- package/types/theme/components/toast.d.ts +1 -1
- package/types/theme/components/toolbar.d.ts +1 -1
- package/types/theme/components/typography.d.ts +1 -1
- package/types/theme/getTheme.d.ts +2 -2
- package/types/theme/global/borders.d.ts +2 -1
- package/types/theme/global/colors/swag.d.ts +1 -1
- package/types/theme/global/colors/work.d.ts +1 -1
- package/types/theme/global/index.d.ts +5 -3
- package/types/theme/global/scale.d.ts +2 -1
- package/types/theme/global/space.d.ts +2 -1
- package/types/theme/global/typography.d.ts +2 -1
- package/types/theme/index.d.ts +4 -2
- package/types/types.d.ts +9 -8
- package/src/components/Radio/__tests__/StyledRadio.spec.tsx +0 -43
- package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +0 -124
- package/src/components/Switch/__tests__/StyledHeading.spec.tsx +0 -42
- package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +0 -1
package/src/theme/getTheme.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GlobalTheme,
|
|
3
|
-
Scale,
|
|
4
|
-
SystemPalette,
|
|
5
|
-
getGlobalTheme,
|
|
6
|
-
defaultScale,
|
|
7
|
-
swagSystemPalette,
|
|
8
|
-
} from './global';
|
|
1
|
+
import { getGlobalTheme, defaultScale, swagSystemPalette } from './global';
|
|
9
2
|
|
|
10
3
|
import getAccordionTheme from './components/accordion';
|
|
11
4
|
import getAlertTheme from './components/alert';
|
|
@@ -40,6 +33,7 @@ import getTimePickerTheme from './components/timePicker';
|
|
|
40
33
|
import getToastTheme from './components/toast';
|
|
41
34
|
import getToolbarTheme from './components/toolbar';
|
|
42
35
|
import getTypographyTheme from './components/typography';
|
|
36
|
+
import type { GlobalTheme, Scale, SystemPalette } from './global';
|
|
43
37
|
|
|
44
38
|
type Theme = GlobalTheme & {
|
|
45
39
|
__hd__: {
|
|
@@ -123,7 +117,6 @@ const getTheme = (
|
|
|
123
117
|
},
|
|
124
118
|
};
|
|
125
119
|
};
|
|
126
|
-
|
|
127
|
-
export { Theme };
|
|
128
|
-
|
|
129
120
|
export default getTheme;
|
|
121
|
+
|
|
122
|
+
export type { Theme };
|
|
@@ -2,15 +2,14 @@ import {
|
|
|
2
2
|
defaultMobilePalette as palette,
|
|
3
3
|
swagPalette,
|
|
4
4
|
} from '@hero-design/colors';
|
|
5
|
-
|
|
6
|
-
import { SystemPalette } from './types';
|
|
5
|
+
import type { SystemPalette } from './types';
|
|
7
6
|
|
|
8
7
|
const swagSystemPalette: SystemPalette = {
|
|
9
8
|
globalPrimary: palette.maasstrichtBlue,
|
|
10
9
|
globalPrimaryLight: palette.maasstrichtBlueLight50,
|
|
11
10
|
globalPrimaryBackground: palette.maasstrichtBlueLight90,
|
|
12
11
|
primary: swagPalette.violet,
|
|
13
|
-
primaryLight: swagPalette.violetLight50,
|
|
12
|
+
primaryLight: swagPalette.violetLight50,
|
|
14
13
|
primaryDark: swagPalette.scarletGumLight30, // DEPRECATED
|
|
15
14
|
primaryBackground: swagPalette.violetLight90,
|
|
16
15
|
primaryBackgroundDark: palette.maasstrichtBlueLight30,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { scale as defaultScale
|
|
2
|
-
import { SystemPalette } from './colors/types';
|
|
1
|
+
import { scale as defaultScale } from './scale';
|
|
3
2
|
import swagSystemPalette from './colors/swag';
|
|
4
3
|
import workSystemPalette from './colors/work';
|
|
5
4
|
|
|
6
5
|
import { getFonts, getFontSizes, getLineHeights } from './typography';
|
|
7
6
|
import { getSpace } from './space';
|
|
8
7
|
import { getBorderWidths, getRadii } from './borders';
|
|
8
|
+
import type { Scale } from './scale';
|
|
9
|
+
import type { SystemPalette } from './colors/types';
|
|
9
10
|
|
|
10
11
|
const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
11
12
|
const fonts = getFonts(scale.font);
|
|
@@ -30,12 +31,6 @@ const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
30
31
|
|
|
31
32
|
type GlobalTheme = ReturnType<typeof getGlobalTheme>;
|
|
32
33
|
|
|
33
|
-
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
SystemPalette,
|
|
37
|
-
getGlobalTheme,
|
|
38
|
-
defaultScale,
|
|
39
|
-
swagSystemPalette,
|
|
40
|
-
workSystemPalette,
|
|
41
|
-
};
|
|
34
|
+
export type { GlobalTheme, Scale, SystemPalette };
|
|
35
|
+
|
|
36
|
+
export { getGlobalTheme, defaultScale, swagSystemPalette, workSystemPalette };
|
|
@@ -69,11 +69,5 @@ const getLineHeights = (fontSizes: FontSizes): LineHeights => {
|
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export {
|
|
73
|
-
|
|
74
|
-
FontSizes,
|
|
75
|
-
LineHeights,
|
|
76
|
-
getFonts,
|
|
77
|
-
getFontSizes,
|
|
78
|
-
getLineHeights,
|
|
79
|
-
};
|
|
72
|
+
export { getFonts, getFontSizes, getLineHeights };
|
|
73
|
+
export type { Fonts, FontSizes, LineHeights };
|
package/src/theme/index.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import getTheme
|
|
1
|
+
import getTheme from './getTheme';
|
|
2
2
|
import ThemeProvider, { useTheme } from './ThemeProvider';
|
|
3
3
|
import ThemeSwitcher from './ThemeSwitcher';
|
|
4
4
|
import { swagSystemPalette, workSystemPalette } from './global';
|
|
5
5
|
|
|
6
|
+
import type { Theme } from './getTheme';
|
|
7
|
+
|
|
6
8
|
const defaultTheme = getTheme();
|
|
7
9
|
|
|
10
|
+
export type { Theme };
|
|
11
|
+
|
|
8
12
|
export {
|
|
9
|
-
Theme,
|
|
10
13
|
getTheme,
|
|
11
14
|
ThemeProvider,
|
|
12
15
|
ThemeSwitcher,
|
package/src/types.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { ToolbarButtonName } from './components/RichTextEditor';
|
|
2
|
+
import type { BottomNavigationTabType } from './components/BottomNavigation';
|
|
3
|
+
import type { IconName } from './components/Icon';
|
|
4
|
+
import type { SingleSelectProps, MultiSelectProps } from './components/Select';
|
|
5
|
+
import type { TabType } from './components/Tabs';
|
|
6
|
+
import type { TextInputProps } from './components/TextInput';
|
|
7
|
+
import type {
|
|
7
8
|
RichTextEditorRef,
|
|
8
9
|
RichTextEditorProps,
|
|
9
|
-
ToolbarButtonName,
|
|
10
10
|
} from './components/RichTextEditor';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import type { Theme } from './theme';
|
|
12
|
+
import type {
|
|
14
13
|
ListRenderOptionInfo,
|
|
15
14
|
SectionListRenderOptionInfo,
|
|
16
15
|
} from './components/Select/types';
|
package/testUtils/setup.tsx
CHANGED
package/tsconfig.json
CHANGED
|
@@ -13,15 +13,10 @@
|
|
|
13
13
|
"noImplicitThis": true,
|
|
14
14
|
"noUnusedLocals": true,
|
|
15
15
|
"skipLibCheck": true,
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
]
|
|
16
|
+
"isolatedModules": true,
|
|
17
|
+
"types": ["jest"]
|
|
19
18
|
},
|
|
20
|
-
"include": [
|
|
21
|
-
|
|
22
|
-
],
|
|
23
|
-
"exclude": [
|
|
24
|
-
"node_modules"
|
|
25
|
-
],
|
|
19
|
+
"include": ["src"],
|
|
20
|
+
"exclude": ["node_modules"],
|
|
26
21
|
"extends": "expo/tsconfig.base"
|
|
27
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { Variant } from './StyledAccordion';
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { Variant } from './StyledAccordion';
|
|
4
4
|
export declare type AccordionItemProps = {
|
|
5
5
|
header: string | ReactElement;
|
|
6
6
|
content: ReactElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Key, ReactElement } from 'react';
|
|
3
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
export interface AccordionProps<K extends Key> {
|
|
4
5
|
/**
|
|
5
6
|
* List of accordion items to be rendered. Each item must have an unique key.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TouchableOpacity, View
|
|
1
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
2
3
|
declare const Container: import("@emotion/native").StyledComponent<ViewProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
5
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { IconName } from '../Icon';
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { IconName } from '../Icon';
|
|
4
4
|
interface AlertProps {
|
|
5
5
|
/**
|
|
6
6
|
* Alert title.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageSourcePropType, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
1
|
+
import type { ImageSourcePropType, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
2
|
interface AvatarProps extends ViewProps {
|
|
3
3
|
/** Callback function when pressing component. */
|
|
4
4
|
onPress?: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
3
|
export interface StatusProps extends ViewProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Animated
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
interface BadgeProps extends React.ComponentProps<typeof Animated.View> {
|
|
4
5
|
/**
|
|
5
6
|
* Content of the Badge.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
|
-
import { IconName } from '../Icon';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
|
+
import type { IconName } from '../Icon';
|
|
4
4
|
export declare type BottomNavigationTabType = {
|
|
5
5
|
key: string;
|
|
6
6
|
title?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Animated, SafeAreaView, View
|
|
1
|
+
import { Animated, SafeAreaView, View } from 'react-native';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
2
3
|
declare const StyledWrapper: import("@emotion/native").StyledComponent<ViewProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
5
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
interface BottomSheetProps {
|
|
4
4
|
/**
|
|
5
5
|
* Bottom sheet open state.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactChild } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { IconName } from '../Icon';
|
|
4
|
-
import { Intent, ThemeVariant } from './StyledButton';
|
|
1
|
+
import type { ReactChild } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { IconName } from '../Icon';
|
|
4
|
+
import type { Intent, ThemeVariant } from './StyledButton';
|
|
5
5
|
export interface ButtonProps {
|
|
6
6
|
/**
|
|
7
7
|
* Helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle, TouchableOpacityProps } from 'react-native';
|
|
2
|
-
import { IconProps, IconName } from '../Icon';
|
|
1
|
+
import type { StyleProp, ViewStyle, TouchableOpacityProps } from 'react-native';
|
|
2
|
+
import type { IconProps, IconName } from '../Icon';
|
|
3
3
|
export interface IconButtonProps {
|
|
4
4
|
/**
|
|
5
5
|
* Set how far you can touch from the button.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { View
|
|
2
|
-
import {
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { Theme } from '@emotion/react';
|
|
3
4
|
declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger' | 'text-primary' | 'text-secondary' | 'text-danger';
|
|
4
5
|
declare const StyledLoadingIndicatorWrapper: import("@emotion/native").StyledComponent<ViewProps & {
|
|
5
6
|
theme?: Theme | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
1
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
2
2
|
declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger' | 'text-primary' | 'text-secondary' | 'text-danger';
|
|
3
3
|
interface LoadingIndicatorProps extends ViewProps {
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TouchableHighlight, View } from 'react-native';
|
|
2
|
-
import { Theme } from '@emotion/react';
|
|
2
|
+
import type { Theme } from '@emotion/react';
|
|
3
3
|
declare type Intent = 'primary' | 'secondary' | 'danger';
|
|
4
4
|
declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger' | 'text-primary' | 'text-secondary' | 'text-danger';
|
|
5
5
|
declare const StyledButtonContainer: import("@emotion/native").StyledComponent<import("react-native").TouchableHighlightProps & {
|
|
@@ -36,4 +36,5 @@ declare const StyledButtonIcon: import("@emotion/native").StyledComponent<import
|
|
|
36
36
|
pressed?: boolean | undefined;
|
|
37
37
|
themeVariant: ThemeVariant;
|
|
38
38
|
}, {}, {}>;
|
|
39
|
-
export { StyledButtonContainer, StyledButtonText, StyledButtonIconWrapper, StyledButtonIcon,
|
|
39
|
+
export { StyledButtonContainer, StyledButtonText, StyledButtonIconWrapper, StyledButtonIcon, };
|
|
40
|
+
export type { Intent, ThemeVariant };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactChild } from 'react';
|
|
2
|
-
import { ViewProps } from 'react-native';
|
|
3
|
-
import { IconName } from '../../Icon';
|
|
1
|
+
import type { ReactChild } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { IconName } from '../../Icon';
|
|
4
4
|
export interface UtilityButtonProps extends ViewProps {
|
|
5
5
|
/**
|
|
6
6
|
* Places an icon within the button, before the button's text
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ButtonProps } from './Button';
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
3
2
|
import IconButton from './IconButton';
|
|
4
3
|
import UtilityButton from './UtilityButton';
|
|
4
|
+
import type { ButtonProps } from './Button';
|
|
5
5
|
interface CompoundButtonProps extends FunctionComponent<ButtonProps> {
|
|
6
6
|
Icon: typeof IconButton;
|
|
7
7
|
Utility: typeof UtilityButton;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TouchableOpacity, View
|
|
1
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
2
3
|
declare const StyledContainer: import("@emotion/native").StyledComponent<ViewProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
5
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
3
|
export interface DataCardProps extends ViewProps {
|
|
4
4
|
/**
|
|
5
5
|
* Card's content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
3
|
interface CardProps extends ViewProps {
|
|
4
4
|
/**
|
|
5
5
|
* Card's content.
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
import { TouchableOpacity } from 'react-native';
|
|
2
|
-
declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
|
|
1
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
2
|
+
export declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
themeWithBorder: boolean;
|
|
7
|
+
themeDisabled: boolean;
|
|
5
8
|
}, {}, {
|
|
6
9
|
ref?: import("react").Ref<TouchableOpacity> | undefined;
|
|
7
10
|
}>;
|
|
8
|
-
export
|
|
11
|
+
export declare const StyledDescription: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
export declare const StyledCheckbox: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
as?: import("react").ElementType<any> | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
themeDisabled: boolean;
|
|
20
|
+
}, {}, {
|
|
21
|
+
ref?: import("react").Ref<View> | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const StyledCheckMark: import("@emotion/native").StyledComponent<import("../Icon").IconProps & {
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
as?: import("react").ElementType<any> | undefined;
|
|
26
|
+
}, {}, {}>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
export interface CheckboxProps {
|
|
3
3
|
/**
|
|
4
4
|
* Control whether the switch is checked
|
|
5
5
|
*/
|
|
6
6
|
checked?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Checkbox's description.
|
|
9
|
+
*/
|
|
10
|
+
description?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the border is shown.
|
|
13
|
+
*/
|
|
14
|
+
withBorder?: boolean;
|
|
7
15
|
/**
|
|
8
16
|
* Whether the switch is disabled
|
|
9
17
|
*/
|
|
@@ -21,5 +29,5 @@ export interface CheckboxProps {
|
|
|
21
29
|
*/
|
|
22
30
|
testID?: string;
|
|
23
31
|
}
|
|
24
|
-
declare const
|
|
25
|
-
export default
|
|
32
|
+
declare const Checkbox: ({ checked, description, withBorder, disabled, onPress, style, testID, }: CheckboxProps) => JSX.Element;
|
|
33
|
+
export default Checkbox;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
3
|
export interface CollapseProps extends ViewProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DatePickerProps } from './types';
|
|
1
|
+
import type { DatePickerProps } from './types';
|
|
2
2
|
declare const DatePickerAndroid: ({ value, label, placeholder, onChange, displayFormat, disabled, required, error, helpText, style, testID, }: DatePickerProps) => JSX.Element;
|
|
3
3
|
export default DatePickerAndroid;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DatePickerProps } from './types';
|
|
1
|
+
import type { DatePickerProps } from './types';
|
|
2
2
|
declare const DatePickerIOS: ({ value, label, placeholder, onChange, confirmLabel, displayFormat, disabled, required, error, helpText, style, testID, }: DatePickerProps) => JSX.Element;
|
|
3
3
|
export default DatePickerIOS;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
2
3
|
declare const StyledPickerWrapper: import("@emotion/native").StyledComponent<ViewProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
5
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Animated, View
|
|
1
|
+
import { Animated, View } from 'react-native';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
2
3
|
declare const StyledContainer: import("@emotion/native").StyledComponent<ViewProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
5
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import Icon from '../../Icon';
|
|
4
4
|
export interface ActionItemProps {
|
|
5
5
|
testID?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Animated, View
|
|
2
|
-
import {
|
|
1
|
+
import { Animated, View } from 'react-native';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { TextProps } from '../../Typography/Text';
|
|
3
4
|
declare const StyledContainer: import("@emotion/native").StyledComponent<ViewProps & {
|
|
4
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TouchableOpacity
|
|
2
|
-
import {
|
|
1
|
+
import { TouchableOpacity } from 'react-native';
|
|
2
|
+
import type { TouchableOpacityProps } from 'react-native';
|
|
3
|
+
import type { IconProps } from '../../Icon';
|
|
3
4
|
declare const StyledActionItem: import("@emotion/native").StyledComponent<TouchableOpacityProps & {
|
|
4
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import { IconName } from '../../Icon';
|
|
3
|
-
import { ActionItemProps } from './ActionItem';
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import type { IconName } from '../../Icon';
|
|
3
|
+
import type { ActionItemProps } from './ActionItem';
|
|
4
4
|
export interface ActionGroupProps {
|
|
5
5
|
/**
|
|
6
6
|
* Title of the action group header.
|