@telus-uds/components-base 1.80.1 → 1.82.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/lib/Autocomplete/Autocomplete.js +3 -1
  3. package/lib/Badge/Badge.js +1 -10
  4. package/lib/Fieldset/Fieldset.js +3 -1
  5. package/lib/Fieldset/FieldsetContainer.js +9 -2
  6. package/lib/Fieldset/FieldsetContainer.native.js +7 -1
  7. package/lib/Icon/Icon.js +24 -2
  8. package/lib/Listbox/Listbox.js +7 -1
  9. package/lib/Modal/Modal.js +40 -4
  10. package/lib/Modal/WebModal.js +73 -0
  11. package/lib/PriceLockup/PriceLockup.js +4 -1
  12. package/lib/PriceLockup/utils/renderFootnoteContent.js +2 -2
  13. package/lib/PriceLockup/utils/renderFootnoteLinks.js +2 -2
  14. package/lib/PriceLockup/utils/renderPrice.js +2 -2
  15. package/lib/PriceLockup/utils/renderTypography.js +1 -1
  16. package/lib/ProductCard/ProductCard.js +238 -0
  17. package/lib/ProductCard/dictionary.js +45 -0
  18. package/lib/ProductCard/index.js +10 -0
  19. package/lib/ProductCardGroup/ProductCardGroup.js +79 -0
  20. package/lib/ProductCardGroup/index.js +10 -0
  21. package/lib/TextInput/TextInput.js +1 -0
  22. package/lib/TextInput/TextInputBase.js +4 -1
  23. package/lib/index.js +16 -0
  24. package/lib/utils/ssr-media-query/create-stylesheet/index.js +2 -1
  25. package/lib/utils/ssr-media-query/utils/common.js +21 -2
  26. package/lib-module/Autocomplete/Autocomplete.js +3 -1
  27. package/lib-module/Badge/Badge.js +1 -10
  28. package/lib-module/Fieldset/Fieldset.js +3 -1
  29. package/lib-module/Fieldset/FieldsetContainer.js +7 -2
  30. package/lib-module/Fieldset/FieldsetContainer.native.js +10 -3
  31. package/lib-module/Icon/Icon.js +24 -2
  32. package/lib-module/Listbox/Listbox.js +7 -1
  33. package/lib-module/Modal/Modal.js +42 -5
  34. package/lib-module/Modal/WebModal.js +65 -0
  35. package/lib-module/PriceLockup/PriceLockup.js +4 -1
  36. package/lib-module/PriceLockup/utils/renderFootnoteContent.js +2 -2
  37. package/lib-module/PriceLockup/utils/renderFootnoteLinks.js +2 -2
  38. package/lib-module/PriceLockup/utils/renderPrice.js +2 -2
  39. package/lib-module/PriceLockup/utils/renderTypography.js +1 -1
  40. package/lib-module/ProductCard/ProductCard.js +231 -0
  41. package/lib-module/ProductCard/dictionary.js +38 -0
  42. package/lib-module/ProductCard/index.js +2 -0
  43. package/lib-module/ProductCardGroup/ProductCardGroup.js +69 -0
  44. package/lib-module/ProductCardGroup/index.js +2 -0
  45. package/lib-module/TextInput/TextInput.js +1 -0
  46. package/lib-module/TextInput/TextInputBase.js +4 -1
  47. package/lib-module/index.js +2 -0
  48. package/lib-module/utils/ssr-media-query/create-stylesheet/index.js +3 -2
  49. package/lib-module/utils/ssr-media-query/utils/common.js +19 -1
  50. package/package.json +2 -2
  51. package/src/Autocomplete/Autocomplete.jsx +4 -1
  52. package/src/Badge/Badge.jsx +7 -10
  53. package/src/Fieldset/Fieldset.jsx +3 -1
  54. package/src/Fieldset/FieldsetContainer.jsx +8 -1
  55. package/src/Fieldset/FieldsetContainer.native.jsx +7 -2
  56. package/src/Icon/Icon.jsx +30 -2
  57. package/src/Listbox/Listbox.jsx +6 -1
  58. package/src/Modal/Modal.jsx +42 -3
  59. package/src/Modal/WebModal.jsx +60 -0
  60. package/src/PriceLockup/PriceLockup.jsx +8 -2
  61. package/src/PriceLockup/utils/renderFootnoteContent.jsx +2 -2
  62. package/src/PriceLockup/utils/renderFootnoteLinks.jsx +2 -2
  63. package/src/PriceLockup/utils/renderPrice.jsx +2 -2
  64. package/src/PriceLockup/utils/renderTypography.jsx +1 -1
  65. package/src/ProductCard/ProductCard.jsx +193 -0
  66. package/src/ProductCard/dictionary.js +38 -0
  67. package/src/ProductCard/index.js +3 -0
  68. package/src/ProductCardGroup/ProductCardGroup.jsx +75 -0
  69. package/src/ProductCardGroup/index.js +3 -0
  70. package/src/TextInput/TextInput.jsx +1 -0
  71. package/src/TextInput/TextInputBase.jsx +4 -1
  72. package/src/index.js +2 -0
  73. package/src/utils/ssr-media-query/create-stylesheet/index.js +3 -2
  74. package/src/utils/ssr-media-query/utils/common.js +19 -1
