@telus-uds/components-web 1.12.0 → 2.0.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,29 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Wed, 17 May 2023 00:13:27 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 19 May 2023 04:52:38 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.0.0
8
+
9
+ Fri, 19 May 2023 04:52:38 GMT
10
+
11
+ ### Major changes
12
+
13
+ - Remove `reactRouterLinkComponent` from `Breadcrumbs` (shahzaibkhalidmalik@outlook.com)
14
+ - Bump @telus-uds/components-base to v1.42.0
15
+
16
+ ### Minor changes
17
+
18
+ - fix icon tokens (mauricio.batresmontejo@telus.com)
19
+
20
+ ### Patches
21
+
22
+ - update default space value for stackview component (evander.owusu@telus.com)
23
+
7
24
  ## 1.12.0
8
25
 
9
- Wed, 17 May 2023 00:13:27 GMT
26
+ Wed, 17 May 2023 00:20:05 GMT
10
27
 
11
28
  ### Minor changes
12
29
 
@@ -95,10 +95,16 @@ const getItems = (items, params, concatenatePaths) => {
95
95
  const isLast = i === filteredItems.length - 1;
96
96
  const breadcrumbName = getBreadcrumbName(item, params);
97
97
  const href = getPath(item.path, params, concatenatePaths, paths);
98
+ const {
99
+ LinkRouter,
100
+ linkRouterProps
101
+ } = item;
98
102
  return {
99
103
  breadcrumbName,
100
104
  href,
101
105
  current: isLast,
106
+ LinkRouter,
107
+ linkRouterProps,
102
108
  ...omitProps(selectProps(item))
103
109
  };
104
110
  });
