@telus-uds/components-web 3.1.0 → 3.2.1

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 (122) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/lib/Badge/Badge.js +19 -11
  3. package/lib/BlockQuote/BlockQuote.js +31 -17
  4. package/lib/Breadcrumbs/Breadcrumbs.js +23 -17
  5. package/lib/Breadcrumbs/Item/Item.js +6 -10
  6. package/lib/Callout/Callout.js +5 -6
  7. package/lib/Card/Card.js +5 -5
  8. package/lib/Card/CardContent.js +5 -6
  9. package/lib/Card/CardFooter.js +5 -6
  10. package/lib/Countdown/Countdown.js +5 -6
  11. package/lib/Countdown/Segment.js +6 -6
  12. package/lib/DatePicker/CalendarContainer.js +5 -5
  13. package/lib/DatePicker/DatePicker.js +12 -18
  14. package/lib/DatePicker/reactDatesCss.js +829 -2
  15. package/lib/Disclaimer/Disclaimer.js +5 -6
  16. package/lib/Footnote/Footnote.js +15 -39
  17. package/lib/Footnote/FootnoteLink.js +5 -6
  18. package/lib/NavigationBar/NavigationBar.js +73 -20
  19. package/lib/NavigationBar/NavigationItem.js +5 -6
  20. package/lib/OrderedList/Item.js +7 -11
  21. package/lib/OrderedList/ItemBase.js +5 -5
  22. package/lib/OrderedList/OrderedList.js +5 -6
  23. package/lib/OrderedList/OrderedListBase.js +5 -5
  24. package/lib/Paragraph/Paragraph.js +16 -8
  25. package/lib/PreviewCard/PreviewCard.js +7 -10
  26. package/lib/PriceLockup/PriceLockup.js +64 -54
  27. package/lib/Progress/ProgressBar.js +6 -6
  28. package/lib/QuantitySelector/QuantitySelector.js +1 -1
  29. package/lib/QuantitySelector/styles.js +18 -9
  30. package/lib/ResponsiveImage/ResponsiveImage.js +7 -1
  31. package/lib/Ribbon/Ribbon.js +57 -31
  32. package/lib/Span/Span.js +6 -7
  33. package/lib/Spinner/Spinner.js +8 -18
  34. package/lib/Spinner/SpinnerContent.js +5 -6
  35. package/lib/StoryCard/StoryCard.js +7 -10
  36. package/lib/Table/Cell.js +43 -12
  37. package/lib/Table/Table.js +15 -11
  38. package/lib/TermsAndConditions/ExpandCollapse.js +7 -13
  39. package/lib/TermsAndConditions/TermsAndConditions.js +9 -22
  40. package/lib/Testimonial/Testimonial.js +10 -26
  41. package/lib/Toast/Toast.js +64 -13
  42. package/lib/Video/ControlBar/ControlBar.js +8 -18
  43. package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +5 -6
  44. package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +7 -14
  45. package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +7 -14
  46. package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +6 -10
  47. package/lib/Video/MiddleControlButton/MiddleControlButton.js +5 -6
  48. package/lib/Video/Video.js +10 -26
  49. package/lib/VideoPicker/VideoPicker.js +44 -20
  50. package/lib/VideoPicker/VideoPickerThumbnail.js +52 -18
  51. package/lib/WaffleGrid/WaffleGrid.js +7 -14
  52. package/lib/WebVideo/WebVideo.js +9 -14
  53. package/lib/index.js +1 -1
  54. package/lib/shared/FullBleedContent/FullBleedContent.js +5 -5
  55. package/lib/shared/VideoSplash/SplashButton/SplashButton.js +6 -9
  56. package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +8 -17
  57. package/lib/shared/VideoSplash/VideoSplash.js +5 -6
  58. package/lib/utils/index.js +3 -1
  59. package/lib/utils/scrollToAnchor.js +19 -0
  60. package/lib/utils/ssr.js +4 -1
  61. package/lib/utils/theming/styled-components.js +26 -0
  62. package/package.json +3 -3
  63. package/src/Badge/Badge.jsx +3 -2
  64. package/src/BlockQuote/BlockQuote.jsx +3 -2
  65. package/src/Breadcrumbs/Breadcrumbs.jsx +23 -13
  66. package/src/Breadcrumbs/Item/Item.jsx +3 -2
  67. package/src/Callout/Callout.jsx +3 -2
  68. package/src/Card/Card.jsx +3 -1
  69. package/src/Card/CardContent.jsx +3 -2
  70. package/src/Card/CardFooter.jsx +3 -2
  71. package/src/Countdown/Countdown.jsx +3 -2
  72. package/src/Countdown/Segment.jsx +3 -1
  73. package/src/DatePicker/CalendarContainer.jsx +3 -1
  74. package/src/DatePicker/DatePicker.jsx +3 -2
  75. package/src/DatePicker/reactDatesCss.js +3 -1
  76. package/src/Disclaimer/Disclaimer.jsx +3 -2
  77. package/src/Footnote/Footnote.jsx +9 -2
  78. package/src/Footnote/FootnoteLink.jsx +3 -2
  79. package/src/NavigationBar/NavigationBar.jsx +55 -13
  80. package/src/NavigationBar/NavigationItem.jsx +3 -2
  81. package/src/OrderedList/Item.jsx +4 -3
  82. package/src/OrderedList/ItemBase.jsx +3 -1
  83. package/src/OrderedList/OrderedList.jsx +3 -2
  84. package/src/OrderedList/OrderedListBase.jsx +3 -1
  85. package/src/Paragraph/Paragraph.jsx +3 -2
  86. package/src/PreviewCard/PreviewCard.jsx +3 -1
  87. package/src/PriceLockup/PriceLockup.jsx +3 -2
  88. package/src/Progress/ProgressBar.jsx +3 -1
  89. package/src/QuantitySelector/QuantitySelector.jsx +1 -1
  90. package/src/QuantitySelector/styles.js +3 -1
  91. package/src/ResponsiveImage/ResponsiveImage.jsx +10 -3
  92. package/src/Ribbon/Ribbon.jsx +3 -2
  93. package/src/Span/Span.jsx +3 -2
  94. package/src/Spinner/Spinner.jsx +3 -2
  95. package/src/Spinner/SpinnerContent.jsx +3 -2
  96. package/src/StoryCard/StoryCard.jsx +3 -1
  97. package/src/Table/Cell.jsx +3 -1
  98. package/src/Table/Table.jsx +3 -2
  99. package/src/TermsAndConditions/ExpandCollapse.jsx +3 -1
  100. package/src/TermsAndConditions/TermsAndConditions.jsx +3 -2
  101. package/src/Testimonial/Testimonial.jsx +3 -2
  102. package/src/Toast/Toast.jsx +3 -2
  103. package/src/Video/ControlBar/ControlBar.jsx +3 -3
  104. package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +4 -3
  105. package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +3 -3
  106. package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +3 -3
  107. package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +3 -3
  108. package/src/Video/MiddleControlButton/MiddleControlButton.jsx +4 -3
  109. package/src/Video/Video.jsx +3 -2
  110. package/src/VideoPicker/VideoPicker.jsx +3 -2
  111. package/src/VideoPicker/VideoPickerThumbnail.jsx +3 -1
  112. package/src/WaffleGrid/WaffleGrid.jsx +3 -2
  113. package/src/WebVideo/WebVideo.jsx +4 -3
  114. package/src/index.js +1 -1
  115. package/src/shared/FullBleedContent/FullBleedContent.jsx +3 -2
  116. package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +3 -1
  117. package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +4 -2
  118. package/src/shared/VideoSplash/VideoSplash.jsx +3 -2
  119. package/src/utils/index.js +5 -1
  120. package/src/utils/scrollToAnchor.js +18 -0
  121. package/src/utils/ssr.js +2 -1
  122. package/src/utils/theming/styled-components.js +23 -0