package/CHANGELOG.md CHANGED
@@ -1,12 +1,40 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Tue, 19 Mar 2024 18:37:02 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 05 Apr 2024 17:10:34 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.82.0
8
+
9
+ Fri, 05 Apr 2024 17:10:34 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Add `ProductCardGroup` component (chris.tafts@telus.com)
14
+ - Add `ProductCard` component (chris.tafts@telus.com)
15
+ - add support for circle container to icon (mauricio.batresmontejo@telus.com)
16
+ - Bump @telus-uds/system-theme-tokens to v2.54.0
17
+
18
+ ### Patches
19
+
20
+ - `Modal`: fix focus life cycle (guillermo.peitzner@telus.com)
21
+
22
+ ## 1.81.0
23
+
24
+ Wed, 27 Mar 2024 21:13:10 GMT
25
+
26
+ ### Minor changes
27
+
28
+ - add test-id prop to radio-group component (guillermo.peitzner@telus.com)
29
+
30
+ ### Patches
31
+
32
+ - SSR: sanitize function values in CSS styles (guillermo.peitzner@telus.com)
33
+ - validation added to the datepicker input and input cleaned after the content is deleted (35577399+JoshHC@users.noreply.github.com)
34
+
7
35
  ## 1.80.1
8
36
 
9
- Tue, 19 Mar 2024 18:37:02 GMT
37
+ Tue, 19 Mar 2024 18:39:50 GMT
10
38
 
11
39
  ### Patches
12
40
 
@@ -247,6 +247,7 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
247
247
  setCurrentValue(newValue);
248
248
  if (!isControlled && inputRef !== null && inputRef !== void 0 && inputRef.current) inputRef.current.value = newValue;
249
249
  if (nested) setNestedSelectedValue(newValue);
250
+ inputRef.current.focus();
250
251
  };
251
252
 
