@telus-uds/components-web 2.13.0 → 2.14.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,30 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Fri, 07 Jul 2023 19:17:02 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 14 Jul 2023 19:38:21 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.14.0
8
+
9
+ Fri, 14 Jul 2023 19:38:21 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `QuantitySelector` now can be controlled from the parent component (shahzaibkhalidmalik@outlook.com)
14
+ - Standardized QuantitySelector (wlsdud194@hotmail.com)
15
+ - Add dictionary override to `TermsAndConditions` (shahzaibkhalidmalik@outlook.com)
16
+ - New token fontSize added for the badge component (35577399+JoshHC@users.noreply.github.com)
17
+ - Bump @telus-uds/components-base to v1.55.0
18
+ - Bump @telus-uds/system-constants to v1.3.0
19
+ - Bump @telus-uds/system-theme-tokens to v2.38.0
20
+
21
+ ### Patches
22
+
23
+ - Fix an issue where `DatePicker` may not close after date selection (shahzaibkhalidmalik@outlook.com)
24
+
7
25
  ## 2.13.0
8
26
 
9
- Fri, 07 Jul 2023 19:17:02 GMT
27
+ Fri, 07 Jul 2023 19:26:41 GMT
10
28
 
11
29
  ### Minor changes
12
30
 
@@ -197,6 +197,7 @@
197
197
  "name": "custom",
198
198
  "raw": {
199
199
  "fontWeight": "fontWeight",
200
+ "fontSize": "fontSize",
200
201
  "fontName": "fontName",
201
202
  "backgroundColor": "color",
202
203
  "borderColor": "color",
@@ -2598,6 +2599,10 @@
2598
2599
  "alternative": {
2599
2600
  "name": "bool",
2600
2601
  "required": false
2602
+ },
2603
+ "disabled": {
2604
+ "name": "bool",
2605
+ "required": false
2601
2606
  }
2602
2607
  }
2603
2608
  },
@@ -2643,6 +2648,13 @@
2643
2648
  "required": false,
2644
2649
  "description": "The default value of the input field"
2645
2650
  },
2651
+ "value": {
2652
+ "type": {
2653
+ "name": "number"
2654
+ },
2655
+ "required": false,
2656
+ "description": "If the input's state is to be controlled by a parent component, use this prop\ntogether with the `onChange` to pass down and update the lifted state."
2657
+ },
2646
2658
  "label": {
2647
2659
  "type": {
2648
2660
  "name": "string"
@@ -3394,6 +3406,29 @@
3394
3406
  },
3395
3407
  "required": false
3396
3408
  },
