@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
|
@@ -81,6 +81,25 @@ declare const _default: {
|
|
|
81
81
|
readonly '1100': 72;
|
|
82
82
|
readonly '1200': 90;
|
|
83
83
|
};
|
|
84
|
+
readonly motion: {
|
|
85
|
+
readonly duration: {
|
|
86
|
+
readonly '100': 130;
|
|
87
|
+
readonly '200': 160;
|
|
88
|
+
readonly '300': 190;
|
|
89
|
+
readonly '400': 220;
|
|
90
|
+
readonly '500': 250;
|
|
91
|
+
readonly '600': 300;
|
|
92
|
+
readonly '700': 350;
|
|
93
|
+
readonly '800': 400;
|
|
94
|
+
readonly '900': 450;
|
|
95
|
+
readonly '1000': 500;
|
|
96
|
+
};
|
|
97
|
+
readonly ease: {
|
|
98
|
+
readonly in: "cubic-bezier(0.42, 0, 1, 1)";
|
|
99
|
+
readonly inOut: "cubic-bezier(0, 0, 1, 1)";
|
|
100
|
+
readonly out: "cubic-bezier(0.19, 0.91, 0.38, 1)";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
84
103
|
readonly space: {
|
|
85
104
|
readonly '0': 0;
|
|
86
105
|
readonly '25': 2;
|
|
@@ -81,6 +81,25 @@ export default {
|
|
|
81
81
|
'1100': 72,
|
|
82
82
|
'1200': 90,
|
|
83
83
|
},
|
|
84
|
+
motion: {
|
|
85
|
+
duration: {
|
|
86
|
+
'100': 130,
|
|
87
|
+
'200': 160,
|
|
88
|
+
'300': 190,
|
|
89
|
+
'400': 220,
|
|
90
|
+
'500': 250,
|
|
91
|
+
'600': 300,
|
|
92
|
+
'700': 350,
|
|
93
|
+
'800': 400,
|
|
94
|
+
'900': 450,
|
|
95
|
+
'1000': 500,
|
|
96
|
+
},
|
|
97
|
+
ease: {
|
|
98
|
+
in: 'cubic-bezier(0.42, 0, 1, 1)',
|
|
99
|
+
inOut: 'cubic-bezier(0, 0, 1, 1)',
|
|
100
|
+
out: 'cubic-bezier(0.19, 0.91, 0.38, 1)',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
84
103
|
space: {
|
|
85
104
|
'0': 0,
|
|
86
105
|
'25': 2,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare const _default: {
|
|
5
5
|
readonly background: {
|
|
6
|
-
readonly brand: "#
|
|
6
|
+
readonly brand: "#7a42c8";
|
|
7
7
|
readonly primary: "#191917";
|
|
8
8
|
readonly secondary: "#232323";
|
|
9
9
|
};
|
|
@@ -79,7 +79,7 @@ declare const _default: {
|
|
|
79
79
|
readonly interactive: {
|
|
80
80
|
readonly affirmative: {
|
|
81
81
|
readonly border: {
|
|
82
|
-
readonly strong: "#
|
|
82
|
+
readonly strong: "#101010";
|
|
83
83
|
readonly subtle: "#58ca93";
|
|
84
84
|
};
|
|
85
85
|
readonly foreground: {
|
|
@@ -115,7 +115,7 @@ declare const _default: {
|
|
|
115
115
|
};
|
|
116
116
|
readonly destructive: {
|
|
117
117
|
readonly border: {
|
|
118
|
-
readonly strong: "#
|
|
118
|
+
readonly strong: "#101010";
|
|
119
119
|
readonly subtle: "#ff7964";
|
|
120
120
|
};
|
|
121
121
|
readonly foreground: {
|
|
@@ -163,7 +163,7 @@ declare const _default: {
|
|
|
163
163
|
};
|
|
164
164
|
readonly highlight: {
|
|
165
165
|
readonly border: {
|
|
166
|
-
readonly strong: "#
|
|
166
|
+
readonly strong: "#101010";
|
|
167
167
|
};
|
|
168
168
|
readonly foreground: {
|
|
169
169
|
readonly strong: "#101010";
|
|
@@ -246,7 +246,7 @@ declare const _default: {
|
|
|
246
246
|
readonly text: {
|
|
247
247
|
readonly affirmative: "#58ca93";
|
|
248
248
|
readonly brand: "#af90de";
|
|
249
|
-
readonly inverted: "#
|
|
249
|
+
readonly inverted: "#fcfbf2";
|
|
250
250
|
readonly primary: "#ebebeb";
|
|
251
251
|
readonly secondary: "#b2afae";
|
|
252
252
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export default {
|
|
5
5
|
background: {
|
|
6
|
-
brand: '#
|
|
6
|
+
brand: '#7a42c8',
|
|
7
7
|
primary: '#191917',
|
|
8
8
|
secondary: '#232323',
|
|
9
9
|
},
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
interactive: {
|
|
80
80
|
affirmative: {
|
|
81
81
|
border: {
|
|
82
|
-
strong: '#
|
|
82
|
+
strong: '#101010',
|
|
83
83
|
subtle: '#58ca93',
|
|
84
84
|
},
|
|
85
85
|
foreground: {
|
|
@@ -115,7 +115,7 @@ export default {
|
|
|
115
115
|
},
|
|
116
116
|
destructive: {
|
|
117
117
|
border: {
|
|
118
|
-
strong: '#
|
|
118
|
+
strong: '#101010',
|
|
119
119
|
subtle: '#ff7964',
|
|
120
120
|
},
|
|
121
121
|
foreground: {
|
|
@@ -163,7 +163,7 @@ export default {
|
|
|
163
163
|
},
|
|
164
164
|
highlight: {
|
|
165
165
|
border: {
|
|
166
|
-
strong: '#
|
|
166
|
+
strong: '#101010',
|
|
167
167
|
},
|
|
168
168
|
foreground: {
|
|
169
169
|
strong: '#101010',
|
|
@@ -246,7 +246,7 @@ export default {
|
|
|
246
246
|
text: {
|
|
247
247
|
affirmative: '#58ca93',
|
|
248
248
|
brand: '#af90de',
|
|
249
|
-
inverted: '#
|
|
249
|
+
inverted: '#fcfbf2',
|
|
250
250
|
primary: '#ebebeb',
|
|
251
251
|
secondary: '#b2afae',
|
|
252
252
|
},
|
package/build/utils/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { default as formatThousands } from './formatThousands';
|
|
|
3
3
|
export { default as getFlattenedColorValue } from './getFlattenedColorValue';
|
|
4
4
|
export { default as getStyleValue } from './getStyleValue';
|
|
5
5
|
export { default as hexWithOpacity } from './hexWithOpacity';
|
|
6
|
+
export { default as isEqual } from './isEqual';
|
|
6
7
|
export * from './styleUtils';
|
package/build/utils/index.js
CHANGED
|
@@ -3,4 +3,5 @@ export { default as formatThousands } from './formatThousands';
|
|
|
3
3
|
export { default as getFlattenedColorValue } from './getFlattenedColorValue';
|
|
4
4
|
export { default as getStyleValue } from './getStyleValue';
|
|
5
5
|
export { default as hexWithOpacity } from './hexWithOpacity';
|
|
6
|
+
export { default as isEqual } from './isEqual';
|
|
6
7
|
export * from './styleUtils';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const isEqual = (a, b) => {
|
|
2
|
+
if (a === b)
|
|
3
|
+
return true;
|
|
4
|
+
if (typeof a !== typeof b)
|
|
5
|
+
return false;
|
|
6
|
+
if (typeof a !== 'object' || a === null || b === null)
|
|
7
|
+
return false;
|
|
8
|
+
if (Array.isArray(a) !== Array.isArray(b))
|
|
9
|
+
return false;
|
|
10
|
+
if (Array.isArray(a)) {
|
|
11
|
+
if (a.length !== b.length)
|
|
12
|
+
return false;
|
|
13
|
+
for (let i = 0; i < a.length; i++) {
|
|
14
|
+
if (!isEqual(a[i], b[i]))
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
const keysA = Object.keys(a);
|
|
20
|
+
const keysB = Object.keys(b);
|
|
21
|
+
if (keysA.length !== keysB.length)
|
|
22
|
+
return false;
|
|
23
|
+
for (const key of keysA) {
|
|
24
|
+
if (!keysB.includes(key) || !isEqual(a[key], b[key]))
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
};
|
|
29
|
+
export default isEqual;
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { BottomSheetModalMethods } from '@gorhom/bottom-sheet/lib/typescript/types';
|
|
4
4
|
import {
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
Badge,
|
|
19
19
|
BodyText,
|
|
20
20
|
BottomSheet,
|
|
21
|
+
BottomSheetModal,
|
|
21
22
|
BottomSheetModalProvider,
|
|
22
23
|
BottomSheetView,
|
|
23
24
|
Box,
|
|
@@ -26,6 +27,9 @@ import {
|
|
|
26
27
|
Center,
|
|
27
28
|
Checkbox,
|
|
28
29
|
CurrencyInput,
|
|
30
|
+
DatePicker,
|
|
31
|
+
DatePickerInput,
|
|
32
|
+
DateType,
|
|
29
33
|
DescriptionList,
|
|
30
34
|
DescriptionListItem,
|
|
31
35
|
DetailText,
|
|
@@ -110,6 +114,11 @@ const AllComponents: React.FC = () => {
|
|
|
110
114
|
const handleModalOpenPress = useCallback(() => {
|
|
111
115
|
modalRef.current?.present();
|
|
112
116
|
}, []);
|
|
117
|
+
const [selected, setSelected] = useState<DateType>();
|
|
118
|
+
const datePickerRef = useRef<BottomSheetModal>(null);
|
|
119
|
+
const handleDatePickerOpenPress = useCallback(() => {
|
|
120
|
+
datePickerRef.current?.present();
|
|
121
|
+
}, []);
|
|
113
122
|
useEffect(() => {
|
|
114
123
|
if (bottomSheetRef.current) {
|
|
115
124
|
setTimeout(() => {
|
|
@@ -124,8 +133,16 @@ const AllComponents: React.FC = () => {
|
|
|
124
133
|
}, 400);
|
|
125
134
|
}
|
|
126
135
|
}, [modalRef]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (datePickerRef.current) {
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
datePickerRef.current?.present();
|
|
140
|
+
}, 500);
|
|
141
|
+
}
|
|
142
|
+
}, [datePickerRef]);
|
|
127
143
|
const [switchEnabled, setSwitchEnabled] = React.useState(false);
|
|
128
144
|
const toggleSwitch = () => setSwitchEnabled(!switchEnabled);
|
|
145
|
+
|
|
129
146
|
const [colorMode] = useColorMode();
|
|
130
147
|
const isDark = colorMode === 'dark';
|
|
131
148
|
return (
|
|
@@ -225,6 +242,30 @@ const AllComponents: React.FC = () => {
|
|
|
225
242
|
<CurrencyInput />
|
|
226
243
|
</Center>
|
|
227
244
|
</ComponentWrapper>
|
|
245
|
+
<ComponentWrapper name="Date Picker" link="/?path=/docs/components-date-picker--docs">
|
|
246
|
+
<Center flex={1}>
|
|
247
|
+
<Button onPress={handleDatePickerOpenPress}>Open Date Picker</Button>
|
|
248
|
+
<BottomSheetModalProvider>
|
|
249
|
+
<DatePicker
|
|
250
|
+
ref={datePickerRef}
|
|
251
|
+
mode="single"
|
|
252
|
+
date={selected}
|
|
253
|
+
onChange={({ date }) => setSelected(date)}
|
|
254
|
+
onCancel={() => setSelected(undefined)}
|
|
255
|
+
/>
|
|
256
|
+
</BottomSheetModalProvider>
|
|
257
|
+
</Center>
|
|
258
|
+
</ComponentWrapper>
|
|
259
|
+
<ComponentWrapper
|
|
260
|
+
name="Date Picker Input"
|
|
261
|
+
link="/?path=/docs/forms-date-picker-input--docs"
|
|
262
|
+
>
|
|
263
|
+
<Center flex={1} padding="200">
|
|
264
|
+
<BottomSheetModalProvider>
|
|
265
|
+
<DatePickerInput placeholder="DD/MM/YYYY" />
|
|
266
|
+
</BottomSheetModalProvider>
|
|
267
|
+
</Center>
|
|
268
|
+
</ComponentWrapper>
|
|
228
269
|
<ComponentWrapper
|
|
229
270
|
name="Description List"
|
|
230
271
|
link="/?path=/docs/components-description-list--docs"
|
|
@@ -241,6 +282,7 @@ const AllComponents: React.FC = () => {
|
|
|
241
282
|
<DetailText>This is some Detail Text</DetailText>
|
|
242
283
|
</Center>
|
|
243
284
|
</ComponentWrapper>
|
|
285
|
+
|
|
244
286
|
<ComponentWrapper name="Divider" link="/?path=/docs/components-divider--docs">
|
|
245
287
|
<Center flex={1} p="300">
|
|
246
288
|
<BodyText>This text is divided</BodyText>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Dimensions, Platform, View, ViewProps } from 'react-native';
|
|
2
|
+
import { UnistylesRuntime } from '../../src/core';
|
|
3
|
+
|
|
4
|
+
const ViewWrap = ({ children }: { children: ViewProps['children'] }) => (
|
|
5
|
+
<View
|
|
6
|
+
style={{
|
|
7
|
+
width: Platform.OS === 'web' ? '100%' : Dimensions.get('window').width,
|
|
8
|
+
height:
|
|
9
|
+
Platform.OS === 'web'
|
|
10
|
+
? '100%'
|
|
11
|
+
: Dimensions.get('window').height -
|
|
12
|
+
UnistylesRuntime.insets.top -
|
|
13
|
+
UnistylesRuntime.insets.bottom -
|
|
14
|
+
33,
|
|
15
|
+
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: 0,
|
|
18
|
+
left: 0,
|
|
19
|
+
right: 0,
|
|
20
|
+
bottom: 0,
|
|
21
|
+
flex: 1,
|
|
22
|
+
marginVertical: Platform.OS === 'web' ? 0 : -8,
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
padding: 16,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</View>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export default ViewWrap;
|
package/docs/components/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as UsageWrap } from './UsageWrap';
|
|
1
|
+
export { default as AdvancedInputExample } from './AdvancedInputExample';
|
|
3
2
|
export { default as BackToTopButton } from './BackToTopButton';
|
|
4
|
-
export { default as ViewFigmaButton } from './ViewFigmaButton';
|
|
5
|
-
export { default as DocComponentWrap } from './DocComponentWrap';
|
|
6
3
|
export { default as BadgeList } from './BadgeList';
|
|
7
|
-
export { default as
|
|
4
|
+
export { default as DocComponentWrap } from './DocComponentWrap';
|
|
5
|
+
export { default as NextPrevPage } from './NextPrevPage';
|
|
8
6
|
export { default as SwitchExample } from './SwitchExample';
|
|
9
7
|
export { default as SwitchList } from './SwitchList';
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
8
|
+
export { default as UsageWrap } from './UsageWrap';
|
|
9
|
+
export { default as VariantTitle } from './VariantTitle';
|
|
10
|
+
export { default as ViewFigmaButton } from './ViewFigmaButton';
|
|
11
|
+
export { default as ViewWrap } from './ViewWrap';
|
package/docs/getting-started.mdx
CHANGED
|
@@ -9,12 +9,12 @@ import { BackToTopButton, NextPrevPage } from './components';
|
|
|
9
9
|
You can just start using the components from the `@utilitywarehouse/hearth-react-native` package.
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
|
-
import { Box, Alert,
|
|
12
|
+
import { Box, Alert, BodyText } from '@utilitywarehouse/hearth-react-native';
|
|
13
13
|
|
|
14
14
|
const App: React.FC = () => (
|
|
15
|
-
<Box>
|
|
15
|
+
<Box p="200">
|
|
16
16
|
<Alert variant="info" text="Welcome to Hearth React Native!" />
|
|
17
|
-
<
|
|
17
|
+
<BodyText>Start building your app with Hearth React Native components.</BodyText>
|
|
18
18
|
</Box>
|
|
19
19
|
);
|
|
20
20
|
```
|
|
@@ -25,15 +25,15 @@ By default the light colour mode is enabled. If you want to enable dark mode, yo
|
|
|
25
25
|
use the `useColorMode` hook to toggle between light and dark modes.
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
|
-
import { useColorMode, Box, Alert,
|
|
28
|
+
import { useColorMode, Box, Alert, BodyText, Button } from '@utilitywarehouse/hearth-react-native';
|
|
29
29
|
|
|
30
30
|
const App: React.FC = () => {
|
|
31
31
|
const [colorMode, setColorMode] = useColorMode();
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
|
-
<Box>
|
|
34
|
+
<Box p="200">
|
|
35
35
|
<Alert variant="info" text="Welcome to Hearth React Native!" />
|
|
36
|
-
<
|
|
36
|
+
<BodyText>Start building your app with Hearth React Native components.</BodyText>
|
|
37
37
|
<Button onPress={() => setColorMode(colorMode === 'light' ? 'dark' : 'light')}>
|
|
38
38
|
Toggle Color Mode
|
|
39
39
|
</Button>
|
package/docs/introduction.mdx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import pig from '../../../shared/storybook/assets/images/react-native-pig.png';
|
|
2
3
|
import { version } from '../package.json';
|
|
3
4
|
import { Box } from '../src';
|
|
4
|
-
import pig from './assets/react-native-pig.png';
|
|
5
5
|
import { BackToTopButton, NextPrevPage } from './components';
|
|
6
6
|
|
|
7
7
|
<Meta title="Introduction" />
|
|
@@ -39,7 +39,7 @@ npm install @utilitywarehouse/hearth-react-native
|
|
|
39
39
|
To install the peer dependencies, you can run the following command:
|
|
40
40
|
|
|
41
41
|
```console
|
|
42
|
-
npm install react-native-unistyles react-native-edge-to-edge react-native-nitro-modules@0.28.1 @gorhom/bottom-sheet react-native-svg react-native-reanimated react-native-worklets react-native-gesture-handler
|
|
42
|
+
npm install react-native-unistyles react-native-edge-to-edge react-native-nitro-modules@0.28.1 @gorhom/bottom-sheet react-native-svg react-native-reanimated react-native-worklets react-native-gesture-handler @utilitywarehouse/hearth-react-native-icons
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
For more information on how to install and configure `react-native-svg`, `react-native-gesture-handler` and `react-native-reanimated`,
|
|
@@ -63,7 +63,7 @@ The `@utilitywarehouse/hearth-react-native` library uses a few packages under th
|
|
|
63
63
|
as well as fonts and icons. Feel free to additionally install these packages if you need to use them in your project.
|
|
64
64
|
|
|
65
65
|
```console
|
|
66
|
-
npm install @utilitywarehouse/hearth-tokens
|
|
66
|
+
npm install @utilitywarehouse/hearth-tokens
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
You will need to include the **Comic Hams**, **DM Mono** and **DM Sans** fonts.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@expo/html-elements": "latest",
|
|
12
11
|
"@gluestack-ui/accordion": "1.0.7",
|
|
13
12
|
"@gluestack-ui/alert": "0.1.15",
|
|
14
13
|
"@gluestack-ui/button": "1.0.7",
|
|
@@ -21,22 +20,23 @@
|
|
|
21
20
|
"@gluestack-ui/spinner": "0.1.14",
|
|
22
21
|
"@gluestack-ui/switch": "0.1.22",
|
|
23
22
|
"@gluestack-ui/textarea": "0.1.23",
|
|
24
|
-
"
|
|
23
|
+
"dayjs": "^1.11.13"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
26
|
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
|
28
27
|
"@chromatic-com/storybook": "^4.1.1",
|
|
29
28
|
"@figma/code-connect": "^1.3.3",
|
|
30
29
|
"@gorhom/bottom-sheet": "5.1.6",
|
|
31
|
-
"@storybook/addon-a11y": "^9.1.
|
|
32
|
-
"@storybook/addon-docs": "^9.1.
|
|
33
|
-
"@storybook/addon-vitest": "^9.1.
|
|
34
|
-
"@storybook/react-native-web-vite": "^9.1.
|
|
30
|
+
"@storybook/addon-a11y": "^9.1.6",
|
|
31
|
+
"@storybook/addon-docs": "^9.1.6",
|
|
32
|
+
"@storybook/addon-vitest": "^9.1.6",
|
|
33
|
+
"@storybook/react-native-web-vite": "^9.1.6",
|
|
35
34
|
"@types/prismjs": "^1.26.5",
|
|
36
35
|
"@types/react": "^19.1.10",
|
|
37
36
|
"@vitest/browser": "^3.2.4",
|
|
38
37
|
"@vitest/coverage-v8": "^3.2.4",
|
|
39
|
-
"
|
|
38
|
+
"chromatic": "^13.3.0",
|
|
39
|
+
"eslint-plugin-storybook": "9.1.6",
|
|
40
40
|
"playwright": "^1.53.1",
|
|
41
41
|
"prismjs": "^1.30.0",
|
|
42
42
|
"react": "^19.1.0",
|
|
@@ -49,16 +49,18 @@
|
|
|
49
49
|
"react-native-unistyles": "3.0.10",
|
|
50
50
|
"react-native-web": "^0.20.0",
|
|
51
51
|
"remark-gfm": "^4.0.1",
|
|
52
|
-
"storybook": "^9.1.
|
|
52
|
+
"storybook": "^9.1.6",
|
|
53
53
|
"typescript": "^5.7.3",
|
|
54
54
|
"vite": "^7.1.3",
|
|
55
55
|
"vitest": "^3.2.4",
|
|
56
56
|
"@utilitywarehouse/hearth-fonts": "^0.0.3",
|
|
57
|
-
"@utilitywarehouse/hearth-react-icons": "^0.
|
|
58
|
-
"@utilitywarehouse/hearth-
|
|
57
|
+
"@utilitywarehouse/hearth-react-icons": "^0.5.0",
|
|
58
|
+
"@utilitywarehouse/hearth-react-native-icons": "^0.5.0",
|
|
59
|
+
"@utilitywarehouse/hearth-tokens": "^0.1.0"
|
|
59
60
|
},
|
|
60
61
|
"peerDependencies": {
|
|
61
62
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
63
|
+
"@utilitywarehouse/hearth-react-native-icons": "0.4.0",
|
|
62
64
|
"react": ">=17 || ^18.0.0 || ^19.0.0",
|
|
63
65
|
"react-native": ">=0.77",
|
|
64
66
|
"react-native-gesture-handler": "^2.22.0",
|
|
@@ -79,6 +81,8 @@
|
|
|
79
81
|
"figma:publish": "figma connect publish",
|
|
80
82
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
81
83
|
"dev": "storybook dev -p 6006",
|
|
82
|
-
"build:storybook": "storybook build"
|
|
84
|
+
"build:storybook": "storybook build",
|
|
85
|
+
"build-storybook": "storybook build",
|
|
86
|
+
"chromatic": "npx chromatic --project-token=chpt_cce0fb1ebd95d2a --build-script-name build:storybook"
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -3,22 +3,50 @@ import { ComponentType } from 'react';
|
|
|
3
3
|
import { ViewStyle } from 'react-native';
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
5
|
import { UnstyledIconButton, UnstyledIconButtonProps } from '../UnstyledIconButton';
|
|
6
|
+
import { useAlertContext } from './Alert.context';
|
|
6
7
|
|
|
7
8
|
const AlertCloseButton = ({
|
|
8
9
|
style,
|
|
9
10
|
icon = CloseSmallIcon,
|
|
10
11
|
...props
|
|
11
|
-
}: Omit<UnstyledIconButtonProps, 'icon'> & { icon?: ComponentType }) =>
|
|
12
|
-
|
|
13
|
-
);
|
|
12
|
+
}: Omit<UnstyledIconButtonProps, 'icon'> & { icon?: ComponentType }) => {
|
|
13
|
+
const { colorScheme } = useAlertContext();
|
|
14
|
+
styles.useVariants({ colorScheme });
|
|
15
|
+
return (
|
|
16
|
+
<UnstyledIconButton
|
|
17
|
+
{...props}
|
|
18
|
+
size="sm"
|
|
19
|
+
style={[styles.button, style as ViewStyle]}
|
|
20
|
+
icon={icon}
|
|
21
|
+
iconStyle={styles.icon as ViewStyle}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
14
25
|
|
|
15
26
|
const styles = StyleSheet.create(theme => ({
|
|
16
|
-
|
|
27
|
+
button: {
|
|
17
28
|
alignSelf: 'flex-start',
|
|
18
|
-
color: theme.color.icon.primary,
|
|
19
29
|
minWidth: 20,
|
|
20
30
|
minHeight: 20,
|
|
21
31
|
},
|
|
32
|
+
icon: {
|
|
33
|
+
variants: {
|
|
34
|
+
colorScheme: {
|
|
35
|
+
info: {
|
|
36
|
+
color: theme.color.feedback.info.foreground.default,
|
|
37
|
+
},
|
|
38
|
+
positive: {
|
|
39
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
40
|
+
},
|
|
41
|
+
danger: {
|
|
42
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
43
|
+
},
|
|
44
|
+
warning: {
|
|
45
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
22
50
|
}));
|
|
23
51
|
|
|
24
52
|
AlertCloseButton.displayName = 'AlertCloseButton';
|
|
@@ -19,6 +19,7 @@ const AlertIcon = (props: IconProps) => {
|
|
|
19
19
|
}
|
|
20
20
|
return InfoMediumIcon;
|
|
21
21
|
})();
|
|
22
|
+
styles.useVariants({ colorScheme });
|
|
22
23
|
return <Icon {...props} as={props.as ?? asProp} style={styles.icon} />;
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -31,7 +32,22 @@ const styles = StyleSheet.create(theme => ({
|
|
|
31
32
|
minWidth: 24,
|
|
32
33
|
minHeight: 24,
|
|
33
34
|
alignSelf: 'flex-start',
|
|
34
|
-
|
|
35
|
+
variants: {
|
|
36
|
+
colorScheme: {
|
|
37
|
+
info: {
|
|
38
|
+
color: theme.color.feedback.info.foreground.default,
|
|
39
|
+
},
|
|
40
|
+
positive: {
|
|
41
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
42
|
+
},
|
|
43
|
+
danger: {
|
|
44
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
45
|
+
},
|
|
46
|
+
warning: {
|
|
47
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
35
51
|
},
|
|
36
52
|
}));
|
|
37
53
|
|
|
@@ -1,15 +1,48 @@
|
|
|
1
|
+
import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
1
2
|
import { ComponentType } from 'react';
|
|
2
3
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
5
|
import { UnstyledIconButton, UnstyledIconButtonProps } from '../UnstyledIconButton';
|
|
6
|
+
import { useAlertContext } from './Alert.context';
|
|
5
7
|
|
|
6
8
|
const AlertIconButton = ({
|
|
7
9
|
style,
|
|
8
10
|
icon = ChevronRightSmallIcon,
|
|
9
11
|
...props
|
|
10
|
-
}: Omit<UnstyledIconButtonProps, 'icon'> & { icon?: ComponentType }) =>
|
|
11
|
-
|
|
12
|
-
);
|
|
12
|
+
}: Omit<UnstyledIconButtonProps, 'icon'> & { icon?: ComponentType }) => {
|
|
13
|
+
const { colorScheme } = useAlertContext();
|
|
14
|
+
styles.useVariants({ colorScheme });
|
|
15
|
+
return (
|
|
16
|
+
<UnstyledIconButton
|
|
17
|
+
{...props}
|
|
18
|
+
size="sm"
|
|
19
|
+
style={style as ViewStyle}
|
|
20
|
+
icon={icon}
|
|
21
|
+
iconStyle={styles.icon as ViewStyle}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const styles = StyleSheet.create(theme => ({
|
|
27
|
+
icon: {
|
|
28
|
+
variants: {
|
|
29
|
+
colorScheme: {
|
|
30
|
+
info: {
|
|
31
|
+
color: theme.color.feedback.info.foreground.default,
|
|
32
|
+
},
|
|
33
|
+
positive: {
|
|
34
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
35
|
+
},
|
|
36
|
+
danger: {
|
|
37
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
38
|
+
},
|
|
39
|
+
warning: {
|
|
40
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}));
|
|
13
46
|
|
|
14
47
|
AlertIconButton.displayName = 'AlertIconButton';
|
|
15
48
|
|