@@ -1,14 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
3
  import { applyTextStyles, selectSystemProps, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
5
- import { htmlAttrs } from '../utils';
4
+ import { htmlAttrs, styledComponents } from '../utils';
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ const {
7
+ styled
8
+ } = styledComponents;
7
9
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
8
- const StyledDisclaimer = /*#__PURE__*/styled.p.withConfig({
9
- displayName: "Disclaimer__StyledDisclaimer",
10
- componentId: "components-web__sc-1l4xf7u-0"
11
- })(_ref => {
10
+ const StyledDisclaimer = styled.p(_ref => {
12
11
  let {
13
12
  fontName,
14
13
  fontWeight,
@@ -1,22 +1,22 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled, { createGlobalStyle } from 'styled-components';
4
3
  import { Icon, Portal, selectSystemProps, Typography, useCopy, useTheme, useResponsiveProp, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
5
4
  import OrderedListBase from '../OrderedList/OrderedListBase';
6
- import { htmlAttrs, media, renderStructuredContent, isElementFocusable } from '../utils';
5
+ import { htmlAttrs, media, renderStructuredContent, isElementFocusable, styledComponents } from '../utils';
7
6
  import defaultDictionary from './dictionary';
8
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
8
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
10
9
  const viewportBreakpoint = 1440;
11
- const GlobalBodyScrollLock = /*#__PURE__*/createGlobalStyle({
10
+ const {
11
+ styled,
12
+ createGlobalStyle
13
+ } = styledComponents;
14
+ const GlobalBodyScrollLock = createGlobalStyle({
12
15
  'html, body': media().until('md').css({
13
16
  overflow: 'hidden'
14
17
  })
15
18
  });
16
- const StyledFootnote = /*#__PURE__*/styled.div.withConfig({
17
- displayName: "Footnote__StyledFootnote",
18
- componentId: "components-web__sc-1563bo5-0"
19
- })(_ref => {
19
+ const StyledFootnote = styled.div(_ref => {
20
20
  let {
21
21
  footnoteBackground,
22
22
  isVisible,
@@ -60,17 +60,11 @@ const StyledFootnote = /*#__PURE__*/styled.div.withConfig({
60
60
  }
61
61
  return {};
62
62
  });
63
- const StyledFootnoteHeader = /*#__PURE__*/styled.div.withConfig({
64
- displayName: "Footnote__StyledFootnoteHeader",
65
- componentId: "components-web__sc-1563bo5-1"
66
- })(() => ({
63
+ const StyledFootnoteHeader = styled.div(() => ({
67
64
  position: 'relative',
68
65
  width: '100%'
69
66
  }));
70
- const StyledHeader = /*#__PURE__*/styled.div.withConfig({
71
- displayName: "Footnote__StyledHeader",
72
- componentId: "components-web__sc-1563bo5-2"
73
- })(_ref3 => {
67
+ const StyledHeader = styled.div(_ref3 => {
74
68
  let {
75
69
  footnoteHeaderPaddingLeft,
76
70
  footnoteHeaderPaddingRight,
@@ -88,10 +82,7 @@ const StyledHeader = /*#__PURE__*/styled.div.withConfig({
88
82
  paddingLeft: footnoteHeaderPaddingLeft
89
83
  };
90
84
  });
91
- const StyledFootnoteBody = /*#__PURE__*/styled.div.withConfig({
92
- displayName: "Footnote__StyledFootnoteBody",
93
- componentId: "components-web__sc-1563bo5-3"
94
- })(_ref4 => {
85
+ const StyledFootnoteBody = styled.div(_ref4 => {
95
86
  let {
96
87
  footnoteBodyBackground,
97
88
  footnoteBodyPadding,
@@ -116,10 +107,7 @@ const StyledFootnoteBody = /*#__PURE__*/styled.div.withConfig({
116
107
  opacity: isTextVisible ? 1 : 0
117
108
  };
118
109
  });
119
- const List = /*#__PURE__*/styled(OrderedListBase).withConfig({
120
- displayName: "Footnote__List",
121
- componentId: "components-web__sc-1563bo5-4"
122
- })(_ref5 => {
110
+ const List = styled(OrderedListBase)(_ref5 => {
123
111
  let {
124
112
  listPaddingLeft
125
113
  } = _ref5;
@@ -128,10 +116,7 @@ const List = /*#__PURE__*/styled(OrderedListBase).withConfig({
128
116
  paddingLeft: listPaddingLeft
129
117
  };
130
118
  });
131
- const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
132
- displayName: "Footnote__ListItem",
133
- componentId: "components-web__sc-1563bo5-5"
134
- })(_ref6 => {
119
+ const ListItem = styled(OrderedListBase.Item)(_ref6 => {
135
120
  let {
136
121
  listItemMarkerFontSize,
137
122
  listItemMarkerLineHeight,
@@ -155,10 +140,7 @@ const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
155
140
  paddingLeft: listItemPaddingLeft
156
141
  };
157
142
  });
158
- const CloseButton = /*#__PURE__*/styled.button.withConfig({
159
- displayName: "Footnote__CloseButton",
160
- componentId: "components-web__sc-1563bo5-6"
161
- })(_ref7 => {
143
+ const CloseButton = styled.button(_ref7 => {
162
144
  let {
163
145
  closeButtonBorder,
164
146
  closeButtonHeight,
@@ -179,10 +161,7 @@ const CloseButton = /*#__PURE__*/styled.button.withConfig({
179
161
  width: closeButtonWidth
180
162
  };
181
163
  });
182
- const ContentContainer = /*#__PURE__*/styled.div.withConfig({
183
- displayName: "Footnote__ContentContainer",
184
- componentId: "components-web__sc-1563bo5-7"
185
- })({
164
+ const ContentContainer = styled.div({
186
165
  'margin-left': 'auto',
187
166
  'margin-right': 'auto',
188
167
  left: 0,
@@ -196,10 +175,7 @@ const ContentContainer = /*#__PURE__*/styled.div.withConfig({
196
175
  width: maxWidth
197
176
  };
198
177
  });
199
- const StyledCustomContentContainer = /*#__PURE__*/styled.div.withConfig({
200
- displayName: "Footnote__StyledCustomContentContainer",
201
- componentId: "components-web__sc-1563bo5-8"
202
- })(_ref9 => {
178
+ const StyledCustomContentContainer = styled.div(_ref9 => {
203
179
  let {
204
180
  listItemColor,
205
181
  listItemFontSize,
@@ -1,15 +1,14 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
3
  import { applyTextStyles, selectSystemProps, useCopy, useThemeTokens, variantProp } from '@telus-uds/components-base';
5
4
  import dictionary from './dictionary';
6
- import { htmlAttrs } from '../utils';
5
+ import { htmlAttrs, styledComponents } from '../utils';
7
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
+ const {
8
+ styled
9
+ } = styledComponents;
8
10
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
9
- const StyledSup = /*#__PURE__*/styled.sup.withConfig({
10
- displayName: "FootnoteLink__StyledSup",
11
- componentId: "components-web__sc-17nd7xo-0"
12
- })(_ref => {
11
+ const StyledSup = styled.sup(_ref => {
13
12
  let {
14
13
  fontSize,
15
14
  lineHeight,
@@ -1,18 +1,17 @@
1
1
  var _withLinkRouter$propT, _withLinkRouter$propT2, _withLinkRouter$propT3, _withLinkRouter$propT4;
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { selectSystemProps, StackView, Typography, useResponsiveProp, withLinkRouter } from '@telus-uds/components-base';
5
- import styled from 'styled-components';
6
- import { htmlAttrs } from '../utils';
4
+ import { selectSystemProps, StackView, Typography, useHash, useInputValue, useResponsiveProp, withLinkRouter } from '@telus-uds/components-base';
5
+ import { htmlAttrs, scrollToAnchor, styledComponents } from '../utils';
7
6
  import NavigationItem from './NavigationItem';
8
7
  import NavigationSubMenu from './NavigationSubMenu';
9
8
  import collapseItems from './collapseItems';
10
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const {
11
+ styled
12
+ } = styledComponents;
11
13
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
12
- const Heading = /*#__PURE__*/styled.div.withConfig({
13
- displayName: "NavigationBar__Heading",
14
- componentId: "components-web__sc-1vis1gt-0"
15
- })({
14
+ const Heading = styled.div({
16
15
  alignItems: 'center',
17
16
  display: 'flex',
18
17
  flex: 1,
@@ -33,18 +32,56 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
33
32
  heading,
34
33
  headingLevel = 'h1',
35
34
  items,
36
- onChange = () => {},
35
+ onChange,
37
36
  selectedId,
37
+ value,
38
38
  LinkRouter,
39
39
  linkRouterProps,
40
40
  ...rest
41
41
  } = _ref;
42
+ const {
43
+ currentValue,
44
+ setValue
45
+ } = useInputValue({
46
+ value,
47
+ initialValue: selectedId,
48
+ onChange
49
+ });
50
+ useHash((hash, event) => {
51
+ let hashItem = hash && items.find(_ref2 => {
52
+ let {
53
+ href
54
+ } = _ref2;
55
+ return hash === href;
56
+ });
57
+ if (!hashItem) {
58
+ const parentItem = items.find(_ref3 => {
59
+ let {
60
+ items: parentItems
61
+ } = _ref3;
62
+ return parentItems === null || parentItems === void 0 ? void 0 : parentItems.some(_ref4 => {
63
+ let {
64
+ href
65
+ } = _ref4;
66
+ return hash === href;
67
+ });
68
+ });
69
+ hashItem = parentItem === null || parentItem === void 0 ? void 0 : parentItem.items.find(_ref5 => {
70
+ let {
71
+ href
72
+ } = _ref5;
73
+ return hash === href;
74
+ });
75
+ }
76
+ const hashId = hashItem && (hashItem.id || hashItem.label);
77
+ if (hashId) setValue(hashId, event);
78
+ }, [items, setValue]);
42
79
  const direction = useResponsiveProp({
43
80
  xs: 'column',
44
81
  sm: 'row'
45
82
  });
46
83
  const itemsForViewport = useResponsiveProp({
47
- xs: collapseItems(items, selectedId),
84
+ xs: collapseItems(items, currentValue),
48
85
  lg: items
49
86
  });
50
87
  const openOverlayRef = React.useRef(null);
@@ -118,7 +155,7 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
118
155
  heading: headingLevel,
119
156
  children: heading
120
157
  })
121
- }), itemsForViewport === null || itemsForViewport === void 0 ? void 0 : itemsForViewport.map((_ref2, index) => {
158
+ }), itemsForViewport === null || itemsForViewport === void 0 ? void 0 : itemsForViewport.map((_ref6, index) => {
122
159
  let {
123
160
  href,
124
161
  label,
@@ -129,38 +166,50 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
129
166
  linkRouterProps: itemLinkRouterProps,
130
167
  items: nestedItems,
131
168
  ...itemRest
132
- } = _ref2;
169
+ } = _ref6;
133
170
  const itemId = id ?? label;
134
171
  const handleClick = event => {
135
172
  if (nestedItems) {
136
173
  setOpenSubMenuId(openSubMenuId !== itemId ? itemId : null);
174
+ return;
175
+ }
176
+ if (href !== null && href !== void 0 && href.startsWith('#')) {
177
+ scrollToAnchor(href, event, () => setValue(itemId, event));
178
+ } else {
179
+ setValue(itemId, event);
137
180
  }
138
181
  onClick === null || onClick === void 0 || onClick(event);
139
- onChange === null || onChange === void 0 || onChange(itemId, event);
140
182
  };
141
183
  const ItemComponent = nestedItems ? NavigationSubMenu : NavigationItem;
142
184
  const isOpen = itemId === openSubMenuId;
185
+ const scrollableNestedItems = (nestedItems === null || nestedItems === void 0 ? void 0 : nestedItems.map(item => ({
186
+ ...item,
187
+ onPress: event => {
188
+ const nestedItemId = item.id ?? item.label;
189
+ scrollToAnchor(item.href, event, () => setValue(nestedItemId, event));
190
+ }
191
+ }))) ?? nestedItems;
143
192
  return /*#__PURE__*/_jsx(ItemComponent, {
144
193
  ref: itemRef,
145
194
  href: href,
146
195
  onClick: handleClick
147
196
  // TODO: refactor to pass selected ID via context
148
197
  ,
149
- selectedId: selectedId,
198
+ selectedId: currentValue,
150
199
  index: index,
151
200
  LinkRouter: ItemLinkRouter,
152
201
  linkRouterProps: {
153
202
  ...linkRouterProps,
154
203
  ...itemLinkRouterProps
155
204
  },
156
- items: nestedItems,
157
- selected: itemId === selectedId,
205
+ items: scrollableNestedItems,
206
+ selected: itemId === currentValue,
158
207
  itemsContainerRef: itemsRef,
159
208
  ...itemRest,
160
- ...(nestedItems && {
209
+ ...(scrollableNestedItems && {
161
210
  isOpen
162
211
  }),
163
- ...(nestedItems && isOpen && {
212
+ ...(scrollableNestedItems && isOpen && {
164
213
  openOverlayRef
165
214
  }),
166
215
  children: label
@@ -177,7 +226,7 @@ NavigationBar.propTypes = {
177
226
  *
178
227
  * Each `item` object must contain:
179
228
  * - `heading` - user-facing text in the tab link
180
- * - `href` - the URL of the page linked to. Do not use hash links, for content within a page, use `Tabs`.
229
+ * - `href` - the URL of the page linked to.
181
230
  * - `id` - a stable, unique identifier of the page within the set. Not written into the HTML.
182
231
  */
183
232
  items: PropTypes.arrayOf(PropTypes.shape({
@@ -208,13 +257,17 @@ NavigationBar.propTypes = {
208
257
  */
209
258
  headingLevel: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
210
259
  /**
211
- * Matches the `id` property of the item in `items` corresponding to the current page
260
+ * Initial selected item ID
212
261
  */
213
- selectedId: PropTypes.string.isRequired,
262
+ selectedId: PropTypes.string,
214
263
  /**
215
264
  * Optional function to be called on pressing a link
216
265
  */
217
266
  onChange: PropTypes.func,
267
+ /**
268
+ * Controlled value for selected item ID
269
+ */
270
+ value: PropTypes.string,
218
271
  /**
219
272
  * Accesibility role for stackview
220
273
  */
@@ -1,15 +1,14 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Button, selectSystemProps, useResponsiveProp, useViewport, useThemeTokensCallback, getTokensPropType } from '@telus-uds/components-base';
4
- import styled from 'styled-components';
5
- import { htmlAttrs } from '../utils';
4
+ import { htmlAttrs, styledComponents } from '../utils';
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ const {
7
+ styled
8
+ } = styledComponents;
7
9
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
8
10
  const defaultMaxWidth = 192;
9
- const ItemContainer = /*#__PURE__*/styled.div.withConfig({
10
- displayName: "NavigationItem__ItemContainer",
11
- componentId: "components-web__sc-ql9x7c-0"
12
- })(_ref => {
11
+ const ItemContainer = styled.div(_ref => {
13
12
  let {
14
13
  targetWidth
15
14
  } = _ref;
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
3
  import { applyTextStyles, getTokensPropType, selectSystemProps, StackView, Typography, useTheme, useThemeTokens, wrapStringsInText } from '@telus-uds/components-base';
5
4
  import ItemBase from './ItemBase';
6
- import { htmlAttrs } from '../utils';
5
+ import { htmlAttrs, styledComponents } from '../utils';
7
6
  import { OL_COUNTER_NAME } from './constants';
8
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const {
9
+ styled
10
+ } = styledComponents;
9
11
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
10
12
  const selectItemTextStyles = (_ref, themeOptions) => {
11
13
  let {
@@ -25,10 +27,7 @@ const selectItemTextStyles = (_ref, themeOptions) => {
25
27
  lineHeight: itemLineHeight
26
28
  });
27
29
  };
28
- const StyledItemBase = /*#__PURE__*/styled(ItemBase).withConfig({
29
- displayName: "Item__StyledItemBase",
30
- componentId: "components-web__sc-7jzwcq-0"
31
- })(_ref2 => {
30
+ const StyledItemBase = styled(ItemBase)(_ref2 => {
32
31
  let {
33
32
  interItemMargin,
34
33
  itemBulletContainerWidth,
@@ -67,13 +66,10 @@ const StyledItemBase = /*#__PURE__*/styled(ItemBase).withConfig({
67
66
  }
68
67
  };
69
68
  });
70
- const ItemContent = /*#__PURE__*/styled.div.withConfig({
71
- displayName: "Item__ItemContent",
72
- componentId: "components-web__sc-7jzwcq-1"
73
- })({
69
+ const ItemContent = styled.div({
74
70
  display: 'flex',
75
71
  flexDirection: 'column',
76
- gap: 5
72
+ gap: 0
77
73
  });
78
74
  const Item = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
79
75
  let {
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import { styledComponents } from '../utils';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
- const StyledItem = /*#__PURE__*/styled.li.withConfig({
6
- displayName: "ItemBase__StyledItem",
7
- componentId: "components-web__sc-o0oiv5-0"
8
- })({
5
+ const {
6
+ styled
7
+ } = styledComponents;
8
+ const StyledItem = styled.li({
9
9
  display: 'flex'
10
10
  });
11
11
  const Item = _ref => {
@@ -1,17 +1,16 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
3
  import { getTokensPropType, selectSystemProps, variantProp } from '@telus-uds/components-base';
5
- import { htmlAttrs } from '../utils';
4
+ import { htmlAttrs, styledComponents } from '../utils';
6
5
  import OrderedListBase from './OrderedListBase';
7
6
  import Item from './Item';
8
7
  import { OL_COUNTER_NAME } from './constants';
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
+ const {
10
+ styled
11
+ } = styledComponents;
10
12
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
11
- const StyledOrderedListBase = /*#__PURE__*/styled(OrderedListBase).withConfig({
12
- displayName: "OrderedList__StyledOrderedListBase",
13
- componentId: "components-web__sc-t5az8z-0"
14
- })(_ref => {
13
+ const StyledOrderedListBase = styled(OrderedListBase)(_ref => {
15
14
  let {
16
15
  start
17
16
  } = _ref;
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import { styledComponents } from '../utils';
4
4
  import ItemBase from './ItemBase';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- const StyledList = /*#__PURE__*/styled.ol.withConfig({
7
- displayName: "OrderedListBase__StyledList",
8
- componentId: "components-web__sc-4m9lgj-0"
9
- })({
6
+ const {
7
+ styled
8
+ } = styledComponents;
9
+ const StyledList = styled.ol({
10
10
  display: 'flex',
11
11
  flexDirection: 'column',
12
12
  listStylePosition: 'inside',
@@ -1,19 +1,20 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
3
  import { getTokensPropType, selectSystemProps } from '@telus-uds/components-base';
5
- import { htmlAttrs, useTypographyTheme } from '../utils';
4
+ import { htmlAttrs, useTypographyTheme, styledComponents } from '../utils';
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ const {
7
+ styled
8
+ } = styledComponents;
7
9
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
8
- const StyledParagraph = /*#__PURE__*/styled.p.withConfig({
9
- displayName: "Paragraph__StyledParagraph",
10
- componentId: "components-web__sc-1bg9r8p-0"
11
- })(["", " ", " &:first-child{margin-block-start:0em;}&:last-child{margin-block-end:0em;}"], _ref => {
10
+ const StyledParagraph = styled.p`
11
+ ${_ref => {
12
12
  let {
13
13
  align
14
14
  } = _ref;
15
15
  return align ? `text-align: ${align};` : '';
16
- }, _ref2 => {
16
+ }}
17
+ ${_ref2 => {
17
18
  let {
18
19
  linesBetween
19
20
  } = _ref2;
@@ -21,7 +22,14 @@ const StyledParagraph = /*#__PURE__*/styled.p.withConfig({
21
22
  margin-block-start: ${linesBetween}em;
22
23
  margin-block-end: ${linesBetween}em;
23
24
  `;
24
- });
25
+ }}
26
+ &:first-child {
27
+ margin-block-start: 0em;
28
+ }
29
+ &:last-child {
30
+ margin-block-end: 0em;
31
+ }
32
+ `;
25
33
 
26
34
  /**
27
35
  * Block text as an HTML ```<p>``` element.
@@ -2,20 +2,20 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import omit from 'lodash.omit';
4
4
  import { Box, getThemeTokens, hrefAttrsProp, PressableCardBase, selectSystemProps, Spacer, StackView, Typography, a11yProps, focusHandlerProps, viewProps, withLinkRouter, useTheme, getTokensPropType } from '@telus-uds/components-base';
5
- import styled from 'styled-components';
5
+ import { styledComponents } from '../utils';
6
6
  import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
7
7
  import AuthorDate from './AuthorDate';
8
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
9
+ const {
10
+ styled
11
+ } = styledComponents;
8
12
 
9
13
  // Passes React Native-oriented system props through UDS PressableCardBase
10
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
11
14
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, viewProps]);
12
15
 
13
16
  // Stop changes to the card's inner border width causing the size and
14
17
  // apparent position of the full bleed image to change.
15
- const FullBleedOffsetOuter = /*#__PURE__*/styled.div.withConfig({
16
- displayName: "PreviewCard__FullBleedOffsetOuter",
17
- componentId: "components-web__sc-1yfz4de-0"
18
- })(_ref => {
18
+ const FullBleedOffsetOuter = styled.div(_ref => {
19
19
  let {
20
20
  borderOffset
21
21
  } = _ref;
@@ -24,10 +24,7 @@ const FullBleedOffsetOuter = /*#__PURE__*/styled.div.withConfig({
24
24
  marginTop: borderOffset * 2
25
25
  };
26
26
  });
27
- const FullBleedOffsetInner = /*#__PURE__*/styled.div.withConfig({
28
- displayName: "PreviewCard__FullBleedOffsetInner",
29
- componentId: "components-web__sc-1yfz4de-1"
30
- })(_ref2 => {
27
+ const FullBleedOffsetInner = styled.div(_ref2 => {
31
28
  let {
32
29
  borderOffset
33
30
  } = _ref2;