252
253
  /**
@@ -276,7 +277,8 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
276
277
  if (event.type === 'keydown' && (event.key === 'Escape' || event.key === '27') || event.type === 'click' && !(openOverlayRef !== null && openOverlayRef !== void 0 && (_openOverlayRef$curre = openOverlayRef.current) !== null && _openOverlayRef$curre !== void 0 && _openOverlayRef$curre.contains(event.target)) || event.type === 'touchstart' && openOverlayRef !== null && openOverlayRef !== void 0 && openOverlayRef.current && event.touches[0].target && !(openOverlayRef !== null && openOverlayRef !== void 0 && (_openOverlayRef$curre2 = openOverlayRef.current) !== null && _openOverlayRef$curre2 !== void 0 && _openOverlayRef$curre2.contains(event.touches[0].target))) {
277
278
  setIsExpanded(false);
278
279
  setNestedSelectedValue(null);
279
- } else if (event.type === 'keydown' && event.key === 'ArrowDown' && isExpanded && !isLoading && targetRef !== null && targetRef !== void 0 && targetRef.current) {
280
+ } else if (event.type === 'keydown' && (event.key === 'ArrowDown' || event.key === 'Tab') && isExpanded && !isLoading && targetRef !== null && targetRef !== void 0 && targetRef.current) {
281
+ event.preventDefault();
280
282
  targetRef.current.focus();
281
283
  }
282
284
  };
@@ -7,7 +7,6 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
9
9
  var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
10
- var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
11
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
11
  var _ThemeProvider = require("../ThemeProvider");
13
12
  var _Typography = _interopRequireDefault(require("../Typography"));
@@ -86,15 +85,7 @@ const Badge = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
86
85
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Badge', tokens, variant);
87
86
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
88
87
  ref: ref,
89
- style: _Platform.default.select({
90
- native: {
91
- ...staticStyles.container,
92
- ...selectContainerBackground(themeTokens),
93
- ...selectContainerBorder(themeTokens),
94
- ...selectContainerPadding(themeTokens)
95
- },
96
- web: {}
97
- }),
88
+ style: [staticStyles.container, selectContainerBackground(themeTokens), selectContainerBorder(themeTokens), selectContainerPadding(themeTokens)],
98
89
  ...selectProps(rest),
99
90
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
100
91
  tokens: getTypographyTokens(themeTokens),
@@ -40,7 +40,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
40
40
  name: fieldsetName,
41
41
  children,
42
42
  variant = {},
43
- tokens = {}
43
+ tokens = {},
44
+ ...rest
44
45
  } = _ref;
45
46
  /* Fieldset tokenization:
46
47
  - error variant can only be activated by passing showErrorBorder and also having validaton as 'error'
@@ -126,6 +127,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
126
127
  name: fieldsetName,
127
128
  borderStyle: borderStyles(themeTokens),
128
129
  showBorderStyle: showErrorBorder,
130
+ ...rest,
129
131
  children: stackedContent
130
132
  });
131
133
  });
@@ -7,20 +7,25 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _cssReset = _interopRequireDefault(require("./cssReset"));
10
+ var _utils = require("../utils");
10
11
  var _jsxRuntime = require("react/jsx-runtime");
11
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.htmlAttrs]);
16
+
14
17
  /**
15
18
  * On Web, wraps children with a HTML `<fieldset>` and sets its attributes as necessary.
16
- */const FieldsetContainer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
19
+ */
20
+ const FieldsetContainer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
17
21
  let {
18
22
  children,
19
23
  inactive,
20
24
  accessibilityRole,
21
25
  name: fieldsetName,
22
26
  showBorderStyle = false,
23
- borderStyle
27
+ borderStyle,
28
+ ...rest
24
29
  } = _ref;
25
30
  // If needs border for error design or reset the component style
26
31
  const styleContainer = showBorderStyle && borderStyle ? borderStyle : _cssReset.default;
@@ -30,11 +35,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
30
35
  style: styleContainer,
31
36
  role: accessibilityRole,
32
37
  name: fieldsetName,
38
+ ...selectProps(rest),
33
39
  children: children
34
40
  });
35
41
  });
36
42
  FieldsetContainer.displayName = 'FieldsetContainer';
37
43
  FieldsetContainer.propTypes = {
44
+ ...selectedSystemPropTypes,
38
45
  accessibilityRole: _propTypes.default.string,
39
46
  children: _propTypes.default.node,
40
47
  inactive: _propTypes.default.bool,
@@ -7,25 +7,31 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
10
+ var _utils = require("../utils");
10
11
  var _jsxRuntime = require("react/jsx-runtime");
11
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
16
+
14
17
  // No equivalent of `<fieldset>` on native, so just apply accessibility role to container.
15
18
  // If a11y testing finds any additional handling is needed at the container level, add it here.
16
19
  const FieldsetContainer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
17
20
  let {
18
21
  children,
19
- accessibilityRole
22
+ accessibilityRole,
23
+ ...rest
20
24
  } = _ref;
21
25
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
22
26
  ref: ref,
23
27
  accessibilityRole: accessibilityRole,
28
+ ...selectProps(rest),
24
29
  children: children
25
30
  });
26
31
  });
27
32
  FieldsetContainer.displayName = 'FieldsetContainer';
28
33
  FieldsetContainer.propTypes = {
34
+ ...selectedSystemPropTypes,
29
35
  children: _propTypes.default.node,
30
36
  accessibilityRole: _propTypes.default.string
31
37
  };
package/lib/Icon/Icon.js CHANGED
@@ -31,6 +31,25 @@ const Icon = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
31
31
  size: size,
32
32
  color: themeTokens.color
33
33
  });
