@telus-uds/components-web 2.9.0 → 2.10.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 (57) hide show
  1. package/CHANGELOG.md +13 -2
  2. package/component-docs.json +82 -81
  3. package/lib/BlockQuote/BlockQuote.js +49 -4
  4. package/lib/Callout/Callout.js +12 -0
  5. package/lib/DatePicker/CalendarContainer.js +24 -0
  6. package/lib/DatePicker/DatePicker.js +8 -2
  7. package/lib/Disclaimer/Disclaimer.js +0 -4
  8. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
  9. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
  10. package/lib/IconButton/IconButton.js +8 -0
  11. package/lib/Listbox/Listbox.js +8 -0
  12. package/lib/NavigationBar/NavigationBar.js +4 -0
  13. package/lib/OrderedList/Item.js +4 -0
  14. package/lib/Paragraph/Paragraph.js +4 -0
  15. package/lib/PreviewCard/AuthorDate.js +7 -0
  16. package/lib/PriceLockup/PriceLockup.js +48 -0
  17. package/lib/QuantitySelector/QuantitySelector.js +51 -0
  18. package/lib/Span/Span.js +4 -0
  19. package/lib/Table/Table.js +4 -0
  20. package/lib/Toast/Toast.js +16 -0
  21. package/lib-module/BlockQuote/BlockQuote.js +50 -5
  22. package/lib-module/Callout/Callout.js +12 -0
  23. package/lib-module/DatePicker/CalendarContainer.js +24 -0
  24. package/lib-module/DatePicker/DatePicker.js +8 -2
  25. package/lib-module/Disclaimer/Disclaimer.js +0 -4
  26. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
  27. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
  28. package/lib-module/IconButton/IconButton.js +8 -0
  29. package/lib-module/Listbox/Listbox.js +8 -0
  30. package/lib-module/NavigationBar/NavigationBar.js +4 -0
  31. package/lib-module/OrderedList/Item.js +4 -0
  32. package/lib-module/Paragraph/Paragraph.js +4 -0
  33. package/lib-module/PreviewCard/AuthorDate.js +7 -0
  34. package/lib-module/PriceLockup/PriceLockup.js +48 -0
  35. package/lib-module/QuantitySelector/QuantitySelector.js +51 -0
  36. package/lib-module/Span/Span.js +4 -0
  37. package/lib-module/Table/Table.js +4 -0
  38. package/lib-module/Toast/Toast.js +16 -0
  39. package/package.json +3 -3
  40. package/src/BlockQuote/BlockQuote.jsx +53 -6
  41. package/src/Callout/Callout.jsx +9 -0
  42. package/src/DatePicker/CalendarContainer.jsx +24 -0
  43. package/src/DatePicker/DatePicker.jsx +8 -2
  44. package/src/Disclaimer/Disclaimer.jsx +0 -3
  45. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +3 -0
  46. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +12 -0
  47. package/src/IconButton/IconButton.jsx +6 -0
  48. package/src/Listbox/Listbox.jsx +6 -0
  49. package/src/NavigationBar/NavigationBar.jsx +3 -0
  50. package/src/OrderedList/Item.jsx +3 -0
  51. package/src/Paragraph/Paragraph.jsx +3 -0
  52. package/src/PreviewCard/AuthorDate.jsx +6 -0
  53. package/src/PriceLockup/PriceLockup.jsx +37 -0
  54. package/src/QuantitySelector/QuantitySelector.jsx +39 -0
  55. package/src/Span/Span.jsx +3 -0
  56. package/src/Table/Table.jsx +3 -0
  57. package/src/Toast/Toast.jsx +12 -0
