@ornikar/kitt-universal 9.30.2 → 9.32.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.
Files changed (92) hide show
  1. package/dist/definitions/KittBreakpoints.d.ts +2 -2
  2. package/dist/definitions/KittBreakpoints.d.ts.map +1 -1
  3. package/dist/definitions/NavigationModal/Body.d.ts +2 -1
  4. package/dist/definitions/NavigationModal/Body.d.ts.map +1 -1
  5. package/dist/definitions/NavigationModal/Header.d.ts +3 -1
  6. package/dist/definitions/NavigationModal/Header.d.ts.map +1 -1
  7. package/dist/definitions/NavigationModal/NavigationModalAnimation.d.ts.map +1 -1
  8. package/dist/definitions/NavigationModal/components/NativeSlideInAnimation.d.ts +1 -2
  9. package/dist/definitions/NavigationModal/components/NativeSlideInAnimation.d.ts.map +1 -1
  10. package/dist/definitions/forms/DatePicker/DatePicker.d.ts +36 -2
  11. package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -1
  12. package/dist/definitions/forms/DatePicker/DatePicker.web.d.ts +2 -2
  13. package/dist/definitions/forms/DatePicker/DatePicker.web.d.ts.map +1 -1
  14. package/dist/definitions/forms/DatePicker/components/DatePickerInputs.d.ts +25 -0
  15. package/dist/definitions/forms/DatePicker/components/DatePickerInputs.d.ts.map +1 -0
  16. package/dist/definitions/forms/DatePicker/components/InputPart.d.ts +16 -0
  17. package/dist/definitions/forms/DatePicker/components/InputPart.d.ts.map +1 -0
  18. package/dist/definitions/forms/DatePicker/components/KeyboardDatePicker.d.ts +7 -0
  19. package/dist/definitions/forms/DatePicker/components/KeyboardDatePicker.d.ts.map +1 -0
  20. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DatePickerAndroid.d.ts +8 -0
  21. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DatePickerAndroid.d.ts.map +1 -0
  22. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DefaultNativeUIDatePicker.d.ts +4 -0
  23. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DefaultNativeUIDatePicker.d.ts.map +1 -0
  24. package/dist/definitions/forms/DatePicker/{ModalPlatformDateTimePicker.d.ts → components/NativeUIDatePicker/ModalPlatformDateTimePicker.d.ts} +0 -0
  25. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -0
  26. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/NativeUIDatePicker.d.ts +7 -0
  27. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/NativeUIDatePicker.d.ts.map +1 -0
  28. package/dist/definitions/forms/DatePicker/{PlatformDateTimePicker.d.ts → components/NativeUIDatePicker/PlatformDateTimePicker.d.ts} +0 -0
  29. package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/PlatformDateTimePicker.d.ts.map +1 -0
  30. package/dist/definitions/forms/DatePicker/components/PartContainer.d.ts +10 -0
  31. package/dist/definitions/forms/DatePicker/components/PartContainer.d.ts.map +1 -0
  32. package/dist/definitions/forms/DatePicker/reducers/keyboardDatePickerReducer.d.ts +41 -0
  33. package/dist/definitions/forms/DatePicker/reducers/keyboardDatePickerReducer.d.ts.map +1 -0
  34. package/dist/definitions/forms/DatePicker/utils/dateFormatter.d.ts +4 -0
  35. package/dist/definitions/forms/DatePicker/utils/dateFormatter.d.ts.map +1 -0
  36. package/dist/definitions/forms/DatePicker/utils/datePartInInterval.d.ts +4 -0
  37. package/dist/definitions/forms/DatePicker/utils/datePartInInterval.d.ts.map +1 -0
  38. package/dist/definitions/forms/DatePicker/utils/isNumber.d.ts +2 -0
  39. package/dist/definitions/forms/DatePicker/utils/isNumber.d.ts.map +1 -0
  40. package/dist/definitions/forms/DatePicker/utils/onDatePartChange.d.ts +11 -0
  41. package/dist/definitions/forms/DatePicker/utils/onDatePartChange.d.ts.map +1 -0
  42. package/dist/definitions/forms/DatePicker/utils/stringToNumber.d.ts +2 -0
  43. package/dist/definitions/forms/DatePicker/utils/stringToNumber.d.ts.map +1 -0
  44. package/dist/definitions/forms/InputText/InputText.d.ts +4 -1
  45. package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
  46. package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
  47. package/dist/definitions/forms/utils.d.ts +0 -8
  48. package/dist/definitions/forms/utils.d.ts.map +1 -1
  49. package/dist/definitions/index.d.ts +1 -1
  50. package/dist/definitions/index.d.ts.map +1 -1
  51. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +25 -0
  52. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  53. package/dist/definitions/themes/default.d.ts +1 -0
  54. package/dist/definitions/themes/default.d.ts.map +1 -1
  55. package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts +1 -0
  56. package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts.map +1 -1
  57. package/dist/index-browser-all.es.android.js +701 -319
  58. package/dist/index-browser-all.es.android.js.map +1 -1
  59. package/dist/index-browser-all.es.ios.js +701 -319
  60. package/dist/index-browser-all.es.ios.js.map +1 -1
  61. package/dist/index-browser-all.es.js +701 -319
  62. package/dist/index-browser-all.es.js.map +1 -1
  63. package/dist/index-browser-all.es.web.js +437 -203
  64. package/dist/index-browser-all.es.web.js.map +1 -1
  65. package/dist/index-node-14.17.cjs.js +616 -231
  66. package/dist/index-node-14.17.cjs.js.map +1 -1
  67. package/dist/index-node-14.17.cjs.web.js +416 -171
  68. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  69. package/dist/linaria-themes-browser-all.es.android.js +1 -0
  70. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  71. package/dist/linaria-themes-browser-all.es.ios.js +1 -0
  72. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  73. package/dist/linaria-themes-browser-all.es.js +1 -0
  74. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  75. package/dist/linaria-themes-browser-all.es.web.js +1 -0
  76. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  77. package/dist/linaria-themes-node-14.17.cjs.js +1 -0
  78. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  79. package/dist/linaria-themes-node-14.17.cjs.web.js +1 -0
  80. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  81. package/dist/tsbuildinfo +1 -1
  82. package/package.json +2 -2
  83. package/dist/definitions/forms/DatePicker/DatePickerAndroid.d.ts +0 -12
  84. package/dist/definitions/forms/DatePicker/DatePickerAndroid.d.ts.map +0 -1
  85. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts +0 -11
  86. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +0 -1
  87. package/dist/definitions/forms/DatePicker/DatePickerInputs.d.ts +0 -9
  88. package/dist/definitions/forms/DatePicker/DatePickerInputs.d.ts.map +0 -1
  89. package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts.map +0 -1
  90. package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts.map +0 -1
  91. package/dist/definitions/forms/DatePicker/types.d.ts +0 -35
  92. package/dist/definitions/forms/DatePicker/types.d.ts.map +0 -1
