@telus-uds/components-web 2.34.3 → 2.35.1

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/CHANGELOG.md CHANGED
@@ -1,12 +1,38 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Fri, 07 Jun 2024 22:36:16 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 04 Jul 2024 19:28:59 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.35.1
8
+
9
+ Thu, 04 Jul 2024 19:28:59 GMT
10
+
11
+ ### Patches
12
+
13
+ - `Breadcrumbs`: fix line break (guillermo.peitzner@telus.com)
14
+ - `OrderedList`: fix numbered text alignment (guillermo.peitzner@telus.com)
15
+ - Bump @telus-uds/components-base to v1.88.0
16
+ - Bump @telus-uds/system-theme-tokens to v2.59.0
17
+
18
+ ## 2.35.0
19
+
20
+ Mon, 24 Jun 2024 16:28:34 GMT
21
+
22
+ ### Minor changes
23
+
24
+ - `ActionCard`: make interactive card render body function (guillermo.peitzner@telus.com)
25
+ - Bump @telus-uds/components-base to v1.87.0
26
+ - Bump @telus-uds/system-theme-tokens to v2.58.0
27
+
28
+ ### Patches
29
+
30
+ - `DatePicker`: fix focus life cycle (guillermo.peitzner@telus.com)
31
+ - List: misalignment issue fixed when the text was too long and the container has display: 'flex' (35577399+JoshHC@users.noreply.github.com)
32
+
7
33
  ## 2.34.3
8
34
 
9
- Fri, 07 Jun 2024 22:36:16 GMT
35
+ Fri, 07 Jun 2024 22:42:09 GMT
10
36
 
11
37
  ### Patches
12
38
 
@@ -16,7 +16,7 @@ const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig
16
16
  displayName: "Item__StyledItemContainer",
17
17
  componentId: "components-web__sc-1rfdaul-0"
18
18
  })({
19
- display: 'flex',
19
+ display: 'inline-block',
20
20
  paddingLeft: _ref => {
21
21
  let {
22
22
  listItemPadding
@@ -30,58 +30,51 @@ const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig
30
30
  } = _ref2;
31
31
  return `${Math.ceil(lineHeight * fontSize)}px`;
32
32
  },
33
- height: _ref3 => {
34
- let {
35
- iconContainerSize
36
- } = _ref3;
37
- return `${iconContainerSize}px`;
38
- },
39
33
  marginBottom: '8px'
40
34
  });
41
35
  const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
42
36
  displayName: "Item__IconContainer",
43
37
  componentId: "components-web__sc-1rfdaul-1"
44
38
  })({
45
- display: 'flex',
46
- justifyContent: 'center',
47
- alignItems: 'center',
48
- paddingLeft: _ref4 => {
39
+ display: 'inline-block',
40
+ paddingLeft: _ref3 => {
49
41
  let {
50
42
  iconPadding
51
- } = _ref4;
43
+ } = _ref3;
52
44
  return `${iconPadding}px`;
53
45
  },
54
- paddingRight: _ref5 => {
46
+ paddingRight: _ref4 => {
55
47
  let {
56
48
  iconPadding
57
- } = _ref5;
49
+ } = _ref4;
58
50
  return `${iconPadding}px`;
59
51
  },
60
- fontFamily: _ref6 => {
52
+ fontFamily: _ref5 => {
61
53
  let {
62
54
  fontName,
63
55
  fontWeight
64
- } = _ref6;
56
+ } = _ref5;
65
57
  return (0, _componentsBase.applyTextStyles)({
66
58
  fontName,
67
59
  fontWeight
68
60
  }).fontFamily;
69
61
  },
70
- height: _ref7 => {
62
+ height: _ref6 => {
71
63
  let {
72
64
  iconContainerSize
73
- } = _ref7;
65
+ } = _ref6;
74
66
  return `${iconContainerSize}px`;
75
67
  },
76
- width: _ref8 => {
68
+ width: _ref7 => {
77
69
  let {
78
70
  iconContainerSize,
79
71
  iconPadding
80
- } = _ref8;
72
+ } = _ref7;
81
73
  return `${iconContainerSize + iconPadding * 2}px`;
82
- }
74
+ },
75
+ verticalAlign: 'bottom'
83
76
  });
