braid-design-system 32.1.1 → 32.3.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 (38) hide show
  1. package/CHANGELOG.md +214 -0
  2. package/codemod/dist/wrapper.js +1315 -21130
  3. package/dist/ToastContext.chunk.cjs +71 -99
  4. package/dist/ToastContext.chunk.mjs +117 -145
  5. package/dist/Toggle.chunk.cjs +70 -49
  6. package/dist/Toggle.chunk.mjs +80 -59
  7. package/dist/reset.d.ts +212 -95
  8. package/dist/side-effects/lib/themes/baseTokens/apac.cjs +7 -8
  9. package/dist/side-effects/lib/themes/baseTokens/apac.mjs +6 -8
  10. package/dist/side-effects/lib/themes/makeRuntimeTokens.cjs +3 -9
  11. package/dist/side-effects/lib/themes/makeRuntimeTokens.mjs +3 -8
  12. package/dist/side-effects/lib/themes/tokenType.cjs +15 -0
  13. package/dist/side-effects/lib/themes/tokenType.mjs +16 -0
  14. package/dist/styles/lib/components/Button/Button.css.cjs +24 -23
  15. package/dist/styles/lib/components/Button/Button.css.mjs +25 -24
  16. package/dist/styles/lib/components/Stepper/Stepper.css.cjs +8 -7
  17. package/dist/styles/lib/components/Stepper/Stepper.css.mjs +8 -7
  18. package/dist/styles/lib/components/Textarea/Highlight/Highlight.css.cjs +34 -3
  19. package/dist/styles/lib/components/Textarea/Highlight/Highlight.css.mjs +34 -3
  20. package/dist/styles/lib/components/TooltipRenderer/TooltipRenderer.css.cjs +1 -9
  21. package/dist/styles/lib/components/TooltipRenderer/TooltipRenderer.css.mjs +1 -9
  22. package/dist/styles/lib/components/private/Keyline/Keyline.css.cjs +4 -0
  23. package/dist/styles/lib/components/private/Keyline/Keyline.css.mjs +5 -1
  24. package/dist/styles/lib/css/atoms/atomicProperties.cjs +2 -0
  25. package/dist/styles/lib/css/atoms/atomicProperties.mjs +2 -0
  26. package/dist/styles/lib/css/negativeMargin/negativeMargin.css.cjs +4 -9
  27. package/dist/styles/lib/css/negativeMargin/negativeMargin.css.mjs +1 -6
  28. package/dist/styles/lib/css/typography.css.cjs +1 -16
  29. package/dist/styles/lib/css/typography.css.mjs +1 -16
  30. package/dist/styles/lib/themes/docs/tokens.cjs +8 -8
  31. package/dist/styles/lib/themes/docs/tokens.mjs +6 -8
  32. package/dist/styles/lib/themes/makeVanillaTheme.cjs +22 -9
  33. package/dist/styles/lib/themes/makeVanillaTheme.mjs +22 -9
  34. package/dist/styles/lib/themes/wireframe/tokens.cjs +25 -29
  35. package/dist/styles/lib/themes/wireframe/tokens.mjs +23 -29
  36. package/package.json +4 -3
  37. package/dist/styles/lib/components/Badge/Badge.css.cjs +0 -27
  38. package/dist/styles/lib/components/Badge/Badge.css.mjs +0 -28
@@ -29,7 +29,6 @@ const reactPopperTooltip = require("react-popper-tooltip");
29
29
  const isMobile = require("is-mobile");
30
30
  const styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs = require("./styles/lib/components/TooltipRenderer/TooltipRenderer.css.cjs");
31
31
  const styles_lib_components_ButtonIcon_ButtonIcon_css_cjs = require("./styles/lib/components/ButtonIcon/ButtonIcon.css.cjs");
32
- const styles_lib_components_private_Keyline_Keyline_css_cjs = require("./styles/lib/components/private/Keyline/Keyline.css.cjs");
33
32
  const styles_lib_components_useToast_Toast_css_cjs = require("./styles/lib/components/useToast/Toast.css.cjs");
34
33
  const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
35
34
  const React__default = /* @__PURE__ */ _interopDefaultCompat(React);
@@ -159,6 +158,7 @@ const adaptiveBackgrounds = {
159
158
  formAccentSoftHover: "neutralHover"
160
159
  };