@@ -209,14 +209,6 @@ const TypographyDefaultColorContext = /*#__PURE__*/react.createContext(undefined
209
209
  function useTypographyDefaultColor() {
210
210
  return react.useContext(TypographyDefaultColorContext);
211
211
  }
212
-
213
- /** @deprecated use native-base instead for SSR compatibility */
214
- const getTypographyTypeConfigKey = theme => {
215
- const isMediumOrAbove = theme.responsive.matchWindowSize({
216
- minWidth: KittBreakpoints.MEDIUM
217
- });
218
- return isMediumOrAbove ? 'mediumAndWide' : 'baseAndSmall';
219
- };
220
212
  function getTypographyTypeConfigKeyFromTypeName(breakpointName) {
221
213
  return breakpointName === 'base' || breakpointName === 'small' ? 'baseAndSmall' : 'mediumAndWide';
222
214
  }
@@ -906,6 +898,7 @@ const lateOceanColorPalette = {
906
898
  englishVermillon: '#D44148',
907
899
  goldCrayola: '#F8C583',
908
900
  aero: '#89BDDD',
901
+ seaShell: '#FFF9F3',
909
902
  transparent: 'transparent',
910
903
  moonPurple: '#DBD6F9',
911
904
  moonPurpleLight1: '#EDEBFC'
@@ -2939,171 +2932,204 @@ function Checkbox({
2939
2932
  });
2940
2933
  }
2941
2934
 
2942
- /** @deprecated use native-base instead */
2943
- function getInputUIState({
2944
- isFocused,
2945
- isDisabled,
2946
- formState
2947
- }) {
2948
- if (isDisabled) return 'disabled';
2949
- if (isFocused) return 'focus';
2950
- if (formState === 'invalid') return 'invalid';
2951
- return 'default';
2935
+ function prefixWithZero(value, maxLength = 2) {
2936
+ return `${value}`.padStart(maxLength, '0');
2952
2937
  }
2953
-
2954
- /** @deprecated this mixin is not SSR compatible */
2955
- const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
2956
- theme,
2957
- $state
2958
- }) => $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
2959
- theme
2960
- }) => theme.kitt.forms.input.borderWidth, ({
2961
- theme
2962
- }) => theme.kitt.forms.input.borderRadius, ({
2963
- theme,
2964
- $state
2965
- }) => theme.kitt.forms.input.states[$state].borderColor, ({
2966
- theme
2967
- }) => {
2968
- const typeConfigKey = getTypographyTypeConfigKey(theme);
2969
- return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
2970
- }, ({
2971
- theme,
2972
- $state
2973
- }) => theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states.default.color, ({
2974
- theme
2975
- }) => theme.kitt.typography.types.bodies.fontFamily.web.regular);
2976
-
2977
- const StyledTypographyText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
2978
- displayName: "DatePickerInputPart__StyledTypographyText",
2979
- componentId: "kitt-universal__sc-11fmlmi-0"
2980
- })(["text-align:center;"]);
2981
- const ViewInput = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2982
- displayName: "DatePickerInputPart__ViewInput",
2983
- componentId: "kitt-universal__sc-11fmlmi-1"
2984
- })(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, ({
2985
- theme
2986
- }) => `${theme.kitt.forms.input.padding.vertical}px ${theme.kitt.forms.input.padding.horizontal}px`, ({
2987
- theme
2988
- }) => theme.kitt.forms.input.minHeight, ({
2989
- theme,
2990
- $partName
2991
- }) => {
2992
- if (!$partName) {
2993
- return undefined;
2994
- }
2995
- return `${theme.kitt.forms.datePicker[$partName].minWidth}px`;
2996
- });
2997
- function DatePickerInputPart({
2998
- $state,
2999
- placeholder,
3000
- value,
3001
- partName,
3002
- disabled
3003
- }) {
3004
- return /*#__PURE__*/jsxRuntime.jsx(ViewInput, {
3005
- $state: $state,
3006
- $partName: partName,
3007
- children: placeholder || value ? /*#__PURE__*/jsxRuntime.jsx(StyledTypographyText, {
3008
- color: !value || disabled ? 'black-light' : undefined,
3009
- children: value || placeholder
3010
- }) : null
3011
- });
2938
+ function dayFormatter(day) {
2939
+ return prefixWithZero(day);
2940
+ }
2941
+ function monthFormatter(month) {
2942
+ return prefixWithZero(month);
2943
+ }
2944
+ function yearFormatter(year) {
2945
+ return prefixWithZero(year, 4);
3012
2946
  }
3013
2947
 
3014
- function prefixWithZero(value) {
3015
- return `${value}`.padStart(2, '0');
2948
+ function getDayInInterval(value, minDate, maxDate) {
2949
+ const minValue = minDate ? minDate.getDate() : 1;
2950
+ const maxValue = maxDate ? maxDate.getDate() : 31;
2951
+ return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
3016
2952
  }
3017
- const PartContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3018
- displayName: "DatePickerInputs__PartContainer",
3019
- componentId: "kitt-universal__sc-j9hin5-0"
3020
- })(["margin-right:", ";", ";"], ({
3021
- theme,
3022
- $isLast
3023
- }) => !$isLast ? `${theme.kitt.spacing * 2}px` : 0, ({
3024
- $isStretch
3025
- }) => $isStretch ? styled.css(["flex:0.33;flex-grow:1;"]) : undefined);
3026
- const DatePickerPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
3027
- displayName: "DatePickerInputs__DatePickerPressable",
3028
- componentId: "kitt-universal__sc-j9hin5-1"
3029
- })(["display:flex;flex-direction:row;", ";"], ({
3030
- $isStretch
3031
- }) => {
3032
- if ($isStretch) {
3033
- return styled.css(["width:100%;"]);
3034
- }
3035
- return styled.css(["align-self:baseline;"]);
3036
- });
3037
- function DatePickerInputs({
3038
- state,
3039
- internalForceState,
3040
- isFocused,
3041
- disabled,
3042
- stretch,
3043
- id,
3044
- testID,
3045
- handleModalOpen,
3046
- currentValue,
3047
- placeholder
3048
- }) {
3049
- const currentState = internalForceState || getInputUIState({
3050
- isFocused,
3051
- isDisabled: Boolean(disabled),
3052
- formState: state
3053
- });
3054
- const sharedPartProps = {
3055
- disabled,
3056
- $state: currentState
3057
- };
3058
- return /*#__PURE__*/jsxRuntime.jsxs(DatePickerPressable, {
3059
- $isStretch: stretch,
3060
- nativeID: id,
3061
- disabled: disabled,
3062
- testID: testID,
3063
- onPress: handleModalOpen,
3064
- children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
3065
- $isStretch: stretch,
3066
- children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, {
3067
- ...sharedPartProps,
3068
- partName: "day",
3069
- value: currentValue ? prefixWithZero(currentValue.getDate()) : undefined,
3070
- placeholder: placeholder?.day
3071
- })
3072
- }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
3073
- $isStretch: stretch,
3074
- children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, {
3075
- ...sharedPartProps,
3076
- partName: "month",
3077
- value: currentValue ? prefixWithZero(currentValue.getMonth() + 1) : undefined,
3078
- placeholder: placeholder?.month
3079
- })
3080
- }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
3081
- $isLast: true,
3082
- $isStretch: stretch,
3083
- children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, {
3084
- ...sharedPartProps,
3085
- partName: "year",
3086
- value: currentValue ? currentValue.getFullYear() : undefined,
3087
- placeholder: placeholder?.year
3088
- })
3089
- })]
3090
- });
2953
+ function getMonthInInterval(value, minDate, maxDate) {
2954
+ const minValue = minDate ? minDate.getMonth() + 1 : 1;
2955
+ const maxValue = maxDate ? maxDate.getMonth() + 1 : 12;
2956
+ return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
2957
+ }
2958
+ function getYearInInterval(value, minDate, maxDate) {
2959
+ const minValue = minDate ? minDate.getFullYear() : 1;
2960
+ const maxValue = maxDate ? maxDate.getFullYear() : 9999;
2961
+ return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
3091
2962
  }
