@telus-uds/components-base 3.17.1 → 3.18.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,16 +1,16 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Fri, 12 Sep 2025 17:00:54 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 16 Sep 2025 21:19:36 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 3.17.1
7
+ ## 3.18.0
8
8
 
9
- Fri, 12 Sep 2025 17:00:54 GMT
9
+ Tue, 16 Sep 2025 21:19:36 GMT
10
10
 
11
- ### Patches
11
+ ### Minor changes
12
12
 
13
- - `Card`: fix pressable-card text-decoration when href is present (guillermo.peitzner@telus.com)
13
+ - `Modal`: add footer prop (guillermo.peitzner@telus.com)
14
14
 
15
15
  ## 3.13.0
16
16
 
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 TELUS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -127,6 +127,7 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
127
127
  confirmButtonVariant,
128
128
  cancelButtonText,
129
129
  cancelButtonType,
130
+ footer,
130
131
  ...rest
131
132
  } = _ref5;
132
133
  const viewport = (0, _ViewportProvider.useViewport)();
@@ -230,6 +231,7 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
230
231
  confirmButtonVariant: confirmButtonVariant,
231
232
  cancelButtonText: cancelButtonText,
232
233
  cancelButtonType: cancelButtonType,
234
+ footer: footer,
233
235
  children: _Platform.default.OS !== 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollView.default, {
234
236
  style: selectScrollViewStyles,
235
237
  children: children
@@ -330,7 +332,11 @@ Modal.propTypes = {
330
332
  /**
331
333
  * Receive a function for the onCancel event in the cancel button.
332
334
  */
333
- onCancel: _propTypes.default.func
335
+ onCancel: _propTypes.default.func,
336
+ /**
337
+ * Receive a react node or an array of nodes to render at the bottom of the modal, above the action buttons.
338
+ */
339
+ footer: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)])
334
340
  };
335
341
  var _default = exports.default = Modal;
336
342
  const staticStyles = _StyleSheet.default.create({
@@ -35,7 +35,8 @@ const ModalContent = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
35
35
  cancelButtonText,
36
36
  cancelButtonType: CancelButton = _Link.TextButton,
37
37
  children,
38
- onCancel
38
+ onCancel,
39
+ footer
39
40
  } = _ref;
40
41
  const viewport = (0, _ViewportProvider.useViewport)();
41
42
  const {
@@ -149,7 +150,7 @@ const ModalContent = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
149
150
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
150
151
  children: bodyText
151
152
  })
152
- }), children, (hasConfirmButton || hasCancelButton) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
153
+ }), children, (hasConfirmButton || hasCancelButton) && !footer && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
153
154
  style: [selectFooterContainerStyles({
154
155
  ...themeTokens,
155
156
  hasBorder: isContentOverflowing
@@ -171,7 +172,7 @@ const ModalContent = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
171
172
  children: cancelButtonText
172
173
  })
173
174
  }) : null]
174
- })]
175
+ }), footer]
175
176
  });
176
177
  });
177
178
  ModalContent.displayName = 'ModalContent';
@@ -200,6 +201,7 @@ ModalContent.propTypes = {
200
201
  cancelButtonType: _propTypes.default.elementType,
201
202
  // TODO: figure out a way of passing an icon to the TextButton
202
203
  children: _propTypes.default.node,
203
- onCancel: _propTypes.default.func
204
+ onCancel: _propTypes.default.func,
205
+ footer: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)])
204
206
  };
205
207
  var _default = exports.default = ModalContent;
@@ -120,6 +120,7 @@ const Modal = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
120
120
  confirmButtonVariant,
121
121
  cancelButtonText,
122
122
  cancelButtonType,
123
+ footer,
123
124
  ...rest
124
125
  } = _ref5;
125
126
  const viewport = useViewport();
@@ -223,6 +224,7 @@ const Modal = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
223
224
  confirmButtonVariant: confirmButtonVariant,
224
225
  cancelButtonText: cancelButtonText,
225
226
  cancelButtonType: cancelButtonType,
227
+ footer: footer,
226
228
  children: Platform.OS !== 'web' ? /*#__PURE__*/_jsx(ScrollView, {
227
229
  style: selectScrollViewStyles,
228
230
  children: children
@@ -323,7 +325,11 @@ Modal.propTypes = {
323
325
  /**
324
326
  * Receive a function for the onCancel event in the cancel button.
325
327
  */
326
- onCancel: PropTypes.func
328
+ onCancel: PropTypes.func,
329
+ /**
330
+ * Receive a react node or an array of nodes to render at the bottom of the modal, above the action buttons.
331
+ */
332
+ footer: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)])
327
333
  };
328
334
  export default Modal;