161
160
  const adaptiveBoxShadow = {
161
+ borderBrandAccent: "borderBrandAccentLight",
162
162
  borderBrandAccentLarge: "borderBrandAccentLightLarge",
163
163
  borderCaution: "borderCautionLight",
164
164
  borderCritical: "borderCriticalLight",
@@ -462,14 +462,20 @@ const resolveResponsiveProp = (value, mobileAtoms, tabletAtoms, desktopAtoms, wi
462
462
  const wideAtom = wideAtoms[wide];
463
463
  return clsx__default.default(mobileAtom, tabletAtom, desktopAtom, wideAtom);
464
464
  };
465
+ const directionStyles = {
466
+ top: styles_lib_css_negativeMargin_negativeMargin_css_cjs.top,
467
+ right: styles_lib_css_negativeMargin_negativeMargin_css_cjs.right,
468
+ bottom: styles_lib_css_negativeMargin_negativeMargin_css_cjs.bottom,
469
+ left: styles_lib_css_negativeMargin_negativeMargin_css_cjs.left
470
+ };
465
471
  const negativeMargin = (direction, space) => space ? clsx__default.default([
466
472
  direction === "top" || direction === "bottom" ? styles_lib_css_negativeMargin_negativeMargin_css_cjs.preventCollapsePseudo[direction] : void 0,
467
473
  resolveResponsiveProp(
468
474
  space,
469
- styles_lib_css_negativeMargin_negativeMargin_css_cjs.styles[direction].mobile,
470
- styles_lib_css_negativeMargin_negativeMargin_css_cjs.styles[direction].tablet,
471
- styles_lib_css_negativeMargin_negativeMargin_css_cjs.styles[direction].desktop,
472
- styles_lib_css_negativeMargin_negativeMargin_css_cjs.styles[direction].wide
475
+ directionStyles[direction].mobile,
476
+ directionStyles[direction].tablet,
477
+ directionStyles[direction].desktop,
478
+ directionStyles[direction].wide
473
479
  )
474
480
  ]) : null;
475
481
  const alignToDisplay = {
@@ -638,7 +644,7 @@ function textStyles({
638
644
  styles_lib_css_typography_css_cjs.fontFamily,
639
645
  styles_lib_css_typography_css_cjs.fontWeight[weight],
640
646
  styles_lib_css_typography_css_cjs.tone[tone],
641
- styles_lib_css_typography_css_cjs.styles[baseline ? "textSizeTrimmed" : "textSizeUntrimmed"][size]
647
+ (baseline ? styles_lib_css_typography_css_cjs.textSizeTrimmed : styles_lib_css_typography_css_cjs.textSizeUntrimmed)[size]
642
648
  ];
643
649
  }
644
650
  const Truncate = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", className: styles_lib_components_private_Truncate_Truncate_css_cjs.truncate, children });
@@ -1176,41 +1182,11 @@ const Overlay = ({
1176
1182
  }
1177
1183
  );
1178
1184
  const ActionsContext = React.createContext(null);
1179
- const Keyline = ({ tone, borderRadius: borderRadius2 }) => {
1180
- const backgroundLightness = useBackgroundLightness();
1181
- return /* @__PURE__ */ jsxRuntime.jsx(
1182
- Box,
1183
- {
1184
- component: "span",
1185
- position: "absolute",
1186
- top: 0,
1187
- bottom: 0,
1188
- left: 0,
1189
- overflow: "hidden",
1190
- borderRadius: borderRadius2,
1191
- className: [styles_lib_components_private_Keyline_Keyline_css_cjs.noRadiusOnRight, styles_lib_components_private_Keyline_Keyline_css_cjs.largestWidth],
1192
- children: /* @__PURE__ */ jsxRuntime.jsx(
1193
- Box,
1194
- {
1195
- component: "span",
1196
- height: "full",
1197
- display: "inlineBlock",
1198
- paddingLeft: "xxsmall",
1199
- className: [
1200
- styles_lib_components_private_Keyline_Keyline_css_cjs.tone[tone],
1201
- styles_lib_components_private_Keyline_Keyline_css_cjs.lightMode[backgroundLightness.lightMode],
1202
- styles_lib_components_private_Keyline_Keyline_css_cjs.darkMode[backgroundLightness.darkMode]
1203
- ]
1204
- }
1205
- )
1206
- }
1207
- );
1208
- };
1209
1185
  const boxShadowForVariant = {
1210
1186
  default: "borderField",
1211
1187
  disabled: "borderNeutralLight",
1212
1188
  focus: "outlineFocus",
1213
- hover: "borderFormAccent",
1189
+ formAccent: "borderFormAccent",
1214
1190
  critical: "borderCritical"
1215
1191
  };
1216
1192
  const FieldOverlay = ({ variant, ...restProps }) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -1382,28 +1358,28 @@ const variants = {
1382
1358
  background: void 0,
1383
1359
  backgroundHover: "formAccentSoftHover",
1384
1360
  backgroundActive: "formAccentSoftActive",
1385
- boxShadow: "borderFormAccentLarge"
1361
+ boxShadow: "borderFormAccent"
1386
1362
  },
1387
1363
  brandAccent: {
1388
1364
  textTone: "brandAccent",
1389
1365
  background: void 0,
1390
1366
  backgroundHover: "brandAccentSoftHover",
1391
1367
  backgroundActive: "brandAccentSoftActive",
1392
- boxShadow: "borderBrandAccentLarge"
1368
+ boxShadow: "borderBrandAccent"
1393
1369
  },
1394
1370
  critical: {
1395
1371
  textTone: "critical",
1396
1372
  background: void 0,
1397
1373
  backgroundHover: "criticalSoftHover",
1398
1374
  backgroundActive: "criticalSoftActive",
1399
- boxShadow: "borderCriticalLarge"
1375
+ boxShadow: "borderCritical"
1400
1376
  },
1401
1377
  neutral: {
1402
1378
  textTone: "neutral",
1403
1379
  background: void 0,
1404
1380
  backgroundHover: "neutralSoftHover",
1405
1381
  backgroundActive: "neutralSoftActive",
1406
- boxShadow: "borderNeutralLarge"
1382
+ boxShadow: "borderNeutral"
1407
1383
  }
1408
1384
  }
1409
1385
  };
