braid-design-system 33.10.2 → 33.11.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 (32) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/lib/components/PageBlock/PageBlock.cjs +2 -3
  5. package/dist/lib/components/PageBlock/PageBlock.mjs +3 -4
  6. package/dist/lib/components/PageBlock/pageBlockGutters.cjs +3 -0
  7. package/dist/lib/components/PageBlock/pageBlockGutters.mjs +4 -0
  8. package/dist/lib/components/RadioGroup/RadioGroup.cjs +0 -1
  9. package/dist/lib/components/RadioGroup/RadioGroup.mjs +0 -1
  10. package/dist/lib/components/TooltipRenderer/TooltipRenderer.cjs +21 -8
  11. package/dist/lib/components/TooltipRenderer/TooltipRenderer.mjs +21 -8
  12. package/dist/lib/components/private/Modal/ModalContent.cjs +3 -3
  13. package/dist/lib/components/private/Modal/ModalContent.mjs +3 -3
  14. package/dist/lib/components/useToast/Toast.cjs +67 -51
  15. package/dist/lib/components/useToast/Toast.css.cjs +10 -0
  16. package/dist/lib/components/useToast/Toast.css.mjs +10 -0
  17. package/dist/lib/components/useToast/Toast.mjs +68 -52
  18. package/dist/lib/components/useToast/Toaster.cjs +49 -20
  19. package/dist/lib/components/useToast/Toaster.css.cjs +18 -0
  20. package/dist/lib/components/useToast/Toaster.css.mjs +19 -0
  21. package/dist/lib/components/useToast/Toaster.mjs +49 -22
  22. package/dist/lib/components/useToast/consts.cjs +5 -0
  23. package/dist/lib/components/useToast/consts.mjs +6 -0
  24. package/dist/lib/components/useToast/useFlipList.cjs +116 -33
  25. package/dist/lib/components/useToast/useFlipList.mjs +116 -33
  26. package/dist/lib/themes/baseTokens/nvl.cjs +7 -10
  27. package/dist/lib/themes/baseTokens/nvl.mjs +7 -10
  28. package/dist/lib/themes/makeVanillaTheme.cjs +10 -10
  29. package/dist/lib/themes/makeVanillaTheme.mjs +1 -1
  30. package/dist/lib/utils/px.cjs +3 -0
  31. package/dist/lib/utils/px.mjs +4 -0
  32. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 33.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **useToast**: Improve layout of toasts when multiple toasts are shown ([#1782](https://github.com/seek-oss/braid-design-system/pull/1782))
8
+
9
+ When multiple toasts are shown simultaneously, they now visually stack in a collapsed format that expands on interaction.
10
+ This prevents toasts from obscuring page content while providing users with an easy way to manage and navigate through the recent toast history.
11
+
12
+ ### Patch Changes
13
+
14
+ - **RadioGroup:** Ensure provided `id` is assigned to `fieldset` ([#1845](https://github.com/seek-oss/braid-design-system/pull/1845))
15
+
16
+ Fixes a bug where the provided `id` was not being passed through to the `fieldset` element.
17
+
18
+ - **seekJobs, seekBusiness:** Update drop shadow palette ([#1847](https://github.com/seek-oss/braid-design-system/pull/1847))
19
+
20
+ Refine the drop shadow palette values of `small`, `medium`, and `large`.
21
+ The shadow values are now softer and more linear in their scale.
22
+
23
+ - **TooltipRenderer:** Optimise performance by reducing unnecessary recalculations of the trigger position ([#1833](https://github.com/seek-oss/braid-design-system/pull/1833))
24
+
25
+ - **seekJobs, seekBusiness:** Increase medium font weight ([#1843](https://github.com/seek-oss/braid-design-system/pull/1843))
26
+
27
+ The introduction of Traditional Chinese support means characters in this unicode range are rendered using the default `sans-serif` font.
28
+ The system fonts that handle these characters only cater for **regular** and **bold** weights, resulting in the `medium` weight of 500 falling back to 400 — resulting in loss of visual hierarchy.
29
+
30
+ By increasing the weight of `medium` to 600, it will now round up to 700 (`strong`) when the rendered font cannot satisfy `medium`.
31
+
32
+ This only affects `seekJobs` and `seekBusiness` themes rendering Traditional Chinese characters, all weights across other character sets remain unchanged.
33
+
3
34
  ## 33.10.2
4
35
 
5
36
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3666,7 +3666,7 @@ type RadioGroupBaseProps<Value = NonNullable<string | number>> = FieldGroupBaseP
3666
3666
  type RadioGroupLabelProps = FieldLabelVariant;
3667
3667
  type RadioGroupProps<Value = NonNullable<string | number>> = RadioGroupBaseProps<Value> & RadioGroupLabelProps;
3668
3668
  declare const RadioGroup$1: {
3669
- ({ id, children, value, name, onChange, disabled, tone, size, ...props }: RadioGroupProps): react.JSX.Element;
3669
+ ({ children, value, name, onChange, disabled, tone, size, ...props }: RadioGroupProps): react.JSX.Element;
3670
3670
  displayName: string;
3671
3671
  };
3672
3672
 
package/dist/index.d.ts CHANGED
@@ -3666,7 +3666,7 @@ type RadioGroupBaseProps<Value = NonNullable<string | number>> = FieldGroupBaseP
3666
3666
  type RadioGroupLabelProps = FieldLabelVariant;
3667
3667
  type RadioGroupProps<Value = NonNullable<string | number>> = RadioGroupBaseProps<Value> & RadioGroupLabelProps;
3668
3668
  declare const RadioGroup$1: {
3669
- ({ id, children, value, name, onChange, disabled, tone, size, ...props }: RadioGroupProps): react.JSX.Element;
3669
+ ({ children, value, name, onChange, disabled, tone, size, ...props }: RadioGroupProps): react.JSX.Element;
3670
3670
  displayName: string;
3671
3671
  };
3672
3672
 
@@ -3,6 +3,7 @@ const jsxRuntime = require("react/jsx-runtime");
3
3
  const lib_components_Box_Box_cjs = require("../Box/Box.cjs");
4
4
  const lib_components_ContentBlock_ContentBlock_cjs = require("../ContentBlock/ContentBlock.cjs");
5
5
  const lib_components_private_buildDataAttributes_cjs = require("../private/buildDataAttributes.cjs");
6
+ const lib_components_PageBlock_pageBlockGutters_cjs = require("./pageBlockGutters.cjs");
6
7
  const validPageBlockComponents = [
7
8
  "div",
8
9
  "article",
@@ -11,7 +12,6 @@ const validPageBlockComponents = [
11
12
  "section",
12
13
  "nav"
13
14
  ];
14
- const gutters = { mobile: "small", tablet: "gutter" };
15
15
  const PageBlock = ({
16
16
  children,
17
17
  width = "large",
@@ -25,11 +25,10 @@ const PageBlock = ({
25
25
  {
26
26
  width: "full",
27
27
  component,
28
- paddingX: gutters,
28
+ paddingX: lib_components_PageBlock_pageBlockGutters_cjs.pageBlockGutters,
29
29
  ...lib_components_private_buildDataAttributes_cjs.buildDataAttributes({ data, validateRestProps: restProps }),
30
30
  children: width === "full" ? children : /* @__PURE__ */ jsxRuntime.jsx(lib_components_ContentBlock_ContentBlock_cjs.ContentBlock, { width, children })
31
31
  }
32
32
  );
33
33
  };
34
34
  exports.PageBlock = PageBlock;
35
- exports.gutters = gutters;
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { Box } from "../Box/Box.mjs";
3
3
  import { ContentBlock } from "../ContentBlock/ContentBlock.mjs";
4
4
  import { buildDataAttributes } from "../private/buildDataAttributes.mjs";
5
+ import { pageBlockGutters } from "./pageBlockGutters.mjs";
5
6
  const validPageBlockComponents = [
6
7
  "div",
7
8
  "article",
@@ -10,7 +11,6 @@ const validPageBlockComponents = [
10
11
  "section",
11
12
  "nav"
12
13
  ];
13
- const gutters = { mobile: "small", tablet: "gutter" };
14
14
  const PageBlock = ({
15
15
  children,
16
16
  width = "large",
@@ -24,13 +24,12 @@ const PageBlock = ({
24
24
  {
25
25
  width: "full",
26
26
  component,
27
- paddingX: gutters,
27
+ paddingX: pageBlockGutters,
28
28
  ...buildDataAttributes({ data, validateRestProps: restProps }),
29
29
  children: width === "full" ? children : /* @__PURE__ */ jsx(ContentBlock, { width, children })
30
30
  }
31
31
  );
32
32
  };
33
33
  export {
34
- PageBlock,
35
- gutters
34
+ PageBlock
36
35
  };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const pageBlockGutters = { mobile: "small", tablet: "gutter" };
3
+ exports.pageBlockGutters = pageBlockGutters;
@@ -0,0 +1,4 @@
1
+ const pageBlockGutters = { mobile: "small", tablet: "gutter" };
2
+ export {
3
+ pageBlockGutters
4
+ };
@@ -14,7 +14,6 @@ const stackSpaceForSize = {
14
14
  standard: "small"
15
15
  };
16
16
  const RadioGroup = ({
17
- id,
18
17
  children,
19
18
  value,
20
19
  name,
@@ -11,7 +11,6 @@ const stackSpaceForSize = {
11
11
  standard: "small"
12
12
  };
13
13
  const RadioGroup = ({
14
- id,
15
14
  children,
16
15
  value,
17
16
  name,
@@ -80,6 +80,7 @@ const TooltipRenderer = ({
80
80
  const isStatic = react.useContext(StaticTooltipContext);
81
81
  const isMobileDevice = react.useRef(isMobile__default.default()).current;
82
82
  const onScreen = react.useRef(null);
83
+ const showTooltip = isStatic ? true : open;
83
84
  react.useEffect(() => {
84
85
  const observer = new IntersectionObserver(
85
86
  ([entry]) => {
@@ -135,18 +136,30 @@ const TooltipRenderer = ({
135
136
  }
136
137
  };
137
138
  }, [open, isMobileDevice]);
138
- lib_hooks_useIsomorphicLayoutEffect_cjs.useIsomorphicLayoutEffect(() => {
139
+ const handleTooltipPosition = () => {
139
140
  const setPositions = () => {
140
- var _a, _b;
141
- setTooltipPosition((_a = tooltipRef.current) == null ? void 0 : _a.getBoundingClientRect());
142
- setTriggerPosition((_b = triggerRef.current) == null ? void 0 : _b.getBoundingClientRect());
141
+ if (tooltipRef.current) {
142
+ setTooltipPosition(tooltipRef.current.getBoundingClientRect());
143
+ }
144
+ if (triggerRef.current) {
145
+ setTriggerPosition(triggerRef.current.getBoundingClientRect());
146
+ }
143
147
  };
144
- const timeoutId = setTimeout(() => {
148
+ setTimeout(() => {
145
149
  const frameId = requestAnimationFrame(setPositions);
146
150
  return () => cancelAnimationFrame(frameId);
147
151
  }, lib_components_private_animationTimeout_cjs.animationTimeout / 2);
148
- return () => clearTimeout(timeoutId);
149
- });
152
+ };
153
+ lib_hooks_useIsomorphicLayoutEffect_cjs.useIsomorphicLayoutEffect(() => {
154
+ if (!showTooltip) {
155
+ return;
156
+ }
157
+ handleTooltipPosition();
158
+ window.addEventListener("resize", handleTooltipPosition);
159
+ return () => {
160
+ window.removeEventListener("resize", handleTooltipPosition);
161
+ };
162
+ }, [showTooltip]);
150
163
  let inferredPlacement = placement;
151
164
  let arrowLeftOffset = 0;
152
165
  if (tooltipPosition && triggerPosition) {
@@ -177,7 +190,7 @@ const TooltipRenderer = ({
177
190
  lockPlacement: isStatic,
178
191
  delayVisibility: !isMobileDevice,
179
192
  modal: false,
180
- open: isStatic ? true : open,
193
+ open: showTooltip,
181
194
  onClose: !isStatic ? () => setOpen(false) : void 0,
182
195
  triggerRef,
183
196
  children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -77,6 +77,7 @@ const TooltipRenderer = ({
77
77
  const isStatic = useContext(StaticTooltipContext);
78
78
  const isMobileDevice = useRef(isMobile()).current;
79
79
  const onScreen = useRef(null);
80
+ const showTooltip = isStatic ? true : open;
80
81
  useEffect(() => {
81
82
  const observer = new IntersectionObserver(
82
83
  ([entry]) => {
@@ -132,18 +133,30 @@ const TooltipRenderer = ({
132
133
  }
133
134
  };
134
135
  }, [open, isMobileDevice]);
135
- useIsomorphicLayoutEffect(() => {
136
+ const handleTooltipPosition = () => {
136
137
  const setPositions = () => {
137
- var _a, _b;
138
- setTooltipPosition((_a = tooltipRef.current) == null ? void 0 : _a.getBoundingClientRect());
139
- setTriggerPosition((_b = triggerRef.current) == null ? void 0 : _b.getBoundingClientRect());
138
+ if (tooltipRef.current) {
139
+ setTooltipPosition(tooltipRef.current.getBoundingClientRect());
140
+ }
141
+ if (triggerRef.current) {
142
+ setTriggerPosition(triggerRef.current.getBoundingClientRect());
143
+ }
140
144
  };
141
- const timeoutId = setTimeout(() => {
145
+ setTimeout(() => {
142
146
  const frameId = requestAnimationFrame(setPositions);
143
147
  return () => cancelAnimationFrame(frameId);
144
148
  }, animationTimeout / 2);
145
- return () => clearTimeout(timeoutId);
146
- });
149
+ };
150
+ useIsomorphicLayoutEffect(() => {
151
+ if (!showTooltip) {
152
+ return;
153
+ }
154
+ handleTooltipPosition();
155
+ window.addEventListener("resize", handleTooltipPosition);
156
+ return () => {
157
+ window.removeEventListener("resize", handleTooltipPosition);
158
+ };
159
+ }, [showTooltip]);
147
160
  let inferredPlacement = placement;
148
161
  let arrowLeftOffset = 0;
149
162
  if (tooltipPosition && triggerPosition) {
@@ -174,7 +187,7 @@ const TooltipRenderer = ({
174
187
  lockPlacement: isStatic,
175
188
  delayVisibility: !isMobileDevice,
176
189
  modal: false,
177
- open: isStatic ? true : open,
190
+ open: showTooltip,
178
191
  onClose: !isStatic ? () => setOpen(false) : void 0,
179
192
  triggerRef,
180
193
  children: /* @__PURE__ */ jsx(
@@ -7,7 +7,7 @@ const lib_components_Bleed_Bleed_cjs = require("../../Bleed/Bleed.cjs");
7
7
  const lib_components_Box_Box_cjs = require("../../Box/Box.cjs");
8
8
  const lib_components_ButtonIcon_ButtonIcon_cjs = require("../../ButtonIcon/ButtonIcon.cjs");
9
9
  const lib_components_Heading_Heading_cjs = require("../../Heading/Heading.cjs");
10
- const lib_components_PageBlock_PageBlock_cjs = require("../../PageBlock/PageBlock.cjs");
10
+ const lib_components_PageBlock_pageBlockGutters_cjs = require("../../PageBlock/pageBlockGutters.cjs");
11
11
  const lib_components_Stack_Stack_cjs = require("../../Stack/Stack.cjs");
12
12
  const lib_components_private_buildDataAttributes_cjs = require("../buildDataAttributes.cjs");
13
13
  const lib_components_private_normalizeKey_cjs = require("../normalizeKey.cjs");
@@ -120,7 +120,7 @@ const ModalContent = ({
120
120
  width: width !== "content" ? "full" : void 0,
121
121
  height: position === "right" || position === "left" ? "full" : void 0,
122
122
  paddingY: modalPadding,
123
- paddingX: position !== "center" ? lib_components_PageBlock_PageBlock_cjs.gutters : modalPadding,
123
+ paddingX: position !== "center" ? lib_components_PageBlock_pageBlockGutters_cjs.pageBlockGutters : modalPadding,
124
124
  className: [
125
125
  lib_components_private_Modal_Modal_css_cjs.pointerEventsAll,
126
126
  position === "center" && lib_components_private_Modal_Modal_css_cjs.maxSize[position]
@@ -171,7 +171,7 @@ const ModalContent = ({
171
171
  display: "flex",
172
172
  justifyContent: "flexEnd",
173
173
  paddingTop: modalPadding,
174
- paddingRight: position !== "center" ? lib_components_PageBlock_PageBlock_cjs.gutters : modalPadding,
174
+ paddingRight: position !== "center" ? lib_components_PageBlock_pageBlockGutters_cjs.pageBlockGutters : modalPadding,
175
175
  className: position === "center" && lib_components_private_Modal_Modal_css_cjs.maxSize[position],
176
176
  children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_Bleed_Bleed_cjs.Bleed, { space: "xsmall", children: /* @__PURE__ */ jsxRuntime.jsx(
177
177
  lib_components_Box_Box_cjs.Box,
@@ -6,7 +6,7 @@ import { Bleed } from "../../Bleed/Bleed.mjs";
6
6
  import { Box } from "../../Box/Box.mjs";
7
7
  import { ButtonIcon } from "../../ButtonIcon/ButtonIcon.mjs";
8
8
  import { Heading } from "../../Heading/Heading.mjs";
9
- import { gutters } from "../../PageBlock/PageBlock.mjs";
9
+ import { pageBlockGutters } from "../../PageBlock/pageBlockGutters.mjs";
10
10
  import { Stack } from "../../Stack/Stack.mjs";
11
11
  import { buildDataAttributes } from "../buildDataAttributes.mjs";
12
12
  import { normalizeKey } from "../normalizeKey.mjs";
@@ -119,7 +119,7 @@ const ModalContent = ({
119
119
  width: width !== "content" ? "full" : void 0,
120
120
  height: position === "right" || position === "left" ? "full" : void 0,
121
121
  paddingY: modalPadding,
122
- paddingX: position !== "center" ? gutters : modalPadding,
122
+ paddingX: position !== "center" ? pageBlockGutters : modalPadding,
123
123
  className: [
124
124
  pointerEventsAll,
125
125
  position === "center" && maxSize[position]
@@ -170,7 +170,7 @@ const ModalContent = ({
170
170
  display: "flex",
171
171
  justifyContent: "flexEnd",
172
172
  paddingTop: modalPadding,
173
- paddingRight: position !== "center" ? gutters : modalPadding,
173
+ paddingRight: position !== "center" ? pageBlockGutters : modalPadding,
174
174
  className: position === "center" && maxSize[position],
175
175
  children: /* @__PURE__ */ jsx(Bleed, { space: "xsmall", children: /* @__PURE__ */ jsx(
176
176
  Box,
@@ -6,12 +6,13 @@ const lib_components_Box_Box_cjs = require("../Box/Box.cjs");
6
6
  const lib_components_ButtonIcon_ButtonIcon_cjs = require("../ButtonIcon/ButtonIcon.cjs");
7
7
  const lib_components_Column_Column_cjs = require("../Column/Column.cjs");
8
8
  const lib_components_Columns_Columns_cjs = require("../Columns/Columns.cjs");
9
- const lib_components_ContentBlock_ContentBlock_cjs = require("../ContentBlock/ContentBlock.cjs");
10
9
  const lib_components_Inline_Inline_cjs = require("../Inline/Inline.cjs");
11
10
  const lib_components_Stack_Stack_cjs = require("../Stack/Stack.cjs");
12
11
  const lib_components_Text_Text_cjs = require("../Text/Text.cjs");
13
12
  const lib_components_TextLinkButton_TextLinkButton_cjs = require("../TextLinkButton/TextLinkButton.cjs");
13
+ const lib_components_private_Overlay_Overlay_cjs = require("../private/Overlay/Overlay.cjs");
14
14
  const lib_components_private_buildDataAttributes_cjs = require("../private/buildDataAttributes.cjs");
15
+ const lib_components_useToast_consts_cjs = require("./consts.cjs");
15
16
  const lib_components_useToast_useTimeout_cjs = require("./useTimeout.cjs");
16
17
  const lib_components_useToast_Toast_css_cjs = require("./Toast.css.cjs");
17
18
  const lib_css_lineHeightContainer_css_cjs = require("../../css/lineHeightContainer.css.cjs");
@@ -24,13 +25,17 @@ const toneToIcon = {
24
25
  critical: lib_components_icons_IconCritical_IconCritical_cjs.IconCritical,
25
26
  positive: lib_components_icons_IconPositive_IconPositive_cjs.IconPositive
26
27
  };
27
- const toastDuration = 1e4;
28
+ const toastDuration = 10 * 1e3;
28
29
  const borderRadius = "large";
29
30
  const Action = ({ label, onClick, removeToast }) => {
30
- const handleClick = react.useCallback(() => {
31
- removeToast();
32
- onClick();
33
- }, [removeToast, onClick]);
31
+ const handleClick = react.useCallback(
32
+ (event) => {
33
+ event.stopPropagation();
34
+ removeToast();
35
+ onClick();
36
+ },
37
+ [removeToast, onClick]
38
+ );
34
39
  return /* @__PURE__ */ jsxRuntime.jsx(lib_components_Text_Text_cjs.Text, { baseline: false, children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { component: "span", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_TextLinkButton_TextLinkButton_cjs.TextLinkButton, { onClick: handleClick, hitArea: "large", children: label }) }) });
35
40
  };
36
41
  const ToastIcon = ({ tone, icon }) => {
@@ -56,6 +61,7 @@ const Toast = react.forwardRef(
56
61
  action,
57
62
  shouldRemove,
58
63
  data,
64
+ expanded = true,
59
65
  ...restProps
60
66
  }, ref) => {
61
67
  const remove = react.useCallback(
@@ -72,6 +78,10 @@ const Toast = react.forwardRef(
72
78
  remove();
73
79
  }
74
80
  }, [shouldRemove, remove, stopTimeout]);
81
+ react.useEffect(
82
+ () => expanded ? stopTimeout() : startTimeout(),
83
+ [expanded, startTimeout, stopTimeout]
84
+ );
75
85
  assert__default.default(
76
86
  !icon || icon.props.size === void 0 && icon.props.tone === void 0,
77
87
  "Icons cannot set the 'size' or 'tone' prop when passed to a Toast component"
@@ -88,56 +98,62 @@ const Toast = react.forwardRef(
88
98
  /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { paddingRight: "medium", children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_Text_Text_cjs.Text, { weight: "medium", tone, baseline: false, children: message }) }),
89
99
  action ? /* @__PURE__ */ jsxRuntime.jsx(Action, { removeToast: remove, ...action }, action.label) : null
90
100
  ] });
91
- return /* @__PURE__ */ jsxRuntime.jsx(
101
+ return /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { position: "relative", width: "full", display: "flex", ref, children: /* @__PURE__ */ jsxRuntime.jsxs(
92
102
  lib_components_Box_Box_cjs.Box,
93
103
  {
94
- display: "flex",
95
- justifyContent: "center",
96
- textAlign: "left",
97
104
  role: "alert",
98
- ref,
99
- onMouseEnter: stopTimeout,
100
- onMouseLeave: startTimeout,
105
+ textAlign: "left",
106
+ background: { lightMode: "surfaceDark", darkMode: "surface" },
107
+ boxShadow: {
108
+ lightMode: "borderNeutral",
109
+ darkMode: "borderNeutralLight"
110
+ },
111
+ borderRadius,
112
+ paddingY: "medium",
113
+ paddingX: "gutter",
114
+ marginTop: lib_components_useToast_consts_cjs.toastGap,
115
+ width: "full",
116
+ position: "relative",
117
+ className: lib_components_useToast_Toast_css_cjs.toast,
118
+ tabIndex: 0,
119
+ outline: "focus",
120
+ onClick: (event) => {
121
+ event.stopPropagation();
122
+ },
101
123
  ...lib_components_private_buildDataAttributes_cjs.buildDataAttributes({ data, validateRestProps: restProps }),
102
- children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { boxShadow: "large", borderRadius, children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_ContentBlock_ContentBlock_cjs.ContentBlock, { width: "xsmall", children: /* @__PURE__ */ jsxRuntime.jsx(
103
- lib_components_Box_Box_cjs.Box,
104
- {
105
- background: { lightMode: "surfaceDark", darkMode: "surface" },
106
- position: "relative",
107
- borderRadius,
108
- paddingY: "medium",
109
- paddingX: "gutter",
110
- overflow: "hidden",
111
- className: lib_components_useToast_Toast_css_cjs.toast,
112
- children: /* @__PURE__ */ jsxRuntime.jsxs(lib_components_Columns_Columns_cjs.Columns, { space: "none", children: [
113
- tone !== "neutral" || tone === "neutral" && icon ? /* @__PURE__ */ jsxRuntime.jsx(lib_components_Column_Column_cjs.Column, { width: "content", children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { paddingRight: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ToastIcon, { tone, icon }) }) }) : null,
114
- /* @__PURE__ */ jsxRuntime.jsx(lib_components_Column_Column_cjs.Column, { children: content }),
115
- /* @__PURE__ */ jsxRuntime.jsx(lib_components_Column_Column_cjs.Column, { width: "content", children: /* @__PURE__ */ jsxRuntime.jsx(
116
- lib_components_Box_Box_cjs.Box,
117
- {
118
- width: "touchable",
119
- display: "flex",
120
- justifyContent: "flexEnd",
121
- alignItems: "center",
122
- className: lib_css_lineHeightContainer_css_cjs.lineHeightContainer.standard,
123
- "aria-hidden": true,
124
- children: /* @__PURE__ */ jsxRuntime.jsx(
125
- lib_components_ButtonIcon_ButtonIcon_cjs.ButtonIcon,
126
- {
127
- icon: /* @__PURE__ */ jsxRuntime.jsx(lib_components_icons_IconClear_IconClear_cjs.IconClear, { tone: "secondary" }),
128
- variant: "transparent",
129
- onClick: remove,
130
- label: closeLabel,
131
- data: process.env.NODE_ENV !== "production" ? { testid: "clearToast" } : {}
132
- }
133
- )
134
- }
135
- ) })
136
- ] })
137
- }
138
- ) }) })
124
+ children: [
125
+ /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { transition: "fast", className: lib_components_useToast_Toast_css_cjs.collapsedToastContent, children: /* @__PURE__ */ jsxRuntime.jsxs(lib_components_Columns_Columns_cjs.Columns, { space: "none", children: [
126
+ tone !== "neutral" || tone === "neutral" && icon ? /* @__PURE__ */ jsxRuntime.jsx(lib_components_Column_Column_cjs.Column, { width: "content", children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { paddingRight: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ToastIcon, { tone, icon }) }) }) : null,
127
+ /* @__PURE__ */ jsxRuntime.jsx(lib_components_Column_Column_cjs.Column, { children: content }),
128
+ /* @__PURE__ */ jsxRuntime.jsx(lib_components_Column_Column_cjs.Column, { width: "content", children: /* @__PURE__ */ jsxRuntime.jsx(
129
+ lib_components_Box_Box_cjs.Box,
130
+ {
131
+ width: "touchable",
132
+ display: "flex",
133
+ justifyContent: "flexEnd",
134
+ alignItems: "center",
135
+ className: lib_css_lineHeightContainer_css_cjs.lineHeightContainer.standard,
136
+ "aria-hidden": true,
137
+ children: /* @__PURE__ */ jsxRuntime.jsx(
138
+ lib_components_ButtonIcon_ButtonIcon_cjs.ButtonIcon,
139
+ {
140
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lib_components_icons_IconClear_IconClear_cjs.IconClear, { tone: "secondary" }),
141
+ variant: "transparent",
142
+ onClick: (event) => {
143
+ event.stopPropagation();
144
+ remove();
145
+ },
146
+ label: closeLabel,
147
+ data: process.env.NODE_ENV !== "production" ? { testid: "clearToast" } : {}
148
+ }
149
+ )
150
+ }
151
+ ) })
152
+ ] }) }),
153
+ /* @__PURE__ */ jsxRuntime.jsx(lib_components_private_Overlay_Overlay_cjs.Overlay, { visible: true, borderRadius, boxShadow: "large" })
154
+ ]
139
155
  }
140
- );
156
+ ) });
141
157
  }
142
158
  );
143
159
  exports.Toast = Toast;
@@ -5,5 +5,15 @@ fileScope.setFileScope("src/lib/components/useToast/Toast.css.ts", "braid-design
5
5
  const toast = css.style({
6
6
  pointerEvents: "all"
7
7
  }, "toast");
8
+ const collapsed = css.style({}, "collapsed");
9
+ const collapsedToastContent = css.style({
10
+ selectors: {
11
+ [`${collapsed} &`]: {
12
+ opacity: 0
13
+ }
14
+ }
15
+ }, "collapsedToastContent");
8
16
  fileScope.endFileScope();
17
+ exports.collapsed = collapsed;
18
+ exports.collapsedToastContent = collapsedToastContent;
9
19
  exports.toast = toast;
@@ -4,7 +4,17 @@ setFileScope("src/lib/components/useToast/Toast.css.ts", "braid-design-system");
4
4
  const toast = style({
5
5
  pointerEvents: "all"
6
6
  }, "toast");
7
+ const collapsed = style({}, "collapsed");
8
+ const collapsedToastContent = style({
9
+ selectors: {
10
+ [`${collapsed} &`]: {
11
+ opacity: 0
12
+ }
13
+ }
14
+ }, "collapsedToastContent");
7
15
  endFileScope();
8
16
  export {
17
+ collapsed,
18
+ collapsedToastContent,
9
19
  toast
10
20
  };