@@ -226,16 +226,53 @@ const PriceLockup = ({
226
226
 
227
227
  PriceLockup.propTypes = {
228
228
  ...selectedSystemPropTypes,
229
+ /**
230
+ * Size of the component
231
+ *
232
+ * Small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
233
+ */
229
234
  size: PropTypes.oneOf(['small', 'medium', 'large']),
235
+ /**
236
+ * If currency symbol other than `$` to be used
237
+ */
230
238
  currencySymbol: PropTypes.string,
239
+ /**
240
+ * Shows additional info above the price
241
+ */
231
242
  topText: PropTypes.string,
243
+ /**
244
+ * Monetary value (including decimals separated by ".")
245
+ */
232
246
  price: PropTypes.string.isRequired,
247
+ /**
248
+ * Shows month/year unit
249
+ */
233
250
  rateText: PropTypes.string,
251
+ /**
252
+ * Shows additional info below the price with a `Divider`
253
+ */
234
254
  bottomText: PropTypes.string,
255
+ /**
256
+ * Displays which side the currency should apperar (left, right)
257
+ */
235
258
  signDirection: PropTypes.oneOf(['right', 'left']),
259
+ /**
260
+ * Shows additional link for context
261
+ */
236
262
  footnoteLinks: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
263
+ /**
264
+ * Function to be called when a footnote link is clicked
265
+ */
237
266
  onClickFootnote: PropTypes.func,
267
+ /**
268
+ * To show price savings comparison
269
+ */
238
270
  strikeThrough: PropTypes.bool,
271
+ /**
272
+ * To provide a11y text for `PriceLockup` component
273
+ *
274
+ * **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
275
+ */
239
276
  a11yText: PropTypes.string
240
277
  }
241
278
 
@@ -210,25 +210,64 @@ const dictionaryContentShape = PropTypes.shape({
210
210
  })
211
211
 
212
212
  QuantitySelector.propTypes = {
213
+ /**
214
+ * The id of the input field
215
+ */
213
216
  id: PropTypes.string,
217
+ /**
218
+ * The minimum number allowed
219
+ */
214
220
  minNumber: PropTypes.number,
221
+ /**
222
+ * The maximum number allowed
223
+ */
215
224
  maxNumber: PropTypes.number,
225
+ /**
226
+ * The callback function that is called when the value of the input field changes
227
+ */
216
228
  onChange: PropTypes.func,
229
+ /**
230
+ * The default value of the input field
231
+ */
217
232
  defaultValue: PropTypes.number,
233
+ /**
234
+ * The label of the input field
235
+ */
218
236
  label: PropTypes.string,
237
+ /**
238
+ * The hint of the input field
239
+ */
219
240
  hint: PropTypes.string,
241
+ /**
242
+ * The position of the hint. Could be shown along side the label or below it
243
+ */
220
244
  hintPosition: PropTypes.oneOf(['inline', 'below']),
245
+ /**
246
+ * Adds a question mark which will display a tooltip when clicked
247
+ */
221
248
  tooltip: PropTypes.string,
249
+ /**
250
+ * The accessibility label of the input field
251
+ */
222
252
  accessibilityLabel: PropTypes.string,
253
+ /**
254
+ * The dictionary object containing the content for the input field
255
+ */
223
256
  dictionary: PropTypes.shape({
224
257
  en: dictionaryContentShape,
225
258
  fr: dictionaryContentShape
226
259
  }),
260
+ /**
261
+ * The language to use for the copy.
262
+ */
227
263
  copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr'])]),
228
264
  variant: PropTypes.exact({
229
265
  alternative: PropTypes.bool
230
266
  }),
231
267
  tokens: PropTypes.oneOf([PropTypes.object, PropTypes.func]),
268
+ /**
269
+ * Sets `data-testid` attribute on the input field for testing purposes.
270
+ */
232
271
  testID: PropTypes.string
233
272
  }
234
273
 
package/src/Span/Span.jsx CHANGED
@@ -27,6 +27,9 @@ const Span = ({ children, variant, tokens, testID, flex, ...rest }) => {
27
27
  Span.propTypes = {
28
28
  ...selectedSystemPropTypes,
29
29
  children: PropTypes.node.isRequired,
30
+ /**
31
+ * Adds `data-testid` attribute for testing
32
+ */
30
33
  testID: PropTypes.string,
31
34
  /**
32
35
  * Sets display to inline-flex so that children are laid out using the flex model.
@@ -87,6 +87,9 @@ const Table = ({ children, fullWidth = true, text = 'medium', tokens, variant, .
87
87
  Table.propTypes = {
88
88
  ...selectedSystemPropTypes,
89
89
  children: PropTypes.node,
90
+ /**
91
+ * Sets text style
92
+ */
90
93
  text: PropTypes.oneOf(['medium', 'small'])
91
94
  }
92
95
 
@@ -156,9 +156,21 @@ const Toast = ({ toast, copy, headline, link, tokens, variant = {}, ...rest }) =
156
156
 
157
157
  Toast.propTypes = {
158
158
  ...selectedSystemPropTypes,
159
+ /**
160
+ * If true, the toast will be displayed
161
+ */
159
162
  toast: PropTypes.bool,
163
+ /**
164
+ * The copy to display in the toast
165
+ */
160
166
  copy: PropTypes.string.isRequired,
167
+ /**
168
+ * The headline to display in the toast (before copy)
169
+ */
161
170
  headline: PropTypes.string,
171
+ /**
172
+ * The link to display in the toast (after copy)
173
+ */
162
174
  link: PropTypes.shape({
163
175
  href: PropTypes.string.isRequired,
164
176
  text: PropTypes.string.isRequired,