@bitrise/bitkit 12.91.0 → 12.93.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "12.91.0",
4
+ "version": "12.93.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -16,6 +16,8 @@ export type DateInputProps = Omit<InputProps, 'value' | 'onChange' | 'placeholde
16
16
  const DateInput = forwardRef<DateInputProps, 'div'>((props, ref) => {
17
17
  const { inputRef, onCalendarClick, onChange, value, ...rest } = props;
18
18
  const [isDatePickerVisible, setIsDatePickerVisible] = useState(false);
19
+ const [isFocused, setIsFocused] = useState(false);
20
+ const [isEmpty, setIsEmpty] = useState(true);
19
21
 
20
22
  const dateFormat = 'MM/dd/yyyy';
21
23
 
@@ -48,7 +50,7 @@ const DateInput = forwardRef<DateInputProps, 'div'>((props, ref) => {
48
50
  },
49
51
  },
50
52
  format: (date: Date | null) => (date ? DateTime.fromJSDate(date).toFormat(dateFormat) : ''),
51
- lazy: false,
53
+ lazy: !isFocused && isEmpty,
52
54
  mask: Date,
53
55
  parse: (str: string) => {
54
56
  try {
@@ -60,7 +62,10 @@ const DateInput = forwardRef<DateInputProps, 'div'>((props, ref) => {
60
62
  pattern: 'LL/dd/yyyy',
61
63
  },
62
64
  {
63
- onAccept: (val) => onChange?.(val),
65
+ onAccept: (val, maskRef) => {
66
+ onChange?.(val);
67
+ setIsEmpty(!maskRef.unmaskedValue);
68
+ },
64
69
  },
65
70
  );
66
71
 
@@ -89,6 +94,9 @@ const DateInput = forwardRef<DateInputProps, 'div'>((props, ref) => {
89
94
  {...rest}
90
95
  ref={ref}
91
96
  inputRef={innerRef}
97
+ onBlur={() => setIsFocused(false)}
98
+ onFocus={() => setIsFocused(true)}
99
+ placeholder={dateFormat.toLocaleLowerCase()}
92
100
  rightAddon={
93
101
  <IconButton
94
102
  _active={{ background: 'transparent' }}
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowQuit = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowRight = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowUp = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronDown = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronLeft = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronRight = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronUp = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const Request = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 16 16" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowDown = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowLeft = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowQuit = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowRight = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ArrowUp = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronDown = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronLeft = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronRight = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const ChevronUp = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const Request = forwardRef<IconProps, 'svg'>((props, ref) => (
4
4
  <Icon ref={ref} viewBox="0 0 24 24" {...props}>
@@ -1,4 +1,4 @@
1
- import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
1
+ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
2
2
 
3
3
  const SortArrows = forwardRef<IconProps, 'svg'>((props, ref) => {
4
4
  return (