3092
2963
 
3093
- // This is not yet implemented
3094
- // We still display the inputs for chromatic
3095
- function DatePicker({
3096
- value,
3097
- ...props
3098
- }) {
3099
- return /*#__PURE__*/jsxRuntime.jsx(DatePickerInputs, {
3100
- handleModalOpen: () => {},
3101
- currentValue: value,
3102
- isFocused: false,
3103
- ...props
3104
- });
2964
+ function isNumber(input) {
2965
+ // Number.isNaN and isNaN are not consistent
2966
+ // eslint-disable-next-line no-restricted-globals
2967
+ return !isNaN(input);
3105
2968
  }
3106
2969
 
2970
+ function onDatePartChange({
2971
+ day,
2972
+ month,
2973
+ year,
2974
+ onChange,
2975
+ onBlur,
2976
+ onFocus
2977
+ }) {
2978
+ const arrayParts = [day, month, year];
2979
+ const isEverythingUndefined = arrayParts.every(v => v === undefined);
2980
+ const isEverythingDefined = arrayParts.every(Boolean);
2981
+
2982
+ // every parts are undefined
2983
+ if (isEverythingUndefined) {
2984
+ if (onFocus) onFocus();
2985
+ onChange(undefined);
2986
+ if (onBlur) onBlur();
2987
+ return;
2988
+ }
2989
+
2990
+ // Do nothing if some input parts are empty
2991
+ if (!isEverythingDefined) {
2992
+ return;
2993
+ }
2994
+ const nextValue = new Date();
2995
+ if (day) nextValue.setDate(day);
2996
+ if (month) nextValue.setMonth(month - 1);
2997
+ if (year) nextValue.setFullYear(year);
2998
+ nextValue.setMinutes(0);
2999
+ nextValue.setHours(0);
3000
+ nextValue.setSeconds(0);
3001
+ nextValue.setMilliseconds(0);
3002
+ if (onFocus) onFocus();
3003
+ onChange(nextValue);
3004
+ if (onBlur) onBlur();
3005
+ }
3006
+
3007
+ function stringToNumber(text) {
3008
+ if (text.length === 0) return undefined;
3009
+ return parseInt(text, 10);
3010
+ }
3011
+
3012
+ const keyboardDatePickerReducer = (state, action) => {
3013
+ const handleChange = dateParts => {
3014
+ const {
3015
+ onFocus,
3016
+ onBlur,
3017
+ onChange
3018
+ } = state;
3019
+ onDatePartChange({
3020
+ ...dateParts,
3021
+ onFocus,
3022
+ onBlur,
3023
+ onChange
3024
+ });
3025
+ };
3026
+ switch (action.type) {
3027
+ case 'day-change':
3028
+ {
3029
+ const nextDay = stringToNumber(action.nextDay || '');
3030
+ if (nextDay === undefined || !isNumber(action.nextDay)) {
3031
+ return {
3032
+ ...state,
3033
+ currentDay: undefined,
3034
+ displayedDay: ''
3035
+ };
3036
+ }
3037
+ handleChange({
3038
+ day: nextDay,
3039
+ month: state.currentMonth,
3040
+ year: state.currentYear
3041
+ });
3042
+ return {
3043
+ ...state,
3044
+ currentDay: nextDay,
3045
+ displayedDay: nextDay.toString()
3046
+ };
3047
+ }
3048
+ case 'month-change':
3049
+ {
3050
+ const nextMonth = stringToNumber(action.nextMonth || '');
3051
+ if (nextMonth === undefined || !isNumber(action.nextMonth)) {
3052
+ return {
3053
+ ...state,
3054
+ currentMonth: undefined,
3055
+ displayedMonth: ''
3056
+ };
3057
+ }
3058
+ handleChange({
3059
+ day: state.currentDay,
3060
+ month: nextMonth,
3061
+ year: state.currentYear
3062
+ });
3063
+ return {
3064
+ ...state,
3065
+ currentMonth: nextMonth,
3066
+ displayedMonth: nextMonth.toString()
3067
+ };
3068
+ }
3069
+ case 'year-change':
3070
+ {
3071
+ const nextYear = stringToNumber(action.nextYear || '');
3072
+ if (nextYear === undefined || !isNumber(action.nextYear)) {
3073
+ return {
3074
+ ...state,
3075
+ currentYear: undefined,
3076
+ displayedYear: ''
3077
+ };
3078
+ }
3079
+ handleChange({
3080
+ day: state.currentDay,
3081
+ month: state.currentMonth,
3082
+ year: nextYear
3083
+ });
3084
+ return {
3085
+ ...state,
3086
+ currentYear: nextYear,
3087
+ displayedYear: nextYear.toString()
3088
+ };
3089
+ }
3090
+ case 'day-blur':
3091
+ {
3092
+ const {
3093
+ minDate,
3094
+ maxDate
3095
+ } = state;
3096
+ const nextCurrentDay = getDayInInterval(state.currentDay, minDate, maxDate);
3097
+ return {
3098
+ ...state,
3099
+ displayedDay: nextCurrentDay ? dayFormatter(nextCurrentDay) : state.displayedDay
3100
+ };
3101
+ }
3102
+ case 'month-blur':
3103
+ {
3104
+ const {
3105
+ minDate,
3106
+ maxDate
3107
+ } = state;
3108
+ const nextCurrentMonth = getMonthInInterval(state.currentMonth, minDate, maxDate);
3109
+ return {
3110
+ ...state,
3111
+ currentMonth: nextCurrentMonth,
3112
+ displayedMonth: nextCurrentMonth !== undefined ? monthFormatter(nextCurrentMonth) : state.displayedMonth
3113
+ };
3114
+ }
3115
+ case 'year-blur':
3116
+ {
3117
+ const {
3118
+ minDate,
3119
+ maxDate
3120
+ } = state;
3121
+ const nextCurrentYear = getYearInInterval(state.currentYear, minDate, maxDate);
3122
+ return {
3123
+ ...state,
3124
+ currentYear: nextCurrentYear,
3125
+ displayedYear: nextCurrentYear !== undefined ? yearFormatter(nextCurrentYear) : state.displayedYear
3126
+ };
3127
+ }
3128
+ default:
3129
+ return state;
3130
+ }
3131
+ };
3132
+
3107
3133
  const _exp$3 = /*#__PURE__*/() => ({
3108
3134
  theme
3109
3135
  }) => {
@@ -3177,6 +3203,181 @@ const InputText = /*#__PURE__*/react.forwardRef(({
3177
3203
  });
3178
3204
  });
3179
3205
 
3206
+ function getCurrentInternalForcedState({
3207
+ isDisabled,
3208
+ isHoveredInternal,
3209
+ isFocusedInternal,
3210
+ isPressedInternal
3211
+ }) {
3212
+ if (isDisabled) return 'disabled';
3213
+ if (isHoveredInternal) return 'hover';
3214
+ if (isFocusedInternal) return 'focus';
3215
+ if (isPressedInternal) return 'hover';
3216
+ return 'default';
3217
+ }
3218
+ const InputPart = /*#__PURE__*/react.forwardRef(({
3219
+ value,
3220
+ placeholder,
3221
+ disabled,
3222
+ isFocusedInternal,
3223
+ isHoveredInternal,
3224
+ isPressedInternal,
3225
+ onChange,
3226
+ onBlur
3227
+ }, ref) => {
3228
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, {
3229
+ ref: ref,
3230
+ internalForceState: getCurrentInternalForcedState({
3231
+ isDisabled: disabled,
3232
+ isHoveredInternal,
3233
+ isFocusedInternal,
3234
+ isPressedInternal
3235
+ }),
3236
+ value: value,
3237
+ placeholder: placeholder,
3238
+ disabled: disabled,
3239
+ keyboardType: "numeric",
3240
+ textAlign: "center",
3241
+ onChange: onChange,
3242
+ onBlur: onBlur
3243
+ });
3244
+ });
3245
+
3246
+ function PartContainer({
3247
+ children,
3248
+ isStretch,
3249
+ width
3250
+ }) {
3251
+ return /*#__PURE__*/jsxRuntime.jsx(View, {
3252
+ flex: createResponsiveStyleFromProp(isStretch, 0.33),
3253
+ flexGrow: createResponsiveStyleFromProp(isStretch, 1),
3254
+ width: isStretch ? undefined : width,
3255
+ children: children
3256
+ });
3257
+ }
3258
+
3259
+ function KeyboardDatePicker({
3260
+ value,
3261
+ testID,
3262
+ id,
3263
+ stretch,
3264
+ placeholder,
3265
+ minDate,
3266
+ maxDate,
3267
+ disabled,
3268
+ isFocusedInternal,
3269
+ isHoveredInternal,
3270
+ isPressedInternal,
3271
+ onChange,
3272
+ onBlur,
3273
+ onFocus,
3274
+ ...props
3275
+ }) {
3276
+ const dayRef = react.useRef(null);
3277
+ const monthRef = react.useRef(null);
3278
+ const yearRef = react.useRef(null);
3279
+ const defaultValue = value;
3280
+ const defaultDay = defaultValue?.getDate();
3281
+ const defaultMonth = defaultValue ? defaultValue.getMonth() + 1 : undefined;
3282
+ const defaultYear = defaultValue?.getFullYear();
3283
+ const [state, dispatch] = react.useReducer(keyboardDatePickerReducer, {
3284
+ currentValue: defaultValue,
3285
+ currentDay: defaultDay,
3286
+ currentMonth: defaultMonth,
3287
+ currentYear: defaultYear,
3288
+ displayedDay: defaultDay ? dayFormatter(defaultDay) : '',
3289
+ displayedMonth: defaultMonth ? monthFormatter(defaultMonth) : '',
3290
+ displayedYear: defaultYear ? yearFormatter(defaultYear) : '',
3291
+ minDate,
3292
+ maxDate,
3293
+ onChange,
3294
+ onBlur,
3295
+ onFocus
3296
+ });
3297
+ const sharedInputPartProps = {
3298
+ isFocusedInternal,
3299
+ isHoveredInternal,
3300
+ isPressedInternal,
3301
+ disabled
3302
+ };
3303
+ return /*#__PURE__*/jsxRuntime.jsx(View, {
3304
+ testID: testID,
3305
+ nativeID: id,
3306
+ children: /*#__PURE__*/jsxRuntime.jsxs(HStack, {
3307
+ space: "kitt.2",
3308
+ children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
3309
+ isStretch: stretch,
3310
+ width: "kitt.forms.datePicker.day.minWidth",
3311
+ children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
3312
+ ref: dayRef,
3313
+ ...sharedInputPartProps,
3314
+ placeholder: placeholder?.day,
3315
+ value: state.displayedDay,
3316
+ onChange: e => {
3317
+ const nextDay = e.nativeEvent.text;
3318
+ dispatch({
3319
+ type: 'day-change',
3320
+ nextDay
3321
+ });
3322
+ if (nextDay.length === 2 && monthRef.current) {
3323
+ monthRef.current.focus();
3324
+ }
3325
+ },
3326
+ onBlur: () => dispatch({
3327
+ type: 'day-blur'
3328
+ })
3329
+ })
3330
+ }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
3331
+ isStretch: stretch,
3332
+ width: "kitt.forms.datePicker.month.minWidth",
3333
+ children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
3334
+ ref: monthRef,
3335
+ ...sharedInputPartProps,
3336
+ placeholder: placeholder?.month,
3337
+ value: state.displayedMonth,
3338
+ onChange: e => {
3339
+ const nextMonth = e.nativeEvent.text;
3340
+ dispatch({
3341
+ type: 'month-change',
3342
+ nextMonth: e.nativeEvent.text
3343
+ });
3344
+ if (nextMonth.length === 2 && yearRef.current) {
3345
+ yearRef.current.focus();
3346
+ }
3347
+ },
3348
+ onBlur: () => dispatch({
3349
+ type: 'month-blur'
3350
+ })
3351
+ })
3352
+ }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
3353
+ isStretch: stretch,
3354
+ width: "kitt.forms.datePicker.year.minWidth",
3355
+ children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
3356
+ ref: yearRef,
3357
+ ...sharedInputPartProps,
3358
+ placeholder: placeholder?.year,
3359
+ value: state.displayedYear,
3360
+ onChange: e => {
3361
+ dispatch({
3362
+ type: 'year-change',
3363
+ nextYear: e.nativeEvent.text
3364
+ });
3365
+ },
3366
+ onBlur: () => dispatch({
3367
+ type: 'year-blur'
3368
+ })
3369
+ })
3370
+ })]
3371
+ })
3372
+ });
3373
+ }
3374
+
3375
+ function DatePicker(props) {
3376
+ return /*#__PURE__*/jsxRuntime.jsx(KeyboardDatePicker, {
3377
+ ...props
3378
+ });
3379
+ }
3380
+
3180
3381
  function InputEmail(props) {
3181
3382
  return /*#__PURE__*/jsxRuntime.jsx(InputText, {
3182
3383
  autoComplete: "email",
@@ -4563,6 +4764,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
4563
4764
  typography: theme.typography.colors,
4564
4765
  palettes: theme.palettes,
4565
4766
  forms: {
4767
+ input: {
4768
+ states: theme.forms.input.states
4769
+ },
4566
4770
  radioButtonGroup: {
4567
4771
  item: {
4568
4772
  borderColor: theme.forms.radioButtonGroup.item.borderColor,
@@ -4607,6 +4811,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
4607
4811
  borderRadius: theme.dialogModal.borderRadius
4608
4812
  },
4609
4813
  forms: {
4814
+ input: {
4815
+ borderRadius: theme.forms.input.borderRadius
4816
+ },
4610
4817
  radioButtonGroup: {
4611
4818
  item: {
4612
4819
  borderRadius: theme.forms.radioButtonGroup.item.borderRadius
@@ -4638,6 +4845,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
4638
4845
  borderWidth: theme.button.borderWidth
4639
4846
  },
4640
4847
  forms: {
4848
+ input: {
4849
+ borderWidth: theme.forms.input.borderWidth
4850
+ },
4641
4851
  radioButtonGroup: {
4642
4852
  item: {
4643
4853
  borderWidth: theme.forms.radioButtonGroup.item.borderWidth
@@ -4684,6 +4894,21 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
4684
4894
  overlayPadding: theme.dialogModal.overlayPadding
4685
4895
  },
4686
4896
  forms: {
4897
+ datePicker: {
4898
+ minHeight: theme.forms.input.minHeight,
4899
+ day: {
4900
+ minWidth: theme.forms.datePicker.day.minWidth
4901
+ },
4902
+ month: {
4903
+ minWidth: theme.forms.datePicker.month.minWidth
4904
+ },
4905
+ year: {
4906
+ minWidth: theme.forms.datePicker.year.minWidth
4907
+ }
4908
+ },
4909
+ input: {
4910
+ minHeight: theme.forms.input.minHeight
4911
+ },
4687
4912
  radioButtonGroup: {
4688
4913
  item: {
4689
4914
  minHeight: theme.forms.radioButtonGroup.item.minHeight
@@ -4730,6 +4955,12 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
4730
4955
  overlayPadding: theme.dialogModal.overlayPadding
4731
4956
  },
4732
4957
  forms: {
4958
+ datePicker: {
4959
+ padding: theme.forms.input.padding
4960
+ },
4961
+ input: {
4962
+ padding: theme.forms.input.padding
4963
+ },
4733
4964
  radioButtonGroup: {
4734
4965
  item: {
4735
4966
  padding: theme.forms.radioButtonGroup.item.padding
@@ -5084,8 +5315,9 @@ const StyledViewWithPadding = /*#__PURE__*/styled__default(ContentPadding).withC
5084
5315
  displayName: "Body__StyledViewWithPadding",
5085
5316
  componentId: "kitt-universal__sc-oc39vn-0"
5086
5317
  })(["padding-top:", "px;padding-bottom:", "px;"], ({
5087
- theme
5088
- }) => theme.kitt.spacing * 6, ({
5318
+ theme,
5319
+ $insetTop
5320
+ }) => Math.max(theme.kitt.spacing * 6, $insetTop), ({
5089
5321
  theme,
5090
5322
  $insetBottom
5091
5323
  }) => Math.max(theme.kitt.spacing * 4, $insetBottom));
@@ -5093,15 +5325,19 @@ function Body({
5093
5325
  children,
5094
5326
  shouldHandleBottomNotch,
5095
5327
  style,
5328
+ shouldHandleTopNotch,
5096
5329
  ...props
5097
5330
  }) {
5098
5331
  const {
5099
- bottom
5332
+ bottom,
5333
+ top
5100
5334
  } = reactNativeSafeAreaContext.useSafeAreaInsets();
5101
5335
  const insetBottom = shouldHandleBottomNotch ? bottom : 0;
5336
+ const insetTop = shouldHandleTopNotch ? top : 0;
5102
5337
  return /*#__PURE__*/jsxRuntime.jsx(StyledViewWithPadding, {
5103
5338
  ...props,
5104
5339
  $insetBottom: insetBottom,
5340
+ $insetTop: insetTop,
5105
5341
  style: style,
5106
5342
  children: children
5107
5343
  });
@@ -5144,9 +5380,10 @@ function Footer({
5144
5380
  const HeaderContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig({
5145
5381
  displayName: "Header__HeaderContainer",
5146
5382
  componentId: "kitt-universal__sc-1g7sbq-0"
5147
- })(["height:", "px;width:100%;justify-content:center;background-color:", ";padding-right:", "px;padding-left:", "px;", ";"], ({
5148
- theme
5149
- }) => theme.kitt.navigationModal.height, ({
5383
+ })(["height:", "px;width:100%;justify-content:center;background-color:", ";padding-right:", "px;padding-left:", "px;padding-top:", "px;", ";"], ({
5384
+ theme,
5385
+ $insetTop
5386
+ }) => theme.kitt.navigationModal.height + $insetTop, ({
5150
5387
  theme,
5151
5388
  $isTransparent
5152
5389
  }) => {
@@ -5159,6 +5396,8 @@ const HeaderContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig(
5159
5396
  theme,
5160
5397
  $hasLeft
5161
5398
  }) => $hasLeft ? theme.kitt.spacing * 2 : theme.kitt.navigationModal.padding, ({
5399
+ $insetTop
5400
+ }) => $insetTop, ({
5162
5401
  $hasSeparator
5163
5402
  }) => {
5164
5403
  if (!$hasSeparator) return undefined;
@@ -5214,14 +5453,20 @@ function Header({
5214
5453
  children,
5215
5454
  right,
5216
5455
  left,
5456
+ shouldHandleTopNotch = true,
5217
5457
  style
5218
5458
  }) {
5459
+ const {
5460
+ top
5461
+ } = reactNativeSafeAreaContext.useSafeAreaInsets();
5462
+ const insetTop = shouldHandleTopNotch ? top : 0;
5219
5463
  const sharedProps = {
5220
5464
  $hasLeft: Boolean(left),
5221
5465
  $hasRight: Boolean(right)
5222
5466
  };
5223
5467
  return /*#__PURE__*/jsxRuntime.jsx(HeaderContainer, {
5224
5468
  $isTransparent: isTransparent,
5469
+ $insetTop: insetTop,
5225
5470
  $hasSeparator: hasSeparator,
5226
5471
  $hasLeft: Boolean(left),
5227
5472
  $hasRight: Boolean(right),