@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.
- package/dist/definitions/KittBreakpoints.d.ts +2 -2
- package/dist/definitions/KittBreakpoints.d.ts.map +1 -1
- package/dist/definitions/NavigationModal/Body.d.ts +2 -1
- package/dist/definitions/NavigationModal/Body.d.ts.map +1 -1
- package/dist/definitions/NavigationModal/Header.d.ts +3 -1
- package/dist/definitions/NavigationModal/Header.d.ts.map +1 -1
- package/dist/definitions/NavigationModal/NavigationModalAnimation.d.ts.map +1 -1
- package/dist/definitions/NavigationModal/components/NativeSlideInAnimation.d.ts +1 -2
- package/dist/definitions/NavigationModal/components/NativeSlideInAnimation.d.ts.map +1 -1
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts +36 -2
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/definitions/forms/DatePicker/DatePicker.web.d.ts +2 -2
- package/dist/definitions/forms/DatePicker/DatePicker.web.d.ts.map +1 -1
- package/dist/definitions/forms/DatePicker/components/DatePickerInputs.d.ts +25 -0
- package/dist/definitions/forms/DatePicker/components/DatePickerInputs.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/components/InputPart.d.ts +16 -0
- package/dist/definitions/forms/DatePicker/components/InputPart.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/components/KeyboardDatePicker.d.ts +7 -0
- package/dist/definitions/forms/DatePicker/components/KeyboardDatePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DatePickerAndroid.d.ts +8 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DatePickerAndroid.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DefaultNativeUIDatePicker.d.ts +4 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/DefaultNativeUIDatePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/{ModalPlatformDateTimePicker.d.ts → components/NativeUIDatePicker/ModalPlatformDateTimePicker.d.ts} +0 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/NativeUIDatePicker.d.ts +7 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/NativeUIDatePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/{PlatformDateTimePicker.d.ts → components/NativeUIDatePicker/PlatformDateTimePicker.d.ts} +0 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/PlatformDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/components/PartContainer.d.ts +10 -0
- package/dist/definitions/forms/DatePicker/components/PartContainer.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/reducers/keyboardDatePickerReducer.d.ts +41 -0
- package/dist/definitions/forms/DatePicker/reducers/keyboardDatePickerReducer.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/utils/dateFormatter.d.ts +4 -0
- package/dist/definitions/forms/DatePicker/utils/dateFormatter.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/utils/datePartInInterval.d.ts +4 -0
- package/dist/definitions/forms/DatePicker/utils/datePartInInterval.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/utils/isNumber.d.ts +2 -0
- package/dist/definitions/forms/DatePicker/utils/isNumber.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/utils/onDatePartChange.d.ts +11 -0
- package/dist/definitions/forms/DatePicker/utils/onDatePartChange.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/utils/stringToNumber.d.ts +2 -0
- package/dist/definitions/forms/DatePicker/utils/stringToNumber.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputText.d.ts +4 -1
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
- package/dist/definitions/forms/utils.d.ts +0 -8
- package/dist/definitions/forms/utils.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +1 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +25 -0
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +1 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts +1 -0
- package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +701 -319
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +701 -319
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +701 -319
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +437 -203
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +616 -231
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.js +416 -171
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +1 -0
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +1 -0
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +1 -0
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +1 -0
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +1 -0
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +1 -0
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/definitions/forms/DatePicker/DatePickerAndroid.d.ts +0 -12
- package/dist/definitions/forms/DatePicker/DatePickerAndroid.d.ts.map +0 -1
- package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts +0 -11
- package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +0 -1
- package/dist/definitions/forms/DatePicker/DatePickerInputs.d.ts +0 -9
- package/dist/definitions/forms/DatePicker/DatePickerInputs.d.ts.map +0 -1
- package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts.map +0 -1
- package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts.map +0 -1
- package/dist/definitions/forms/DatePicker/types.d.ts +0 -35
- package/dist/definitions/forms/DatePicker/types.d.ts.map +0 -1
|
@@ -910,6 +910,7 @@ const lateOceanColorPalette = {
|
|
|
910
910
|
englishVermillon: '#D44148',
|
|
911
911
|
goldCrayola: '#F8C583',
|
|
912
912
|
aero: '#89BDDD',
|
|
913
|
+
seaShell: '#FFF9F3',
|
|
913
914
|
transparent: 'transparent',
|
|
914
915
|
moonPurple: '#DBD6F9',
|
|
915
916
|
moonPurpleLight1: '#EDEBFC'
|
|
@@ -3354,154 +3355,500 @@ function Checkbox({
|
|
|
3354
3355
|
});
|
|
3355
3356
|
}
|
|
3356
3357
|
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3358
|
+
function prefixWithZero(value, maxLength = 2) {
|
|
3359
|
+
return `${value}`.padStart(maxLength, '0');
|
|
3360
|
+
}
|
|
3361
|
+
function dayFormatter(day) {
|
|
3362
|
+
return prefixWithZero(day);
|
|
3363
|
+
}
|
|
3364
|
+
function monthFormatter(month) {
|
|
3365
|
+
return prefixWithZero(month);
|
|
3366
|
+
}
|
|
3367
|
+
function yearFormatter(year) {
|
|
3368
|
+
return prefixWithZero(year, 4);
|
|
3369
|
+
}
|
|
3370
|
+
|
|
3371
|
+
function getDayInInterval(value, minDate, maxDate) {
|
|
3372
|
+
const minValue = minDate ? minDate.getDate() : 1;
|
|
3373
|
+
const maxValue = maxDate ? maxDate.getDate() : 31;
|
|
3374
|
+
return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
|
|
3375
|
+
}
|
|
3376
|
+
function getMonthInInterval(value, minDate, maxDate) {
|
|
3377
|
+
const minValue = minDate ? minDate.getMonth() + 1 : 1;
|
|
3378
|
+
const maxValue = maxDate ? maxDate.getMonth() + 1 : 12;
|
|
3379
|
+
return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
|
|
3380
|
+
}
|
|
3381
|
+
function getYearInInterval(value, minDate, maxDate) {
|
|
3382
|
+
const minValue = minDate ? minDate.getFullYear() : 1;
|
|
3383
|
+
const maxValue = maxDate ? maxDate.getFullYear() : 9999;
|
|
3384
|
+
return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
function isNumber(input) {
|
|
3388
|
+
// Number.isNaN and isNaN are not consistent
|
|
3389
|
+
// eslint-disable-next-line no-restricted-globals
|
|
3390
|
+
return !isNaN(input);
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3393
|
+
function onDatePartChange({
|
|
3394
|
+
day,
|
|
3395
|
+
month,
|
|
3396
|
+
year,
|
|
3397
|
+
onChange,
|
|
3398
|
+
onBlur,
|
|
3399
|
+
onFocus
|
|
3400
|
+
}) {
|
|
3401
|
+
const arrayParts = [day, month, year];
|
|
3402
|
+
const isEverythingUndefined = arrayParts.every(v => v === undefined);
|
|
3403
|
+
const isEverythingDefined = arrayParts.every(Boolean);
|
|
3404
|
+
|
|
3405
|
+
// every parts are undefined
|
|
3406
|
+
if (isEverythingUndefined) {
|
|
3407
|
+
if (onFocus) onFocus();
|
|
3408
|
+
onChange(undefined);
|
|
3409
|
+
if (onBlur) onBlur();
|
|
3410
|
+
return;
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
// Do nothing if some input parts are empty
|
|
3414
|
+
if (!isEverythingDefined) {
|
|
3415
|
+
return;
|
|
3416
|
+
}
|
|
3417
|
+
const nextValue = new Date();
|
|
3418
|
+
if (day) nextValue.setDate(day);
|
|
3419
|
+
if (month) nextValue.setMonth(month - 1);
|
|
3420
|
+
if (year) nextValue.setFullYear(year);
|
|
3421
|
+
nextValue.setMinutes(0);
|
|
3422
|
+
nextValue.setHours(0);
|
|
3423
|
+
nextValue.setSeconds(0);
|
|
3424
|
+
nextValue.setMilliseconds(0);
|
|
3425
|
+
if (onFocus) onFocus();
|
|
3426
|
+
onChange(nextValue);
|
|
3427
|
+
if (onBlur) onBlur();
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
function stringToNumber(text) {
|
|
3431
|
+
if (text.length === 0) return undefined;
|
|
3432
|
+
return parseInt(text, 10);
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
const keyboardDatePickerReducer = (state, action) => {
|
|
3436
|
+
const handleChange = dateParts => {
|
|
3437
|
+
const {
|
|
3438
|
+
onFocus,
|
|
3439
|
+
onBlur,
|
|
3440
|
+
onChange
|
|
3441
|
+
} = state;
|
|
3442
|
+
onDatePartChange({
|
|
3443
|
+
...dateParts,
|
|
3444
|
+
onFocus,
|
|
3445
|
+
onBlur,
|
|
3446
|
+
onChange
|
|
3447
|
+
});
|
|
3448
|
+
};
|
|
3449
|
+
switch (action.type) {
|
|
3450
|
+
case 'day-change':
|
|
3451
|
+
{
|
|
3452
|
+
const nextDay = stringToNumber(action.nextDay || '');
|
|
3453
|
+
if (nextDay === undefined || !isNumber(action.nextDay)) {
|
|
3454
|
+
return {
|
|
3455
|
+
...state,
|
|
3456
|
+
currentDay: undefined,
|
|
3457
|
+
displayedDay: ''
|
|
3458
|
+
};
|
|
3459
|
+
}
|
|
3460
|
+
handleChange({
|
|
3461
|
+
day: nextDay,
|
|
3462
|
+
month: state.currentMonth,
|
|
3463
|
+
year: state.currentYear
|
|
3464
|
+
});
|
|
3465
|
+
return {
|
|
3466
|
+
...state,
|
|
3467
|
+
currentDay: nextDay,
|
|
3468
|
+
displayedDay: nextDay.toString()
|
|
3469
|
+
};
|
|
3470
|
+
}
|
|
3471
|
+
case 'month-change':
|
|
3472
|
+
{
|
|
3473
|
+
const nextMonth = stringToNumber(action.nextMonth || '');
|
|
3474
|
+
if (nextMonth === undefined || !isNumber(action.nextMonth)) {
|
|
3475
|
+
return {
|
|
3476
|
+
...state,
|
|
3477
|
+
currentMonth: undefined,
|
|
3478
|
+
displayedMonth: ''
|
|
3479
|
+
};
|
|
3480
|
+
}
|
|
3481
|
+
handleChange({
|
|
3482
|
+
day: state.currentDay,
|
|
3483
|
+
month: nextMonth,
|
|
3484
|
+
year: state.currentYear
|
|
3485
|
+
});
|
|
3486
|
+
return {
|
|
3487
|
+
...state,
|
|
3488
|
+
currentMonth: nextMonth,
|
|
3489
|
+
displayedMonth: nextMonth.toString()
|
|
3490
|
+
};
|
|
3491
|
+
}
|
|
3492
|
+
case 'year-change':
|
|
3493
|
+
{
|
|
3494
|
+
const nextYear = stringToNumber(action.nextYear || '');
|
|
3495
|
+
if (nextYear === undefined || !isNumber(action.nextYear)) {
|
|
3496
|
+
return {
|
|
3497
|
+
...state,
|
|
3498
|
+
currentYear: undefined,
|
|
3499
|
+
displayedYear: ''
|
|
3500
|
+
};
|
|
3501
|
+
}
|
|
3502
|
+
handleChange({
|
|
3503
|
+
day: state.currentDay,
|
|
3504
|
+
month: state.currentMonth,
|
|
3505
|
+
year: nextYear
|
|
3506
|
+
});
|
|
3507
|
+
return {
|
|
3508
|
+
...state,
|
|
3509
|
+
currentYear: nextYear,
|
|
3510
|
+
displayedYear: nextYear.toString()
|
|
3511
|
+
};
|
|
3512
|
+
}
|
|
3513
|
+
case 'day-blur':
|
|
3514
|
+
{
|
|
3515
|
+
const {
|
|
3516
|
+
minDate,
|
|
3517
|
+
maxDate
|
|
3518
|
+
} = state;
|
|
3519
|
+
const nextCurrentDay = getDayInInterval(state.currentDay, minDate, maxDate);
|
|
3520
|
+
return {
|
|
3521
|
+
...state,
|
|
3522
|
+
displayedDay: nextCurrentDay ? dayFormatter(nextCurrentDay) : state.displayedDay
|
|
3523
|
+
};
|
|
3524
|
+
}
|
|
3525
|
+
case 'month-blur':
|
|
3526
|
+
{
|
|
3527
|
+
const {
|
|
3528
|
+
minDate,
|
|
3529
|
+
maxDate
|
|
3530
|
+
} = state;
|
|
3531
|
+
const nextCurrentMonth = getMonthInInterval(state.currentMonth, minDate, maxDate);
|
|
3532
|
+
return {
|
|
3533
|
+
...state,
|
|
3534
|
+
currentMonth: nextCurrentMonth,
|
|
3535
|
+
displayedMonth: nextCurrentMonth !== undefined ? monthFormatter(nextCurrentMonth) : state.displayedMonth
|
|
3536
|
+
};
|
|
3537
|
+
}
|
|
3538
|
+
case 'year-blur':
|
|
3539
|
+
{
|
|
3540
|
+
const {
|
|
3541
|
+
minDate,
|
|
3542
|
+
maxDate
|
|
3543
|
+
} = state;
|
|
3544
|
+
const nextCurrentYear = getYearInInterval(state.currentYear, minDate, maxDate);
|
|
3545
|
+
return {
|
|
3546
|
+
...state,
|
|
3547
|
+
currentYear: nextCurrentYear,
|
|
3548
|
+
displayedYear: nextCurrentYear !== undefined ? yearFormatter(nextCurrentYear) : state.displayedYear
|
|
3549
|
+
};
|
|
3550
|
+
}
|
|
3551
|
+
default:
|
|
3552
|
+
return state;
|
|
3553
|
+
}
|
|
3554
|
+
};
|
|
3555
|
+
|
|
3556
|
+
const InputTextContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
3557
|
+
displayName: "InputTextContainer",
|
|
3558
|
+
componentId: "kitt-universal__sc-8j6fjq-0"
|
|
3559
|
+
})(["position:relative;"]);
|
|
3560
|
+
|
|
3561
|
+
const InputText = /*#__PURE__*/React.forwardRef(({
|
|
3562
|
+
id,
|
|
3563
|
+
right,
|
|
3564
|
+
state: formState,
|
|
3565
|
+
variant = 'outline',
|
|
3566
|
+
internalForceState,
|
|
3567
|
+
disabled = false,
|
|
3568
|
+
autoCorrect = true,
|
|
3569
|
+
textContentType = 'none',
|
|
3570
|
+
autoComplete = 'off',
|
|
3571
|
+
keyboardType = 'default',
|
|
3572
|
+
multiline,
|
|
3573
|
+
onSubmitEditing,
|
|
3574
|
+
...props
|
|
3575
|
+
}, ref) => {
|
|
3576
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
3577
|
+
const fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3578
|
+
base: 'body'
|
|
3579
|
+
});
|
|
3580
|
+
const shouldHandleSingleLineOnIOS = reactNative.Platform.OS === 'ios' && !multiline;
|
|
3581
|
+
return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
|
|
3582
|
+
$isDisabled: disabled,
|
|
3583
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(nativeBase.Input, {
|
|
3584
|
+
ref: ref,
|
|
3585
|
+
multiline: multiline,
|
|
3586
|
+
nativeID: id,
|
|
3587
|
+
isDisabled: internalForceState ? internalForceState === 'disabled' : disabled,
|
|
3588
|
+
isHovered: internalForceState ? internalForceState === 'hover' : undefined,
|
|
3589
|
+
isFocused: internalForceState ? internalForceState === 'focus' : undefined,
|
|
3590
|
+
keyboardType: keyboardType,
|
|
3591
|
+
autoComplete: autoComplete,
|
|
3592
|
+
autoCorrect: autoCorrect,
|
|
3593
|
+
textContentType: textContentType,
|
|
3594
|
+
fontSize: fontSizeForNativeBase,
|
|
3595
|
+
lineHeight:
|
|
3596
|
+
// On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
|
|
3597
|
+
// This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
|
|
3598
|
+
shouldHandleSingleLineOnIOS ? 0 : fontSizeForNativeBase,
|
|
3599
|
+
fontWeight: "bodies.regular",
|
|
3600
|
+
fontFamily: "bodies.regular",
|
|
3601
|
+
py: !multiline && reactNative.Platform.OS !== 'web' ? 0 : undefined,
|
|
3602
|
+
variant: variant,
|
|
3603
|
+
...props,
|
|
3604
|
+
onSubmitEditing: multiline ? () => null : onSubmitEditing
|
|
3605
|
+
}), right ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3606
|
+
position: "absolute",
|
|
3607
|
+
right: 0,
|
|
3608
|
+
top: 0,
|
|
3609
|
+
bottom: 0,
|
|
3610
|
+
justifyContent: "center",
|
|
3611
|
+
padding: theme.kitt.forms.input.rightContainer.padding,
|
|
3612
|
+
children: right
|
|
3613
|
+
}) : null]
|
|
3614
|
+
});
|
|
3615
|
+
});
|
|
3616
|
+
|
|
3617
|
+
function getCurrentInternalForcedState({
|
|
3360
3618
|
isDisabled,
|
|
3361
|
-
|
|
3619
|
+
isHoveredInternal,
|
|
3620
|
+
isFocusedInternal,
|
|
3621
|
+
isPressedInternal
|
|
3362
3622
|
}) {
|
|
3363
3623
|
if (isDisabled) return 'disabled';
|
|
3364
|
-
if (
|
|
3365
|
-
if (
|
|
3624
|
+
if (isHoveredInternal) return 'hover';
|
|
3625
|
+
if (isFocusedInternal) return 'focus';
|
|
3626
|
+
if (isPressedInternal) return 'hover';
|
|
3366
3627
|
return 'default';
|
|
3367
3628
|
}
|
|
3629
|
+
const InputPart = /*#__PURE__*/React.forwardRef(({
|
|
3630
|
+
value,
|
|
3631
|
+
placeholder,
|
|
3632
|
+
disabled,
|
|
3633
|
+
isFocusedInternal,
|
|
3634
|
+
isHoveredInternal,
|
|
3635
|
+
isPressedInternal,
|
|
3636
|
+
onChange,
|
|
3637
|
+
onBlur
|
|
3638
|
+
}, ref) => {
|
|
3639
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
3640
|
+
ref: ref,
|
|
3641
|
+
internalForceState: getCurrentInternalForcedState({
|
|
3642
|
+
isDisabled: disabled,
|
|
3643
|
+
isHoveredInternal,
|
|
3644
|
+
isFocusedInternal,
|
|
3645
|
+
isPressedInternal
|
|
3646
|
+
}),
|
|
3647
|
+
value: value,
|
|
3648
|
+
placeholder: placeholder,
|
|
3649
|
+
disabled: disabled,
|
|
3650
|
+
keyboardType: "numeric",
|
|
3651
|
+
textAlign: "center",
|
|
3652
|
+
onChange: onChange,
|
|
3653
|
+
onBlur: onBlur
|
|
3654
|
+
});
|
|
3655
|
+
});
|
|
3368
3656
|
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
})
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
}
|
|
3381
|
-
theme
|
|
3382
|
-
}) => {
|
|
3383
|
-
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
3384
|
-
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
|
|
3385
|
-
}, ({
|
|
3386
|
-
theme,
|
|
3387
|
-
$state
|
|
3388
|
-
}) => theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states.default.color, ({
|
|
3389
|
-
theme
|
|
3390
|
-
}) => reactNative.Platform.OS === 'web' ? theme.kitt.typography.types.bodies.fontFamily.web.regular : theme.kitt.typography.types.bodies.fontFamily.native.regular);
|
|
3657
|
+
function PartContainer({
|
|
3658
|
+
children,
|
|
3659
|
+
isStretch,
|
|
3660
|
+
width
|
|
3661
|
+
}) {
|
|
3662
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3663
|
+
flex: createResponsiveStyleFromProp(isStretch, 0.33),
|
|
3664
|
+
flexGrow: createResponsiveStyleFromProp(isStretch, 1),
|
|
3665
|
+
width: isStretch ? undefined : width,
|
|
3666
|
+
children: children
|
|
3667
|
+
});
|
|
3668
|
+
}
|
|
3391
3669
|
|
|
3392
|
-
|
|
3393
|
-
displayName: "DatePickerInputPart__StyledTypographyText",
|
|
3394
|
-
componentId: "kitt-universal__sc-11fmlmi-0"
|
|
3395
|
-
})(["text-align:center;"]);
|
|
3396
|
-
const ViewInput = /*#__PURE__*/styled__default.View.withConfig({
|
|
3397
|
-
displayName: "DatePickerInputPart__ViewInput",
|
|
3398
|
-
componentId: "kitt-universal__sc-11fmlmi-1"
|
|
3399
|
-
})(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, ({
|
|
3400
|
-
theme
|
|
3401
|
-
}) => `${theme.kitt.forms.input.padding.vertical}px ${theme.kitt.forms.input.padding.horizontal}px`, ({
|
|
3402
|
-
theme
|
|
3403
|
-
}) => theme.kitt.forms.input.minHeight, ({
|
|
3404
|
-
theme,
|
|
3405
|
-
$partName
|
|
3406
|
-
}) => {
|
|
3407
|
-
if (!$partName) {
|
|
3408
|
-
return undefined;
|
|
3409
|
-
}
|
|
3410
|
-
return `${theme.kitt.forms.datePicker[$partName].minWidth}px`;
|
|
3411
|
-
});
|
|
3412
|
-
function DatePickerInputPart({
|
|
3413
|
-
$state,
|
|
3414
|
-
placeholder,
|
|
3670
|
+
function KeyboardDatePicker({
|
|
3415
3671
|
value,
|
|
3416
|
-
|
|
3417
|
-
|
|
3672
|
+
testID,
|
|
3673
|
+
id,
|
|
3674
|
+
stretch,
|
|
3675
|
+
placeholder,
|
|
3676
|
+
minDate,
|
|
3677
|
+
maxDate,
|
|
3678
|
+
disabled,
|
|
3679
|
+
isFocusedInternal,
|
|
3680
|
+
isHoveredInternal,
|
|
3681
|
+
isPressedInternal,
|
|
3682
|
+
onChange,
|
|
3683
|
+
onBlur,
|
|
3684
|
+
onFocus,
|
|
3685
|
+
...props
|
|
3418
3686
|
}) {
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3687
|
+
const dayRef = React.useRef(null);
|
|
3688
|
+
const monthRef = React.useRef(null);
|
|
3689
|
+
const yearRef = React.useRef(null);
|
|
3690
|
+
const defaultValue = value;
|
|
3691
|
+
const defaultDay = defaultValue?.getDate();
|
|
3692
|
+
const defaultMonth = defaultValue ? defaultValue.getMonth() + 1 : undefined;
|
|
3693
|
+
const defaultYear = defaultValue?.getFullYear();
|
|
3694
|
+
const [state, dispatch] = React.useReducer(keyboardDatePickerReducer, {
|
|
3695
|
+
currentValue: defaultValue,
|
|
3696
|
+
currentDay: defaultDay,
|
|
3697
|
+
currentMonth: defaultMonth,
|
|
3698
|
+
currentYear: defaultYear,
|
|
3699
|
+
displayedDay: defaultDay ? dayFormatter(defaultDay) : '',
|
|
3700
|
+
displayedMonth: defaultMonth ? monthFormatter(defaultMonth) : '',
|
|
3701
|
+
displayedYear: defaultYear ? yearFormatter(defaultYear) : '',
|
|
3702
|
+
minDate,
|
|
3703
|
+
maxDate,
|
|
3704
|
+
onChange,
|
|
3705
|
+
onBlur,
|
|
3706
|
+
onFocus
|
|
3707
|
+
});
|
|
3708
|
+
const sharedInputPartProps = {
|
|
3709
|
+
isFocusedInternal,
|
|
3710
|
+
isHoveredInternal,
|
|
3711
|
+
isPressedInternal,
|
|
3712
|
+
disabled
|
|
3713
|
+
};
|
|
3714
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3715
|
+
testID: testID,
|
|
3716
|
+
nativeID: id,
|
|
3717
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(HStack, {
|
|
3718
|
+
space: "kitt.2",
|
|
3719
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
3720
|
+
isStretch: stretch,
|
|
3721
|
+
width: "kitt.forms.datePicker.day.minWidth",
|
|
3722
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
|
|
3723
|
+
ref: dayRef,
|
|
3724
|
+
...sharedInputPartProps,
|
|
3725
|
+
placeholder: placeholder?.day,
|
|
3726
|
+
value: state.displayedDay,
|
|
3727
|
+
onChange: e => {
|
|
3728
|
+
const nextDay = e.nativeEvent.text;
|
|
3729
|
+
dispatch({
|
|
3730
|
+
type: 'day-change',
|
|
3731
|
+
nextDay
|
|
3732
|
+
});
|
|
3733
|
+
if (nextDay.length === 2 && monthRef.current) {
|
|
3734
|
+
monthRef.current.focus();
|
|
3735
|
+
}
|
|
3736
|
+
},
|
|
3737
|
+
onBlur: () => dispatch({
|
|
3738
|
+
type: 'day-blur'
|
|
3739
|
+
})
|
|
3740
|
+
})
|
|
3741
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
3742
|
+
isStretch: stretch,
|
|
3743
|
+
width: "kitt.forms.datePicker.month.minWidth",
|
|
3744
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
|
|
3745
|
+
ref: monthRef,
|
|
3746
|
+
...sharedInputPartProps,
|
|
3747
|
+
placeholder: placeholder?.month,
|
|
3748
|
+
value: state.displayedMonth,
|
|
3749
|
+
onChange: e => {
|
|
3750
|
+
const nextMonth = e.nativeEvent.text;
|
|
3751
|
+
dispatch({
|
|
3752
|
+
type: 'month-change',
|
|
3753
|
+
nextMonth: e.nativeEvent.text
|
|
3754
|
+
});
|
|
3755
|
+
if (nextMonth.length === 2 && yearRef.current) {
|
|
3756
|
+
yearRef.current.focus();
|
|
3757
|
+
}
|
|
3758
|
+
},
|
|
3759
|
+
onBlur: () => dispatch({
|
|
3760
|
+
type: 'month-blur'
|
|
3761
|
+
})
|
|
3762
|
+
})
|
|
3763
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
3764
|
+
isStretch: stretch,
|
|
3765
|
+
width: "kitt.forms.datePicker.year.minWidth",
|
|
3766
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
|
|
3767
|
+
ref: yearRef,
|
|
3768
|
+
...sharedInputPartProps,
|
|
3769
|
+
placeholder: placeholder?.year,
|
|
3770
|
+
value: state.displayedYear,
|
|
3771
|
+
onChange: e => {
|
|
3772
|
+
dispatch({
|
|
3773
|
+
type: 'year-change',
|
|
3774
|
+
nextYear: e.nativeEvent.text
|
|
3775
|
+
});
|
|
3776
|
+
},
|
|
3777
|
+
onBlur: () => dispatch({
|
|
3778
|
+
type: 'year-blur'
|
|
3779
|
+
})
|
|
3780
|
+
})
|
|
3781
|
+
})]
|
|
3782
|
+
})
|
|
3426
3783
|
});
|
|
3427
3784
|
}
|
|
3428
3785
|
|
|
3429
|
-
function prefixWithZero(value) {
|
|
3430
|
-
return `${value}`.padStart(2, '0');
|
|
3431
|
-
}
|
|
3432
|
-
const PartContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
3433
|
-
displayName: "DatePickerInputs__PartContainer",
|
|
3434
|
-
componentId: "kitt-universal__sc-j9hin5-0"
|
|
3435
|
-
})(["margin-right:", ";", ";"], ({
|
|
3436
|
-
theme,
|
|
3437
|
-
$isLast
|
|
3438
|
-
}) => !$isLast ? `${theme.kitt.spacing * 2}px` : 0, ({
|
|
3439
|
-
$isStretch
|
|
3440
|
-
}) => $isStretch ? styled.css(["flex:0.33;flex-grow:1;"]) : undefined);
|
|
3441
|
-
const DatePickerPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
3442
|
-
displayName: "DatePickerInputs__DatePickerPressable",
|
|
3443
|
-
componentId: "kitt-universal__sc-j9hin5-1"
|
|
3444
|
-
})(["display:flex;flex-direction:row;", ";"], ({
|
|
3445
|
-
$isStretch
|
|
3446
|
-
}) => {
|
|
3447
|
-
if ($isStretch) {
|
|
3448
|
-
return styled.css(["width:100%;"]);
|
|
3449
|
-
}
|
|
3450
|
-
return styled.css(["align-self:baseline;"]);
|
|
3451
|
-
});
|
|
3452
3786
|
function DatePickerInputs({
|
|
3453
|
-
state,
|
|
3454
|
-
internalForceState,
|
|
3455
|
-
isFocused,
|
|
3456
3787
|
disabled,
|
|
3457
3788
|
stretch,
|
|
3458
3789
|
id,
|
|
3459
3790
|
testID,
|
|
3460
|
-
handleModalOpen,
|
|
3461
3791
|
currentValue,
|
|
3462
|
-
placeholder
|
|
3792
|
+
placeholder,
|
|
3793
|
+
isFocusedInternal,
|
|
3794
|
+
isHoveredInternal,
|
|
3795
|
+
isPressedInternal,
|
|
3796
|
+
onPress
|
|
3463
3797
|
}) {
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
const sharedPartProps = {
|
|
3470
|
-
disabled,
|
|
3471
|
-
$state: currentState
|
|
3798
|
+
const sharedInputPartProps = {
|
|
3799
|
+
isFocusedInternal,
|
|
3800
|
+
isHoveredInternal,
|
|
3801
|
+
isPressedInternal,
|
|
3802
|
+
disabled
|
|
3472
3803
|
};
|
|
3473
|
-
return /*#__PURE__*/jsxRuntime.
|
|
3474
|
-
|
|
3804
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
3805
|
+
display: "flex",
|
|
3806
|
+
flexDirection: "row",
|
|
3807
|
+
position: "relative",
|
|
3808
|
+
alignSelf: createResponsiveStyleFromProp(stretch, undefined, 'base-line'),
|
|
3475
3809
|
nativeID: id,
|
|
3476
3810
|
disabled: disabled,
|
|
3477
3811
|
testID: testID,
|
|
3478
|
-
onPress:
|
|
3479
|
-
children:
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3812
|
+
onPress: onPress,
|
|
3813
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
3814
|
+
position: "relative",
|
|
3815
|
+
width: createResponsiveStyleFromProp(stretch, '100%'),
|
|
3816
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(HStack, {
|
|
3817
|
+
space: "kitt.2",
|
|
3818
|
+
width: createResponsiveStyleFromProp(stretch, '100%'),
|
|
3819
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
3820
|
+
isStretch: stretch,
|
|
3821
|
+
width: "kitt.forms.datePicker.day.minWidth",
|
|
3822
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
|
|
3823
|
+
...sharedInputPartProps,
|
|
3824
|
+
placeholder: placeholder?.day,
|
|
3825
|
+
value: currentValue ? dayFormatter(currentValue.getDate()) : undefined
|
|
3826
|
+
})
|
|
3827
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
3828
|
+
isStretch: stretch,
|
|
3829
|
+
width: "kitt.forms.datePicker.month.minWidth",
|
|
3830
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
|
|
3831
|
+
...sharedInputPartProps,
|
|
3832
|
+
placeholder: placeholder?.month,
|
|
3833
|
+
value: currentValue ? monthFormatter(currentValue.getMonth() + 1) : undefined
|
|
3834
|
+
})
|
|
3835
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
3836
|
+
isStretch: stretch,
|
|
3837
|
+
width: "kitt.forms.datePicker.year.minWidth",
|
|
3838
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InputPart, {
|
|
3839
|
+
...sharedInputPartProps,
|
|
3840
|
+
placeholder: placeholder?.year,
|
|
3841
|
+
value: currentValue ? yearFormatter(currentValue.getFullYear()) : undefined
|
|
3842
|
+
})
|
|
3843
|
+
})]
|
|
3844
|
+
}), /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3845
|
+
width: "100%",
|
|
3846
|
+
height: "100%",
|
|
3847
|
+
position: "absolute",
|
|
3848
|
+
top: "0",
|
|
3849
|
+
left: "0"
|
|
3850
|
+
})]
|
|
3851
|
+
})
|
|
3505
3852
|
});
|
|
3506
3853
|
}
|
|
3507
3854
|
|
|
@@ -3511,13 +3858,12 @@ function DatePickerAndroid({
|
|
|
3511
3858
|
pickerDefaultDate,
|
|
3512
3859
|
pickerUITestID,
|
|
3513
3860
|
isDefaultVisible,
|
|
3514
|
-
|
|
3515
|
-
currentValue,
|
|
3516
|
-
setCurrentValue,
|
|
3861
|
+
value,
|
|
3517
3862
|
onChange,
|
|
3518
|
-
isFocused,
|
|
3519
3863
|
...props
|
|
3520
3864
|
}) {
|
|
3865
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
3866
|
+
const [currentValue, setCurrentValue] = React.useState(value);
|
|
3521
3867
|
const handleClose = () => {
|
|
3522
3868
|
if (onBlur) onBlur();
|
|
3523
3869
|
};
|
|
@@ -3547,9 +3893,9 @@ function DatePickerAndroid({
|
|
|
3547
3893
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3548
3894
|
}, []);
|
|
3549
3895
|
return /*#__PURE__*/jsxRuntime.jsx(DatePickerInputs, {
|
|
3550
|
-
handleModalOpen: handleModalOpen,
|
|
3551
3896
|
currentValue: currentValue,
|
|
3552
|
-
|
|
3897
|
+
isFocusedInternal: isFocused,
|
|
3898
|
+
onPress: handleModalOpen,
|
|
3553
3899
|
...props
|
|
3554
3900
|
});
|
|
3555
3901
|
}
|
|
@@ -4008,35 +4354,24 @@ function ModalPlatformDateTimePicker({
|
|
|
4008
4354
|
});
|
|
4009
4355
|
}
|
|
4010
4356
|
|
|
4011
|
-
function
|
|
4357
|
+
function DefaultNativeUIDatePicker({
|
|
4012
4358
|
value,
|
|
4013
4359
|
pickerUITestID,
|
|
4014
4360
|
pickerUITitle,
|
|
4015
4361
|
pickerUIValidateButtonLabel,
|
|
4016
4362
|
isDefaultVisible,
|
|
4363
|
+
pickerDefaultDate,
|
|
4364
|
+
isFocusedInternal,
|
|
4365
|
+
isHoveredInternal,
|
|
4366
|
+
isPressedInternal,
|
|
4017
4367
|
onChange,
|
|
4018
4368
|
onFocus,
|
|
4019
4369
|
onBlur,
|
|
4020
|
-
pickerDefaultDate,
|
|
4021
4370
|
...props
|
|
4022
4371
|
}) {
|
|
4023
4372
|
const [isPickerUIVisible, setIsPickerUIVisible] = React.useState(isDefaultVisible);
|
|
4024
4373
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
4025
4374
|
const [currentValue, setCurrentValue] = React.useState(value);
|
|
4026
|
-
if (reactNative.Platform.OS === 'android') {
|
|
4027
|
-
return /*#__PURE__*/jsxRuntime.jsx(DatePickerAndroid, {
|
|
4028
|
-
pickerDefaultDate: pickerDefaultDate,
|
|
4029
|
-
pickerUITestID: pickerUITestID,
|
|
4030
|
-
isDefaultVisible: isDefaultVisible,
|
|
4031
|
-
currentValue: currentValue,
|
|
4032
|
-
setCurrentValue: setCurrentValue,
|
|
4033
|
-
isFocused: isFocused,
|
|
4034
|
-
setIsFocused: setIsFocused,
|
|
4035
|
-
onChange: onChange,
|
|
4036
|
-
onBlur: onBlur,
|
|
4037
|
-
...props
|
|
4038
|
-
});
|
|
4039
|
-
}
|
|
4040
4375
|
const handleModalClose = () => {
|
|
4041
4376
|
if (onBlur) onBlur();
|
|
4042
4377
|
setIsPickerUIVisible(false);
|
|
@@ -4044,13 +4379,15 @@ function DatePicker({
|
|
|
4044
4379
|
};
|
|
4045
4380
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4046
4381
|
children: [/*#__PURE__*/jsxRuntime.jsx(DatePickerInputs, {
|
|
4047
|
-
|
|
4382
|
+
currentValue: currentValue,
|
|
4383
|
+
isFocusedInternal: isFocused || isFocusedInternal,
|
|
4384
|
+
isHoveredInternal: isHoveredInternal,
|
|
4385
|
+
isPressedInternal: isPressedInternal,
|
|
4386
|
+
onPress: () => {
|
|
4048
4387
|
if (onFocus) onFocus();
|
|
4049
4388
|
setIsPickerUIVisible(true);
|
|
4050
4389
|
setIsFocused(true);
|
|
4051
4390
|
},
|
|
4052
|
-
currentValue: currentValue,
|
|
4053
|
-
isFocused: isFocused,
|
|
4054
4391
|
...props
|
|
4055
4392
|
}), /*#__PURE__*/jsxRuntime.jsx(ModalPlatformDateTimePicker, {
|
|
4056
4393
|
testID: pickerUITestID,
|
|
@@ -4069,66 +4406,49 @@ function DatePicker({
|
|
|
4069
4406
|
});
|
|
4070
4407
|
}
|
|
4071
4408
|
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
right,
|
|
4080
|
-
state: formState,
|
|
4081
|
-
variant = 'outline',
|
|
4082
|
-
internalForceState,
|
|
4083
|
-
disabled = false,
|
|
4084
|
-
autoCorrect = true,
|
|
4085
|
-
textContentType = 'none',
|
|
4086
|
-
autoComplete = 'off',
|
|
4087
|
-
keyboardType = 'default',
|
|
4088
|
-
multiline,
|
|
4089
|
-
onSubmitEditing,
|
|
4409
|
+
function NativeUIDatePicker({
|
|
4410
|
+
value,
|
|
4411
|
+
pickerUITestID,
|
|
4412
|
+
isDefaultVisible,
|
|
4413
|
+
pickerDefaultDate,
|
|
4414
|
+
onChange,
|
|
4415
|
+
onBlur,
|
|
4090
4416
|
...props
|
|
4091
|
-
}
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4417
|
+
}) {
|
|
4418
|
+
if (reactNative.Platform.OS === 'android') {
|
|
4419
|
+
return /*#__PURE__*/jsxRuntime.jsx(DatePickerAndroid, {
|
|
4420
|
+
pickerDefaultDate: pickerDefaultDate,
|
|
4421
|
+
pickerUITestID: pickerUITestID,
|
|
4422
|
+
isDefaultVisible: isDefaultVisible,
|
|
4423
|
+
value: value,
|
|
4424
|
+
onChange: onChange,
|
|
4425
|
+
onBlur: onBlur,
|
|
4426
|
+
...props
|
|
4427
|
+
});
|
|
4428
|
+
}
|
|
4429
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultNativeUIDatePicker, {
|
|
4430
|
+
value: value,
|
|
4431
|
+
isDefaultVisible: isDefaultVisible,
|
|
4432
|
+
pickerUITestID: pickerUITestID,
|
|
4433
|
+
onChange: onChange,
|
|
4434
|
+
onBlur: onBlur,
|
|
4435
|
+
...props
|
|
4095
4436
|
});
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
textContentType: textContentType,
|
|
4110
|
-
fontSize: fontSizeForNativeBase,
|
|
4111
|
-
lineHeight:
|
|
4112
|
-
// On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
|
|
4113
|
-
// This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
|
|
4114
|
-
shouldHandleSingleLineOnIOS ? 0 : fontSizeForNativeBase,
|
|
4115
|
-
fontWeight: "bodies.regular",
|
|
4116
|
-
fontFamily: "bodies.regular",
|
|
4117
|
-
py: !multiline && reactNative.Platform.OS !== 'web' ? 0 : undefined,
|
|
4118
|
-
variant: variant,
|
|
4119
|
-
...props,
|
|
4120
|
-
onSubmitEditing: multiline ? () => null : onSubmitEditing
|
|
4121
|
-
}), right ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
4122
|
-
position: "absolute",
|
|
4123
|
-
right: 0,
|
|
4124
|
-
top: 0,
|
|
4125
|
-
bottom: 0,
|
|
4126
|
-
justifyContent: "center",
|
|
4127
|
-
padding: theme.kitt.forms.input.rightContainer.padding,
|
|
4128
|
-
children: right
|
|
4129
|
-
}) : null]
|
|
4437
|
+
}
|
|
4438
|
+
|
|
4439
|
+
function DatePicker({
|
|
4440
|
+
fillMode = 'native',
|
|
4441
|
+
...props
|
|
4442
|
+
}) {
|
|
4443
|
+
if (fillMode === 'keyboard') {
|
|
4444
|
+
return /*#__PURE__*/jsxRuntime.jsx(KeyboardDatePicker, {
|
|
4445
|
+
...props
|
|
4446
|
+
});
|
|
4447
|
+
}
|
|
4448
|
+
return /*#__PURE__*/jsxRuntime.jsx(NativeUIDatePicker, {
|
|
4449
|
+
...props
|
|
4130
4450
|
});
|
|
4131
|
-
}
|
|
4451
|
+
}
|
|
4132
4452
|
|
|
4133
4453
|
function InputEmail(props) {
|
|
4134
4454
|
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
@@ -5273,6 +5593,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
5273
5593
|
typography: theme.typography.colors,
|
|
5274
5594
|
palettes: theme.palettes,
|
|
5275
5595
|
forms: {
|
|
5596
|
+
input: {
|
|
5597
|
+
states: theme.forms.input.states
|
|
5598
|
+
},
|
|
5276
5599
|
radioButtonGroup: {
|
|
5277
5600
|
item: {
|
|
5278
5601
|
borderColor: theme.forms.radioButtonGroup.item.borderColor,
|
|
@@ -5317,6 +5640,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
5317
5640
|
borderRadius: theme.dialogModal.borderRadius
|
|
5318
5641
|
},
|
|
5319
5642
|
forms: {
|
|
5643
|
+
input: {
|
|
5644
|
+
borderRadius: theme.forms.input.borderRadius
|
|
5645
|
+
},
|
|
5320
5646
|
radioButtonGroup: {
|
|
5321
5647
|
item: {
|
|
5322
5648
|
borderRadius: theme.forms.radioButtonGroup.item.borderRadius
|
|
@@ -5348,6 +5674,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
5348
5674
|
borderWidth: theme.button.borderWidth
|
|
5349
5675
|
},
|
|
5350
5676
|
forms: {
|
|
5677
|
+
input: {
|
|
5678
|
+
borderWidth: theme.forms.input.borderWidth
|
|
5679
|
+
},
|
|
5351
5680
|
radioButtonGroup: {
|
|
5352
5681
|
item: {
|
|
5353
5682
|
borderWidth: theme.forms.radioButtonGroup.item.borderWidth
|
|
@@ -5394,6 +5723,21 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
5394
5723
|
overlayPadding: theme.dialogModal.overlayPadding
|
|
5395
5724
|
},
|
|
5396
5725
|
forms: {
|
|
5726
|
+
datePicker: {
|
|
5727
|
+
minHeight: theme.forms.input.minHeight,
|
|
5728
|
+
day: {
|
|
5729
|
+
minWidth: theme.forms.datePicker.day.minWidth
|
|
5730
|
+
},
|
|
5731
|
+
month: {
|
|
5732
|
+
minWidth: theme.forms.datePicker.month.minWidth
|
|
5733
|
+
},
|
|
5734
|
+
year: {
|
|
5735
|
+
minWidth: theme.forms.datePicker.year.minWidth
|
|
5736
|
+
}
|
|
5737
|
+
},
|
|
5738
|
+
input: {
|
|
5739
|
+
minHeight: theme.forms.input.minHeight
|
|
5740
|
+
},
|
|
5397
5741
|
radioButtonGroup: {
|
|
5398
5742
|
item: {
|
|
5399
5743
|
minHeight: theme.forms.radioButtonGroup.item.minHeight
|
|
@@ -5440,6 +5784,12 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
5440
5784
|
overlayPadding: theme.dialogModal.overlayPadding
|
|
5441
5785
|
},
|
|
5442
5786
|
forms: {
|
|
5787
|
+
datePicker: {
|
|
5788
|
+
padding: theme.forms.input.padding
|
|
5789
|
+
},
|
|
5790
|
+
input: {
|
|
5791
|
+
padding: theme.forms.input.padding
|
|
5792
|
+
},
|
|
5443
5793
|
radioButtonGroup: {
|
|
5444
5794
|
item: {
|
|
5445
5795
|
padding: theme.forms.radioButtonGroup.item.padding
|
|
@@ -5794,8 +6144,9 @@ const StyledViewWithPadding = /*#__PURE__*/styled__default(ContentPadding).withC
|
|
|
5794
6144
|
displayName: "Body__StyledViewWithPadding",
|
|
5795
6145
|
componentId: "kitt-universal__sc-oc39vn-0"
|
|
5796
6146
|
})(["padding-top:", "px;padding-bottom:", "px;"], ({
|
|
5797
|
-
theme
|
|
5798
|
-
|
|
6147
|
+
theme,
|
|
6148
|
+
$insetTop
|
|
6149
|
+
}) => Math.max(theme.kitt.spacing * 6, $insetTop), ({
|
|
5799
6150
|
theme,
|
|
5800
6151
|
$insetBottom
|
|
5801
6152
|
}) => Math.max(theme.kitt.spacing * 4, $insetBottom));
|
|
@@ -5803,15 +6154,19 @@ function Body({
|
|
|
5803
6154
|
children,
|
|
5804
6155
|
shouldHandleBottomNotch,
|
|
5805
6156
|
style,
|
|
6157
|
+
shouldHandleTopNotch,
|
|
5806
6158
|
...props
|
|
5807
6159
|
}) {
|
|
5808
6160
|
const {
|
|
5809
|
-
bottom
|
|
6161
|
+
bottom,
|
|
6162
|
+
top
|
|
5810
6163
|
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
5811
6164
|
const insetBottom = shouldHandleBottomNotch ? bottom : 0;
|
|
6165
|
+
const insetTop = shouldHandleTopNotch ? top : 0;
|
|
5812
6166
|
return /*#__PURE__*/jsxRuntime.jsx(StyledViewWithPadding, {
|
|
5813
6167
|
...props,
|
|
5814
6168
|
$insetBottom: insetBottom,
|
|
6169
|
+
$insetTop: insetTop,
|
|
5815
6170
|
style: style,
|
|
5816
6171
|
children: children
|
|
5817
6172
|
});
|
|
@@ -5854,9 +6209,10 @@ function Footer({
|
|
|
5854
6209
|
const HeaderContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig({
|
|
5855
6210
|
displayName: "Header__HeaderContainer",
|
|
5856
6211
|
componentId: "kitt-universal__sc-1g7sbq-0"
|
|
5857
|
-
})(["height:", "px;width:100%;justify-content:center;background-color:", ";padding-right:", "px;padding-left:", "px;", ";"], ({
|
|
5858
|
-
theme
|
|
5859
|
-
|
|
6212
|
+
})(["height:", "px;width:100%;justify-content:center;background-color:", ";padding-right:", "px;padding-left:", "px;padding-top:", "px;", ";"], ({
|
|
6213
|
+
theme,
|
|
6214
|
+
$insetTop
|
|
6215
|
+
}) => theme.kitt.navigationModal.height + $insetTop, ({
|
|
5860
6216
|
theme,
|
|
5861
6217
|
$isTransparent
|
|
5862
6218
|
}) => {
|
|
@@ -5869,6 +6225,8 @@ const HeaderContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig(
|
|
|
5869
6225
|
theme,
|
|
5870
6226
|
$hasLeft
|
|
5871
6227
|
}) => $hasLeft ? theme.kitt.spacing * 2 : theme.kitt.navigationModal.padding, ({
|
|
6228
|
+
$insetTop
|
|
6229
|
+
}) => $insetTop, ({
|
|
5872
6230
|
$hasSeparator
|
|
5873
6231
|
}) => {
|
|
5874
6232
|
if (!$hasSeparator) return undefined;
|
|
@@ -5924,14 +6282,20 @@ function Header({
|
|
|
5924
6282
|
children,
|
|
5925
6283
|
right,
|
|
5926
6284
|
left,
|
|
6285
|
+
shouldHandleTopNotch = true,
|
|
5927
6286
|
style
|
|
5928
6287
|
}) {
|
|
6288
|
+
const {
|
|
6289
|
+
top
|
|
6290
|
+
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
6291
|
+
const insetTop = shouldHandleTopNotch ? top : 0;
|
|
5929
6292
|
const sharedProps = {
|
|
5930
6293
|
$hasLeft: Boolean(left),
|
|
5931
6294
|
$hasRight: Boolean(right)
|
|
5932
6295
|
};
|
|
5933
6296
|
return /*#__PURE__*/jsxRuntime.jsx(HeaderContainer, {
|
|
5934
6297
|
$isTransparent: isTransparent,
|
|
6298
|
+
$insetTop: insetTop,
|
|
5935
6299
|
$hasSeparator: hasSeparator,
|
|
5936
6300
|
$hasLeft: Boolean(left),
|
|
5937
6301
|
$hasRight: Boolean(right),
|
|
@@ -6003,7 +6367,6 @@ function NativeOpacityAnimation({
|
|
|
6003
6367
|
}
|
|
6004
6368
|
|
|
6005
6369
|
function NativeSlideInAnimation({
|
|
6006
|
-
topInset = 0,
|
|
6007
6370
|
visible,
|
|
6008
6371
|
children,
|
|
6009
6372
|
onEntered,
|
|
@@ -6023,7 +6386,6 @@ function NativeSlideInAnimation({
|
|
|
6023
6386
|
// Since animation callback is called on component mount, we must make sure that the animation has been runed once to call it an exit
|
|
6024
6387
|
if (!visible && hasRunAnimationRef.current) onExited();
|
|
6025
6388
|
}
|
|
6026
|
-
const viewportHeight = wHeight - topInset;
|
|
6027
6389
|
const translateStyle = Animated.useAnimatedStyle(function () {
|
|
6028
6390
|
const _f = function () {
|
|
6029
6391
|
const {
|
|
@@ -6033,7 +6395,7 @@ function NativeSlideInAnimation({
|
|
|
6033
6395
|
const [x1, y1, x2, y2] = easing;
|
|
6034
6396
|
return {
|
|
6035
6397
|
transform: [{
|
|
6036
|
-
translateY: Animated.withTiming(visible ? 0 :
|
|
6398
|
+
translateY: Animated.withTiming(visible ? 0 : wHeight, {
|
|
6037
6399
|
duration,
|
|
6038
6400
|
easing: Animated.Easing.bezier(x1, y1, x2, y2)
|
|
6039
6401
|
}, function () {
|
|
@@ -6047,7 +6409,7 @@ function NativeSlideInAnimation({
|
|
|
6047
6409
|
};
|
|
6048
6410
|
_f.asString = "function _f(isFinished){const{runOnJS,handleAnimationFinished}=jsThis._closure;{if(!isFinished)return;runOnJS(handleAnimationFinished)();}}";
|
|
6049
6411
|
_f.__workletHash = 14707844242190;
|
|
6050
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/NavigationModal/components/NativeSlideInAnimation.tsx (
|
|
6412
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/NavigationModal/components/NativeSlideInAnimation.tsx (45:12)";
|
|
6051
6413
|
return _f;
|
|
6052
6414
|
}())
|
|
6053
6415
|
}]
|
|
@@ -6065,24 +6427,27 @@ function NativeSlideInAnimation({
|
|
|
6065
6427
|
},
|
|
6066
6428
|
withTiming: Animated.withTiming,
|
|
6067
6429
|
visible,
|
|
6068
|
-
|
|
6430
|
+
wHeight,
|
|
6069
6431
|
Easing: {
|
|
6070
6432
|
bezier: Animated.Easing.bezier
|
|
6071
6433
|
},
|
|
6072
6434
|
runOnJS: Animated.runOnJS,
|
|
6073
6435
|
handleAnimationFinished
|
|
6074
6436
|
};
|
|
6075
|
-
_f.asString = "function _f(){const{theme,withTiming,visible,
|
|
6076
|
-
_f.__workletHash =
|
|
6077
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/NavigationModal/components/NativeSlideInAnimation.tsx (
|
|
6437
|
+
_f.asString = "function _f(){const{theme,withTiming,visible,wHeight,Easing,runOnJS,handleAnimationFinished}=jsThis._closure;{const{duration:duration,easing:easing}=theme.kitt.navigationModal.animation.content;const[x1,y1,x2,y2]=easing;return{transform:[{translateY:withTiming(visible?0:wHeight,{duration:duration,easing:Easing.bezier(x1,y1,x2,y2)},function(isFinished){if(!isFinished)return;runOnJS(handleAnimationFinished)();})}]};}}";
|
|
6438
|
+
_f.__workletHash = 14160876288353;
|
|
6439
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/NavigationModal/components/NativeSlideInAnimation.tsx (35:42)";
|
|
6078
6440
|
return _f;
|
|
6079
6441
|
}());
|
|
6080
6442
|
return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
|
|
6081
6443
|
style: [{
|
|
6082
6444
|
transform: [{
|
|
6083
|
-
translateY:
|
|
6445
|
+
translateY: wHeight
|
|
6084
6446
|
}]
|
|
6085
|
-
}, translateStyle
|
|
6447
|
+
}, translateStyle, {
|
|
6448
|
+
width: '100%',
|
|
6449
|
+
flex: 1
|
|
6450
|
+
}],
|
|
6086
6451
|
children: children
|
|
6087
6452
|
});
|
|
6088
6453
|
}
|
|
@@ -6095,9 +6460,6 @@ function NavigationModalAnimation({
|
|
|
6095
6460
|
onExit,
|
|
6096
6461
|
onExited
|
|
6097
6462
|
}) {
|
|
6098
|
-
const {
|
|
6099
|
-
top
|
|
6100
|
-
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
6101
6463
|
const [isModalVisible, setIsModalVisible] = React.useState(visible);
|
|
6102
6464
|
const [isContentVisible, setIsContentVisible] = React.useState(false);
|
|
6103
6465
|
const handleAnimationExited = () => {
|
|
@@ -6132,14 +6494,14 @@ function NavigationModalAnimation({
|
|
|
6132
6494
|
children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
|
|
6133
6495
|
onPress: handleAnimationExited
|
|
6134
6496
|
})
|
|
6135
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
6136
|
-
topInset: top,
|
|
6497
|
+
}), /*#__PURE__*/jsxRuntime.jsx(NativeSlideInAnimation, {
|
|
6137
6498
|
visible: isContentVisible,
|
|
6138
6499
|
onExited: handleAnimationExited,
|
|
6139
6500
|
onEntered: onEntered,
|
|
6140
|
-
children:
|
|
6141
|
-
|
|
6142
|
-
|
|
6501
|
+
children: /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
6502
|
+
flex: 1,
|
|
6503
|
+
children: children
|
|
6504
|
+
})
|
|
6143
6505
|
})]
|
|
6144
6506
|
})
|
|
6145
6507
|
});
|
|
@@ -7230,6 +7592,29 @@ function Tag({
|
|
|
7230
7592
|
});
|
|
7231
7593
|
}
|
|
7232
7594
|
|
|
7595
|
+
/** @deprecated this mixin is not SSR compatible */
|
|
7596
|
+
const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
|
|
7597
|
+
theme,
|
|
7598
|
+
$state
|
|
7599
|
+
}) => $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
|
|
7600
|
+
theme
|
|
7601
|
+
}) => theme.kitt.forms.input.borderWidth, ({
|
|
7602
|
+
theme
|
|
7603
|
+
}) => theme.kitt.forms.input.borderRadius, ({
|
|
7604
|
+
theme,
|
|
7605
|
+
$state
|
|
7606
|
+
}) => theme.kitt.forms.input.states[$state].borderColor, ({
|
|
7607
|
+
theme
|
|
7608
|
+
}) => {
|
|
7609
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
7610
|
+
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
|
|
7611
|
+
}, ({
|
|
7612
|
+
theme,
|
|
7613
|
+
$state
|
|
7614
|
+
}) => theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states.default.color, ({
|
|
7615
|
+
theme
|
|
7616
|
+
}) => reactNative.Platform.OS === 'web' ? theme.kitt.typography.types.bodies.fontFamily.web.regular : theme.kitt.typography.types.bodies.fontFamily.native.regular);
|
|
7617
|
+
|
|
7233
7618
|
function Title({
|
|
7234
7619
|
children
|
|
7235
7620
|
}) {
|