@utilitywarehouse/hearth-react-native 0.3.0 → 0.4.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/.storybook/preview.tsx +3 -0
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +3 -1
- package/CHANGELOG.md +22 -0
- package/build/components/Alert/AlertCloseButton.js +25 -3
- package/build/components/Alert/AlertIcon.js +17 -1
- package/build/components/Alert/AlertIconButton.js +27 -1
- package/build/components/Alert/AlertLink.js +47 -1
- package/build/components/Alert/AlertText.d.ts +1 -1
- package/build/components/Alert/AlertText.js +26 -2
- package/build/components/Alert/AlertTitle.d.ts +1 -1
- package/build/components/Alert/AlertTitle.js +26 -2
- package/build/components/Badge/BadgeIcon.js +72 -0
- package/build/components/Badge/BadgeText.js +72 -0
- package/build/components/Button/ButtonRoot.js +1 -0
- package/build/components/Checkbox/Checkbox.d.ts +2 -2
- package/build/components/Checkbox/Checkbox.js +11 -10
- package/build/components/Checkbox/Checkbox.props.d.ts +3 -1
- package/build/components/Checkbox/CheckboxIcon.js +1 -1
- package/build/components/Checkbox/CheckboxImage.d.ts +6 -0
- package/build/components/Checkbox/CheckboxImage.js +5 -0
- package/build/components/Checkbox/CheckboxTileRoot.js +1 -1
- package/build/components/Checkbox/index.d.ts +3 -2
- package/build/components/Checkbox/index.js +2 -1
- package/build/components/CurrencyInput/CurrencyInput.js +1 -1
- package/build/components/DatePicker/DatePicker.context.d.ts +19 -0
- package/build/components/DatePicker/DatePicker.context.js +3 -0
- package/build/components/DatePicker/DatePicker.d.ts +19 -0
- package/build/components/DatePicker/DatePicker.js +479 -0
- package/build/components/DatePicker/DatePicker.props.d.ts +125 -0
- package/build/components/DatePicker/DatePicker.props.js +1 -0
- package/build/components/DatePicker/DatePickerCalendar.d.ts +2 -0
- package/build/components/DatePicker/DatePickerCalendar.js +28 -0
- package/build/components/DatePicker/DatePickerDay.d.ts +11 -0
- package/build/components/DatePicker/DatePickerDay.js +242 -0
- package/build/components/DatePicker/DatePickerDays.d.ts +2 -0
- package/build/components/DatePicker/DatePickerDays.js +157 -0
- package/build/components/DatePicker/DatePickerFooter.d.ts +2 -0
- package/build/components/DatePicker/DatePickerFooter.js +23 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerHeader.props.d.ts +8 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerHeader.props.js +1 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerMonthButton.d.ts +2 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerMonthButton.js +14 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerNextButton.d.ts +2 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerNextButton.js +32 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerPrevButton.d.ts +2 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerPrevButton.js +32 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerSelectors.d.ts +6 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerSelectors.js +64 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerTimeButton.d.ts +1 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerTimeButton.js +22 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerYearButton.d.ts +2 -0
- package/build/components/DatePicker/DatePickerHeader/DatePickerYearButton.js +25 -0
- package/build/components/DatePicker/DatePickerHeader/index.d.ts +3 -0
- package/build/components/DatePicker/DatePickerHeader/index.js +30 -0
- package/build/components/DatePicker/DatePickerMonths.d.ts +2 -0
- package/build/components/DatePicker/DatePickerMonths.js +69 -0
- package/build/components/DatePicker/DatePickerWeekdays.d.ts +8 -0
- package/build/components/DatePicker/DatePickerWeekdays.js +26 -0
- package/build/components/DatePicker/DatePickerYears.d.ts +2 -0
- package/build/components/DatePicker/DatePickerYears.js +83 -0
- package/build/components/DatePicker/TimePicker.d.ts +3 -0
- package/build/components/DatePicker/TimePicker.js +84 -0
- package/build/components/DatePicker/enums.d.ts +12 -0
- package/build/components/DatePicker/enums.js +12 -0
- package/build/components/DatePicker/index.d.ts +4 -0
- package/build/components/DatePicker/index.js +3 -0
- package/build/components/DatePicker/polyfill.d.ts +0 -0
- package/build/components/DatePicker/polyfill.js +22 -0
- package/build/components/DatePicker/time-picker/animated-math.d.ts +4 -0
- package/build/components/DatePicker/time-picker/animated-math.js +19 -0
- package/build/components/DatePicker/time-picker/period-native.d.ts +6 -0
- package/build/components/DatePicker/time-picker/period-native.js +17 -0
- package/build/components/DatePicker/time-picker/period-picker.d.ts +6 -0
- package/build/components/DatePicker/time-picker/period-picker.js +10 -0
- package/build/components/DatePicker/time-picker/period-web.d.ts +6 -0
- package/build/components/DatePicker/time-picker/period-web.js +21 -0
- package/build/components/DatePicker/time-picker/wheel-native.d.ts +8 -0
- package/build/components/DatePicker/time-picker/wheel-native.js +19 -0
- package/build/components/DatePicker/time-picker/wheel-picker/index.d.ts +2 -0
- package/build/components/DatePicker/time-picker/wheel-picker/index.js +2 -0
- package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker-item.d.ts +16 -0
- package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker-item.js +97 -0
- package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.d.ts +21 -0
- package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.js +88 -0
- package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.style.d.ts +23 -0
- package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.style.js +21 -0
- package/build/components/DatePicker/time-picker/wheel-web.d.ts +8 -0
- package/build/components/DatePicker/time-picker/wheel-web.js +148 -0
- package/build/components/DatePicker/time-picker/wheel.d.ts +8 -0
- package/build/components/DatePicker/time-picker/wheel.js +10 -0
- package/build/components/DatePicker/utils.d.ts +212 -0
- package/build/components/DatePicker/utils.js +391 -0
- package/build/components/DatePickerInput/DatePickerInput.d.ts +6 -0
- package/build/components/DatePickerInput/DatePickerInput.js +126 -0
- package/build/components/DatePickerInput/DatePickerInput.props.d.ts +47 -0
- package/build/components/DatePickerInput/DatePickerInput.props.js +1 -0
- package/build/components/DatePickerInput/DatePickerInputDoneButton.d.ts +8 -0
- package/build/components/DatePickerInput/DatePickerInputDoneButton.js +19 -0
- package/build/components/DatePickerInput/DatePickerInputDoneButton.web.d.ts +5 -0
- package/build/components/DatePickerInput/DatePickerInputDoneButton.web.js +5 -0
- package/build/components/DatePickerInput/index.d.ts +2 -0
- package/build/components/DatePickerInput/index.js +1 -0
- package/build/components/Input/InputField.d.ts +1 -1
- package/build/components/Input/InputField.js +1 -1
- package/build/components/Input/InputSlot.d.ts +1 -1
- package/build/components/Input/InputSlot.js +3 -3
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.js +4 -4
- package/build/components/Link/Link.props.d.ts +3 -0
- package/build/components/Radio/Radio.d.ts +2 -2
- package/build/components/Radio/Radio.js +9 -8
- package/build/components/Radio/Radio.props.d.ts +3 -1
- package/build/components/Radio/RadioImage.d.ts +6 -0
- package/build/components/Radio/RadioImage.js +5 -0
- package/build/components/Radio/RadioTileRoot.js +1 -1
- package/build/components/Radio/index.d.ts +3 -2
- package/build/components/Radio/index.js +2 -1
- package/build/components/Select/SelectOption.js +1 -7
- package/build/components/UnstyledIconButton/UnstyledIconButton.d.ts +1 -1
- package/build/components/UnstyledIconButton/UnstyledIconButton.js +5 -5
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +2 -1
- package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
- package/build/components/index.d.ts +2 -0
- package/build/components/index.js +2 -0
- package/build/core/themes.d.ts +12 -12
- package/build/hooks/index.d.ts +4 -3
- package/build/hooks/index.js +4 -3
- package/build/hooks/usePrevious.d.ts +1 -0
- package/build/hooks/usePrevious.js +8 -0
- package/build/hooks/useTheme.d.ts +2 -1
- package/build/hooks/useTheme.js +2 -2
- package/build/tokens/color.d.ts +12 -12
- package/build/tokens/color.js +6 -6
- package/build/tokens/components/dark/alert.d.ts +13 -0
- package/build/tokens/components/dark/alert.js +13 -0
- package/build/tokens/components/dark/checkbox.d.ts +3 -0
- package/build/tokens/components/dark/checkbox.js +3 -0
- package/build/tokens/components/dark/date-picker.d.ts +1 -0
- package/build/tokens/components/dark/date-picker.js +1 -0
- package/build/tokens/components/dark/icon-button.d.ts +7 -0
- package/build/tokens/components/dark/icon-button.js +7 -0
- package/build/tokens/components/dark/illustrations.d.ts +7 -0
- package/build/tokens/components/dark/illustrations.js +6 -0
- package/build/tokens/components/dark/index.d.ts +2 -0
- package/build/tokens/components/dark/index.js +2 -0
- package/build/tokens/components/dark/link.d.ts +5 -0
- package/build/tokens/components/dark/link.js +5 -0
- package/build/tokens/components/dark/progress-bar.d.ts +41 -0
- package/build/tokens/components/dark/progress-bar.js +40 -0
- package/build/tokens/components/dark/segmented-control.d.ts +2 -2
- package/build/tokens/components/dark/segmented-control.js +2 -2
- package/build/tokens/components/dark/table.d.ts +3 -0
- package/build/tokens/components/dark/table.js +3 -0
- package/build/tokens/components/light/alert.d.ts +13 -0
- package/build/tokens/components/light/alert.js +13 -0
- package/build/tokens/components/light/checkbox.d.ts +3 -0
- package/build/tokens/components/light/checkbox.js +3 -0
- package/build/tokens/components/light/date-picker.d.ts +1 -0
- package/build/tokens/components/light/date-picker.js +1 -0
- package/build/tokens/components/light/icon-button.d.ts +7 -0
- package/build/tokens/components/light/icon-button.js +7 -0
- package/build/tokens/components/light/illustrations.d.ts +7 -0
- package/build/tokens/components/light/illustrations.js +6 -0
- package/build/tokens/components/light/index.d.ts +2 -0
- package/build/tokens/components/light/index.js +2 -0
- package/build/tokens/components/light/link.d.ts +5 -0
- package/build/tokens/components/light/link.js +5 -0
- package/build/tokens/components/light/progress-bar.d.ts +41 -0
- package/build/tokens/components/light/progress-bar.js +40 -0
- package/build/tokens/components/light/segmented-control.d.ts +2 -2
- package/build/tokens/components/light/segmented-control.js +2 -2
- package/build/tokens/components/light/table.d.ts +3 -0
- package/build/tokens/components/light/table.js +3 -0
- package/build/tokens/index.d.ts +1 -0
- package/build/tokens/index.js +1 -0
- package/build/tokens/motion.d.ts +23 -0
- package/build/tokens/motion.js +22 -0
- package/build/tokens/primitive.d.ts +19 -0
- package/build/tokens/primitive.js +19 -0
- package/build/tokens/semantic-dark.d.ts +5 -5
- package/build/tokens/semantic-dark.js +5 -5
- package/build/tokens/semantic-light.d.ts +1 -1
- package/build/tokens/semantic-light.js +1 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/isEqual.d.ts +2 -0
- package/build/utils/isEqual.js +29 -0
- package/chromatic.config.json +6 -0
- package/docs/assets/bank-logo.png +0 -0
- package/docs/assets/bank-logo1.png +0 -0
- package/docs/components/AllComponents.web.tsx +43 -1
- package/docs/components/ViewWrap.tsx +32 -0
- package/docs/components/index.ts +7 -7
- package/docs/getting-started.mdx +6 -6
- package/docs/introduction.mdx +3 -3
- package/package.json +16 -12
- package/src/components/Alert/AlertCloseButton.tsx +33 -5
- package/src/components/Alert/AlertIcon.tsx +17 -1
- package/src/components/Alert/AlertIconButton.tsx +37 -4
- package/src/components/Alert/AlertLink.tsx +52 -1
- package/src/components/Alert/AlertText.tsx +28 -3
- package/src/components/Alert/AlertTitle.tsx +28 -3
- package/src/components/Badge/BadgeIcon.tsx +72 -0
- package/src/components/Badge/BadgeText.tsx +72 -0
- package/src/components/Button/ButtonRoot.tsx +1 -0
- package/src/components/Checkbox/Checkbox.docs.mdx +45 -7
- package/src/components/Checkbox/Checkbox.props.ts +3 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +37 -1
- package/src/components/Checkbox/Checkbox.tsx +12 -9
- package/src/components/Checkbox/CheckboxIcon.tsx +1 -1
- package/src/components/Checkbox/CheckboxImage.tsx +9 -0
- package/src/components/Checkbox/CheckboxTileRoot.tsx +1 -1
- package/src/components/Checkbox/index.ts +3 -2
- package/src/components/CurrencyInput/CurrencyInput.tsx +2 -1
- package/src/components/DatePicker/DatePicker.context.ts +23 -0
- package/src/components/DatePicker/DatePicker.docs.mdx +239 -0
- package/src/components/DatePicker/DatePicker.props.ts +139 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +98 -0
- package/src/components/DatePicker/DatePicker.tsx +669 -0
- package/src/components/DatePicker/DatePickerCalendar.tsx +41 -0
- package/src/components/DatePicker/DatePickerDay.tsx +302 -0
- package/src/components/DatePicker/DatePickerDays.tsx +241 -0
- package/src/components/DatePicker/DatePickerFooter.tsx +35 -0
- package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.props.ts +10 -0
- package/src/components/DatePicker/DatePickerHeader/DatePickerMonthButton.tsx +29 -0
- package/src/components/DatePicker/DatePickerHeader/DatePickerNextButton.tsx +46 -0
- package/src/components/DatePicker/DatePickerHeader/DatePickerPrevButton.tsx +46 -0
- package/src/components/DatePicker/DatePickerHeader/DatePickerSelectors.tsx +96 -0
- package/src/components/DatePicker/DatePickerHeader/DatePickerTimeButton.tsx +48 -0
- package/src/components/DatePicker/DatePickerHeader/DatePickerYearButton.tsx +50 -0
- package/src/components/DatePicker/DatePickerHeader/index.tsx +64 -0
- package/src/components/DatePicker/DatePickerMonths.tsx +101 -0
- package/src/components/DatePicker/DatePickerWeekdays.tsx +49 -0
- package/src/components/DatePicker/DatePickerYears.tsx +119 -0
- package/src/components/DatePicker/TimePicker.tsx +141 -0
- package/src/components/DatePicker/enums.ts +14 -0
- package/src/components/DatePicker/index.ts +13 -0
- package/src/components/DatePicker/polyfill.ts +21 -0
- package/src/components/DatePicker/time-picker/animated-math.ts +33 -0
- package/src/components/DatePicker/time-picker/period-native.tsx +34 -0
- package/src/components/DatePicker/time-picker/period-picker.tsx +16 -0
- package/src/components/DatePicker/time-picker/period-web.tsx +36 -0
- package/src/components/DatePicker/time-picker/wheel-native.tsx +37 -0
- package/src/components/DatePicker/time-picker/wheel-picker/index.ts +3 -0
- package/src/components/DatePicker/time-picker/wheel-picker/wheel-picker-item.tsx +132 -0
- package/src/components/DatePicker/time-picker/wheel-picker/wheel-picker.style.ts +22 -0
- package/src/components/DatePicker/time-picker/wheel-picker/wheel-picker.tsx +200 -0
- package/src/components/DatePicker/time-picker/wheel-web.tsx +181 -0
- package/src/components/DatePicker/time-picker/wheel.tsx +18 -0
- package/src/components/DatePicker/utils.ts +549 -0
- package/src/components/DatePickerInput/DatePickerInput.docs.mdx +237 -0
- package/src/components/DatePickerInput/DatePickerInput.props.ts +50 -0
- package/src/components/DatePickerInput/DatePickerInput.stories.tsx +178 -0
- package/src/components/DatePickerInput/DatePickerInput.tsx +265 -0
- package/src/components/DatePickerInput/DatePickerInputDoneButton.tsx +42 -0
- package/src/components/DatePickerInput/DatePickerInputDoneButton.web.tsx +7 -0
- package/src/components/DatePickerInput/index.ts +2 -0
- package/src/components/Icon/Icon.stories.tsx +4 -3
- package/src/components/IconContainer/IconContainer.docs.mdx +4 -4
- package/src/components/Input/InputField.tsx +0 -2
- package/src/components/Input/InputSlot.tsx +14 -3
- package/src/components/Link/Link.props.ts +3 -0
- package/src/components/Link/Link.tsx +12 -6
- package/src/components/List/List.docs.mdx +24 -23
- package/src/components/Modal/Modal.stories.tsx +2 -30
- package/src/components/Radio/Radio.docs.mdx +96 -124
- package/src/components/Radio/Radio.props.ts +3 -1
- package/src/components/Radio/Radio.stories.tsx +47 -0
- package/src/components/Radio/Radio.tsx +10 -7
- package/src/components/Radio/RadioImage.tsx +9 -0
- package/src/components/Radio/RadioTileRoot.tsx +1 -1
- package/src/components/Radio/index.ts +3 -2
- package/src/components/Select/Select.docs.mdx +6 -6
- package/src/components/Select/Select.stories.tsx +7 -7
- package/src/components/Select/SelectOption.tsx +4 -10
- package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
- package/src/components/UnstyledIconButton/UnstyledIconButton.tsx +23 -5
- package/src/components/UnstyledIconButton/UnstyledIconButtonRoot.tsx +7 -3
- package/src/components/index.ts +2 -0
- package/src/hooks/index.ts +4 -3
- package/src/hooks/usePrevious.ts +9 -0
- package/src/hooks/useTheme.ts +4 -3
- package/src/tokens/color.ts +6 -6
- package/src/tokens/components/dark/alert.ts +13 -0
- package/src/tokens/components/dark/checkbox.ts +3 -0
- package/src/tokens/components/dark/date-picker.ts +1 -0
- package/src/tokens/components/dark/icon-button.ts +7 -0
- package/src/tokens/components/dark/illustrations.ts +7 -0
- package/src/tokens/components/dark/index.ts +2 -0
- package/src/tokens/components/dark/link.ts +5 -0
- package/src/tokens/components/dark/progress-bar.ts +41 -0
- package/src/tokens/components/dark/segmented-control.ts +2 -2
- package/src/tokens/components/dark/table.ts +3 -0
- package/src/tokens/components/light/alert.ts +13 -0
- package/src/tokens/components/light/checkbox.ts +3 -0
- package/src/tokens/components/light/date-picker.ts +1 -0
- package/src/tokens/components/light/icon-button.ts +7 -0
- package/src/tokens/components/light/illustrations.ts +7 -0
- package/src/tokens/components/light/index.ts +2 -0
- package/src/tokens/components/light/link.ts +5 -0
- package/src/tokens/components/light/progress-bar.ts +41 -0
- package/src/tokens/components/light/segmented-control.ts +2 -2
- package/src/tokens/components/light/table.ts +3 -0
- package/src/tokens/index.ts +1 -0
- package/src/tokens/motion.ts +23 -0
- package/src/tokens/primitive.ts +19 -0
- package/src/tokens/semantic-dark.ts +5 -5
- package/src/tokens/semantic-light.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/isEqual.ts +30 -0
- package/docs/assets/react-native-pig.png +0 -0
- package/docs/components/AdvancedRadioExample.tsx +0 -126
|
@@ -1,9 +1,60 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
1
2
|
import { Link, LinkProps } from '../Link';
|
|
3
|
+
import { useAlertContext } from './Alert.context';
|
|
2
4
|
|
|
3
5
|
const AlertLink = ({ children, ...props }: LinkProps) => {
|
|
4
|
-
|
|
6
|
+
const { colorScheme } = useAlertContext();
|
|
7
|
+
styles.useVariants({ colorScheme });
|
|
8
|
+
return (
|
|
9
|
+
<Link {...props} textStyle={styles.text} iconStyle={styles.icon}>
|
|
10
|
+
{children}
|
|
11
|
+
</Link>
|
|
12
|
+
);
|
|
5
13
|
};
|
|
6
14
|
|
|
15
|
+
const styles = StyleSheet.create(theme => ({
|
|
16
|
+
text: {
|
|
17
|
+
variants: {
|
|
18
|
+
colorScheme: {
|
|
19
|
+
info: {
|
|
20
|
+
color: theme.color.feedback.info.foreground.default,
|
|
21
|
+
textDecorationColor: theme.color.feedback.info.foreground.default,
|
|
22
|
+
},
|
|
23
|
+
positive: {
|
|
24
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
25
|
+
textDecorationColor: theme.color.feedback.positive.foreground.default,
|
|
26
|
+
},
|
|
27
|
+
danger: {
|
|
28
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
29
|
+
textDecorationColor: theme.color.feedback.danger.foreground.default,
|
|
30
|
+
},
|
|
31
|
+
warning: {
|
|
32
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
33
|
+
textDecorationColor: theme.color.feedback.warning.foreground.default,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
icon: {
|
|
39
|
+
variants: {
|
|
40
|
+
colorScheme: {
|
|
41
|
+
info: {
|
|
42
|
+
color: theme.color.feedback.info.foreground.default,
|
|
43
|
+
},
|
|
44
|
+
positive: {
|
|
45
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
46
|
+
},
|
|
47
|
+
danger: {
|
|
48
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
49
|
+
},
|
|
50
|
+
warning: {
|
|
51
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
}));
|
|
57
|
+
|
|
7
58
|
AlertLink.displayName = 'AlertLink';
|
|
8
59
|
|
|
9
60
|
export default AlertLink;
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
import { TextProps } from 'react-native';
|
|
1
|
+
import { TextProps, TextStyle } from 'react-native';
|
|
2
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
3
|
import { BodyText } from '../BodyText';
|
|
4
|
+
import { useAlertContext } from './Alert.context';
|
|
3
5
|
|
|
4
|
-
const AlertText = ({ children, ...props }: TextProps & { semibold?: boolean }) => {
|
|
6
|
+
const AlertText = ({ children, style, ...props }: TextProps & { semibold?: boolean }) => {
|
|
7
|
+
const { colorScheme } = useAlertContext();
|
|
8
|
+
styles.useVariants({ colorScheme });
|
|
5
9
|
return (
|
|
6
|
-
<BodyText size="md" {...props}>
|
|
10
|
+
<BodyText size="md" style={[styles.text as TextStyle, style]} {...props}>
|
|
7
11
|
{children}
|
|
8
12
|
</BodyText>
|
|
9
13
|
);
|
|
10
14
|
};
|
|
11
15
|
|
|
16
|
+
const styles = StyleSheet.create(theme => ({
|
|
17
|
+
text: {
|
|
18
|
+
variants: {
|
|
19
|
+
colorScheme: {
|
|
20
|
+
info: {
|
|
21
|
+
color: theme.color.feedback.info.foreground.default,
|
|
22
|
+
},
|
|
23
|
+
positive: {
|
|
24
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
25
|
+
},
|
|
26
|
+
danger: {
|
|
27
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
28
|
+
},
|
|
29
|
+
warning: {
|
|
30
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
|
|
12
37
|
AlertText.displayName = 'AlertText';
|
|
13
38
|
|
|
14
39
|
export default AlertText;
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
import type { TextProps } from 'react-native';
|
|
1
|
+
import type { TextProps, TextStyle } from 'react-native';
|
|
2
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
3
|
import { DetailText } from '../DetailText';
|
|
4
|
+
import { useAlertContext } from './Alert.context';
|
|
3
5
|
|
|
4
|
-
const AlertTitle = ({ children, ...props }: TextProps) => {
|
|
6
|
+
const AlertTitle = ({ children, style, ...props }: TextProps) => {
|
|
7
|
+
const { colorScheme } = useAlertContext();
|
|
8
|
+
styles.useVariants({ colorScheme });
|
|
5
9
|
return (
|
|
6
|
-
<DetailText size="md" {...props}>
|
|
10
|
+
<DetailText size="md" style={[styles.title as TextStyle, style]} {...props}>
|
|
7
11
|
{children}
|
|
8
12
|
</DetailText>
|
|
9
13
|
);
|
|
10
14
|
};
|
|
11
15
|
|
|
16
|
+
const styles = StyleSheet.create(theme => ({
|
|
17
|
+
title: {
|
|
18
|
+
variants: {
|
|
19
|
+
colorScheme: {
|
|
20
|
+
info: {
|
|
21
|
+
color: theme.color.feedback.info.foreground,
|
|
22
|
+
},
|
|
23
|
+
positive: {
|
|
24
|
+
color: theme.color.feedback.positive.foreground,
|
|
25
|
+
},
|
|
26
|
+
danger: {
|
|
27
|
+
color: theme.color.feedback.danger.foreground,
|
|
28
|
+
},
|
|
29
|
+
warning: {
|
|
30
|
+
color: theme.color.feedback.warning.foreground,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
|
|
12
37
|
AlertTitle.displayName = 'AlertTitle';
|
|
13
38
|
|
|
14
39
|
export default AlertTitle;
|
|
@@ -43,6 +43,78 @@ const styles = StyleSheet.create(theme => ({
|
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
compoundVariants: [
|
|
46
|
+
// Emphasis
|
|
47
|
+
{
|
|
48
|
+
colorScheme: 'info',
|
|
49
|
+
variant: 'emphasis',
|
|
50
|
+
styles: {
|
|
51
|
+
color: theme.color.feedback.info.foreground.default,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
colorScheme: 'danger',
|
|
56
|
+
variant: 'emphasis',
|
|
57
|
+
styles: {
|
|
58
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
colorScheme: 'positive',
|
|
63
|
+
variant: 'emphasis',
|
|
64
|
+
styles: {
|
|
65
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
colorScheme: 'warning',
|
|
70
|
+
variant: 'emphasis',
|
|
71
|
+
styles: {
|
|
72
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
colorScheme: 'functional',
|
|
77
|
+
variant: 'emphasis',
|
|
78
|
+
styles: {
|
|
79
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
// Subtle
|
|
83
|
+
{
|
|
84
|
+
colorScheme: 'info',
|
|
85
|
+
variant: 'subtle',
|
|
86
|
+
styles: {
|
|
87
|
+
color: theme.color.feedback.info.foreground.default,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
colorScheme: 'danger',
|
|
92
|
+
variant: 'subtle',
|
|
93
|
+
styles: {
|
|
94
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
colorScheme: 'positive',
|
|
99
|
+
variant: 'subtle',
|
|
100
|
+
styles: {
|
|
101
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
colorScheme: 'warning',
|
|
106
|
+
variant: 'subtle',
|
|
107
|
+
styles: {
|
|
108
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
colorScheme: 'functional',
|
|
113
|
+
variant: 'subtle',
|
|
114
|
+
styles: {
|
|
115
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
46
118
|
// Outline
|
|
47
119
|
{
|
|
48
120
|
colorScheme: 'info',
|
|
@@ -43,6 +43,78 @@ const styles = StyleSheet.create(theme => ({
|
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
compoundVariants: [
|
|
46
|
+
// Emphasis
|
|
47
|
+
{
|
|
48
|
+
colorScheme: 'info',
|
|
49
|
+
variant: 'emphasis',
|
|
50
|
+
styles: {
|
|
51
|
+
color: theme.color.feedback.info.foreground.default,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
colorScheme: 'danger',
|
|
56
|
+
variant: 'emphasis',
|
|
57
|
+
styles: {
|
|
58
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
colorScheme: 'positive',
|
|
63
|
+
variant: 'emphasis',
|
|
64
|
+
styles: {
|
|
65
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
colorScheme: 'warning',
|
|
70
|
+
variant: 'emphasis',
|
|
71
|
+
styles: {
|
|
72
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
colorScheme: 'functional',
|
|
77
|
+
variant: 'emphasis',
|
|
78
|
+
styles: {
|
|
79
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
// Subtle
|
|
83
|
+
{
|
|
84
|
+
colorScheme: 'info',
|
|
85
|
+
variant: 'subtle',
|
|
86
|
+
styles: {
|
|
87
|
+
color: theme.color.feedback.info.foreground.default,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
colorScheme: 'danger',
|
|
92
|
+
variant: 'subtle',
|
|
93
|
+
styles: {
|
|
94
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
colorScheme: 'positive',
|
|
99
|
+
variant: 'subtle',
|
|
100
|
+
styles: {
|
|
101
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
colorScheme: 'warning',
|
|
106
|
+
variant: 'subtle',
|
|
107
|
+
styles: {
|
|
108
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
colorScheme: 'functional',
|
|
113
|
+
variant: 'subtle',
|
|
114
|
+
styles: {
|
|
115
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
46
118
|
// Outline
|
|
47
119
|
{
|
|
48
120
|
colorScheme: 'info',
|
|
@@ -201,6 +201,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
201
201
|
colorScheme: 'affirmative',
|
|
202
202
|
styles: {
|
|
203
203
|
backgroundColor: theme.color.interactive.affirmative.surface.strong.default,
|
|
204
|
+
borderColor: theme.color.interactive.affirmative.border.strong,
|
|
204
205
|
_web: {
|
|
205
206
|
_hover: {
|
|
206
207
|
backgroundColor: theme.color.interactive.affirmative.surface.strong.hover,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
3
|
import {
|
|
4
|
+
Box,
|
|
5
|
+
Center,
|
|
4
6
|
Checkbox,
|
|
5
7
|
CheckboxGroup,
|
|
6
|
-
CheckboxTile,
|
|
7
8
|
CheckboxIndicator,
|
|
8
9
|
CheckboxLabel,
|
|
9
|
-
|
|
10
|
-
Box,
|
|
10
|
+
CheckboxTile,
|
|
11
11
|
FormField,
|
|
12
12
|
} from '../../';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
13
|
+
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
14
|
+
import * as Stories from './Checkbox.stories';
|
|
15
15
|
|
|
16
16
|
<Meta title="Forms / Checkbox" />
|
|
17
17
|
|
|
@@ -33,10 +33,12 @@ Whether you're building a simple form or a complex data collection system, the C
|
|
|
33
33
|
- [`CheckboxIcon`](#checkboxicon)
|
|
34
34
|
- [`CheckboxLabel`](#checkboxlabel)
|
|
35
35
|
- [`CheckboxGroup`](#checkboxgroup)
|
|
36
|
+
- [`CheckboxImage`](#checkboximage)
|
|
36
37
|
- [Variants](#variants)
|
|
37
38
|
- [Advanced Usage](#advanced-usage)
|
|
38
39
|
- [Examples](#examples)
|
|
39
40
|
- [`CheckboxTile` component](#checkboxtile-component)
|
|
41
|
+
- [`CheckboxImage` component](#checkboximage-component)
|
|
40
42
|
- [`CheckboxGroup` component](#checkboxgroup-component)
|
|
41
43
|
|
|
42
44
|
## Playground
|
|
@@ -89,6 +91,7 @@ const MyComponent = () => {
|
|
|
89
91
|
| `validText` | `string` | - | The valid text to be displayed below the checkbox. |
|
|
90
92
|
| `showValidationIcon` | `boolean` | `true` | Whether to show the validation icon. |
|
|
91
93
|
| `type` | `'default' \| 'tile'` | `default` | The type of the checkbox. |
|
|
94
|
+
| `image` | `ImageProps` | - | The image to be displayed next to the label. |
|
|
92
95
|
|
|
93
96
|
## Components
|
|
94
97
|
|
|
@@ -205,6 +208,10 @@ const MyComponent = () => {
|
|
|
205
208
|
| `disabled` | `bool` | `false` | To manually set disable to the checkbox. |
|
|
206
209
|
| `validationStatus` | `'valid' \| 'invalid' \| 'initial'` | - | The validation status of the checkbox group. |
|
|
207
210
|
|
|
211
|
+
### `CheckboxImage`
|
|
212
|
+
|
|
213
|
+
The `CheckboxImage` component is used to display an image next to the checkbox label. It inherits all the properties of React Native's `Image` component.
|
|
214
|
+
|
|
208
215
|
## Variants
|
|
209
216
|
|
|
210
217
|
<Canvas of={Stories.Variants} />
|
|
@@ -322,6 +329,37 @@ const MyComponent = () => {
|
|
|
322
329
|
};
|
|
323
330
|
```
|
|
324
331
|
|
|
332
|
+
### `CheckboxImage` component
|
|
333
|
+
|
|
334
|
+
The `CheckboxImage` component is used to display an image next to the checkbox label. It inherits all the properties of React Native's `Image` component.
|
|
335
|
+
|
|
336
|
+
<Canvas of={Stories.WithImage} />
|
|
337
|
+
|
|
338
|
+
```tsx
|
|
339
|
+
import { Checkbox } from '@utilitywarehouse/native-ui';
|
|
340
|
+
import visaLogo from '../../../assets/visa.png';
|
|
341
|
+
import mastercardLogo from '../../../assets/mastercard.png';
|
|
342
|
+
|
|
343
|
+
const MyComponent = () => {
|
|
344
|
+
return (
|
|
345
|
+
<CheckboxGroup>
|
|
346
|
+
<Checkbox
|
|
347
|
+
value="visa"
|
|
348
|
+
aria-label="Visa"
|
|
349
|
+
label="Visa"
|
|
350
|
+
image={{ source: visaLogo, style: { width: 40, height: 24, resizeMode: 'contain' } }}
|
|
351
|
+
/>
|
|
352
|
+
<Checkbox
|
|
353
|
+
value="mastercard"
|
|
354
|
+
aria-label="Mastercard"
|
|
355
|
+
label="Mastercard"
|
|
356
|
+
image={{ source: mastercardLogo, style: { width: 40, height: 24, resizeMode: 'contain' } }}
|
|
357
|
+
/>
|
|
358
|
+
</CheckboxGroup>
|
|
359
|
+
);
|
|
360
|
+
};
|
|
361
|
+
```
|
|
362
|
+
|
|
325
363
|
### `CheckboxGroup` component
|
|
326
364
|
|
|
327
365
|
The `CheckboxGroup` component is used to group multiple `Checkbox` components together.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type { PressableProps, ViewProps } from 'react-native';
|
|
2
|
+
import type { ImageProps, PressableProps, ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type CheckboxBaseProps = {
|
|
5
5
|
onChange?: (isSelected: boolean) => void;
|
|
@@ -26,6 +26,7 @@ type CheckboxWithChildrenProps = {
|
|
|
26
26
|
invalidText?: never;
|
|
27
27
|
validText?: never;
|
|
28
28
|
showValidationIcon?: never;
|
|
29
|
+
image?: never;
|
|
29
30
|
} & CheckboxBaseProps;
|
|
30
31
|
|
|
31
32
|
type CheckboxWithoutChildrenProps = {
|
|
@@ -36,6 +37,7 @@ type CheckboxWithoutChildrenProps = {
|
|
|
36
37
|
invalidText?: string;
|
|
37
38
|
validText?: string;
|
|
38
39
|
showValidationIcon?: boolean;
|
|
40
|
+
image?: ImageProps;
|
|
39
41
|
} & CheckboxBaseProps;
|
|
40
42
|
|
|
41
43
|
type CheckboxProps = CheckboxWithChildrenProps | CheckboxWithoutChildrenProps;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
1
2
|
import React, { useEffect } from 'react';
|
|
3
|
+
import { ImageSourcePropType } from 'react-native';
|
|
2
4
|
import { Checkbox, CheckboxGroup } from '.';
|
|
3
|
-
import
|
|
5
|
+
import bankLogo from '../../../docs/assets/bank-logo.png';
|
|
6
|
+
import bankLogo1 from '../../../docs/assets/bank-logo1.png';
|
|
4
7
|
import { VariantTitle } from '../../../docs/components';
|
|
5
8
|
|
|
6
9
|
const meta = {
|
|
@@ -91,6 +94,39 @@ export const Playground: Story = {
|
|
|
91
94
|
},
|
|
92
95
|
};
|
|
93
96
|
|
|
97
|
+
export const WithImage: Story = {
|
|
98
|
+
render: ({ children, ...args }) => (
|
|
99
|
+
<CheckboxGroup aria-label="Checkbox Group" nativeID="checkbox-group">
|
|
100
|
+
<Checkbox
|
|
101
|
+
aria-label="Visa"
|
|
102
|
+
onChange={(checked: boolean) => {
|
|
103
|
+
console.log(checked, '###');
|
|
104
|
+
}}
|
|
105
|
+
nativeID="checkbox-1"
|
|
106
|
+
{...args}
|
|
107
|
+
value="visa"
|
|
108
|
+
label="Visa"
|
|
109
|
+
image={{ source: bankLogo1 as ImageSourcePropType, style: { width: 40, height: 24 } }}
|
|
110
|
+
/>
|
|
111
|
+
<Checkbox
|
|
112
|
+
aria-label="Mastercard"
|
|
113
|
+
onChange={(checked: boolean) => {
|
|
114
|
+
console.log(checked, '###');
|
|
115
|
+
}}
|
|
116
|
+
nativeID="checkbox-2"
|
|
117
|
+
{...args}
|
|
118
|
+
value="mastercard"
|
|
119
|
+
label="Mastercard"
|
|
120
|
+
image={{
|
|
121
|
+
source: bankLogo as ImageSourcePropType,
|
|
122
|
+
style: { width: 40, height: 24 },
|
|
123
|
+
resizeMode: 'contain',
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
</CheckboxGroup>
|
|
127
|
+
),
|
|
128
|
+
};
|
|
129
|
+
|
|
94
130
|
export const Variants: Story = {
|
|
95
131
|
render: () => {
|
|
96
132
|
const [values, setValues] = React.useState(['Label 1']);
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { createCheckbox } from '@gluestack-ui/checkbox';
|
|
2
|
-
import
|
|
3
|
-
import StyledCheckboxIndicator from './CheckboxIndicator';
|
|
4
|
-
import StyledCheckboxIcon from './CheckboxIcon';
|
|
5
|
-
import StyledCheckboxLabel from './CheckboxLabel';
|
|
6
|
-
import StyledCheckboxGroup from './CheckboxGroupRoot';
|
|
7
|
-
import CheckboxProps from './Checkbox.props';
|
|
2
|
+
import { useFormFieldContext } from '../FormField';
|
|
8
3
|
import { Helper } from '../Helper';
|
|
4
|
+
import CheckboxProps from './Checkbox.props';
|
|
9
5
|
import { useCheckboxGroupContext } from './CheckboxGroup.context';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import StyledCheckboxGroup from './CheckboxGroupRoot';
|
|
7
|
+
import StyledCheckboxIcon from './CheckboxIcon';
|
|
8
|
+
import CheckboxImage from './CheckboxImage';
|
|
9
|
+
import StyledCheckboxIndicator from './CheckboxIndicator';
|
|
10
|
+
import StyledCheckboxLabel from './CheckboxLabel';
|
|
11
|
+
import StyledCheckbox from './CheckboxRoot';
|
|
12
12
|
import CheckboxTextContent from './CheckboxTextContent';
|
|
13
|
+
import CheckboxTileRoot from './CheckboxTileRoot';
|
|
13
14
|
|
|
14
15
|
const CheckboxComponent = createCheckbox({
|
|
15
16
|
Root: StyledCheckbox,
|
|
@@ -41,6 +42,7 @@ const Checkbox = ({
|
|
|
41
42
|
validationStatus: validation,
|
|
42
43
|
showValidationIcon,
|
|
43
44
|
type = 'default',
|
|
45
|
+
image,
|
|
44
46
|
...props
|
|
45
47
|
}: CheckboxProps) => {
|
|
46
48
|
const { validationStatus: fieldValidationStatus } = useFormFieldContext();
|
|
@@ -55,6 +57,7 @@ const Checkbox = ({
|
|
|
55
57
|
<CheckboxIndicator>
|
|
56
58
|
<CheckboxIcon />
|
|
57
59
|
</CheckboxIndicator>
|
|
60
|
+
{image ? <CheckboxImage {...image} /> : null}
|
|
58
61
|
<CheckboxTextContent>
|
|
59
62
|
{!!label && <CheckboxLabel>{label}</CheckboxLabel>}
|
|
60
63
|
{!!helperText && <Helper disabled={disabled} icon={helperIcon} text={helperText} />}
|
|
@@ -96,6 +99,6 @@ CheckboxTile.displayName = 'CheckboxTile';
|
|
|
96
99
|
|
|
97
100
|
Checkbox.displayName = 'Checkbox';
|
|
98
101
|
|
|
99
|
-
export { Checkbox, CheckboxGroup,
|
|
102
|
+
export { Checkbox, CheckboxGroup, CheckboxIcon, CheckboxIndicator, CheckboxLabel, CheckboxTile };
|
|
100
103
|
|
|
101
104
|
export default Checkbox;
|
|
@@ -19,7 +19,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
19
19
|
gap: theme.components.checkbox.gap,
|
|
20
20
|
padding: theme.components.checkbox.tile.padding,
|
|
21
21
|
borderWidth: theme.components.checkbox.tile.borderWidth,
|
|
22
|
-
borderColor: theme.color.border.
|
|
22
|
+
borderColor: theme.color.border.strong,
|
|
23
23
|
borderRadius: theme.components.checkbox.tile.borderRadius,
|
|
24
24
|
backgroundColor: theme.color.surface.neutral.strong,
|
|
25
25
|
variants: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export {
|
|
2
2
|
default as Checkbox,
|
|
3
|
+
CheckboxIcon,
|
|
3
4
|
CheckboxIndicator,
|
|
4
5
|
CheckboxLabel,
|
|
5
|
-
CheckboxIcon,
|
|
6
6
|
CheckboxTile,
|
|
7
7
|
} from './Checkbox';
|
|
8
|
+
export type { default as CheckboxProps } from './Checkbox.props';
|
|
8
9
|
export { default as CheckboxGroup } from './CheckboxGroup';
|
|
9
10
|
export { default as CheckboxGroupTextContent } from './CheckboxGroupTextContent';
|
|
11
|
+
export { default as CheckboxImage } from './CheckboxImage';
|
|
10
12
|
export { default as CheckboxTextContent } from './CheckboxTextContent';
|
|
11
|
-
export type { default as CheckboxProps } from './Checkbox.props';
|
|
@@ -47,13 +47,14 @@ const CurrencyInput = ({
|
|
|
47
47
|
style={styles.wrap}
|
|
48
48
|
>
|
|
49
49
|
<InputSlot>
|
|
50
|
-
<DetailText size="4xl" style={styles.text}>
|
|
50
|
+
<DetailText size="4xl" style={styles.text} accessible={false}>
|
|
51
51
|
£
|
|
52
52
|
</DetailText>
|
|
53
53
|
</InputSlot>
|
|
54
54
|
<InputField
|
|
55
55
|
inputMode="decimal"
|
|
56
56
|
inBottomSheet={inBottomSheet}
|
|
57
|
+
accessibilityHint='Enter the amount in pounds and pence, for example "10.99"'
|
|
57
58
|
{...rest}
|
|
58
59
|
placeholder={getPlaceholder}
|
|
59
60
|
keyboardType="decimal-pad"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import type { DatePickerBaseProps, DateType } from './DatePicker.props';
|
|
3
|
+
import { CalendarViews } from './enums';
|
|
4
|
+
|
|
5
|
+
export interface DatePickerContextType extends DatePickerBaseProps {
|
|
6
|
+
showOutsideDays: boolean;
|
|
7
|
+
firstDayOfWeek: number;
|
|
8
|
+
calendarView: CalendarViews;
|
|
9
|
+
currentDate: DateType; // used for latest state of calendar based on Month and Year
|
|
10
|
+
currentYear: number;
|
|
11
|
+
numerals: 'latn';
|
|
12
|
+
setCalendarView: (value: CalendarViews) => void;
|
|
13
|
+
onSelectDate: (date: DateType) => void;
|
|
14
|
+
onSelectMonth: (month: number) => void;
|
|
15
|
+
onSelectYear: (year: number) => void;
|
|
16
|
+
onChangeMonth: (value: number) => void;
|
|
17
|
+
onChangeYear: (value: number) => void;
|
|
18
|
+
closeDatePicker: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const DatePickerContext = createContext({} as DatePickerContextType);
|
|
22
|
+
|
|
23
|
+
export const useDatePickerContext = () => useContext(DatePickerContext);
|