3409
+ "dictionary": {
3410
+ "defaultValue": {
3411
+ "value": "{\n en: {\n headingHide: 'Hide terms and conditions',\n headingView: 'View terms and conditions',\n nonIndexedTitle: 'The following applies to all terms and conditions above'\n },\n fr: {\n headingHide: 'Masquer les modalités et conditions',\n headingView: 'Voir les modalités et conditions',\n nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus'\n }\n}",
3412
+ "computed": false
3413
+ },
3414
+ "type": {
3415
+ "name": "shape",
3416
+ "value": {
3417
+ "en": {
3418
+ "name": "custom",
3419
+ "raw": "dictionaryContentShape",
3420
+ "required": false
3421
+ },
3422
+ "fr": {
3423
+ "name": "custom",
3424
+ "raw": "dictionaryContentShape",
3425
+ "required": false
3426
+ }
3427
+ }
3428
+ },
3429
+ "required": false,
3430
+ "description": "Custom dictionary containing the labels to use for `TermsAndConditions`"
3431
+ },
3397
3432
  "indexedContent": {
3398
3433
  "defaultValue": {
3399
3434
  "value": "[]",
@@ -3467,7 +3502,7 @@
3467
3502
  },
3468
3503
  "testimonialStyle": {
3469
3504
  "defaultValue": {
3470
- "value": "'heading'",
3505
+ "value": "'large'",
3471
3506
  "computed": false
3472
3507
  },
3473
3508
  "type": {
@@ -3486,6 +3521,13 @@
3486
3521
  "required": false,
3487
3522
  "description": "Testimonial style"
3488
3523
  },
3524
+ "copy": {
3525
+ "defaultValue": {
3526
+ "value": "'en'",
3527
+ "computed": false
3528
+ },
3529
+ "required": false
3530
+ },
3489
3531
  "variant": {
3490
3532
  "defaultValue": {
3491
3533
  "value": "{}",
@@ -5586,15 +5628,7 @@
5586
5628
  "showPanelTabs": "show",
5587
5629
  "spaceBetweenSlideAndPreviousNextNavigation": "size",
5588
5630
  "spaceBetweenSlideAndPanelNavigation": "size",
5589
- "thumbnailBorderColor": "color",
5590
- "thumbnailBorderRadius": "radius",
5591
- "thumbnailBorderWidth": "border",
5592
- "thumbnailContainerPaddingTop": "size",
5593
- "thumbnailMargin": "size",
5594
- "thumbnailPadding": "size",
5595
- "thumbnailSelectedBorderColor": "color",
5596
- "thumbnailSelectedBorderWidth": "border",
5597
- "thumbnailSize": "size"
5631
+ "stepTrackerCurrentBackgroundColor": "color"
5598
5632
  }
5599
5633
  },
5600
5634
  "required": false,
@@ -5955,15 +5989,7 @@
5955
5989
  "showPanelTabs": "show",
5956
5990
  "spaceBetweenSlideAndPreviousNextNavigation": "size",
5957
5991
  "spaceBetweenSlideAndPanelNavigation": "size",
5958
- "thumbnailBorderColor": "color",
5959
- "thumbnailBorderRadius": "radius",
5960
- "thumbnailBorderWidth": "border",
5961
- "thumbnailContainerPaddingTop": "size",
5962
- "thumbnailMargin": "size",
5963
- "thumbnailPadding": "size",
5964
- "thumbnailSelectedBorderColor": "color",
5965
- "thumbnailSelectedBorderWidth": "border",
5966
- "thumbnailSize": "size"
5992
+ "stepTrackerCurrentBackgroundColor": "color"
5967
5993
  }
5968
5994
  },
5969
5995
  "required": false,
@@ -13371,6 +13397,7 @@
13371
13397
  "name": "custom",
13372
13398
  "raw": {
13373
13399
  "outerBorderColor": "color",
13400
+ "backgroundColor": "color",
13374
13401
  "outerBorderWidth": "border",
13375
13402
  "outerBorderGap": "size",
13376
13403
  "borderRadius": "radius",
@@ -77,7 +77,8 @@ const Badge = _ref6 => {
77
77
  paddingTop,
78
78
  paddingBottom,
79
79
  fontName,
80
- fontWeight
80
+ fontWeight,
81
+ fontSize
81
82
  } = (0, _componentsBase.useThemeTokens)('Badge', tokens, variant);
82
83
  const semanticGradient = gradient && (0, _utils.transformGradient)(gradient);
83
84
  const {
@@ -94,6 +95,11 @@ const Badge = _ref6 => {
94
95
  background = semanticGradient;
95
96
  }
96
97
 
98
+ const fontSizeMapping = {
99
+ 12: 'micro',
100
+ 14: 'small',
101
+ 16: 'h6'
102
+ };
97
103
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(BadgeContainer, {
98
104
  isOutlineOffer: isOutlineOffer,
99
105
  isAlternative: alternative,
@@ -111,6 +117,9 @@ const Badge = _ref6 => {
111
117
  fontWeight,
112
118
  color
113
119
  },
120
+ variant: {
121
+ size: fontSizeMapping[fontSize]
122
+ },
114
123
  children: children
115
124
  })
116
125
  });
@@ -23,6 +23,8 @@ var _componentsBase = require("@telus-uds/components-base");
23
23
 
24
24
  var _moment = _interopRequireDefault(require("moment"));
25
25
 
26
+ var _lodash = require("lodash");
27
+
26
28
  var _CalendarContainer = _interopRequireDefault(require("./CalendarContainer"));
27
29
 
28
30
  var _dictionary = _interopRequireDefault(require("./dictionary"));
@@ -137,7 +139,11 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
137
139
  copy
138
140
  });