34
+ const paddingStyles = variant !== null && variant !== void 0 && variant.padding ? {
35
+ padding: themeTokens.width,
36
+ width: themeTokens.size + themeTokens.width * 2,
37
+ // sets the diameter of the circle which is the size of the icon plus twice the general padding established to obtain a perfect circle
38
+ height: themeTokens.size + themeTokens.width * 2
39
+ } : {};
40
+ const getIconContentForMobile = () => {
41
+ if (Object.keys(paddingStyles).length) {
42
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
43
+ style: {
44
+ backgroundColor: themeTokens.backgroundColor,
45
+ borderRadius: themeTokens.borderRadius,
46
+ ...paddingStyles
47
+ },
48
+ children: iconContent
49
+ });
50
+ }
51
+ return iconContent;
52
+ };
34
53
  return _Platform.default.OS === 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
35
54
  ref: ref
36
55
  // eslint-disable-next-line react-native/no-inline-styles
@@ -40,11 +59,14 @@ const Icon = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
40
59
  // https://github.com/telus/universal-design-system/issues/487
41
60
  transition: 'transform 200ms, color 200ms',
42
61
  transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' '),
43
- ...style
62
+ ...style,
63
+ backgroundColor: themeTokens.backgroundColor,
64
+ borderRadius: themeTokens.borderRadius,
65
+ ...paddingStyles
44
66
  },
45
67
  dataSet: dataSet,
46
68
  children: iconContent
47
- }) : iconContent;
69
+ }) : getIconContentForMobile();
48
70
  });
49
71
  Icon.displayName = 'Icon';
50
72
  const iconComponentPropTypes = {
@@ -75,8 +75,14 @@ const Listbox = _ref => {
75
75
  // Return focus to the dropdown control after leaving the last item
76
76
  parentRef === null || parentRef === void 0 ? void 0 : (_parentRef$current3 = parentRef.current) === null || _parentRef$current3 === void 0 ? void 0 : _parentRef$current3.focus();
77
77
  if (onClose) onClose(event);
78
+ } else if (!nextItemRef && firstItemRef) {
79
+ var _firstItemRef$current;
80
+ // If the last item is focused, move the focus to the first one
81
+ event.preventDefault();
82
+ setFocusedIndex(0);
83
+ (_firstItemRef$current = firstItemRef.current) === null || _firstItemRef$current === void 0 ? void 0 : _firstItemRef$current.focus();
78
84
  }
79
- }, [focusedIndex, onClose, parentRef]);
85
+ }, [focusedIndex, onClose, parentRef, firstItemRef]);
80
86
 
81
87
  // Add listeners for mouse clicks outside and for key presses
82
88
  (0, _react.useEffect)(() => {
@@ -19,6 +19,7 @@ var _IconButton = _interopRequireDefault(require("../IconButton"));
19
19
  var _dictionary = _interopRequireDefault(require("./dictionary"));
20
20
  var _useScrollBlocking = _interopRequireDefault(require("../utils/useScrollBlocking"));
21
21
  var _ModalContent = _interopRequireDefault(require("./ModalContent"));
22
+ var _WebModal = _interopRequireDefault(require("./WebModal"));
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -151,12 +152,32 @@ const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
151
152
  // Show the custom react node passed to `closedButton` or the default close button if `closeButton` is `undefined`.
152
153
  // Hide the close button if `closeButton` is `null`.
153
154
  const showCloseButton = closeButton !== null;
155
+
156
+ // These refs are used to manage focus in the web modal container
157
+ const focusTrapRef = (0, _react.useRef)(null);
158
+ const closeButtonRef = (0, _react.useRef)(null);
159
+ (0, _react.useEffect)(() => {
160
+ if (_Platform.default.OS === 'web') {
161
+ const handleFocus = () => {
162
+ // If the focus is on the last item of the web modal container, move it to the close button
163
+ if (document.activeElement === focusTrapRef.current) {
164
+ closeButtonRef.current.focus();
165
+ }
166
+ return undefined;
167
+ };
168
+
169
+ // Add an event listener to manage focus in the web modal container
170
+ document.addEventListener('focusin', handleFocus);
171
+
172
+ // Clean up the event listener
173
+ return () => document.removeEventListener('focusin', handleFocus);
174
+ }
175
+ return undefined;
176
+ }, []);
154
177
  if (!isOpen) {
155
178
  return null;
156
179
  }
157
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, {
158
- transparent: true,
159
- ...selectProps(rest),
180
+ const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
160
181
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ScrollView.default, {
161
182
  contentContainerStyle: [staticStyles.positioningContainer],
162
183
  ref: modalRef,
@@ -174,7 +195,8 @@ const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
174
195
  onPress: handleClose,
175
196
  icon: CloseIconComponent,
176
197
  accessibilityRole: "button",
177
- accessibilityLabel: closeLabel
198
+ accessibilityLabel: closeLabel,
199
+ ref: closeButtonRef
178
200
  })
179
201
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalContent.default, {
180
202
  tokens: tokens,
@@ -206,6 +228,20 @@ const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
206
228
  })]
