@telus-uds/components-base 1.37.0 → 1.38.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,24 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Mon, 24 Apr 2023 21:33:59 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 27 Apr 2023 14:32:16 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.38.0
8
+
9
+ Thu, 27 Apr 2023 14:32:16 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - add a new button variant to support responsive width across the different viewports (guillermo.peitzner@telus.com)
14
+ - export use theme call back (mauricio.batresmontejo@telus.com)
15
+ - standarization of activity indicator (ignacio.cuyun@telus.com)
16
+ - conditionally render Icon based on it being defined (kyle.king2@telus.com)
17
+ - Bump @telus-uds/system-theme-tokens to v2.23.0
18
+
7
19
  ## 1.37.0
8
20
 
9
- Mon, 24 Apr 2023 21:33:59 GMT
21
+ Mon, 24 Apr 2023 21:42:02 GMT
10
22
 
11
23
  ### Minor changes
12
24
 
@@ -1,23 +1,27 @@
1
1
  {
2
2
  "schema": {
3
3
  "components": {
4
- "Toast": {
5
- "containerBackgroundColor": "color",
6
- "containerGap": "size",
7
- "animationHeightBefore": "size",
8
- "animationHeightAfter": "size",
9
- "animationPaddingBottomBefore": "size",
10
- "animationPaddingBottomAfter": "size",
11
- "animationPaddingTopBefore": "size",
12
- "animationPaddingTopAfter": "size",
13
- "animationBackgroundColorBefore": "color",
14
- "animationBackgroundColorAfter": "color",
15
- "animationColorBefore": "color",
16
- "animationColorAfter": "color",
17
- "animationDivColorBefore": "color",
18
- "animationDivColorAfter": "color",
19
- "animationFillColorBefore": "color",
20
- "animationFillColorAfter": "color"
4
+ "SplashButton": {
5
+ "playIcon": "icon",
6
+ "playIconColor": "color",
7
+ "buttonContentBackground": "color",
8
+ "buttonContentChildrenBackground": "color"
9
+ },
10
+ "SplashButtonWithDetails": {
11
+ "playIcon": "icon",
12
+ "playIconColor": "color",
13
+ "buttonContentBackground": "color",
14
+ "buttonContentChildrenBackground": "color",
15
+ "buttonBackground": "color",
16
+ "buttonBorderColor": "color",
17
+ "buttonRadius": "radius",
18
+ "buttonLeftPosition": "size",
19
+ "buttonBottomPosition": "size",
20
+ "buttonMinHeight": "size",
21
+ "buttonPaddingLeft": "size",
22
+ "buttonPaddingRight": "size",
23
+ "detailsContainerPadding": "size",
24
+ "playIconContainerBackground": "color"
21
25
  },
22
26
  "Table": {
23
27
  "tablePaddingBottom": "size",
@@ -41,6 +45,69 @@
41
45
  "size": "size",
42
46
  "thickness": "border"
43
47
  },
48
+ "Video": {
49
+ "borderColor": "color",
50
+ "pauseIcon": "icon",
51
+ "replayIcon": "icon",
52
+ "playIcon": "icon"
53
+ },
54
+ "VideoMiddleControlButton": {
55
+ "width": "size",
56
+ "height": "size",
57
+ "background": "color",
58
+ "iconColor": "color"
59
+ },
60
+ "VideoControlBar": {
61
+ "paddingTop": "size",
62
+ "paddingBottom": "size",
63
+ "paddingLeft": "size",
64
+ "paddingRight": "size",
65
+ "paddingLeftCompactMode": "size",
66
+ "paddingRightCompactMode": "size",
67
+ "menuBottom": "size",
68
+ "menuRight": "size",
69
+ "menuMarginLeft": "size",
70
+ "captionsIcon": "icon",
71
+ "settingsIcon": "icon",
72
+ "minimizeIcon": "icon",
73
+ "maximizeIcon": "icon"
74
+ },
75
+ "VideoButton": {
76
+ "color": "color"
77
+ },
78
+ "VideoMenu": {
79
+ "padding": "size",
80
+ "background": "color",
81
+ "checkMarkWidth": "size",
82
+ "checkMarkHeight": "size",
83
+ "checkMarkSelectedColor": "color",
84
+ "checkMarkHoverColor": "color",
85
+ "checkMarkFocusColor": "color",
86
+ "checkMarkUnselectedColor": "color",
87
+ "checkMarkIcon": "icon"
88
+ },
89
+ "VideoProgressBar": {
90
+ "thumbHeight": "size",
91
+ "thumbWidth": "size",
92
+ "thumbBackground": "color",
93
+ "timestampMarginLeft": "size",
94
+ "timestampMarginRight": "size",
95
+ "trackGradientStart": "color",
96
+ "trackGradientEnd": "color",
97
+ "rangeBackground": "color"
98
+ },
99
+ "VideoVolumeSlider": {
100
+ "marginLeft": "size",
101
+ "marginRight": "size",
102
+ "thumbHeight": "size",
103
+ "thumbWidth": "size",
104
+ "thumbBackground": "color",
105
+ "trackGradientStart": "color",
106
+ "trackGradientEnd": "color",
107
+ "rangeBackground": "color",
108
+ "mutedIcon": "icon",
109
+ "unmutedIcon": "icon"
110
+ },
44
111
  "Callout": {
45
112
  "background": "color",
46
113
  "gap": "size",
@@ -61,6 +128,19 @@
61
128
  "itemBorderColor": "color",
62
129
  "itemPadding": "size"
63
130
  },
131
+ "QuantitySelector": {
132
+ "leftIcon": "icon",
133
+ "rightIcon": "icon",
134
+ "iconSize": "size",
135
+ "borderColor": "color",
136
+ "inputBorderColor": "color",
137
+ "inputBackgroundColor": "color",
138
+ "inputBorderWidth": "size",
139
+ "padding": "size",
140
+ "backgroundColor": "color",
141
+ "textColor": "color",
142
+ "iconColor": "color"
143
+ },
64
144
  "Footnote": {
65
145
  "footnoteBackground": "color",
66
146
  "footnoteBorderTopSizeMd": "border",
@@ -1089,6 +1169,26 @@
1089
1169
  "paddingVertical": "size",
1090
1170
  "borderRadius": "radius"
1091
1171
  },
1172
+ "StoryCard": {
1173
+ "outerBorderColor": "color",
1174
+ "outerBorderGap": "size",
1175
+ "outerBorderWidth": "border",
1176
+ "flex": "integer",
1177
+ "backgroundColor": "color",
1178
+ "borderColor": "color",
1179
+ "borderRadius": "radius",
1180
+ "borderWidth": "border",
1181
+ "paddingBottom": "size",
1182
+ "paddingLeft": "size",
1183
+ "paddingRight": "size",
1184
+ "paddingTop": "size",
1185
+ "minWidth": "size",
1186
+ "shadow": "shadow",
1187
+ "contentAlignItems": "flexAlign",
1188
+ "contentJustifyContent": "flexJustifyContent",
1189
+ "contentFlexGrow": "integer",
1190
+ "contentFlexShrink": "integer"
1191
+ },
1092
1192
  "Tabs": {
1093
1193
  "nextIcon": "icon",
1094
1194
  "previousIcon": "icon",
@@ -1166,6 +1266,55 @@
1166
1266
  "outerBorderGap": "size",
1167
1267
  "outerBackgroundColor": "color"
1168
1268
  },
1269
+ "Testimonial": {
1270
+ "testimonialContainerGap": "size",
1271
+ "quoteContainerGap": "size",
1272
+ "iconColor": "color",
1273
+ "dividerBorder": "border",
1274
+ "dividerBackgroundColor": "color",
1275
+ "figcaptionGap": "size",
1276
+ "textColor": "color",
1277
+ "imageSize": "size",
1278
+ "icon": "icon"
1279
+ },
1280
+ "TermsAndConditions": {
1281
+ "contentPaddingBottom": "size",
1282
+ "contentPaddingLeft": "size",
1283
+ "mdContentPaddingBottom": "size",
1284
+ "mdContentPaddingLeft": "size",
1285
+ "orderedPadding": "size",
1286
+ "unorderedPadding": "size",
1287
+ "listFontName": "fontName",
1288
+ "listFontWeight": "fontWeight",
1289
+ "listFontSize": "fontSize",
1290
+ "listLineHeight": "lineHeight",
1291
+ "listColor": "color",
1292
+ "listMarginBottom": "size",
1293
+ "listMarginLeft": "size",
1294
+ "titleColor": "color",
1295
+ "titleFontSize": "fontSize",
1296
+ "titleLineHeight": "lineHeight",
1297
+ "titlePaddingLeft": "size",
1298
+ "expandIconContainerBorder": "border",
1299
+ "expandIconContainerBorderColor": "color",
1300
+ "expandIconContainerHeight": "size",
1301
+ "expandIconContainerMarginX": "size",
1302
+ "expandIconContainerMarginY": "size",
1303
+ "expandIconContainerWidth": "size",
1304
+ "expandIconContainerAlignItems": "flexAlign",
1305
+ "expandIconContainerJustifyContent": "flexJustifyContent",
1306
+ "expandTitleColor": "color",
1307
+ "expandTitleFontSize": "size",
1308
+ "expandTitleLineHeight": "lineHeight",
1309
+ "expandTitleMarginX": "size",
1310
+ "expandTitleMarginY": "size",
1311
+ "expandBaseBorderWidth": "border",
1312
+ "expandContentPaddingBottom": "size",
1313
+ "expandContentPaddingLeft": "size",
1314
+ "expandContentPaddingRight": "size",
1315
+ "expandContentPaddingTop": "size",
1316
+ "icon": "icon"
1317
+ },
1169
1318
  "TextArea": {
1170
1319
  "minLines": "integer",
1171
1320
  "maxLines": "integer"
@@ -1197,6 +1346,24 @@
1197
1346
  "iconSize": "size",
1198
1347
  "iconColor": "color"
1199
1348
  },
1349
+ "Toast": {
1350
+ "containerBackgroundColor": "color",
1351
+ "containerGap": "size",
1352
+ "animationHeightBefore": "size",
1353
+ "animationHeightAfter": "size",
1354
+ "animationPaddingBottomBefore": "size",
1355
+ "animationPaddingBottomAfter": "size",
1356
+ "animationPaddingTopBefore": "size",
1357
+ "animationPaddingTopAfter": "size",
1358
+ "animationBackgroundColorBefore": "color",
1359
+ "animationBackgroundColorAfter": "color",
1360
+ "animationColorBefore": "color",
1361
+ "animationColorAfter": "color",
1362
+ "animationDivColorBefore": "color",
1363
+ "animationDivColorAfter": "color",
1364
+ "animationFillColorBefore": "color",
1365
+ "animationFillColorAfter": "color"
1366
+ },
1200
1367
  "ToggleSwitch": {
1201
1368
  "borderColor": "color",
1202
1369
  "borderWidth": "border",
@@ -1304,6 +1471,22 @@
1304
1471
  "fontScaleCap": "fontSize",
1305
1472
  "letterSpacing": "letterSpacing"
1306
1473
  },
1474
+ "Countdown": {
1475
+ "containerBorderRadius": "radius",
1476
+ "containerGradient": "gradient",
1477
+ "containerInverseBorder": "border",
1478
+ "containerInverseBorderColor": "color",
1479
+ "containerPaddingBottomTop": "size",
1480
+ "containerPaddingLeftRight": "size",
1481
+ "inverseBorderColor": "color",
1482
+ "labelBorderColor": "color",
1483
+ "textFontSize": "fontSize",
1484
+ "textLineHeight": "lineHeight",
1485
+ "labelFontSize": "fontSize",
1486
+ "labelLineHeight": "lineHeight",
1487
+ "textTimerFontWeight": "fontWeight",
1488
+ "textTimerFontName": "fontName"
1489
+ },
1307
1490
  "Skeleton": {
1308
1491
  "color": "color",
1309
1492
  "size": "size",
@@ -1328,6 +1511,18 @@
1328
1511
  "type": "state"
1329
1512
  }
1330
1513
  },
1514
+ "SplashButton": {
1515
+ "hover": {
1516
+ "description": "Currently web only. Applies when an interactive component's hover handler is triggered, such as on mouseover.",
1517
+ "values": [
1518
+ true
1519
+ ],
1520
+ "type": "state",
1521
+ "platforms": [
1522
+ "rn"
1523
+ ]
1524
+ }
1525
+ },
1331
1526
  "Button": {
1332
1527
  "focus": {
1333
1528
  "description": "Currently only web has good support for this. Applies when an interactive component's focus handler is triggered, such as keyboard tabbing or selection.",
@@ -1967,6 +2162,41 @@
1967
2162
  "type": "state"
1968
2163
  }
1969
2164
  },
2165
+ "QuantitySelector": {
2166
+ "focus": {
2167
+ "description": "Currently only web has good support for this. Applies when an interactive component's focus handler is triggered, such as keyboard tabbing or selection.",
2168
+ "values": [
2169
+ true
2170
+ ],
2171
+ "type": "state",
2172
+ "platforms": [
2173
+ "rn"
2174
+ ]
2175
+ },
2176
+ "hover": {
2177
+ "description": "Currently web only. Applies when an interactive component's hover handler is triggered, such as on mouseover.",
2178
+ "values": [
2179
+ true
2180
+ ],
2181
+ "type": "state",
2182
+ "platforms": [
2183
+ "rn"
2184
+ ]
2185
+ },
2186
+ "disabled": {
2187
+ "values": [
2188
+ true
2189
+ ],
2190
+ "type": "state"
2191
+ },
2192
+ "pressed": {
2193
+ "description": "Applies while an interactive component is being physically pressed. Most visible on touchscreen taps; in React Native Web, this is visible on web mouse clicks only if the pressable is held down.",
2194
+ "values": [
2195
+ true
2196
+ ],
2197
+ "type": "state"
2198
+ }
2199
+ },
1970
2200
  "Radio": {
1971
2201
  "checked": {
1972
2202
  "description": "Corresponds to a selected state for a checkbox or radio",
@@ -2219,6 +2449,35 @@
2219
2449
  "type": "state"
2220
2450
  }
2221
2451
  },
2452
+ "StoryCard": {
2453
+ "focus": {
2454
+ "description": "Currently only web has good support for this. Applies when an interactive component's focus handler is triggered, such as keyboard tabbing or selection.",
2455
+ "values": [
2456
+ true
2457
+ ],
2458
+ "type": "state",
2459
+ "platforms": [
2460
+ "rn"
2461
+ ]
2462
+ },
2463
+ "hover": {
2464
+ "description": "Currently web only. Applies when an interactive component's hover handler is triggered, such as on mouseover.",
2465
+ "values": [
2466
+ true
2467
+ ],
2468
+ "type": "state",
2469
+ "platforms": [
2470
+ "rn"
2471
+ ]
2472
+ },
2473
+ "pressed": {
2474
+ "description": "Applies while an interactive component is being physically pressed. Most visible on touchscreen taps; in React Native Web, this is visible on web mouse clicks only if the pressable is held down.",
2475
+ "values": [
2476
+ true
2477
+ ],
2478
+ "type": "state"
2479
+ }
2480
+ },
2222
2481
  "TabsItem": {
2223
2482
  "focus": {
2224
2483
  "description": "Currently only web has good support for this. Applies when an interactive component's focus handler is triggered, such as keyboard tabbing or selection.",
@@ -2332,6 +2591,15 @@
2332
2591
  "type": "state"
2333
2592
  }
2334
2593
  },
2594
+ "TermsAndConditions": {
2595
+ "expanded": {
2596
+ "description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
2597
+ "values": [
2598
+ true
2599
+ ],
2600
+ "type": "state"
2601
+ }
2602
+ },
2335
2603
  "ToggleSwitch": {
2336
2604
  "focus": {
2337
2605
  "description": "Currently only web has good support for this. Applies when an interactive component's focus handler is triggered, such as keyboard tabbing or selection.",
@@ -70,6 +70,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
70
70
  r: "20",
71
71
  strokeDasharray: reduceMotion ? MAX_SVG_LENGTH : [MIN_SVG_LENGTH, SVG_CIRCUMFERENCE],
72
72
  strokeDashoffset: 0,
73
+ vectorEffect: "non-scaling-stroke",
73
74
  children: reduceMotion ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
74
75
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
75
76
  attributeName: "stroke-dashoffset",
@@ -15,6 +15,8 @@ var _ThemeProvider = require("../ThemeProvider");
15
15
 
16
16
  var _props = require("../utils/props");
17
17
 
18
+ var _ViewportProvider = require("../ViewportProvider");
19
+
18
20
  var _jsxRuntime = require("react/jsx-runtime");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -30,7 +32,12 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
30
32
  variant,
31
33
  ...props
32
34
  } = _ref;
33
- const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('Button', tokens, variant);
35
+ const viewport = (0, _ViewportProvider.useViewport)();
36
+ const buttonVariant = {
37
+ viewport,
38
+ ...variant
39
+ };
40
+ const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('Button', tokens, buttonVariant);
34
41
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, { ...props,
35
42
  tokens: getTokens,
36
43
  accessibilityRole: accessibilityRole,
@@ -15,6 +15,8 @@ var _props = require("../utils/props");
15
15
 
16
16
  var _ThemeProvider = require("../ThemeProvider");
17
17
 
18
+ var _ViewportProvider = require("../ViewportProvider");
19
+
18
20
  var _jsxRuntime = require("react/jsx-runtime");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -41,7 +43,12 @@ const ButtonLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
41
43
  rest
42
44
  } = _props.hrefAttrsProp.bundle(props);
43
45
 
44
- const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('Button', tokens, variant);
46
+ const viewport = (0, _ViewportProvider.useViewport)();
47
+ const buttonVariant = {
48
+ viewport,
49
+ ...variant
50
+ };
51
+ const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('Button', tokens, buttonVariant);
45
52
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
46
53
  ref: ref,
47
54
  accessibilityRole: accessibilityRole,
package/lib/index.js CHANGED
@@ -60,6 +60,7 @@ var _exportNames = {
60
60
  useTheme: true,
61
61
  useSetTheme: true,
62
62
  useThemeTokens: true,
63
+ useThemeTokensCallback: true,
63
64
  getThemeTokens: true,
64
65
  applyOuterBorder: true,
65
66
  applyTextStyles: true,
@@ -426,6 +427,12 @@ Object.defineProperty(exports, "useThemeTokens", {
426
427
  return _ThemeProvider.useThemeTokens;
427
428
  }
428
429
  });
430
+ Object.defineProperty(exports, "useThemeTokensCallback", {
431
+ enumerable: true,
432
+ get: function () {
433
+ return _ThemeProvider.useThemeTokensCallback;
434
+ }
435
+ });
429
436
  Object.defineProperty(exports, "useViewport", {
430
437
  enumerable: true,
431
438
  get: function () {
@@ -57,6 +57,7 @@ const Spinner = /*#__PURE__*/forwardRef((_ref, ref) => {
57
57
  r: "20",
58
58
  strokeDasharray: reduceMotion ? MAX_SVG_LENGTH : [MIN_SVG_LENGTH, SVG_CIRCUMFERENCE],
59
59
  strokeDashoffset: 0,
60
+ vectorEffect: "non-scaling-stroke",
60
61
  children: reduceMotion ? null : /*#__PURE__*/_jsxs(_Fragment, {
61
62
  children: [/*#__PURE__*/_jsx("animate", {
62
63
  attributeName: "stroke-dashoffset",
@@ -3,6 +3,7 @@ import ButtonBase from './ButtonBase';
3
3
  import buttonPropTypes, { textAndA11yText } from './propTypes';
4
4
  import { useThemeTokensCallback } from '../ThemeProvider';
5
5
  import { a11yProps } from '../utils/props';
6
+ import { useViewport } from '../ViewportProvider';
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
8
9
  let {
@@ -11,7 +12,12 @@ const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
11
12
  variant,
12
13
  ...props
13
14
  } = _ref;
14
- const getTokens = useThemeTokensCallback('Button', tokens, variant);
15
+ const viewport = useViewport();
16
+ const buttonVariant = {
17
+ viewport,
18
+ ...variant
19
+ };
20
+ const getTokens = useThemeTokensCallback('Button', tokens, buttonVariant);
15
21
  return /*#__PURE__*/_jsx(ButtonBase, { ...props,
16
22
  tokens: getTokens,
17
23
  accessibilityRole: accessibilityRole,
@@ -3,6 +3,7 @@ import ButtonBase from './ButtonBase';
3
3
  import buttonPropTypes, { textAndA11yText } from './propTypes';
4
4
  import { a11yProps, hrefAttrsProp, linkProps } from '../utils/props';
5
5
  import { useThemeTokensCallback } from '../ThemeProvider';
6
+ import { useViewport } from '../ViewportProvider';
6
7
  /**
7
8
  * `ButtonLink` is a component with the semantics and behaviour of a link, but with the visual appearance of a button.
8
9
  * ButtonLink is a block-level component and should not be used inline.
@@ -21,7 +22,12 @@ const ButtonLink = /*#__PURE__*/forwardRef((_ref, ref) => {
21
22
  hrefAttrs,
22
23
  rest
23
24
  } = hrefAttrsProp.bundle(props);
24
- const getTokens = useThemeTokensCallback('Button', tokens, variant);
25
+ const viewport = useViewport();
26
+ const buttonVariant = {
27
+ viewport,
28
+ ...variant
29
+ };
30
+ const getTokens = useThemeTokensCallback('Button', tokens, buttonVariant);
25
31
  return /*#__PURE__*/_jsx(ButtonBase, {
26
32
  ref: ref,
27
33
  accessibilityRole: accessibilityRole,
@@ -54,6 +54,6 @@ export { default as BaseProvider } from './BaseProvider';
54
54
  export { useHydrationContext } from './BaseProvider/HydrationContext';
55
55
  export { default as Validator } from './Validator';
56
56
  export { default as ViewportProvider, useViewport, ViewportContext } from './ViewportProvider';
57
- export { default as ThemeProvider, useTheme, useSetTheme, useThemeTokens, getThemeTokens, applyOuterBorder, applyTextStyles, applyShadowToken } from './ThemeProvider';
57
+ export { default as ThemeProvider, useTheme, useSetTheme, useThemeTokens, useThemeTokensCallback, getThemeTokens, applyOuterBorder, applyTextStyles, applyShadowToken } from './ThemeProvider';
58
58
  export * from './utils';
59
59
  export { Portal } from '@gorhom/portal';
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "@floating-ui/react-native": "^0.8.1",
12
12
  "@gorhom/portal": "^1.0.14",
13
13
  "@telus-uds/system-constants": "^1.2.0",
14
- "@telus-uds/system-theme-tokens": "^2.22.0",
14
+ "@telus-uds/system-theme-tokens": "^2.23.0",
15
15
  "airbnb-prop-types": "^2.16.0",
16
16
  "lodash.debounce": "^4.0.8",
17
17
  "lodash.merge": "^4.6.2",
@@ -72,5 +72,5 @@
72
72
  "standard-engine": {
73
73
  "skip": true
74
74
  },
75
- "version": "1.37.0"
75
+ "version": "1.38.0"
76
76
  }
@@ -53,6 +53,7 @@ const Spinner = forwardRef(({ size, color, thickness, label, isStatic = false },
53
53
  r="20"
54
54
  strokeDasharray={reduceMotion ? MAX_SVG_LENGTH : [MIN_SVG_LENGTH, SVG_CIRCUMFERENCE]}
55
55
  strokeDashoffset={0}
56
+ vectorEffect="non-scaling-stroke"
56
57
  >
57
58
  {reduceMotion ? null : (
58
59
  <>
@@ -4,9 +4,12 @@ import ButtonBase from './ButtonBase'
4
4
  import buttonPropTypes, { textAndA11yText } from './propTypes'
5
5
  import { useThemeTokensCallback } from '../ThemeProvider'
6
6
  import { a11yProps } from '../utils/props'
7
+ import { useViewport } from '../ViewportProvider'
7
8
 
8
9
  const Button = forwardRef(({ accessibilityRole = 'button', tokens, variant, ...props }, ref) => {
9
- const getTokens = useThemeTokensCallback('Button', tokens, variant)
10
+ const viewport = useViewport()
11
+ const buttonVariant = { viewport, ...variant }
12
+ const getTokens = useThemeTokensCallback('Button', tokens, buttonVariant)
10
13
  return (
11
14
  <ButtonBase {...props} tokens={getTokens} accessibilityRole={accessibilityRole} ref={ref} />
12
15
  )
@@ -3,6 +3,7 @@ import ButtonBase from './ButtonBase'
3
3
  import buttonPropTypes, { textAndA11yText } from './propTypes'
4
4
  import { a11yProps, hrefAttrsProp, linkProps } from '../utils/props'
5
5
  import { useThemeTokensCallback } from '../ThemeProvider'
6
+ import { useViewport } from '../ViewportProvider'
6
7
 
7
8
  /**
8
9
  * `ButtonLink` is a component with the semantics and behaviour of a link, but with the visual appearance of a button.
@@ -11,7 +12,9 @@ import { useThemeTokensCallback } from '../ThemeProvider'
11
12
  const ButtonLink = forwardRef(
12
13
  ({ accessibilityRole = 'link', tokens, variant, dataSet, ...props }, ref) => {
13
14
  const { hrefAttrs, rest } = hrefAttrsProp.bundle(props)
14
- const getTokens = useThemeTokensCallback('Button', tokens, variant)
15
+ const viewport = useViewport()
16
+ const buttonVariant = { viewport, ...variant }
17
+ const getTokens = useThemeTokensCallback('Button', tokens, buttonVariant)
15
18
  return (
16
19
  <ButtonBase
17
20
  ref={ref}
package/src/index.js CHANGED
@@ -60,6 +60,7 @@ export {
60
60
  useTheme,
61
61
  useSetTheme,
62
62
  useThemeTokens,
63
+ useThemeTokensCallback,
63
64
  getThemeTokens,
64
65
  applyOuterBorder,
65
66
  applyTextStyles,