braid-design-system 32.2.0 → 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.
- package/CHANGELOG.md +89 -0
- package/codemod/dist/wrapper.js +1221 -21034
- package/dist/ToastContext.chunk.cjs +52 -80
- package/dist/ToastContext.chunk.mjs +88 -116
- package/dist/Toggle.chunk.cjs +52 -21
- package/dist/Toggle.chunk.mjs +58 -27
- package/dist/reset.d.ts +22 -4
- package/dist/styles/lib/components/Stepper/Stepper.css.cjs +8 -7
- package/dist/styles/lib/components/Stepper/Stepper.css.mjs +8 -7
- package/dist/styles/lib/components/Textarea/Highlight/Highlight.css.cjs +34 -3
- package/dist/styles/lib/components/Textarea/Highlight/Highlight.css.mjs +34 -3
- package/dist/styles/lib/components/TooltipRenderer/TooltipRenderer.css.cjs +0 -4
- package/dist/styles/lib/components/TooltipRenderer/TooltipRenderer.css.mjs +0 -4
- package/dist/styles/lib/css/atoms/atomicProperties.cjs +2 -0
- package/dist/styles/lib/css/atoms/atomicProperties.mjs +2 -0
- package/package.json +2 -2
|
@@ -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",
|
|
@@ -1182,36 +1182,6 @@ const Overlay = ({
|
|
|
1182
1182
|
}
|
|
1183
1183
|
);
|
|
1184
1184
|
const ActionsContext = React.createContext(null);
|
|
1185
|
-
const Keyline = ({ tone, borderRadius: borderRadius2 }) => {
|
|
1186
|
-
const backgroundLightness = useBackgroundLightness();
|
|
1187
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1188
|
-
Box,
|
|
1189
|
-
{
|
|
1190
|
-
component: "span",
|
|
1191
|
-
position: "absolute",
|
|
1192
|
-
top: 0,
|
|
1193
|
-
bottom: 0,
|
|
1194
|
-
left: 0,
|
|
1195
|
-
overflow: "hidden",
|
|
1196
|
-
borderRadius: borderRadius2,
|
|
1197
|
-
className: [styles_lib_components_private_Keyline_Keyline_css_cjs.noRadiusOnRight, styles_lib_components_private_Keyline_Keyline_css_cjs.largestWidth],
|
|
1198
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1199
|
-
Box,
|
|
1200
|
-
{
|
|
1201
|
-
component: "span",
|
|
1202
|
-
height: "full",
|
|
1203
|
-
display: "inlineBlock",
|
|
1204
|
-
className: [
|
|
1205
|
-
styles_lib_components_private_Keyline_Keyline_css_cjs.width,
|
|
1206
|
-
styles_lib_components_private_Keyline_Keyline_css_cjs.tone[tone],
|
|
1207
|
-
styles_lib_components_private_Keyline_Keyline_css_cjs.lightMode[backgroundLightness.lightMode],
|
|
1208
|
-
styles_lib_components_private_Keyline_Keyline_css_cjs.darkMode[backgroundLightness.darkMode]
|
|
1209
|
-
]
|
|
1210
|
-
}
|
|
1211
|
-
)
|
|
1212
|
-
}
|
|
1213
|
-
);
|
|
1214
|
-
};
|
|
1215
1185
|
const boxShadowForVariant = {
|
|
1216
1186
|
default: "borderField",
|
|
1217
1187
|
disabled: "borderNeutralLight",
|
|
@@ -1388,28 +1358,28 @@ const variants = {
|
|
|
1388
1358
|
background: void 0,
|
|
1389
1359
|
backgroundHover: "formAccentSoftHover",
|
|
1390
1360
|
backgroundActive: "formAccentSoftActive",
|
|
1391
|
-
boxShadow: "
|
|
1361
|
+
boxShadow: "borderFormAccent"
|
|
1392
1362
|
},
|
|
1393
1363
|
brandAccent: {
|
|
1394
1364
|
textTone: "brandAccent",
|
|
1395
1365
|
background: void 0,
|
|
1396
1366
|
backgroundHover: "brandAccentSoftHover",
|
|
1397
1367
|
backgroundActive: "brandAccentSoftActive",
|
|
1398
|
-
boxShadow: "
|
|
1368
|
+
boxShadow: "borderBrandAccent"
|
|
1399
1369
|
},
|
|
1400
1370
|
critical: {
|
|
1401
1371
|
textTone: "critical",
|
|
1402
1372
|
background: void 0,
|
|
1403
1373
|
backgroundHover: "criticalSoftHover",
|
|
1404
1374
|
backgroundActive: "criticalSoftActive",
|
|
1405
|
-
boxShadow: "
|
|
1375
|
+
boxShadow: "borderCritical"
|
|
1406
1376
|
},
|
|
1407
1377
|
neutral: {
|
|
1408
1378
|
textTone: "neutral",
|
|
1409
1379
|
background: void 0,
|
|
1410
1380
|
backgroundHover: "neutralSoftHover",
|
|
1411
1381
|
backgroundActive: "neutralSoftActive",
|
|
1412
|
-
boxShadow: "
|
|
1382
|
+
boxShadow: "borderNeutral"
|
|
1413
1383
|
}
|
|
1414
1384
|
}
|
|
1415
1385
|
};
|
|
@@ -1704,10 +1674,10 @@ const TooltipContent = ({
|
|
|
1704
1674
|
Box,
|
|
1705
1675
|
{
|
|
1706
1676
|
boxShadow: "large",
|
|
1707
|
-
background: "
|
|
1677
|
+
background: "neutral",
|
|
1708
1678
|
borderRadius: borderRadius$1,
|
|
1709
1679
|
padding: "small",
|
|
1710
|
-
className: [styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.
|
|
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
|
-
|
|
1688
|
+
background: "neutral",
|
|
1689
|
+
className: styles_lib_components_TooltipRenderer_TooltipRenderer_css_cjs.arrow
|
|
1719
1690
|
}
|
|
1720
1691
|
)
|
|
1721
1692
|
] })
|
|
@@ -2154,7 +2125,17 @@ const Action = ({ label, onClick, removeToast }) => {
|
|
|
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",
|
|
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: "
|
|
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: "
|
|
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.
|
|
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
|
-
|
|
2204
|
+
paddingX: "gutter",
|
|
2226
2205
|
overflow: "hidden",
|
|
2227
2206
|
className: styles_lib_components_useToast_Toast_css_cjs.toast,
|
|
2228
|
-
children: [
|
|
2229
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
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;
|