207
229
  })
208
230
  });
231
+ if (_Platform.default.OS === 'web') {
232
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_WebModal.default, {
233
+ ...selectProps(rest),
234
+ children: [content, /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
235
+ accessibilityRole: "button",
236
+ ref: focusTrapRef
237
+ })]
238
+ });
239
+ }
240
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, {
241
+ transparent: true,
242
+ ...selectProps(rest),
243
+ children: content
244
+ });
209
245
  });
210
246
  Modal.displayName = 'Modal';
211
247
  Modal.propTypes = {
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
10
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
11
+ var _utils = require("../utils");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
15
+
16
+ /**
17
+ * WebModal component.
18
+ *
19
+ * @component
20
+ * @param {Object} props - The component props.
21
+ * @param {ReactNode} props.children - The content of the modal.
22
+ * @returns {JSX.Element} The rendered WebModal component.
23
+ */
24
+ const WebModal = _ref => {
25
+ let {
26
+ children,
27
+ ...rest
28
+ } = _ref;
29
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
30
+ style: staticStyles.container,
31
+ ...selectProps(rest),
32
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
33
+ style: staticStyles.content,
34
+ children: children
35
+ })
36
+ });
37
+ };
38
+ WebModal.propTypes = {
39
+ ...selectedSystemPropTypes,
40
+ // children to be rendered within the modal
41
+ children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)])
42
+ };
43
+ const staticStyles = _StyleSheet.default.create({
44
+ container: {
45
+ position: 'fixed',
46
+ backgroundColor: 'rgba(0, 0, 0, 0)',
47
+ top: 0,
48
+ right: 0,
49
+ left: 0,
50
+ bottom: 0,
51
+ alignItems: 'stretch',
52
+ boxSizing: 'border-box',
53
+ display: 'flex',
54
+ flexBasis: 'auto',
55
+ flexDirection: 'column',
56
+ flexShrink: 0,
57
+ listStyle: 'none',
58
+ margin: 0,
59
+ minHeight: 0,
60
+ minWidth: 0,
61
+ padding: 0,
62
+ textDecoration: 'none',
63
+ zIndex: 1
64
+ },
65
+ content: {
66
+ flex: 1,
67
+ flexGrow: 1,
68
+ flexShrink: 1,
69
+ flexBasis: 0
70
+ }
71
+ });
72
+ var _default = WebModal;
73
+ exports.default = _default;
@@ -117,7 +117,6 @@ const PriceLockup = _ref7 => {
117
117
  bottomTextMarginTop,
118
118
  priceMarginBottom,
119
119
  bottomLinksMarginLeft,
120
- topTextMarginBottom,
121
120
  fontColor,
122
121
  dividerColor,
123
122
  ...themeTokens
@@ -139,6 +138,7 @@ const PriceLockup = _ref7 => {
139
138
  ...selectProps(rest)
140
139
  }],
141
140
  children: [topText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
141
+ style: staticStyles.topText,
142
142
  children: (0, _renderTypography.default)(topText, topTextTypographyTokens)
143
143
  }) : null, (0, _renderPrice.default)(price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens), bottomText ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
144
144
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
@@ -216,5 +216,8 @@ exports.default = _default;
216
216
  const staticStyles = _StyleSheet.default.create({
217
217
  priceLockupContainer: {
218
218
  alignSelf: 'flex-start'
219
+ },
220
+ topText: {
221
+ marginBottom: 4
219
222
  }
220
223
  });
@@ -49,13 +49,13 @@ const renderFootnoteContent = (footnoteMarginTop, bottomTextMarginTop, bottomTex
49
49
  bottomTextMarginTop
50
50
  }),
51
51
  children: [(0, _renderTypography.default)(bottomText, bottomTextTypographyTokens, undefined, fontColor), ' ']
