@telus-uds/components-base 1.91.0 → 1.92.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/CHANGELOG.md CHANGED
@@ -1,12 +1,26 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Mon, 12 Aug 2024 06:26:58 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 22 Aug 2024 18:17:39 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.92.0
8
+
9
+ Thu, 22 Aug 2024 18:17:39 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `Select`: Add `active` variant (Mauricio.BatresMontejo@telus.com)
14
+ - MultiSelectFilter: onOpen function added to component, the function is called when the modal is opened (35577399+JoshHC@users.noreply.github.com)
15
+ - Bump @telus-uds/system-theme-tokens to v2.62.0
16
+
17
+ ### Patches
18
+
19
+ - `carouseltabspanel`: pass accessibilityRole of presentation to divider so align with accessibility tests (<tony.eng@telus.com>)
20
+
7
21
  ## 1.91.0
8
22
 
9
- Mon, 12 Aug 2024 06:26:58 GMT
23
+ Mon, 12 Aug 2024 06:35:32 GMT
10
24
 
11
25
  ### Minor changes
12
26
 
@@ -47,7 +47,9 @@ const CarouselTabsPanel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
47
47
  direction: "row",
48
48
  space: 3,
49
49
  divider: {
50
- variant: dividerVariant
50
+ variant: dividerVariant,
51
+ accessibilityRole: 'presentation',
52
+ accessibilityOrientation: null
51
53
  },
52
54
  ref: ref,
53
55
  accessibilityRole: "tablist",
@@ -66,6 +66,7 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
66
66
  onChange,
67
67
  onConfirm = () => {},
68
68
  onCancel = () => {},
69
+ onOpen = () => {},
69
70
  copy = 'en',
70
71
  readOnly = false,
71
72
  inactive = false,
@@ -136,6 +137,7 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
136
137
  }]);
137
138
  const handleChange = event => {
138
139
  if (pressHandlers.onPress) pressHandlers === null || pressHandlers === void 0 ? void 0 : pressHandlers.onPress(event);
140
+ if (isOpen) onOpen();
139
141
  setIsOpen(!isOpen);
140
142
  };
141
143
  const onApply = e => {
@@ -452,6 +454,10 @@ MultiSelectFilter.propTypes = {
452
454
  * If provided, this function is called when the selection is confirmed.
453
455
  */
454
456
  onConfirm: _propTypes.default.func,
457
+ /**
458
+ * If provided, this function is called when the modal with options is opened.
459
+ * */
460
+ onOpen: _propTypes.default.func,
455
461
  /**
456
462
  * If provided, this function is called when `MultiSelectFilter` is closed.
457
463
  * */
@@ -18,6 +18,8 @@ const Picker = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
18
18
  onBlur,
19
19
  onMouseOver,
20
20
  onMouseOut,
21
+ onOpen = () => {},
22
+ onClose = () => {},
21
23
  style,
22
24
  inactive,
23
25
  children,
@@ -32,29 +34,44 @@ const Picker = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
32
34
  accessibilityDescribedBy,
33
35
  accessibilityInvalid
34
36
  } = rest;
35
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
36
- ref: ref,
37
- style: style,
38
- onMouseOver: onMouseOver,
39
- onMouseOut: onMouseOut,
40
- onFocus: onFocus,
41
- onBlur: onBlur,
42
- disabled: inactive,
43
- value: value || (placeholder !== undefined ? placeholder.value : undefined),
44
- onChange: event => onChange(event.target.value, event),
45
- id: nativeID,
46
- "aria-label": accessibilityLabel,
47
- "aria-describedby": accessibilityDescribedBy,
48
- "aria-invalid": accessibilityInvalid,
49
- "data-testid": testID,
50
- ...selectedProps,
51
- children: [placeholder !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
52
- value: placeholder.value,
53
- disabled: true,
54
- hidden: true,
55
- children: placeholder.label
56
- }), children]
57
- });
37
+ return (
38
+ /*#__PURE__*/
39
+ /**
40
+ * The onOpen and onClose methods are to call the new active variant that changes the icon of the select,
41
+ * onOpen when the select is open and onClose when the select is closed, onOpen is in the event onMousedown
42
+ * when is selected and oClose is in onMouseOut and onChange when the select is closed.
43
+ */
44
+ (0, _jsxRuntime.jsxs)("select", {
45
+ ref: ref,
46
+ style: style,
47
+ onMouseOver: onMouseOver,
48
+ onMouseOut: () => {
49
+ onMouseOut === null || onMouseOut === void 0 ? void 0 : onMouseOut();
50
+ onClose === null || onClose === void 0 ? void 0 : onClose();
51
+ },
52
+ onFocus: onFocus,
53
+ onBlur: onBlur,
54
+ onMouseDown: onOpen,
55
+ disabled: inactive,
56
+ value: value || (placeholder !== undefined ? placeholder.value : undefined),
57
+ onChange: event => {
58
+ onClose();
59
+ onChange(event.target.value, event);
60
+ },
61
+ id: nativeID,
62
+ "aria-label": accessibilityLabel,
63
+ "aria-describedby": accessibilityDescribedBy,
64
+ "aria-invalid": accessibilityInvalid,
65
+ "data-testid": testID,
66
+ ...selectedProps,
67
+ children: [placeholder !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
68
+ value: placeholder.value,
69
+ disabled: true,
70
+ hidden: true,
71
+ children: placeholder.label
72
+ }), children]
73
+ })
74
+ );
58
75
  });