329
335
  const staticStyles = StyleSheet.create({
@@ -28,7 +28,8 @@ const ModalContent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
28
28
  cancelButtonText,
29
29
  cancelButtonType: CancelButton = TextButton,
30
30
  children,
31
- onCancel
31
+ onCancel,
32
+ footer
32
33
  } = _ref;
33
34
  const viewport = useViewport();
34
35
  const {
@@ -142,7 +143,7 @@ const ModalContent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
142
143
  children: /*#__PURE__*/_jsx(Typography, {
143
144
  children: bodyText
144
145
  })
145
- }), children, (hasConfirmButton || hasCancelButton) && /*#__PURE__*/_jsxs(View, {
146
+ }), children, (hasConfirmButton || hasCancelButton) && !footer && /*#__PURE__*/_jsxs(View, {
146
147
  style: [selectFooterContainerStyles({
147
148
  ...themeTokens,
148
149
  hasBorder: isContentOverflowing
@@ -164,7 +165,7 @@ const ModalContent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
164
165
  children: cancelButtonText
165
166
  })
166
167
  }) : null]
167
- })]
168
+ }), footer]
168
169
  });
169
170
  });
170
171
  ModalContent.displayName = 'ModalContent';
@@ -193,6 +194,7 @@ ModalContent.propTypes = {
193
194
  cancelButtonType: PropTypes.elementType,
194
195
  // TODO: figure out a way of passing an icon to the TextButton
195
196
  children: PropTypes.node,
196
- onCancel: PropTypes.func
197
+ onCancel: PropTypes.func,
198
+ footer: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)])
197
199
  };
198
200
  export default ModalContent;
package/lib/package.json CHANGED
@@ -84,6 +84,6 @@
84
84
  "standard-engine": {
85
85
  "skip": true
86
86
  },
87
- "version": "3.17.1",
87
+ "version": "3.18.0",
88
88
  "types": "types/index.d.ts"
89
89
  }
package/package.json CHANGED
@@ -84,6 +84,6 @@
84
84
  "standard-engine": {
85
85
  "skip": true
86
86
  },
87
- "version": "3.17.1",
87
+ "version": "3.18.0",
88
88
  "types": "types/index.d.ts"
89
89
  }
@@ -118,6 +118,7 @@ const Modal = React.forwardRef(
118
118
  confirmButtonVariant,
119
119
  cancelButtonText,
120
120
  cancelButtonType,
121
+ footer,
121
122
  ...rest
122
123
  },
123
124
  ref
@@ -240,6 +241,7 @@ const Modal = React.forwardRef(
240
241
  confirmButtonVariant={confirmButtonVariant}
241
242
  cancelButtonText={cancelButtonText}
242
243
  cancelButtonType={cancelButtonType}
244
+ footer={footer}
243
245
  >
244
246
  {Platform.OS !== 'web' ? (
245
247
  <ScrollView style={selectScrollViewStyles}>{children}</ScrollView>
@@ -343,7 +345,11 @@ Modal.propTypes = {
343
345
  /**
344
346
  * Receive a function for the onCancel event in the cancel button.
345
347
  */
346
- onCancel: PropTypes.func
348
+ onCancel: PropTypes.func,
349
+ /**
350
+ * Receive a react node or an array of nodes to render at the bottom of the modal, above the action buttons.
351
+ */
352
+ footer: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)])
347
353
  }
348
354
 
349
355
  export default Modal
@@ -25,7 +25,8 @@ const ModalContent = React.forwardRef(
25
25
  cancelButtonText,
26
26
  cancelButtonType: CancelButton = TextButton,
27
27
  children,
28
- onCancel
28
+ onCancel,
29
+ footer
29
30
  },
30
31
  ref
31
32
  ) => {
@@ -131,7 +132,7 @@ const ModalContent = React.forwardRef(
131
132
  </Box>
132
133
  )}
133
134
  {children}
134
- {(hasConfirmButton || hasCancelButton) && (
135
+ {(hasConfirmButton || hasCancelButton) && !footer && (
135
136
  <View
136
137
  style={[
137
138
  selectFooterContainerStyles({
@@ -158,6 +159,7 @@ const ModalContent = React.forwardRef(
158
159
  ) : null}
159
160
  </View>
160
161
  )}
162
+ {footer}
161
163
  </View>
162
164
  )
163
165
  }
@@ -190,7 +192,8 @@ ModalContent.propTypes = {
190
192
  cancelButtonText: PropTypes.string,
191
193
  cancelButtonType: PropTypes.elementType, // TODO: figure out a way of passing an icon to the TextButton
192
194
  children: PropTypes.node,
193
- onCancel: PropTypes.func
195
+ onCancel: PropTypes.func,
196
+ footer: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)])
194
197
  }
195
198
 
196
199
  export default ModalContent