@@ -1413,7 +1389,7 @@ const ButtonLoader = () => /* @__PURE__ */ jsxRuntime.jsxs(Box, { "aria-hidden":
1413
1389
  /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", className: styles_lib_components_Button_Button_css_cjs.loadingDot, children: "." })
1414
1390
  ] });
1415
1391
  const transparentPaddingX = "small";
1416
- const buttonRadius = "large";
1392
+ const buttonRadius = "standard";
1417
1393
  const ButtonOverlays = ({
1418
1394
  variant = "solid",
1419
1395
  tone,
@@ -1480,7 +1456,6 @@ const ButtonText = ({
1480
1456
  iconPosition = "leading",
1481
1457
  variant = "solid",
1482
1458
  tone,
1483
- labelSpacing = true,
1484
1459
  bleed
1485
1460
  }) => {
1486
1461
  const lightness = useBackgroundLightness();
@@ -1503,9 +1478,8 @@ const ButtonText = ({
1503
1478
  flexWrap: "wrap",
1504
1479
  overflow: "hidden",
1505
1480
  pointerEvents: "none",
1506
- paddingX: labelSpacing ? labelPaddingX : void 0,
1507
- paddingY: labelSpacing && size === "small" ? styles_lib_components_Button_Button_css_cjs.constants.smallButtonPaddingSize : void 0,
1508
- className: labelSpacing && size === "standard" ? styles_lib_css_typography_css_cjs.touchableText.standard : void 0,
1481
+ paddingX: labelPaddingX,
1482
+ className: styles_lib_components_Button_Button_css_cjs.padToMinHeight,
1509
1483
  background: tone === "neutral" && variant !== "solid" ? {
1510
1484
  lightMode: lightness.lightMode === "light" ? "customLight" : "customDark",
1511
1485
  darkMode: lightness.darkMode === "light" ? "customLight" : "customDark"
@@ -1515,8 +1489,8 @@ const ButtonText = ({
1515
1489
  {
1516
1490
  tone: stylesForVariant.textTone,
1517
1491
  weight: "medium",
1492
+ align: "center",
1518
1493
  size,
1519
- baseline: false,
1520
1494
  children: [
1521
1495
  icon && iconPosition === "leading" ? /* @__PURE__ */ jsxRuntime.jsx(
1522
1496
  AvoidWidowIcon,
@@ -1683,7 +1657,7 @@ const TooltipTextDefaultsProvider = ({
1683
1657
  }
1684
1658
  );
1685
1659
  };
1686
- const borderRadius$1 = "xlarge";
1660
+ const borderRadius$1 = "large";
1687
1661
  const TooltipContent = ({
1688
1662
  children,
1689
1663
  opacity,
@@ -1700,14 +1674,10 @@ const TooltipContent = ({
1700
1674
  Box,
1701
1675
  {
1702
1676
  boxShadow: "large",
1703
- background: "customDark",
1677
+ background: "neutral",
1704
1678
  borderRadius: borderRadius$1,
1705
- className: [
1706
- styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.background,
1707
- styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.maxWidth,
1708
- styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.translateZ0,
1709
- styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.padding
1710
- ],
1679
+ padding: "small",
1680
+ className: [styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.maxWidth, styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.translateZ0],
1711
1681
  children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipTextDefaultsProvider, { children: [
1712
1682
  /* @__PURE__ */ jsxRuntime.jsx(Box, { position: "relative", zIndex: 1, children }),
1713
1683
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1715,7 +1685,8 @@ const TooltipContent = ({
1715
1685
  {
1716
1686
  ...arrowProps,
1717
1687
  borderRadius: borderRadius$1,
1718
- className: [styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.arrow, styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.background]
1688
+ background: "neutral",
1689
+ className: styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.arrow
1719
1690
  }
1720
1691
  )
1721
1692
  ] })
@@ -2148,13 +2119,23 @@ const toneToIcon = {
2148
2119
  positive: IconPositive
2149
2120
  };
2150
2121
  const toastDuration = 1e4;
2151
- const borderRadius = "xlarge";
2122
+ const borderRadius = "large";
2152
2123
  const Action = ({ label, onClick, removeToast }) => {
2153
2124
  const handleClick = React.useCallback(() => {
2154
2125
  removeToast();
2155
2126
  onClick();
2156
2127
  }, [removeToast, onClick]);
2157
- return /* @__PURE__ */ jsxRuntime.jsx(Text, { baseline: false, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", paddingRight: "xsmall", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(TextLinkButton, { onClick: handleClick, hitArea: "large", children: label }) }) });
2128
+ return /* @__PURE__ */ jsxRuntime.jsx(Text, { baseline: false, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(TextLinkButton, { onClick: handleClick, hitArea: "large", children: label }) }) });
2129
+ };
2130
+ const ToastIcon = ({ tone, icon }) => {
2131
+ if (tone !== "neutral") {
2132
+ const Icon = toneToIcon[tone];
2133
+ return /* @__PURE__ */ jsxRuntime.jsx(Icon, { tone });
2134
+ }
2135
+ if (icon) {
2136
+ return React.cloneElement(icon, { tone });
2137
+ }
2138
+ return null;
2158
2139
  };
2159
2140
  const Toast = React__default.default.forwardRef(
2160
2141
  ({
@@ -2186,7 +2167,6 @@ const Toast = React__default.default.forwardRef(
2186
2167
  remove();
2187
2168
  }
2188
2169
  }, [shouldRemove, remove, stopTimeout]);
2189
- const Icon = tone !== "neutral" ? toneToIcon[tone] : void 0;
2190
2170
  assert__default.default(
2191
2171
  !icon || icon.props.size === void 0 && icon.props.tone === void 0,
2192
2172
  "Icons cannot set the 'size' or 'tone' prop when passed to a Toast component"
@@ -2196,11 +2176,11 @@ const Toast = React__default.default.forwardRef(
2196
2176
  `Icons cannot be customised on a Toast component using '${tone}' tone`
2197
2177
  );
2198
2178
  const content = description ? /* @__PURE__ */ jsxRuntime.jsxs(Stack, { space: "xxsmall", children: [
2199
- /* @__PURE__ */ jsxRuntime.jsx(Text, { weight: "strong", baseline: false, children: message }),
2179
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { weight: "medium", tone, baseline: false, children: message }),
2200
2180
  description ? /* @__PURE__ */ jsxRuntime.jsx(Text, { baseline: false, tone: "secondary", children: description }) : null,
2201
2181
  action ? /* @__PURE__ */ jsxRuntime.jsx(Action, { removeToast: remove, ...action }, action.label) : null
2202
2182
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(Inline, { space: "xxsmall", children: [
2203
- /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingRight: "medium", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { weight: "strong", baseline: false, children: message }) }),
2183
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingRight: "medium", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { weight: "medium", tone, baseline: false, children: message }) }),
2204
2184
  action ? /* @__PURE__ */ jsxRuntime.jsx(Action, { removeToast: remove, ...action }, action.label) : null
2205
2185
  ] });
2206
2186
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2214,50 +2194,43 @@ const Toast = React__default.default.forwardRef(
2214
2194
  onMouseLeave: startTimeout,
2215
2195
  className: vanillaTheme,
2216
2196
  ...buildDataAttributes({ data, validateRestProps: restProps }),
2217
- children: /* @__PURE__ */ jsxRuntime.jsx(Box, { boxShadow: "large", borderRadius, children: /* @__PURE__ */ jsxRuntime.jsx(ContentBlock, { width: "xsmall", children: /* @__PURE__ */ jsxRuntime.jsxs(
2197
+ children: /* @__PURE__ */ jsxRuntime.jsx(Box, { boxShadow: "large", borderRadius, children: /* @__PURE__ */ jsxRuntime.jsx(ContentBlock, { width: "xsmall", children: /* @__PURE__ */ jsxRuntime.jsx(
2218
2198
  Box,
2219
2199
  {
2220
- background: "surface",
2200
+ background: { lightMode: "surfaceDark", darkMode: "surface" },
2221
2201
  position: "relative",
2222
- boxShadow: "borderNeutralLight",
2223
2202
  borderRadius,
2224
2203
  paddingY: "medium",
2225
- paddingLeft: "medium",
2204
+ paddingX: "gutter",
2226
2205
  overflow: "hidden",
2227
2206
  className: styles_lib_components_useToast_Toast_css_cjs.toast,
2228
- children: [
2229
- /* @__PURE__ */ jsxRuntime.jsxs(Columns, { space: "none", children: [
2230
- /* @__PURE__ */ jsxRuntime.jsxs(Column, { width: "content", children: [
2231
- Icon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingRight: "small", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { tone }) }) : null,
2232
- tone === "neutral" && icon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingRight: "small", children: React.cloneElement(icon, { tone: "secondary" }) }) : null
2233
- ] }),
2234
- /* @__PURE__ */ jsxRuntime.jsx(Column, { children: content }),
2235
- /* @__PURE__ */ jsxRuntime.jsx(Column, { width: "content", children: /* @__PURE__ */ jsxRuntime.jsx(
2236
- Box,
2237
- {
2238
- width: "touchable",
2239
- display: "flex",
2240
- justifyContent: "center",
2241
- alignItems: "center",
2242
- className: styles_lib_css_lineHeightContainer_css_cjs.lineHeightContainer.standard,
2243
- "aria-hidden": true,
2244
- children: /* @__PURE__ */ jsxRuntime.jsx(
2245
- ButtonIcon,
2246
- {
2247
- id: `${dedupeKey}-clear`,
2248
- icon: /* @__PURE__ */ jsxRuntime.jsx(IconClear, {}),
2249
- tone: "secondary",
2250
- variant: "transparent",
2251
- onClick: remove,
2252
- label: closeLabel,
2253
- data: process.env.NODE_ENV !== "production" ? { testid: "clearToast" } : {}
2254
- }
2255
- )
2256
- }
2257
- ) })
2258
- ] }),
2259
- tone !== "neutral" ? /* @__PURE__ */ jsxRuntime.jsx(Keyline, { tone, borderRadius }) : null
2260
- ]
2207
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Columns, { space: "none", children: [
2208
+ tone !== "neutral" || tone === "neutral" && icon ? /* @__PURE__ */ jsxRuntime.jsx(Column, { width: "content", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingRight: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ToastIcon, { tone, icon }) }) }) : null,
2209
+ /* @__PURE__ */ jsxRuntime.jsx(Column, { children: content }),
2210
+ /* @__PURE__ */ jsxRuntime.jsx(Column, { width: "content", children: /* @__PURE__ */ jsxRuntime.jsx(
2211
+ Box,
2212
+ {
2213
+ width: "touchable",
2214
+ display: "flex",
2215
+ justifyContent: "flexEnd",
2216
+ alignItems: "center",
2217
+ className: styles_lib_css_lineHeightContainer_css_cjs.lineHeightContainer.standard,
2218
+ "aria-hidden": true,
2219
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2220
+ ButtonIcon,
2221
+ {
2222
+ id: `${dedupeKey}-clear`,
2223
+ icon: /* @__PURE__ */ jsxRuntime.jsx(IconClear, {}),
2224
+ tone: "secondary",
2225
+ variant: "transparent",
2226
+ onClick: remove,
2227
+ label: closeLabel,
2228
+ data: process.env.NODE_ENV !== "production" ? { testid: "clearToast" } : {}
2229
+ }
2230
+ )
2231
+ }
2232
+ ) })
2233
+ ] })
2261
2234
  }
2262
2235
  ) }) })
2263
2236
  }
@@ -2547,7 +2520,6 @@ exports.IconCritical = IconCritical;
2547
2520
  exports.IconPositive = IconPositive;
2548
2521
  exports.IconRenderer = IconRenderer;
2549
2522
  exports.Inline = Inline;
2550
- exports.Keyline = Keyline;
2551
2523
  exports.Overlay = Overlay;
2552
2524
  exports.PublicBox = PublicBox;
2553
2525
  exports.Stack = Stack;