59
76
  Picker.displayName = 'Picker';
60
77
  var _default = Picker;
@@ -67,6 +84,14 @@ Picker.propTypes = {
67
84
  onBlur: _propTypes.default.func,
68
85
  onMouseOver: _propTypes.default.func,
69
86
  onMouseOut: _propTypes.default.func,
87
+ /**
88
+ * It executes when the select choices are open
89
+ */
90
+ onOpen: _propTypes.default.func,
91
+ /**
92
+ * It executes when the select choices are closed
93
+ */
94
+ onClose: _propTypes.default.func,
70
95
  style: _propTypes.default.object,
71
96
  inactive: _propTypes.default.bool,
72
97
  children: (0, _utils.componentPropType)(['Item', 'Group']),
@@ -217,6 +217,7 @@ const Select = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
217
217
  const [isHovered, setIsHovered] = _react.default.useState(false);
218
218
  const handleMouseOver = () => setIsHovered(true);
219
219
  const handleMouseOut = () => setIsHovered(false);
220
+ const [isOpen, setIsOpen] = _react.default.useState(false);
220
221
  const {
221
222
  supportsProps,
222
223
  ...selectedProps
@@ -225,6 +226,7 @@ const Select = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
225
226
  focus: isFocused,
226
227
  hover: isHovered,
227
228
  inactive,
229
+ active: isOpen,
228
230
  validation
229
231
  });
230
232
  const {
@@ -253,6 +255,8 @@ const Select = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
253
255
  onBlur: handleBlur,
254
256
  onMouseOver: handleMouseOver,
255
257
  onMouseOut: handleMouseOut,
258
+ onOpen: () => setIsOpen(true),
259
+ onClose: () => setIsOpen(false),
256
260
  onChange: e => setValue(e, null),
257
261
  value: currentValue,
258
262
  inactive: inactive,
@@ -41,7 +41,9 @@ const CarouselTabsPanel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
41
41
  direction: "row",
42
42
  space: 3,
43
43
  divider: {
44
- variant: dividerVariant
44
+ variant: dividerVariant,
45
+ accessibilityRole: 'presentation',
46
+ accessibilityOrientation: null
45
47
  },
46
48
  ref: ref,
47
49
  accessibilityRole: "tablist",
@@ -61,6 +61,7 @@ const MultiSelectFilter = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
61
61
  onChange,
62
62
  onConfirm = () => {},
63
63
  onCancel = () => {},
64
+ onOpen = () => {},
64
65
  copy = 'en',
65
66
  readOnly = false,
66
67
  inactive = false,
@@ -131,6 +132,7 @@ const MultiSelectFilter = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
131
132
  }]);