84
- const Item = /*#__PURE__*/_react.default.forwardRef((_ref9, ref) => {
77
+ const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
85
78
  let {
86
79
  href,
87
80
  children,
@@ -94,7 +87,7 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref9, ref) => {
94
87
  LinkRouter,
95
88
  linkRouterProps,
96
89
  ...rest
97
- } = _ref9;
90
+ } = _ref8;
98
91
  const {
99
92
  iconColor,
100
93
  icon: ChevronRightIcon,
package/lib/Card/Card.js CHANGED
@@ -110,7 +110,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
110
110
  dataSet: dataSet,
111
111
  onPress: onPress,
112
112
  ...selectProps(rest),
113
- children: interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body
113
+ children: typeof (interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body) === 'function' ? interactiveCard.body() : interactiveCard.body
114
114
  }) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
115
115
  direction: contentStackDirection,
116
116
  tokens: {
@@ -185,7 +185,7 @@ Card.propTypes = {
185
185
  * Object to set interactive card's properties
186
186
  */
187
187
  interactiveCard: _propTypes.default.shape({
188
- body: _propTypes.default.node,
188
+ body: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
189
189
  tokens: (0, _componentsBase.getTokensPropType)('Card'),
190
190
  variant: _componentsBase.variantProp.propType
191
191
  })
@@ -119,6 +119,7 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
119
119
  const [inputDate, setInputDate] = _react.default.useState(date instanceof _moment.default ? date : undefined);
120
120
  const [inputText, setInputText] = _react.default.useState(date instanceof _moment.default ? date.format(dateFormat) : '');
121
121
  const textInputRef = _react.default.useRef();
122
+ const prevButtonRef = _react.default.useRef();
122
123
  const [datePickerPosition, setDatePickerPosition] = _react.default.useState({
123
124
  left: 0,
124
125
  top: 0
@@ -159,6 +160,19 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
159
160
  setInputText(date instanceof _moment.default ? date.format(dateFormat) : '');
160
161
  }
161
162
  }, [date, inputDate]);
163
+ _react.default.useEffect(() => {
164
+ let timeoutId;
165
+ if (prevButtonRef.current && isFocused) {
166
+ timeoutId = setTimeout(() => prevButtonRef.current.focus(), 100);
167
+ }
168
+ return () => clearTimeout(timeoutId);
169
+ }, [isFocused]);
170
+ _react.default.useEffect(() => {
171
+ if (inputText !== '' && inputDate !== undefined) {
172
+ var _textInputRef$current;
173
+ textInputRef === null || textInputRef === void 0 ? void 0 : (_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 ? void 0 : _textInputRef$current.focus();
174
+ }
175
+ }, [inputDate, inputText]);
162
176
  const onFocusChange = _ref4 => {
163
177
  let {
164
178
  focused
@@ -169,7 +183,7 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
169
183
  setIsClickedInside(false);
170
184
  };
171
185
  const handleFocus = event => {
172
- if (event.target.tagName === 'INPUT' && !disabled) {
186
+ if (event.target.tagName === 'INPUT' && !disabled && inputDate === undefined && inputText === '') {
173
187
  setIsFocused(true);
174
188
  }
175
189
  };
@@ -265,7 +279,8 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
265
279
  variant: {
266
280
  size: 'small'
267
281
  },
268
- testID: prevTestID
282
+ testID: prevTestID,
283
+ ref: prevButtonRef
269
284
  });
270
285
  };
271
286
  const renderNextButton = _ref6 => {
@@ -38,7 +38,7 @@ const StyledItemBase = /*#__PURE__*/(0, _styledComponents.default)(_ItemBase.def
38
38
  let {
39
39
  interItemMargin,
40
40
  itemBulletContainerWidth,
41
- itemBulletContainerAlign,
41
+ itemBulletTextAlign,
42
42
  itemFontWeight,
43
43
  itemFontSize,
44
44
  itemFontName,
@@ -55,7 +55,7 @@ const StyledItemBase = /*#__PURE__*/(0, _styledComponents.default)(_ItemBase.def
55
55
  color: itemColor,
56
56
  width: itemBulletContainerWidth,
57
57
  paddingRight: listGutter,
58
- textAlign: itemBulletContainerAlign,
58
+ justifyContent: itemBulletTextAlign,
59
59
  ...(0, _componentsBase.applyTextStyles)({
60
60
  fontWeight: itemFontWeight,
61
61
  fontSize: itemFontSize,
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "A11yText", {
15
15
  return _componentsBase.A11yText;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "ActionCard", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _componentsBase.ActionCard;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "ActivityIndicator", {
19
25
  enumerable: true,
20
26
  get: function () {
@@ -11,7 +11,7 @@ const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
11
11
  displayName: "Item__StyledItemContainer",
12
12
  componentId: "components-web__sc-1rfdaul-0"
13
13
  })({
14
- display: 'flex',
14
+ display: 'inline-block',
15
15
  paddingLeft: _ref => {
16
16
  let {
17
17
  listItemPadding
@@ -25,58 +25,51 @@ const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
25
25
  } = _ref2;
26
26
  return `${Math.ceil(lineHeight * fontSize)}px`;
27
27
  },
28
- height: _ref3 => {
29
- let {
30
- iconContainerSize
31
- } = _ref3;
32
- return `${iconContainerSize}px`;
33
- },
34
28
  marginBottom: '8px'
35
29
  });
36
30
  const IconContainer = /*#__PURE__*/styled.span.withConfig({
37
31
  displayName: "Item__IconContainer",
38
32
  componentId: "components-web__sc-1rfdaul-1"
39
33
  })({
40
- display: 'flex',
41
- justifyContent: 'center',
42
- alignItems: 'center',
43
- paddingLeft: _ref4 => {
34
+ display: 'inline-block',
35
+ paddingLeft: _ref3 => {
44
36
  let {
45
37
  iconPadding
46
- } = _ref4;
38
+ } = _ref3;
47
39
  return `${iconPadding}px`;
48
40
  },
49
- paddingRight: _ref5 => {
41
+ paddingRight: _ref4 => {
50
42
  let {
51
43
  iconPadding
52
- } = _ref5;
44
+ } = _ref4;
53
45
  return `${iconPadding}px`;
54
46
  },
55
- fontFamily: _ref6 => {
47
+ fontFamily: _ref5 => {
56
48
  let {
57
49
  fontName,
58
50
  fontWeight
59
- } = _ref6;
51
+ } = _ref5;
60
52
  return applyTextStyles({
61
53
  fontName,
62
54
  fontWeight
63
55
  }).fontFamily;
64
56
  },
65
- height: _ref7 => {
57
+ height: _ref6 => {
66
58
  let {
67
59
  iconContainerSize
68
- } = _ref7;
60
+ } = _ref6;
69
61
  return `${iconContainerSize}px`;
70
62
  },
71
- width: _ref8 => {
63
+ width: _ref7 => {
72
64
  let {
73
65
  iconContainerSize,
74
66
  iconPadding
75
- } = _ref8;
67
+ } = _ref7;
76
68
  return `${iconContainerSize + iconPadding * 2}px`;
77
- }
69
+ },
70
+ verticalAlign: 'bottom'
78
71
  });
79
- const Item = /*#__PURE__*/React.forwardRef((_ref9, ref) => {
72
+ const Item = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
80
73
  let {
81
74
  href,
82
75
  children,
@@ -89,7 +82,7 @@ const Item = /*#__PURE__*/React.forwardRef((_ref9, ref) => {
89
82
  LinkRouter,
90
83
  linkRouterProps,
91
84
  ...rest
92
- } = _ref9;
85
+ } = _ref8;
93
86
  const {
94
87
  iconColor,
95
88
  icon: ChevronRightIcon,
@@ -103,7 +103,7 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
103
103
  dataSet: dataSet,
104
104
  onPress: onPress,
105
105
  ...selectProps(rest),
106
- children: interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body
106
+ children: typeof (interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body) === 'function' ? interactiveCard.body() : interactiveCard.body
107
107
  }) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/_jsxs(StackView, {
108
108
  direction: contentStackDirection,
109
109
  tokens: {
@@ -178,7 +178,7 @@ Card.propTypes = {
178
178
  * Object to set interactive card's properties
179
179
  */
180
180
  interactiveCard: PropTypes.shape({
181
- body: PropTypes.node,
181
+ body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
182
182
  tokens: getTokensPropType('Card'),
183
183
  variant: variantProp.propType
184
184
  })
@@ -114,6 +114,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
114
114
  const [inputDate, setInputDate] = React.useState(date instanceof moment ? date : undefined);
115
115
  const [inputText, setInputText] = React.useState(date instanceof moment ? date.format(dateFormat) : '');
116
116
  const textInputRef = React.useRef();
117
+ const prevButtonRef = React.useRef();
117
118
  const [datePickerPosition, setDatePickerPosition] = React.useState({
118
119
  left: 0,
119
120
  top: 0
@@ -154,6 +155,19 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
154
155
  setInputText(date instanceof moment ? date.format(dateFormat) : '');
155
156
  }
156
157
  }, [date, inputDate]);
158
+ React.useEffect(() => {
159
+ let timeoutId;
160
+ if (prevButtonRef.current && isFocused) {
161
+ timeoutId = setTimeout(() => prevButtonRef.current.focus(), 100);
162
+ }
163
+ return () => clearTimeout(timeoutId);
164
+ }, [isFocused]);
165
+ React.useEffect(() => {
166
+ if (inputText !== '' && inputDate !== undefined) {
167
+ var _textInputRef$current;
168
+ textInputRef === null || textInputRef === void 0 ? void 0 : (_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 ? void 0 : _textInputRef$current.focus();
169
+ }
170
+ }, [inputDate, inputText]);
157
171
  const onFocusChange = _ref4 => {
158
172
  let {
159
173
  focused
@@ -164,7 +178,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
164
178
  setIsClickedInside(false);
165
179
  };
166
180
  const handleFocus = event => {
167
- if (event.target.tagName === 'INPUT' && !disabled) {
181
+ if (event.target.tagName === 'INPUT' && !disabled && inputDate === undefined && inputText === '') {
168
182
  setIsFocused(true);
169
183
  }
170
184
  };
@@ -260,7 +274,8 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
260
274
  variant: {
261
275
  size: 'small'
262
276
  },
263
- testID: prevTestID
277
+ testID: prevTestID,
278
+ ref: prevButtonRef
264
279
  });
265
280
  };
266
281
  const renderNextButton = _ref6 => {
@@ -32,7 +32,7 @@ const StyledItemBase = /*#__PURE__*/styled(ItemBase).withConfig({
32
32
  let {
33
33
  interItemMargin,
34
34
  itemBulletContainerWidth,
35
- itemBulletContainerAlign,
35
+ itemBulletTextAlign,
36
36
  itemFontWeight,
37
37
  itemFontSize,
38
38
  itemFontName,
@@ -49,7 +49,7 @@ const StyledItemBase = /*#__PURE__*/styled(ItemBase).withConfig({
49
49
  color: itemColor,
50
50
  width: itemBulletContainerWidth,
51
51
  paddingRight: listGutter,
52
- textAlign: itemBulletContainerAlign,
52
+ justifyContent: itemBulletTextAlign,
53
53
  ...applyTextStyles({
54
54
  fontWeight: itemFontWeight,
55
55
  fontSize: itemFontSize,
@@ -5,7 +5,7 @@ export {
5
5
  /**
6
6
  * Most base components should be re-exported as-is.
7
7
  */
8
- A11yText, ActivityIndicator, Autocomplete, Box, Button, BaseProvider, A11yInfoProvider, ViewportProvider, ThemeProvider, ButtonDropdown, ButtonGroup, ButtonLink, CardGroup, Carousel, CarouselTabs, Checkbox, CheckboxGroup, ChevronLink, ColourToggle, Divider, ExpandCollapse, Feedback, FlexGrid, Icon, InputLabel, InputSupports, Link, Listbox, Modal, MultiSelectFilter, Notification, Pagination, Portal, QuickLinks, QuickLinksFeature, Radio, RadioGroup, RadioCard, RadioCardGroup, Responsive, Search, Select, SideNav, Skeleton, SkipLink, Spacer, StackView, StackWrap, StepTracker, Tabs, Tags, TextButton, TextArea, TextInput, Timeline, ToggleSwitch, ToggleSwitchGroup, TooltipButton, Tooltip, Typography, Validator,
8
+ ActionCard, A11yText, ActivityIndicator, Autocomplete, Box, Button, BaseProvider, A11yInfoProvider, ViewportProvider, ThemeProvider, ButtonDropdown, ButtonGroup, ButtonLink, CardGroup, Carousel, CarouselTabs, Checkbox, CheckboxGroup, ChevronLink, ColourToggle, Divider, ExpandCollapse, Feedback, FlexGrid, Icon, InputLabel, InputSupports, Link, Listbox, Modal, MultiSelectFilter, Notification, Pagination, Portal, QuickLinks, QuickLinksFeature, Radio, RadioGroup, RadioCard, RadioCardGroup, Responsive, Search, Select, SideNav, Skeleton, SkipLink, Spacer, StackView, StackWrap, StepTracker, Tabs, Tags, TextButton, TextArea, TextInput, Timeline, ToggleSwitch, ToggleSwitchGroup, TooltipButton, Tooltip, Typography, Validator,
9
9
  /*
10
10
  * Most utilities exported from @telus-uds/components-base are for building systems, not apps.
11
11
  * Re-export only those utilities with a stable API and known use cases within apps / pages.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "@gorhom/portal": "^1.0.14",
8
- "@telus-uds/components-base": "1.86.0",
8
+ "@telus-uds/components-base": "1.88.0",
9
9
  "@telus-uds/system-constants": "^1.3.0",
10
10
  "fscreen": "^1.2.0",
11
11
  "lodash.omit": "^4.5.0",
@@ -13,7 +13,7 @@
13
13
  "react-dates": "^21.8.0",
14
14
  "react-helmet-async": "^1.3.0",
15
15
  "react-moment-proptypes": "^1.8.1",
16
- "@telus-uds/system-theme-tokens": "^2.57.0",
16
+ "@telus-uds/system-theme-tokens": "^2.59.0",
17
17
  "prop-types": "^15.7.2",
18
18
  "lodash.throttle": "^4.1.1",
19
19
  "react-youtube": "^10.1.0",
@@ -83,5 +83,5 @@
83
83
  "skip": true
84
84
  },
85
85
  "types": "types/index.d.ts",
86
- "version": "2.34.3"
86
+ "version": "2.35.1"
87
87
  }
@@ -14,22 +14,20 @@ import { htmlAttrs } from '../../utils'
14
14
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
15
15
 
16
16
  const StyledItemContainer = styled.li({
17
- display: 'flex',
17
+ display: 'inline-block',
18
18
  paddingLeft: ({ listItemPadding }) => `${listItemPadding}px`,
19
19
  lineHeight: ({ lineHeight, fontSize }) => `${Math.ceil(lineHeight * fontSize)}px`,
20
- height: ({ iconContainerSize }) => `${iconContainerSize}px`,
21
20
  marginBottom: '8px'
22
21
  })
23
22
 
24
23
  const IconContainer = styled.span({
25
- display: 'flex',
26
- justifyContent: 'center',
27
- alignItems: 'center',
24
+ display: 'inline-block',
28
25
  paddingLeft: ({ iconPadding }) => `${iconPadding}px`,
29
26
  paddingRight: ({ iconPadding }) => `${iconPadding}px`,
30
27
  fontFamily: ({ fontName, fontWeight }) => applyTextStyles({ fontName, fontWeight }).fontFamily,
31
28
  height: ({ iconContainerSize }) => `${iconContainerSize}px`,
32
- width: ({ iconContainerSize, iconPadding }) => `${iconContainerSize + iconPadding * 2}px`
29
+ width: ({ iconContainerSize, iconPadding }) => `${iconContainerSize + iconPadding * 2}px`,
30
+ verticalAlign: 'bottom'
33
31
  })
34
32
 
35
33
  const Item = React.forwardRef(
package/src/Card/Card.jsx CHANGED
@@ -116,7 +116,9 @@ const Card = React.forwardRef(
116
116
  onPress={onPress}
117
117
  {...selectProps(rest)}
118
118
  >
119
- {interactiveCard?.body}
119
+ {typeof interactiveCard?.body === 'function'
120
+ ? interactiveCard.body()
121
+ : interactiveCard.body}
120
122
  </PressableCardBase>
121
123
  ) : null}
122
124
  {children || fullBleedContentPosition !== 'none' ? (
@@ -197,7 +199,7 @@ Card.propTypes = {
197
199
  * Object to set interactive card's properties
198
200
  */
199
201
  interactiveCard: PropTypes.shape({
200
- body: PropTypes.node,
202
+ body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
201
203
  tokens: getTokensPropType('Card'),
202
204
  variant: variantProp.propType
203
205
  })
@@ -109,6 +109,7 @@ const DatePicker = React.forwardRef(
109
109
  date instanceof moment ? date.format(dateFormat) : ''
110
110
  )
111
111
  const textInputRef = React.useRef()
112
+ const prevButtonRef = React.useRef()
112
113
  const [datePickerPosition, setDatePickerPosition] = React.useState({ left: 0, top: 0 })
113
114
 
114
115
  useSafeLayoutEffect(() => {
@@ -130,6 +131,7 @@ const DatePicker = React.forwardRef(
130
131
  const [isFocused, setIsFocused] = React.useState(false)
131
132
  const [isClickedInside, setIsClickedInside] = React.useState(false)
132
133
  const getCopy = useCopy({ dictionary, copy })
134
+
133
135
  React.useEffect(() => {
134
136
  /**
135
137
  * `date` could be passed as `null` to reset the value so explicitly
@@ -140,6 +142,23 @@ const DatePicker = React.forwardRef(
140
142
  setInputText(date instanceof moment ? date.format(dateFormat) : '')
141
143
  }
142
144
  }, [date, inputDate])
145
+
146
+ React.useEffect(() => {
147
+ let timeoutId
148
+
149
+ if (prevButtonRef.current && isFocused) {
150
+ timeoutId = setTimeout(() => prevButtonRef.current.focus(), 100)
151
+ }
152
+
153
+ return () => clearTimeout(timeoutId)
154
+ }, [isFocused])
155
+
156
+ React.useEffect(() => {
157
+ if (inputText !== '' && inputDate !== undefined) {
158
+ textInputRef?.current?.focus()
159
+ }
160
+ }, [inputDate, inputText])
161
+
143
162
  const onFocusChange = ({ focused }) => {
144
163
  if (!isClickedInside) {
145
164
  setIsFocused(focused)
@@ -147,7 +166,12 @@ const DatePicker = React.forwardRef(
147
166
  setIsClickedInside(false)
148
167
  }
149
168
  const handleFocus = (event) => {
150
- if (event.target.tagName === 'INPUT' && !disabled) {
169
+ if (
170
+ event.target.tagName === 'INPUT' &&
171
+ !disabled &&
172
+ inputDate === undefined &&
173
+ inputText === ''
174
+ ) {
151
175
  setIsFocused(true)
152
176
  }
153
177
  }
@@ -248,6 +272,7 @@ const DatePicker = React.forwardRef(
248
272
  icon={previousIcon}
249
273
  variant={{ size: 'small' }}
250
274
  testID={prevTestID}
275
+ ref={prevButtonRef}
251
276
  />
252
277
  )
253
278
  const renderNextButton = ({ onClick }) => (
@@ -34,7 +34,7 @@ const StyledItemBase = styled(ItemBase)(
34
34
  ({
35
35
  interItemMargin,
36
36
  itemBulletContainerWidth,
37
- itemBulletContainerAlign,
37
+ itemBulletTextAlign,
38
38
  itemFontWeight,
39
39
  itemFontSize,
40
40
  itemFontName,
@@ -50,7 +50,7 @@ const StyledItemBase = styled(ItemBase)(
50
50
  color: itemColor,
51
51
  width: itemBulletContainerWidth,
52
52
  paddingRight: listGutter,
53
- textAlign: itemBulletContainerAlign,
53
+ justifyContent: itemBulletTextAlign,
54
54
  ...applyTextStyles({
55
55
  fontWeight: itemFontWeight,
56
56
  fontSize: itemFontSize,
@@ -5,6 +5,7 @@ export {
5
5
  /**
6
6
  * Most base components should be re-exported as-is.
7
7
  */
8
+ ActionCard,
8
9
  A11yText,
9
10
  ActivityIndicator,
10
11
  Autocomplete,