52
- }), footnoteLinks.length <= MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
52
+ }), (footnoteLinks === null || footnoteLinks === void 0 ? void 0 : footnoteLinks.length) <= MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
53
53
  style: [staticStyles.footnoteLinkContainer, selectFootnoteLinksStyles({
54
54
  bottomLinksMarginLeft
55
55
  })],
56
56
  children: (0, _renderFootnoteLinks.default)(footnoteLinks, themeTokens, onClickFootnote)
57
57
  }) : null]
58
- }), footnoteLinks.length > MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
58
+ }), (footnoteLinks === null || footnoteLinks === void 0 ? void 0 : footnoteLinks.length) > MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
59
59
  style: staticStyles.verticalFootnoteLinkContainer,
60
60
  children: (0, _renderFootnoteLinks.default)(footnoteLinks, themeTokens, onClickFootnote)
61
61
  }) : null]
@@ -18,7 +18,7 @@ const selectFootnoteLinkStyles = (_ref, footnoteLinks) => {
18
18
  } = _ref;
19
19
  // This is used to apply the proper line height when there is 4 or more footnote links
20
20
  const MAX_FOOTNOTE_LINKS_ALLOWED = 3;
21
- const lineHeight = footnoteLinks.length > MAX_FOOTNOTE_LINKS_ALLOWED ? footnoteLinkFontSize * footnoteLinkLineHeight : undefined;
21
+ const lineHeight = (footnoteLinks === null || footnoteLinks === void 0 ? void 0 : footnoteLinks.length) > MAX_FOOTNOTE_LINKS_ALLOWED ? footnoteLinkFontSize * footnoteLinkLineHeight : undefined;
22
22
  return {
23
23
  color: footnoteLinkColor,
24
24
  fontName: footnoteLinkFontName,
@@ -27,7 +27,7 @@ const selectFootnoteLinkStyles = (_ref, footnoteLinks) => {
27
27
  fontSize: footnoteLinkFontSize
28
28
  };
29
29
  };
30
- const renderFootnoteLinks = (footnoteLinks, themeTokens, onClickFootnote) => footnoteLinks && footnoteLinks.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_FootnoteLink.default, {
30
+ const renderFootnoteLinks = (footnoteLinks, themeTokens, onClickFootnote) => (footnoteLinks === null || footnoteLinks === void 0 ? void 0 : footnoteLinks.length) > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_FootnoteLink.default, {
31
31
  tokens: selectFootnoteLinkStyles(themeTokens, footnoteLinks),
32
32
  content: footnoteLinks,
33
33
  onClick: onClickFootnote
@@ -73,13 +73,13 @@ const renderPrice = (price, rateText, ratePosition, signDirection, currencySymbo
73
73
  }), rateText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
74
74
  style: ratePosition === 'bottom' ? staticStyles.rateTextVerticalPosition : [staticStyles.rateTextPosition, staticStyles.rateTextVerticalPosition],
75
75
  children: (0, _renderTypography.default)(rateText, rateTypographyTokens, ratePosition, fontColor)
76
- }) : null, !bottomText && footnoteLinks.length <= MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
76
+ }) : null, !bottomText && (footnoteLinks === null || footnoteLinks === void 0 ? void 0 : footnoteLinks.length) <= MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
77
77
  style: [footnoteLinkPositionStyles, selectFootnoteLinksStyles({
78
78
  bottomLinksMarginLeft
79
79
  })],
80
80
  children: (0, _renderFootnoteLinks.default)(footnoteLinks, themeTokens, onClickFootnote)
81
81
  }) : null]
82
- }), !bottomText && footnoteLinks.length > MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
82
+ }), !bottomText && (footnoteLinks === null || footnoteLinks === void 0 ? void 0 : footnoteLinks.length) > MAX_FOOTNOTE_LINKS_ALLOWED ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
83
83
  style: staticStyles.verticalFootnoteLinkContainer,
84
84
  children: (0, _renderFootnoteLinks.default)(footnoteLinks, themeTokens, onClickFootnote)
85
85
  }) : null]
@@ -9,7 +9,7 @@ var _Typography = _interopRequireDefault(require("../../Typography"));
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  const renderTypography = (value, themeTokens, ratePosition, fontColor) => {
12
- const customProps = ratePosition === 'bottom' ? {
12
+ const customProps = ratePosition === 'bottom' && value !== '$' ? {
13
13
  variant: {
14
14
  size: 'micro'
15
15
  },