132
133
  const handleChange = event => {
133
134
  if (pressHandlers.onPress) pressHandlers === null || pressHandlers === void 0 ? void 0 : pressHandlers.onPress(event);
135
+ if (isOpen) onOpen();
134
136
  setIsOpen(!isOpen);
135
137
  };
136
138
  const onApply = e => {
@@ -447,6 +449,10 @@ MultiSelectFilter.propTypes = {
447
449
  * If provided, this function is called when the selection is confirmed.
448
450
  */
449
451
  onConfirm: PropTypes.func,
452
+ /**
453
+ * If provided, this function is called when the modal with options is opened.
454
+ * */
455
+ onOpen: PropTypes.func,
450
456
  /**
451
457
  * If provided, this function is called when `MultiSelectFilter` is closed.
452
458
  * */
@@ -12,6 +12,8 @@ const Picker = /*#__PURE__*/React.forwardRef((_ref, ref) => {
12
12
  onBlur,
13
13
  onMouseOver,
14
14
  onMouseOut,
15
+ onOpen = () => {},
16
+ onClose = () => {},
15
17
  style,
16
18
  inactive,
17
19
  children,
@@ -26,29 +28,44 @@ const Picker = /*#__PURE__*/React.forwardRef((_ref, ref) => {
26
28
  accessibilityDescribedBy,
27
29
  accessibilityInvalid
28
30
  } = rest;
29
- return /*#__PURE__*/_jsxs("select", {
30
- ref: ref,
31
- style: style,
32
- onMouseOver: onMouseOver,
33
- onMouseOut: onMouseOut,
34
- onFocus: onFocus,
35
- onBlur: onBlur,
36
- disabled: inactive,
37
- value: value || (placeholder !== undefined ? placeholder.value : undefined),
38
- onChange: event => onChange(event.target.value, event),
39
- id: nativeID,
40
- "aria-label": accessibilityLabel,
41
- "aria-describedby": accessibilityDescribedBy,
42
- "aria-invalid": accessibilityInvalid,
43
- "data-testid": testID,
44
- ...selectedProps,
45
- children: [placeholder !== undefined && /*#__PURE__*/_jsx("option", {
46
- value: placeholder.value,
47
- disabled: true,
48
- hidden: true,
49
- children: placeholder.label
50
- }), children]
51
- });
31
+ return (
32
+ /*#__PURE__*/
33
+ /**
34
+ * The onOpen and onClose methods are to call the new active variant that changes the icon of the select,
35
+ * onOpen when the select is open and onClose when the select is closed, onOpen is in the event onMousedown
36
+ * when is selected and oClose is in onMouseOut and onChange when the select is closed.
37
+ */
38
+ _jsxs("select", {
39
+ ref: ref,
40
+ style: style,
41
+ onMouseOver: onMouseOver,
42
+ onMouseOut: () => {
43
+ onMouseOut === null || onMouseOut === void 0 ? void 0 : onMouseOut();
44
+ onClose === null || onClose === void 0 ? void 0 : onClose();
45
+ },
46
+ onFocus: onFocus,
47
+ onBlur: onBlur,
48
+ onMouseDown: onOpen,
49
+ disabled: inactive,
50
+ value: value || (placeholder !== undefined ? placeholder.value : undefined),
51
+ onChange: event => {
52
+ onClose();
53
+ onChange(event.target.value, event);
54
+ },
55
+ id: nativeID,
56
+ "aria-label": accessibilityLabel,
57
+ "aria-describedby": accessibilityDescribedBy,
58
+ "aria-invalid": accessibilityInvalid,
59
+ "data-testid": testID,
60
+ ...selectedProps,
61
+ children: [placeholder !== undefined && /*#__PURE__*/_jsx("option", {
62
+ value: placeholder.value,
63
+ disabled: true,
64
+ hidden: true,
65
+ children: placeholder.label
66
+ }), children]
67
+ })
68
+ );
52
69
  });
53
70
  Picker.displayName = 'Picker';
54
71
  export default Picker;
@@ -60,6 +77,14 @@ Picker.propTypes = {
60
77
  onBlur: PropTypes.func,
61
78
  onMouseOver: PropTypes.func,
62
79
  onMouseOut: PropTypes.func,
80
+ /**
81
+ * It executes when the select choices are open
82
+ */
83
+ onOpen: PropTypes.func,
84
+ /**
85
+ * It executes when the select choices are closed
86
+ */
87
+ onClose: PropTypes.func,
63
88
  style: PropTypes.object,
64
89
  inactive: PropTypes.bool,
65
90
  children: componentPropType(['Item', 'Group']),
@@ -211,6 +211,7 @@ const Select = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
211
211
  const [isHovered, setIsHovered] = React.useState(false);
212
212
  const handleMouseOver = () => setIsHovered(true);
213
213
  const handleMouseOut = () => setIsHovered(false);
214
+ const [isOpen, setIsOpen] = React.useState(false);
214
215
  const {
215
216
  supportsProps,
216
217
  ...selectedProps
@@ -219,6 +220,7 @@ const Select = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
219
220
  focus: isFocused,
220
221
  hover: isHovered,
221
222
  inactive,
223
+ active: isOpen,
222
224
  validation
223
225
  });
224
226
  const {
@@ -247,6 +249,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
247
249
  onBlur: handleBlur,
248
250
  onMouseOver: handleMouseOver,
249
251
  onMouseOut: handleMouseOut,
252
+ onOpen: () => setIsOpen(true),
253
+ onClose: () => setIsOpen(false),
250
254
  onChange: e => setValue(e, null),
251
255
  value: currentValue,
252
256
  inactive: inactive,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "@floating-ui/react-native": "^0.8.1",
12
12
  "@gorhom/portal": "^1.0.14",
13
13
  "@telus-uds/system-constants": "^1.3.0",
14
- "@telus-uds/system-theme-tokens": "^2.61.0",
14
+ "@telus-uds/system-theme-tokens": "^2.62.0",
15
15
  "airbnb-prop-types": "^2.16.0",
16
16
  "css-mediaquery": "^0.1.2",
17
17
  "expo-linear-gradient": "^12.5.0",
@@ -85,6 +85,6 @@
85
85
  "standard-engine": {
86
86
  "skip": true
87
87
  },
88
- "version": "1.91.0",
88
+ "version": "1.92.0",
89
89
  "types": "types/index.d.ts"
90
90
  }
@@ -35,7 +35,11 @@ const CarouselTabsPanel = React.forwardRef(({ items }, ref) => {
35
35
  <StackView
36
36
  direction="row"
37
37
  space={3}
38
- divider={{ variant: dividerVariant }}
38
+ divider={{
39
+ variant: dividerVariant,
40
+ accessibilityRole: 'presentation',
41
+ accessibilityOrientation: null
42
+ }}
39
43
  ref={ref}
40
44
  accessibilityRole="tablist"
41
45
  >
@@ -57,6 +57,7 @@ const MultiSelectFilter = React.forwardRef(
57
57
  onChange,
58
58
  onConfirm = () => {},
59
59
  onCancel = () => {},
60
+ onOpen = () => {},
60
61
  copy = 'en',
61
62
  readOnly = false,
62
63
  inactive = false,
@@ -124,6 +125,7 @@ const MultiSelectFilter = React.forwardRef(
124
125
 
125
126
  const handleChange = (event) => {
126
127
  if (pressHandlers.onPress) pressHandlers?.onPress(event)
128
+ if (isOpen) onOpen()
127
129
  setIsOpen(!isOpen)
128
130
  }
129
131
 
@@ -406,6 +408,10 @@ MultiSelectFilter.propTypes = {
406
408
  * If provided, this function is called when the selection is confirmed.
407
409
  */
408
410
  onConfirm: PropTypes.func,
411
+ /**
412
+ * If provided, this function is called when the modal with options is opened.
413
+ * */
414
+ onOpen: PropTypes.func,
409
415
  /**
410
416
  * If provided, this function is called when `MultiSelectFilter` is closed.
411
417
  * */
@@ -14,6 +14,8 @@ const Picker = React.forwardRef(
14
14
  onBlur,
15
15
  onMouseOver,
16
16
  onMouseOut,
17
+ onOpen = () => {},
18
+ onClose = () => {},
17
19
  style,
18
20
  inactive,
19
21
  children,
@@ -28,16 +30,28 @@ const Picker = React.forwardRef(
28
30
  const { accessibilityLabel, accessibilityDescribedBy, accessibilityInvalid } = rest
29
31
 
30
32
  return (
33
+ /**
34
+ * The onOpen and onClose methods are to call the new active variant that changes the icon of the select,
35
+ * onOpen when the select is open and onClose when the select is closed, onOpen is in the event onMousedown
36
+ * when is selected and oClose is in onMouseOut and onChange when the select is closed.
37
+ */
31
38
  <select
32
39
  ref={ref}
33
40
  style={style}
34
41
  onMouseOver={onMouseOver}
35
- onMouseOut={onMouseOut}
42
+ onMouseOut={() => {
43
+ onMouseOut?.()
44
+ onClose?.()
45
+ }}
36
46
  onFocus={onFocus}
37
47
  onBlur={onBlur}
48
+ onMouseDown={onOpen}
38
49
  disabled={inactive}
39
50
  value={value || (placeholder !== undefined ? placeholder.value : undefined)}
40
- onChange={(event) => onChange(event.target.value, event)}
51
+ onChange={(event) => {
52
+ onClose()
53
+ onChange(event.target.value, event)
54
+ }}
41
55
  id={nativeID}
42
56
  aria-label={accessibilityLabel}
43
57
  aria-describedby={accessibilityDescribedBy}
@@ -67,6 +81,14 @@ Picker.propTypes = {
67
81
  onBlur: PropTypes.func,
68
82
  onMouseOver: PropTypes.func,
69
83
  onMouseOut: PropTypes.func,
84
+ /**
85
+ * It executes when the select choices are open
86
+ */
87
+ onOpen: PropTypes.func,
88
+ /**
89
+ * It executes when the select choices are closed
90
+ */
91
+ onClose: PropTypes.func,
70
92
  style: PropTypes.object,
71
93
  inactive: PropTypes.bool,
72
94
  children: componentPropType(['Item', 'Group']),
@@ -214,12 +214,15 @@ const Select = React.forwardRef(
214
214
  const handleMouseOver = () => setIsHovered(true)
215
215
  const handleMouseOut = () => setIsHovered(false)
216
216
 
217
+ const [isOpen, setIsOpen] = React.useState(false)
218
+
217
219
  const { supportsProps, ...selectedProps } = selectProps(rest)
218
220
 
219
221
  const themeTokens = useThemeTokens('Select', tokens, variant, {
220
222
  focus: isFocused,
221
223
  hover: isHovered,
222
224
  inactive,
225
+ active: isOpen,
223
226
  validation
224
227
  })
225
228
 
@@ -243,6 +246,8 @@ const Select = React.forwardRef(
243
246
  onBlur={handleBlur}
244
247
  onMouseOver={handleMouseOver}
245
248
  onMouseOut={handleMouseOut}
249
+ onOpen={() => setIsOpen(true)}
250
+ onClose={() => setIsOpen(false)}
246
251
  onChange={(e) => setValue(e, null)}
247
252
  value={currentValue}
248
253
  inactive={inactive}