139
141
  (0, _react.useEffect)(() => {
140
- if (!(0, _moment.default)(date).isSame(inputDate)) {
142
+ /**
143
+ * `date` could be passed as `null` to reset the value so explicitly
144
+ * checking for not being `undefined`
145
+ */
146
+ if (!(0, _lodash.isUndefined)(date) && !(0, _moment.default)(date).isSame(inputDate)) {
141
147
  setInputDate(date);
142
148
  setInputText(date instanceof _moment.default ? date.format(dateFormat) : '');
143
149
  }
@@ -179,6 +185,7 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
179
185
  const onChange = value => {
180
186
  setInputDate(value);
181
187
  setInputText(value.format(dateFormat));
188
+ setIsFocused(false);
182
189
  if (onDateChange) onDateChange(value);
183
190
  };
184
191
 
@@ -11,12 +11,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _componentsBase = require("@telus-uds/components-base");
13
13
 
14
- var _IconButton = _interopRequireDefault(require("../IconButton"));
15
-
16
14
  var _styles = require("./styles");
17
15
 
18
16
  var _dictionary = _interopRequireDefault(require("./dictionary"));
19
17
 
18
+ var _SideButton = _interopRequireDefault(require("./SideButton"));
19
+
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -39,6 +39,7 @@ const QuantitySelector = _ref => {
39
39
  minNumber,
40
40
  maxNumber,
41
41
  defaultValue,
42
+ value,
42
43
  label,
43
44
  hint,
44
45
  hintPosition,
@@ -52,19 +53,9 @@ const QuantitySelector = _ref => {
52
53
  testID
53
54
  } = _ref;
54
55
  const {
55
- components: {
56
- QuantitySelector: componentTheme
57
- }
58
- } = (0, _componentsBase.useTheme)();
59
- const {
60
- leftIcon,
61
- rightIcon,
62
- padding
63
- } = (0, _componentsBase.useThemeTokens)('QuantitySelector', tokens, variant);
64
- const [error, setError] = (0, _react.useState)('');
65
- const {
66
- alternative
56
+ disabled
67
57
  } = variant;
58
+ const [error, setError] = (0, _react.useState)('');
68
59
  const getCopy = (0, _componentsBase.useCopy)({
69
60
  dictionary,
70
61
  copy
@@ -77,17 +68,16 @@ const QuantitySelector = _ref => {
77
68
  return numberToEvaluate;
78
69
  };
79
70
 
80
- const initialValue = getValidatedNumber(defaultValue);
81
71
  const {
82
72
  currentValue: number,
83
73
  setValue: setNumber
84
74
  } = (0, _componentsBase.useInputValue)({
85
- value: undefined,
86
- initialValue,
75
+ value: getValidatedNumber(value),
76
+ initialValue: getValidatedNumber(defaultValue),
87
77
  onChange
88
78
  });
89
- const isDecreaseEnabled = !isNumber(minNumber) || number > minNumber;
90
- const isIncreaseEnabled = !isNumber(maxNumber) || number < maxNumber;
79
+ const isDecreaseEnabled = !disabled && !isNumber(minNumber) || number > minNumber;
80
+ const isIncreaseEnabled = !disabled && !isNumber(maxNumber) || number < maxNumber;
91
81
  const inputValue = isNumber(number) ? number.toString() : '';
92
82
 
93
83
  const updateNumber = (newNumber, originalInputEvent) => {
@@ -119,20 +109,31 @@ const QuantitySelector = _ref => {
119
109
  tooltip: tooltip
120
110
  }) : null;
121
111
 
112
+ const getTokens = (0, _componentsBase.useThemeTokensCallback)('QuantitySelector', tokens, variant);
113
+
122
114
  const renderTextInput = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.TextInput, {
123
115
  nativeID: id,
124
116
  value: inputValue,
117
+ defaultValue: defaultValue,
125
118
  tokens: textInputState => {
126
119
  const {
120
+ inputWidth,
121
+ inputBorderWidth,
127
122
  inputBorderColor,
128
- inputBackgroundColor
129
- } = (0, _componentsBase.getThemeTokens)(componentTheme, tokens, variant, textInputState);
130
- return {
131
- borderRadius: 0,
132
- margin: 0,
133
- padding: 0,
123
+ textColor,
124
+ inputBackgroundColor,
125
+ ...rest
126
+ } = getTokens({ ...textInputState
127
+ });
128
+ return { ...rest,
129
+ order: 1,
130
+ borderWidth: inputBorderWidth,
131
+ backgroundColor: inputBackgroundColor,
132
+ color: textColor,
133
+ width: inputWidth,
134
134
  borderColor: inputBorderColor,
135
- backgroundColor: inputBackgroundColor
135
+ borderRadius: 0,
136
+ outerBorderWidth: 0
136
137
  };
137
138
  },
138
139
  onChange: inputChangeHandler // Using title as an accessibility workaround
@@ -146,38 +147,6 @@ const QuantitySelector = _ref => {
146
147
  accessibilityValueNow: number
147
148
  });
148
149
 
149
- const getButtonTokens = isEnabled => buttonState => {
150
- const disabled = !isEnabled;
151
- const { ...buttonTokens
152
- } = (0, _componentsBase.getThemeTokens)(componentTheme, tokens, variant, { ...buttonState,
153
- disabled
154
- });
155
- return { ...buttonTokens,
156
- outerBorderGap: 0,
157
- padding
158
- };
159
- };
160
-
161
- const renderLeftButton = () => {
162
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
163
- icon: leftIcon,
164
- tokens: getButtonTokens(isDecreaseEnabled),
165
- onPress: event => updateNumber(number - 1, event),
166
- onDoubleClick: event => updateNumber(number - 1, event),
167
- accessibilityLabel: getCopy('accessibility').decreaseButton,
168
- accessibilityDisabled: !isDecreaseEnabled
169
- });
170
- };
171
-
172
- const renderRightButton = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
173
- icon: rightIcon,
174
- tokens: getButtonTokens(isIncreaseEnabled),
175
- onPress: () => updateNumber(number + 1),
176
- onDoubleClick: () => updateNumber(number + 1),
177
- accessibilityLabel: getCopy('accessibility').increaseButton,
178
- accessibilityDisabled: !isIncreaseEnabled
179
- });
180
-
181
150
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Box, {
182
151
  space: 2,
183
152
  testID: testID,
@@ -185,14 +154,39 @@ const QuantitySelector = _ref => {
185
154
  space: 2
186
155
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.InputWrapper, {
187
156
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.InputField, {
188
- className: `${alternative ? 'alternative' : ''}`,
189
157
  children: renderTextInput()
190
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.RightButtonWrapper, {
191
- className: `${alternative ? 'alternative' : ''}`,
192
- children: renderRightButton()
193
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.LeftButtonWrapper, {
194
- className: `${alternative ? 'alternative' : ''}`,
195
- children: renderLeftButton()
158
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
159
+ style: {
160
+ order: 0
161
+ },
162
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SideButton.default, {
163
+ isEnabled: isDecreaseEnabled,
164
+ onPress: () => updateNumber(number - 1),
165
+ onDoubleClick: () => updateNumber(number - 1),
166
+ tokens: tokens,
167
+ variant: {
168
+ decrease: true,
169
+ ...variant
170
+ },
171
+ accessibilityLabel: getCopy('accessibility').decreaseButton,
172
+ accessibilityDisabled: !isDecreaseEnabled
173
+ })
174
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
175
+ style: {
176
+ order: 2
177
+ },
178
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SideButton.default, {
179
+ isEnabled: isIncreaseEnabled,
180
+ onPress: () => updateNumber(number + 1),
181
+ onDoubleClick: () => updateNumber(number + 1),
182
+ accessibilityLabel: getCopy('accessibility').increaseButton,
183
+ accessibilityDisabled: !isIncreaseEnabled,
184
+ tokens: tokens,
185
+ variant: {
186
+ increase: true,
187
+ ...variant
188
+ }
189
+ })
196
190
  })]
197
191
  }), error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Box, {
198
192
  vertical: 2,
@@ -244,6 +238,12 @@ QuantitySelector.propTypes = {
244
238
  */
245
239
  defaultValue: _propTypes.default.number,
246
240
 
241
+ /**
242
+ * If the input's state is to be controlled by a parent component, use this prop
243
+ * together with the `onChange` to pass down and update the lifted state.
244
+ */
245
+ value: _propTypes.default.number,
246
+
247
247
  /**
248
248
  * The label of the input field
249
249
  */
@@ -282,7 +282,8 @@ QuantitySelector.propTypes = {
282
282
  */
283
283
  copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr'])]),
284
284
  variant: _propTypes.default.exact({
285
- alternative: _propTypes.default.bool
285
+ alternative: _propTypes.default.bool,
286
+ disabled: _propTypes.default.bool
286
287
  }),
287
288
  tokens: _propTypes.default.oneOf([_propTypes.default.object, _propTypes.default.func]),
288
289
 
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _componentsBase = require("@telus-uds/components-base");
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ const SideButton = _ref => {
19
+ let {
20
+ isEnabled,
21
+ onPress,
22
+ onDoubleClick,
23
+ accessibilityLabel,
24
+ accessibilityDisabled,
25
+ tokens,
26
+ variant
27
+ } = _ref;
28
+ const getTokens = (0, _componentsBase.useThemeTokensCallback)('QuantitySelectorSideButton', tokens, variant);
29
+
30
+ const getButtonTokens = _ref2 => {
31
+ let {
32
+ buttonState,
33
+ disabled
34
+ } = _ref2;
35
+ const {
36
+ borderRadius,
37
+ borderTopLeftRadius,
38
+ borderTopRightRadius,
39
+ borderBottomLeftRadius,
40
+ borderBottomRightRadius,
41
+ ...rest
42
+ } = getTokens({ ...buttonState,
43
+ disabled
44
+ });
45
+ return { ...rest,
46
+ borderRadius,
47
+ borderTopLeftRadius,
48
+ borderTopRightRadius,
49
+ borderBottomLeftRadius,
50
+ borderBottomRightRadius,
51
+ outerBorderRadius: borderRadius,
52
+ outerBorderTopLeftRadius: borderTopLeftRadius,
53
+ outerBorderTopRightRadius: borderTopRightRadius,
54
+ outerBorderBottomLeftRadius: borderBottomLeftRadius,
55
+ outerBorderBottomRightRadius: borderBottomRightRadius,
56
+ outerBorderGap: 0,
57
+ outerBorderWidth: 0
58
+ };
59
+ };
60
+
61
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.IconButton, {
62
+ tokens: buttonState => getButtonTokens({
63
+ disabled: !isEnabled,
64
+ buttonState
65
+ }),
66
+ onPress: onPress,
67
+ onDoubleClick: onDoubleClick,
68
+ accessibilityLabel: accessibilityLabel,
69
+ accessibilityDisabled: accessibilityDisabled
70
+ });
71
+ };
72
+
73
+ SideButton.displayName = 'QuantitySelectorSideButton';
74
+ SideButton.defaultProps = {
75
+ isEnabled: true,
76
+ onPress: () => {},
77
+ onDoubleClick: () => {},
78
+ accessibilityLabel: '',
79
+ accessibilityDisabled: false,
80
+ tokens: {},
81
+ variant: {}
82
+ };
83
+ SideButton.propTypes = {
84
+ isEnabled: _propTypes.default.bool,
85
+ onPress: _propTypes.default.func,
86
+ onDoubleClick: _propTypes.default.func,
87
+ accessibilityLabel: _propTypes.default.string,
88
+ accessibilityDisabled: _propTypes.default.bool,
89
+ tokens: _propTypes.default.object,
90
+ variant: _propTypes.default.object
91
+ };
92
+ var _default = SideButton;
93
+ exports.default = _default;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.RightButtonWrapper = exports.LeftButtonWrapper = exports.InputWrapper = exports.InputField = void 0;
6
+ exports.InputWrapper = exports.InputField = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
@@ -12,29 +12,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  const InputField = /*#__PURE__*/_styledComponents.default.div.withConfig({
13
13
  displayName: "styles__InputField",
14
14
  componentId: "components-web__sc-1lrz1xk-0"
15
- })(["order:2;min-width:3.5rem;max-width:5 rem;height:28px;padding:0;width:64px;text-align:center;z-index:10;input{text-align:center;}&.alternative{input{height:40px;}}"]);
15
+ })(["order:1;text-align:center;z-index:10;input{text-align:center;}"]);
16
16
 
17
17
  exports.InputField = InputField;
18
18
 
19
- const ButtonWrapper = /*#__PURE__*/_styledComponents.default.div.withConfig({
20
- displayName: "styles__ButtonWrapper",
21
- componentId: "components-web__sc-1lrz1xk-1"
22
- })(["&.alternative{div[role='button']{height:42px;> div{height:40px;> div{padding:12px 16px;}}}}"]);
23
-
24
- const LeftButtonWrapper = /*#__PURE__*/(0, _styledComponents.default)(ButtonWrapper).withConfig({
25
- displayName: "styles__LeftButtonWrapper",
26
- componentId: "components-web__sc-1lrz1xk-2"
27
- })(["order:0;div[role='button']{border-radius:4px 0px 0px 4px !important;> div{border-right:none;border-radius:4px 0px 0px 4px !important;}}&.alternative{div[role='button']{border-radius:36px 0px 0px 36px !important;> div{border-radius:24px 0px 0px 24px !important;}}}"]);
28
- exports.LeftButtonWrapper = LeftButtonWrapper;
29
- const RightButtonWrapper = /*#__PURE__*/(0, _styledComponents.default)(ButtonWrapper).withConfig({
30
- displayName: "styles__RightButtonWrapper",
31
- componentId: "components-web__sc-1lrz1xk-3"
32
- })(["order:3;div[role='button']{border-radius:0px 4px 4px 0px !important;> div{border-left:none;border-radius:0px 4px 4px 0px !important;}}&.alternative{div[role='button']{border-radius:0px 36px 36px 0px !important;> div{border-radius:0px 36px 36px 0px !important;}}}"]);
33
- exports.RightButtonWrapper = RightButtonWrapper;
34
-
35
19
  const InputWrapper = /*#__PURE__*/_styledComponents.default.div.withConfig({
36
20
  displayName: "styles__InputWrapper",
37
- componentId: "components-web__sc-1lrz1xk-4"
38
- })(["textalign:start;display:flex;flexdirection:row;flexwrap:nowrap;justifycontent:center;"]);
21
+ componentId: "components-web__sc-1lrz1xk-1"
22
+ })(["text-align:start;display:flex;flex-direction:row;flex-wrap:nowrap;"]);
39
23
 