@@ -126,7 +132,6 @@ const Breadcrumbs = _ref2 => {
126
132
  linkRouterProps,
127
133
  params = {},
128
134
  tokens,
129
- reactRouterLinkComponent,
130
135
  routes,
131
136
  variant,
132
137
  LinkRouter,
@@ -183,7 +188,6 @@ const Breadcrumbs = _ref2 => {
183
188
  href,
184
189
  current,
185
190
  breadcrumbName,
186
- reactRouterLinkComponent: linkComponent = reactRouterLinkComponent,
187
191
  LinkRouter: ItemLinkRouter = LinkRouter,
188
192
  linkRouterProps: itemLinkRouterProps,
189
193
  ...itemRest
@@ -194,9 +198,8 @@ const Breadcrumbs = _ref2 => {
194
198
  tokens: tokens,
195
199
  key: href,
196
200
  linkRouterProps: { ...linkRouterProps,
197
- itemLinkRouterProps
201
+ ...itemLinkRouterProps
198
202
  },
199
- reactRouterLinkComponent: linkComponent,
200
203
  variant: { ...variant,
201
204
  size: 'micro'
202
205
  },
@@ -225,12 +228,6 @@ Breadcrumbs.propTypes = { ...selectedSystemPropTypes,
225
228
  */
226
229
  params: _propTypes.default.object,
227
230
 
228
- /**
229
- * React Router Link component.
230
- * @deprecated please use `LinkRouter` and `linkRouterProps` instead
231
- */
232
- reactRouterLinkComponent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
233
-
234
231
  /**
235
232
  * An array of routes to be displayed as breadcrumbs.
236
233
  */
@@ -71,7 +71,6 @@ const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
71
71
  const Item = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
72
72
  let {
73
73
  href,
74
- reactRouterLinkComponent: ReactRouterLink,
75
74
  children,
76
75
  current = false,
77
76
  tokens,
@@ -79,6 +78,8 @@ const Item = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
79
78
  light: true
80
79
  },
81
80
  // `light` variant (shared with the `Link` component) is default by design
81
+ LinkRouter,
82
+ linkRouterProps,
82
83
  ...rest
83
84
  } = _ref5;
84
85
  const {
@@ -90,15 +91,9 @@ const Item = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
90
91
  fontSize,
91
92
  ...themeTokens
92
93
  } = (0, _componentsBase.useThemeTokens)('Breadcrumbs', tokens, variant);
93
-
94
- const linkOptions = _componentsBase.clickProps.toPressProps(selectProps(rest));
95
-
96
- if (ReactRouterLink) {
97
- linkOptions.to = href;
98
- } else {
99
- linkOptions.href = href;
100
- }
101
-
94
+ const linkOptions = { ..._componentsBase.clickProps.toPressProps(selectProps(rest)),
95
+ href
96
+ };
102
97
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledItemContainer, { ...themeTokens,
103
98
  children: current ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
104
99
  tokens: {
@@ -109,26 +104,14 @@ const Item = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
109
104
  },
110
105
  children: children
111
106
  }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
112
- children: [ReactRouterLink ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ReactRouterLink, { ...linkOptions,
113
- tokens: {
114
- color,
115
- blockFontSize: fontSize
116
- } // TODO refactor
117
- // eslint-disable-next-line react/no-unstable-nested-components
118
- ,
119
- component: props => {
120
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Link, { ...props,
121
- variant: variant
122
- });
123
- },
107
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Link, { ...linkOptions,
124
108
  ref: ref,
125
- children: children
126
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Link, { ...linkOptions,
127
109
  tokens: {
128
110
  color,
129
111
  blockFontSize: fontSize
130
112
  },
131
- ref: ref,
113
+ LinkRouter: LinkRouter,
114
+ linkRouterProps: linkRouterProps,
132
115
  variant: variant,
133
116
  children: children
134
117
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconContainer, { ...themeTokens,
@@ -156,18 +139,11 @@ Item.propTypes = { ...selectedSystemPropTypes,
156
139
  current: _propTypes.default.bool,
157
140
 
158
141
  /**
159
- * Target URL. This will be converted to `to` if the `reactRouterLinkComponent`
142
+ * Target URL. This will be converted to `to` if the `LinkRouter`
160
143
  * prop is provided to the `Item` or parent `Breadcrumbs` element.
161
144
  */
162
145
  href: _propTypes.default.string.isRequired,
163
146
 
164
- /**
165
- * React Router Link component. This will be passed down from the parent
166
- * `<Breadcrumbs>` if the parent has a `reactRouterLinkComponent` provided.
167
- * @deprecated please use `LinkRouter` and `linkRouterProps` instead
168
- */
169
- reactRouterLinkComponent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
170
-
171
147
  /**
172
148
  * Variant to render.
173
149
  */
@@ -179,12 +155,9 @@ Item.propTypes = { ...selectedSystemPropTypes,
179
155
 
180
156
  Item.defaultProps = {
181
157
  current: false,
182
- reactRouterLinkComponent: undefined,
183
158
  variant: {
184
159
  light: true
185
160
  }
186
161
  };
187
-
188
- var _default = (0, _componentsBase.withLinkRouter)(Item);
189
-
162
+ var _default = Item;
190
163
  exports.default = _default;
@@ -52,7 +52,6 @@ const StyledFootnote = /*#__PURE__*/_styledComponents.default.div.withConfig({
52
52
  width: '100vw',
53
53
  backgroundColor: footnoteBackground,
54
54
  display: 'block',
55
- boxShadow: '0 0 16px 0 rgba(0, 0, 0, 0.1)',
56
55
  transform: 'translateY(100%)',
57
56
  transition: 'transform 500ms ease-out',
58
57
  '@media() (prefers-reduced-motion: reduce)': {
@@ -95,14 +94,20 @@ const StyledHeader = /*#__PURE__*/_styledComponents.default.div.withConfig({
95
94
  componentId: "components-web__sc-1563bo5-2"
96
95
  })(_ref3 => {
97
96
  let {
98
- headerMargin
97
+ footnoteHeaderPaddingLeft,
98
+ footnoteHeaderPaddingRight,
99
+ footnoteHeaderPaddingTop,
100
+ footnoteHeaderPaddingBottom
99
101
  } = _ref3;
100
102
  return {
101
103
  alignItems: 'center',
102
104
  display: 'flex',
103
105
  flexDirection: 'row',
104
106
  justifyContent: 'space-between',
105
- margin: headerMargin
107
+ paddingTop: footnoteHeaderPaddingTop,
108
+ paddingBottom: footnoteHeaderPaddingBottom,
109
+ paddingRight: footnoteHeaderPaddingRight,
110
+ paddingLeft: footnoteHeaderPaddingLeft
106
111
  };
107
112
  });
108
113
 
@@ -202,6 +207,7 @@ const CloseButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
202
207
  cursor: 'pointer',
203
208
  display: 'flex',
204
209
  justifyContent: 'center',
210
+ backgroundColor: 'white',
205
211
  border: closeButtonBorder,
206
212
  height: closeButtonHeight,
207
213
  margin: closeButtonMargin,
@@ -295,6 +301,14 @@ const Footnote = props => {
295
301
  footnoteBodyPaddingRight,
296
302
  footnoteBodyPaddingTop,
297
303
  footnoteBodyPaddingBottom,
304
+ footnoteHeaderPaddingLeft,
305
+ footnoteHeaderPaddingRight,
306
+ footnoteHeaderPaddingTop,
307
+ footnoteHeaderPaddingBottom,
308
+ headerLineHeight,
309
+ headerFontSize,
310
+ headerFontName,
311
+ headerFontWeight,
298
312
  listPaddingLeft,
299
313
  listItemMarkerFontSize,
300
314
  listItemMarkerLineHeight,
@@ -506,13 +520,16 @@ const Footnote = props => {
506
520
  ref: headerRef,
507
521
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledHeader, {
508
522
  ref: headingRef,
523
+ footnoteHeaderPaddingLeft: footnoteHeaderPaddingLeft,
524
+ footnoteHeaderPaddingRight: footnoteHeaderPaddingRight,
525
+ footnoteHeaderPaddingTop: footnoteHeaderPaddingTop,
526
+ footnoteHeaderPaddingBottom: footnoteHeaderPaddingBottom,
509
527
  headerMargin: headerMargin,
510
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
511
- block: true,
512
- heading: true,
513
- tabIndex: -1,
514
- variant: {
515
- size: 'h4'
528
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
529
+ style: {
530
+ fontSize: `${headerFontSize}px`,
531
+ lineHeight: `${headerLineHeight}px`,
532
+ fontFamily: `${headerFontName}${headerFontWeight}normal`
516
533
  },
517
534
  children: getCopy('heading')
518
535
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
@@ -75,10 +75,16 @@ const getItems = (items, params, concatenatePaths) => {
75
75
  const isLast = i === filteredItems.length - 1;
76
76
  const breadcrumbName = getBreadcrumbName(item, params);
77
77
  const href = getPath(item.path, params, concatenatePaths, paths);
78
+ const {
79
+ LinkRouter,
80
+ linkRouterProps
81
+ } = item;
78
82
  return {
79
83
  breadcrumbName,
80
84
  href,
81
85
  current: isLast,
86
+ LinkRouter,
87
+ linkRouterProps,
82
88
  ...omitProps(selectProps(item))
83
89
  };
84
90
  });
@@ -106,7 +112,6 @@ const Breadcrumbs = _ref2 => {
106
112
  linkRouterProps,
107
113
  params = {},
108
114
  tokens,
109
- reactRouterLinkComponent,
110
115
  routes,
111
116
  variant,
112
117
  LinkRouter,
@@ -165,7 +170,6 @@ const Breadcrumbs = _ref2 => {
165
170
  href,
166
171
  current,
167
172
  breadcrumbName,
168
- reactRouterLinkComponent: linkComponent = reactRouterLinkComponent,
169
173
  LinkRouter: ItemLinkRouter = LinkRouter,
170
174
  linkRouterProps: itemLinkRouterProps,
171
175
  ...itemRest
@@ -176,9 +180,8 @@ const Breadcrumbs = _ref2 => {
176
180
  tokens: tokens,
177
181
  key: href,
178
182
  linkRouterProps: { ...linkRouterProps,
179
- itemLinkRouterProps
183
+ ...itemLinkRouterProps
180
184
  },
181
- reactRouterLinkComponent: linkComponent,
182
185
  variant: { ...variant,
183
186
  size: 'micro'
184
187
  },
@@ -207,12 +210,6 @@ Breadcrumbs.propTypes = { ...selectedSystemPropTypes,
207
210
  */
208
211
  params: PropTypes.object,
209
212
 
210
- /**
211
- * React Router Link component.
212
- * @deprecated please use `LinkRouter` and `linkRouterProps` instead
213
- */
214
- reactRouterLinkComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
215
-
216
213
  /**
217
214
  * An array of routes to be displayed as breadcrumbs.
218
215
  */
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import { Link, Typography, applyTextStyles, clickProps, selectSystemProps, useThemeTokens, withLinkRouter } from '@telus-uds/components-base';
4
+ import { Link, Typography, applyTextStyles, clickProps, selectSystemProps, useThemeTokens } from '@telus-uds/components-base';
5
5
  import { htmlAttrs } from '../../utils';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -51,7 +51,6 @@ const IconContainer = /*#__PURE__*/styled.span.withConfig({
51
51
  const Item = /*#__PURE__*/forwardRef((_ref5, ref) => {
52
52
  let {
53
53
  href,
54
- reactRouterLinkComponent: ReactRouterLink,
55
54
  children,
56
55
  current = false,
57
56
  tokens,
@@ -59,6 +58,8 @@ const Item = /*#__PURE__*/forwardRef((_ref5, ref) => {
59
58
  light: true
60
59
  },
61
60
  // `light` variant (shared with the `Link` component) is default by design
61
+ LinkRouter,
62
+ linkRouterProps,
62
63
  ...rest
63
64
  } = _ref5;
64
65
  const {
@@ -70,14 +71,9 @@ const Item = /*#__PURE__*/forwardRef((_ref5, ref) => {
70
71
  fontSize,
71
72
  ...themeTokens
72
73
  } = useThemeTokens('Breadcrumbs', tokens, variant);
73
- const linkOptions = clickProps.toPressProps(selectProps(rest));
74
-
75
- if (ReactRouterLink) {
76
- linkOptions.to = href;
77
- } else {
78
- linkOptions.href = href;
79
- }
80
-
74
+ const linkOptions = { ...clickProps.toPressProps(selectProps(rest)),
75
+ href
76
+ };
81
77
  return /*#__PURE__*/_jsx(StyledItemContainer, { ...themeTokens,
82
78
  children: current ? /*#__PURE__*/_jsx(Typography, {
83
79
  tokens: {
@@ -88,26 +84,14 @@ const Item = /*#__PURE__*/forwardRef((_ref5, ref) => {
88
84
  },
89
85
  children: children
90
86
  }) : /*#__PURE__*/_jsxs(_Fragment, {
91
- children: [ReactRouterLink ? /*#__PURE__*/_jsx(ReactRouterLink, { ...linkOptions,
92
- tokens: {
93
- color,
94
- blockFontSize: fontSize
95
- } // TODO refactor
96
- // eslint-disable-next-line react/no-unstable-nested-components
97
- ,
98
- component: props => {
99
- return /*#__PURE__*/_jsx(Link, { ...props,
100
- variant: variant
101
- });
102
- },
87
+ children: [/*#__PURE__*/_jsx(Link, { ...linkOptions,
103
88
  ref: ref,
104
- children: children
105
- }) : /*#__PURE__*/_jsx(Link, { ...linkOptions,
106
89
  tokens: {
107
90
  color,
108
91
  blockFontSize: fontSize
109
92
  },
110
- ref: ref,
93
+ LinkRouter: LinkRouter,
94
+ linkRouterProps: linkRouterProps,
111
95
  variant: variant,
112
96
  children: children
113
97
  }), /*#__PURE__*/_jsx(IconContainer, { ...themeTokens,
@@ -135,18 +119,11 @@ Item.propTypes = { ...selectedSystemPropTypes,
135
119
  current: PropTypes.bool,
136
120
 
137
121
  /**
138
- * Target URL. This will be converted to `to` if the `reactRouterLinkComponent`
122
+ * Target URL. This will be converted to `to` if the `LinkRouter`
139
123
  * prop is provided to the `Item` or parent `Breadcrumbs` element.
140
124
  */
141
125
  href: PropTypes.string.isRequired,
142
126
 
143
- /**
144
- * React Router Link component. This will be passed down from the parent
145
- * `<Breadcrumbs>` if the parent has a `reactRouterLinkComponent` provided.
146
- * @deprecated please use `LinkRouter` and `linkRouterProps` instead
147
- */
148
- reactRouterLinkComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
149
-
150
127
  /**
151
128
  * Variant to render.
152
129
  */
@@ -158,9 +135,8 @@ Item.propTypes = { ...selectedSystemPropTypes,
158
135
 
159
136
  Item.defaultProps = {
160
137
  current: false,
161
- reactRouterLinkComponent: undefined,
162
138
  variant: {
163
139
  light: true
164
140
  }
165
141
  };
166
- export default withLinkRouter(Item);
142
+ export default Item;
@@ -31,7 +31,6 @@ const StyledFootnote = /*#__PURE__*/styled.div.withConfig({
31
31
  width: '100vw',
32
32
  backgroundColor: footnoteBackground,
33
33
  display: 'block',
34
- boxShadow: '0 0 16px 0 rgba(0, 0, 0, 0.1)',
35
34
  transform: 'translateY(100%)',
36
35
  transition: 'transform 500ms ease-out',
37
36
  '@media() (prefers-reduced-motion: reduce)': {
@@ -72,14 +71,20 @@ const StyledHeader = /*#__PURE__*/styled.div.withConfig({
72
71
  componentId: "components-web__sc-1563bo5-2"
73
72
  })(_ref3 => {
74
73
  let {
75
- headerMargin
74
+ footnoteHeaderPaddingLeft,
75
+ footnoteHeaderPaddingRight,
76
+ footnoteHeaderPaddingTop,
77
+ footnoteHeaderPaddingBottom
76
78
  } = _ref3;
77
79
  return {
78
80
  alignItems: 'center',
79
81
  display: 'flex',
80
82
  flexDirection: 'row',
81
83
  justifyContent: 'space-between',
82
- margin: headerMargin
84
+ paddingTop: footnoteHeaderPaddingTop,
85
+ paddingBottom: footnoteHeaderPaddingBottom,
86
+ paddingRight: footnoteHeaderPaddingRight,
87
+ paddingLeft: footnoteHeaderPaddingLeft
83
88
  };
84
89
  });
85
90
  const StyledFootnoteBody = /*#__PURE__*/styled.div.withConfig({
@@ -176,6 +181,7 @@ const CloseButton = /*#__PURE__*/styled.button.withConfig({
176
181
  cursor: 'pointer',
177
182
  display: 'flex',
178
183
  justifyContent: 'center',
184
+ backgroundColor: 'white',
179
185
  border: closeButtonBorder,
180
186
  height: closeButtonHeight,
181
187
  margin: closeButtonMargin,
@@ -267,6 +273,14 @@ const Footnote = props => {
267
273
  footnoteBodyPaddingRight,
268
274
  footnoteBodyPaddingTop,
269
275
  footnoteBodyPaddingBottom,
276
+ footnoteHeaderPaddingLeft,
277
+ footnoteHeaderPaddingRight,
278
+ footnoteHeaderPaddingTop,
279
+ footnoteHeaderPaddingBottom,
280
+ headerLineHeight,
281
+ headerFontSize,
282
+ headerFontName,
283
+ headerFontWeight,
270
284
  listPaddingLeft,
271
285
  listItemMarkerFontSize,
272
286
  listItemMarkerLineHeight,
@@ -478,13 +492,16 @@ const Footnote = props => {
478
492
  ref: headerRef,
479
493
  children: /*#__PURE__*/_jsxs(StyledHeader, {
480
494
  ref: headingRef,
495
+ footnoteHeaderPaddingLeft: footnoteHeaderPaddingLeft,
496
+ footnoteHeaderPaddingRight: footnoteHeaderPaddingRight,
497
+ footnoteHeaderPaddingTop: footnoteHeaderPaddingTop,
498
+ footnoteHeaderPaddingBottom: footnoteHeaderPaddingBottom,
481
499
  headerMargin: headerMargin,
482
- children: [/*#__PURE__*/_jsx(Typography, {
483
- block: true,
484
- heading: true,
485
- tabIndex: -1,
486
- variant: {
487
- size: 'h4'
500
+ children: [/*#__PURE__*/_jsx("h2", {
501
+ style: {
502
+ fontSize: `${headerFontSize}px`,
503
+ lineHeight: `${headerLineHeight}px`,
504
+ fontFamily: `${headerFontName}${headerFontWeight}normal`
488
505
  },
489
506
  children: getCopy('heading')
490
507
  }), /*#__PURE__*/_jsx(CloseButton, {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "@gorhom/portal": "^1.0.14",
8
- "@telus-uds/components-base": "1.41.0",
8
+ "@telus-uds/components-base": "1.42.0",
9
9
  "@telus-uds/system-constants": "^1.2.0",
10
10
  "fscreen": "^1.2.0",
11
11
  "lodash.omit": "^4.5.0",
@@ -61,5 +61,5 @@
61
61
  "skip": true
62
62
  },
63
63
  "types": "types/index.d.ts",
64
- "version": "1.12.0"
64
+ "version": "2.0.0"
65
65
  }
@@ -74,10 +74,13 @@ const getItems = (items, params, concatenatePaths) => {
74
74
  const isLast = i === filteredItems.length - 1
75
75
  const breadcrumbName = getBreadcrumbName(item, params)
76
76
  const href = getPath(item.path, params, concatenatePaths, paths)
77
+ const { LinkRouter, linkRouterProps } = item
77
78
  return {
78
79
  breadcrumbName,
79
80
  href,
80
81
  current: isLast,
82
+ LinkRouter,
83
+ linkRouterProps,
81
84
  ...omitProps(selectProps(item))
82
85
  }
83
86
  })
@@ -103,7 +106,6 @@ const Breadcrumbs = ({
103
106
  linkRouterProps,
104
107
  params = {},
105
108
  tokens,
106
- reactRouterLinkComponent,
107
109
  routes,
108
110
  variant,
109
111
  LinkRouter,
@@ -157,25 +159,25 @@ const Breadcrumbs = ({
157
159
  href,
158
160
  current,
159
161
  breadcrumbName,
160
- reactRouterLinkComponent: linkComponent = reactRouterLinkComponent,
161
162
  LinkRouter: ItemLinkRouter = LinkRouter,
162
163
  linkRouterProps: itemLinkRouterProps,
163
164
  ...itemRest
164
- }) => (
165
- <Item
166
- {...itemRest}
167
- current={current}
168
- href={href}
169
- tokens={tokens}
170
- key={href}
171
- linkRouterProps={{ ...linkRouterProps, itemLinkRouterProps }}
172
- reactRouterLinkComponent={linkComponent}
173
- variant={{ ...variant, size: 'micro' }}
174
- LinkRouter={ItemLinkRouter}
175
- >
176
- {breadcrumbName}
177
- </Item>
178
- )
165
+ }) => {
166
+ return (
167
+ <Item
168
+ {...itemRest}
169
+ current={current}
170
+ href={href}
171
+ tokens={tokens}
172
+ key={href}
173
+ linkRouterProps={{ ...linkRouterProps, ...itemLinkRouterProps }}
174
+ variant={{ ...variant, size: 'micro' }}
175
+ LinkRouter={ItemLinkRouter}
176
+ >
177
+ {breadcrumbName}
178
+ </Item>
179
+ )
180
+ }
179
181
  )}
180
182
  </StyledList>
181
183
  {metadata}
@@ -198,11 +200,6 @@ Breadcrumbs.propTypes = {
198
200
  * React Router params.
199
201
  */
200
202
  params: PropTypes.object,
201
- /**
202
- * React Router Link component.
203
- * @deprecated please use `LinkRouter` and `linkRouterProps` instead
204
- */
205
- reactRouterLinkComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
206
203
  /**
207
204
  * An array of routes to be displayed as breadcrumbs.
208
205
  */
@@ -7,8 +7,7 @@ import {
7
7
  applyTextStyles,
8
8
  clickProps,
9
9
  selectSystemProps,
10
- useThemeTokens,
11
- withLinkRouter
10
+ useThemeTokens
12
11
  } from '@telus-uds/components-base'
13
12
  import { htmlAttrs } from '../../utils'
14
13
 
@@ -31,11 +30,12 @@ const Item = forwardRef(
31
30
  (
32
31
  {
33
32
  href,
34
- reactRouterLinkComponent: ReactRouterLink,
35
33
  children,
36
34
  current = false,
37
35
  tokens,
38
36
  variant = { light: true }, // `light` variant (shared with the `Link` component) is default by design
37
+ LinkRouter,
38
+ linkRouterProps,
39
39
  ...rest
40
40
  },
41
41
  ref
@@ -50,13 +50,7 @@ const Item = forwardRef(
50
50
  ...themeTokens
51
51
  } = useThemeTokens('Breadcrumbs', tokens, variant)
52
52
 
53
- const linkOptions = clickProps.toPressProps(selectProps(rest))
54
-
55
- if (ReactRouterLink) {
56
- linkOptions.to = href
57
- } else {
58
- linkOptions.href = href
59
- }
53
+ const linkOptions = { ...clickProps.toPressProps(selectProps(rest)), href }
60
54
 
61
55
  return (
62
56
  <StyledItemContainer {...themeTokens}>
@@ -66,29 +60,16 @@ const Item = forwardRef(
66
60
  </Typography>
67
61
  ) : (
68
62
  <>
69
- {ReactRouterLink ? (
70
- <ReactRouterLink
71
- {...linkOptions}
72
- tokens={{ color, blockFontSize: fontSize }}
73
- // TODO refactor
74
- // eslint-disable-next-line react/no-unstable-nested-components
75
- component={(props) => {
76
- return <Link {...props} variant={variant} />
77
- }}
78
- ref={ref}
79
- >
80
- {children}
81
- </ReactRouterLink>
82
- ) : (
83
- <Link
84
- {...linkOptions}
85
- tokens={{ color, blockFontSize: fontSize }}
86
- ref={ref}
87
- variant={variant}
88
- >
89
- {children}
90
- </Link>
91
- )}
63
+ <Link
64
+ {...linkOptions}
65
+ ref={ref}
66
+ tokens={{ color, blockFontSize: fontSize }}
67
+ LinkRouter={LinkRouter}
68
+ linkRouterProps={linkRouterProps}
69
+ variant={variant}
70
+ >
71
+ {children}
72
+ </Link>
92
73
  <IconContainer {...themeTokens}>
93
74
  <ChevronRightIcon size={iconSize} color={iconColor} />
94
75
  </IconContainer>
@@ -114,16 +95,10 @@ Item.propTypes = {
114
95
  */
115
96
  current: PropTypes.bool,
116
97
  /**
117
- * Target URL. This will be converted to `to` if the `reactRouterLinkComponent`
98
+ * Target URL. This will be converted to `to` if the `LinkRouter`
118
99
  * prop is provided to the `Item` or parent `Breadcrumbs` element.
119
100
  */
120
101
  href: PropTypes.string.isRequired,
121
- /**
122
- * React Router Link component. This will be passed down from the parent
123
- * `<Breadcrumbs>` if the parent has a `reactRouterLinkComponent` provided.
124
- * @deprecated please use `LinkRouter` and `linkRouterProps` instead
125
- */
126
- reactRouterLinkComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
127
102
  /**
128
103
  * Variant to render.
129
104
  */
@@ -134,8 +109,7 @@ Item.propTypes = {
134
109
  // - probably related https://github.com/yannickcr/eslint-plugin-react/issues/2760
135
110
  Item.defaultProps = {
136
111
  current: false,
137
- reactRouterLinkComponent: undefined,
138
112
  variant: { light: true }
139
113
  }
140
114
 
141
- export default withLinkRouter(Item)
115
+ export default Item
@@ -32,7 +32,6 @@ const StyledFootnote = styled.div(
32
32
  width: '100vw',
33
33
  backgroundColor: footnoteBackground,
34
34
  display: 'block',
35
- boxShadow: '0 0 16px 0 rgba(0, 0, 0, 0.1)',
36
35
  transform: 'translateY(100%)',
37
36
  transition: 'transform 500ms ease-out',
38
37
  '@media() (prefers-reduced-motion: reduce)': {
@@ -63,13 +62,23 @@ const StyledFootnoteHeader = styled.div({
63
62
  width: '100%'
64
63
  })
65
64
 
66
- const StyledHeader = styled.div(({ headerMargin }) => ({
67
- alignItems: 'center',
68
- display: 'flex',
69
- flexDirection: 'row',
70
- justifyContent: 'space-between',
71
- margin: headerMargin
72
- }))
65
+ const StyledHeader = styled.div(
66
+ ({
67
+ footnoteHeaderPaddingLeft,
68
+ footnoteHeaderPaddingRight,
69
+ footnoteHeaderPaddingTop,
70
+ footnoteHeaderPaddingBottom
71
+ }) => ({
72
+ alignItems: 'center',
73
+ display: 'flex',
74
+ flexDirection: 'row',
75
+ justifyContent: 'space-between',
76
+ paddingTop: footnoteHeaderPaddingTop,
77
+ paddingBottom: footnoteHeaderPaddingBottom,
78
+ paddingRight: footnoteHeaderPaddingRight,
79
+ paddingLeft: footnoteHeaderPaddingLeft
80
+ })
81
+ )
73
82
 
74
83
  const StyledFootnoteBody = styled.div(
75
84
  {
@@ -134,6 +143,7 @@ const CloseButton = styled.button(
134
143
  cursor: 'pointer',
135
144
  display: 'flex',
136
145
  justifyContent: 'center',
146
+ backgroundColor: 'white',
137
147
  border: closeButtonBorder,
138
148
  height: closeButtonHeight,
139
149
  margin: closeButtonMargin,
@@ -208,6 +218,14 @@ const Footnote = (props) => {
208
218
  footnoteBodyPaddingRight,
209
219
  footnoteBodyPaddingTop,
210
220
  footnoteBodyPaddingBottom,
221
+ footnoteHeaderPaddingLeft,
222
+ footnoteHeaderPaddingRight,
223
+ footnoteHeaderPaddingTop,
224
+ footnoteHeaderPaddingBottom,
225
+ headerLineHeight,
226
+ headerFontSize,
227
+ headerFontName,
228
+ headerFontWeight,
211
229
  listPaddingLeft,
212
230
  listItemMarkerFontSize,
213
231
  listItemMarkerLineHeight,
@@ -423,10 +441,23 @@ const Footnote = (props) => {
423
441
  >
424
442
  <ContentContainer maxWidth={maxWidth}>
425
443
  <StyledFootnoteHeader ref={headerRef}>
426
- <StyledHeader ref={headingRef} headerMargin={headerMargin}>
427
- <Typography block heading tabIndex={-1} variant={{ size: 'h4' }}>
444
+ <StyledHeader
445
+ ref={headingRef}
446
+ footnoteHeaderPaddingLeft={footnoteHeaderPaddingLeft}
447
+ footnoteHeaderPaddingRight={footnoteHeaderPaddingRight}
448
+ footnoteHeaderPaddingTop={footnoteHeaderPaddingTop}
449
+ footnoteHeaderPaddingBottom={footnoteHeaderPaddingBottom}
450
+ headerMargin={headerMargin}
451
+ >
452
+ <h2
453
+ style={{
454
+ fontSize: `${headerFontSize}px`,
455
+ lineHeight: `${headerLineHeight}px`,
456
+ fontFamily: `${headerFontName}${headerFontWeight}normal`
457
+ }}
458
+ >
428
459
  {getCopy('heading')}
429
- </Typography>
460
+ </h2>
430
461
  <CloseButton
431
462
  closeButtonBorder={`${closeButtonBorderSize}px solid ${closeButtonBorderColor}`}
432
463
  closeButtonWidth={`${closeButtonWidth}px`}