40
24
  exports.InputWrapper = InputWrapper;
@@ -133,10 +133,11 @@ const TermsAndConditions = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
133
133
  nonIndexedContent,
134
134
  tokens,
135
135
  variant = {},
136
+ dictionary = _dictionary.default,
136
137
  ...rest
137
138
  } = _ref6;
138
139
  const getCopy = (0, _componentsBase.useCopy)({
139
- dictionary: _dictionary.default,
140
+ dictionary,
140
141
  copy
141
142
  });
142
143
  const hasIndexedContent = indexedContent.length > 0;
@@ -199,7 +200,14 @@ const TermsAndConditions = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
199
200
  })]
200
201
  });
201
202
  });
202
- TermsAndConditions.displayName = 'TermsAndConditions';
203
+ TermsAndConditions.displayName = 'TermsAndConditions'; // If a language dictionary entry is provided, it must contain every key
204
+
205
+ const dictionaryContentShape = _propTypes.default.shape({
206
+ headingHide: _propTypes.default.string.isRequired,
207
+ headingView: _propTypes.default.string.isRequired,
208
+ nonIndexedTitle: _propTypes.default.string.isRequired
209
+ });
210
+
203
211
  TermsAndConditions.propTypes = { ...selectedSystemPropTypes,
204
212
 
205
213
  /**
@@ -225,12 +233,21 @@ TermsAndConditions.propTypes = { ...selectedSystemPropTypes,
225
233
  *
226
234
  * nonIndexedContent do not have a corresponding superscript and instead apply to the page as a whole.
227
235
  */
228
- nonIndexedContent: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string]))
236
+ nonIndexedContent: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string])),
237
+
238
+ /**
239
+ * Custom dictionary containing the labels to use for `TermsAndConditions`
240
+ */
241
+ dictionary: _propTypes.default.shape({
242
+ en: dictionaryContentShape,
243
+ fr: dictionaryContentShape
244
+ })
229
245
  };
230
246
  TermsAndConditions.defaultProps = {
231
247
  copy: 'en',
232
248
  indexedContent: [],
233
- nonIndexedContent: []
249
+ nonIndexedContent: [],
250
+ dictionary: _dictionary.default
234
251
  };
235
252
  var _default = TermsAndConditions;
236
253
  exports.default = _default;