braid-design-system 34.6.0 → 34.6.2

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 (57) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +4 -2
  3. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  4. package/dist/lib/components/Autosuggest/Autosuggest.cjs +18 -24
  5. package/dist/lib/components/Autosuggest/Autosuggest.mjs +19 -25
  6. package/dist/lib/components/Autosuggest/useScrollIntoView.cjs +14 -0
  7. package/dist/lib/components/Autosuggest/useScrollIntoView.mjs +14 -0
  8. package/dist/lib/components/BraidProvider/BraidProvider.cjs +3 -2
  9. package/dist/lib/components/BraidProvider/BraidProvider.mjs +3 -2
  10. package/dist/lib/components/Button/ButtonLoader.css.mjs +2 -1
  11. package/dist/lib/components/ButtonLink/ButtonLink.playroom.cjs +2 -1
  12. package/dist/lib/components/ButtonLink/ButtonLink.playroom.mjs +2 -1
  13. package/dist/lib/components/FieldMessage/FieldMessage.playroom.cjs +2 -1
  14. package/dist/lib/components/FieldMessage/FieldMessage.playroom.mjs +2 -1
  15. package/dist/lib/components/Link/Link.cjs +2 -1
  16. package/dist/lib/components/Link/Link.mjs +2 -1
  17. package/dist/lib/components/Loader/Loader.css.cjs +6 -5
  18. package/dist/lib/components/Loader/Loader.css.mjs +11 -9
  19. package/dist/lib/components/PageBlock/PageBlock.cjs +2 -1
  20. package/dist/lib/components/PageBlock/PageBlock.mjs +2 -1
  21. package/dist/lib/components/Stepper/Stepper.css.cjs +1 -1
  22. package/dist/lib/components/Stepper/Stepper.css.mjs +1 -1
  23. package/dist/lib/components/Table/TableBody.cjs +2 -1
  24. package/dist/lib/components/Table/TableBody.mjs +2 -1
  25. package/dist/lib/components/Table/TableCell.cjs +2 -1
  26. package/dist/lib/components/Table/TableCell.mjs +2 -1
  27. package/dist/lib/components/Table/TableFooter.cjs +2 -1
  28. package/dist/lib/components/Table/TableFooter.mjs +2 -1
  29. package/dist/lib/components/Table/TableHeader.cjs +2 -1
  30. package/dist/lib/components/Table/TableHeader.mjs +2 -1
  31. package/dist/lib/components/Tabs/Tab.cjs +14 -12
  32. package/dist/lib/components/Tabs/Tab.mjs +14 -12
  33. package/dist/lib/components/TextLink/TextLink.mjs +2 -1
  34. package/dist/lib/components/Textarea/formatRanges.cjs +3 -2
  35. package/dist/lib/components/Textarea/formatRanges.mjs +3 -2
  36. package/dist/lib/components/TooltipRenderer/TooltipRenderer.cjs +2 -1
  37. package/dist/lib/components/TooltipRenderer/TooltipRenderer.mjs +2 -1
  38. package/dist/lib/components/private/Announcement/Announcement.cjs +1 -0
  39. package/dist/lib/components/private/Announcement/Announcement.mjs +1 -0
  40. package/dist/lib/components/private/Modal/Modal.cjs +2 -1
  41. package/dist/lib/components/private/Modal/Modal.mjs +2 -1
  42. package/dist/lib/components/private/Popover/Popover.cjs +11 -9
  43. package/dist/lib/components/private/Popover/Popover.css.mjs +5 -4
  44. package/dist/lib/components/private/Popover/Popover.mjs +11 -9
  45. package/dist/lib/components/useToast/Toast.cjs +7 -6
  46. package/dist/lib/components/useToast/Toast.mjs +7 -6
  47. package/dist/lib/components/useToast/useFlipList.cjs +24 -24
  48. package/dist/lib/components/useToast/useFlipList.mjs +24 -24
  49. package/dist/lib/css/atoms/sprinkles.css.d.cts +1 -1
  50. package/dist/lib/css/atoms/sprinkles.css.d.mts +1 -1
  51. package/dist/lib/hooks/useIcon/icon.css.cjs +4 -7
  52. package/dist/lib/hooks/useIcon/icon.css.mjs +4 -7
  53. package/dist/lib/playroom/FrameComponent.cjs +2 -1
  54. package/dist/lib/playroom/FrameComponent.mjs +2 -1
  55. package/dist/lib/utils/isLight/index.cjs +1 -1
  56. package/dist/lib/utils/isLight/index.mjs +1 -1
  57. package/package.json +1 -1
@@ -48,18 +48,20 @@ const Tab = ({ children, data, badge, icon, item, ...restProps }) => {
48
48
  });
49
49
  (0, react.useEffect)(() => {
50
50
  if (!tabRef.current || !scrollContainer) return;
51
- if (isSelected || isFocused) if (isMobile) require_smoothScroll.smoothScroll(tabRef.current, {
52
- scrollContainer,
53
- direction: "horizontal",
54
- offset: space[paddingXForTabSize[size]] * grid * 3,
55
- ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
56
- });
57
- else require_smoothScroll.smoothScrollIntoView(tabRef.current, {
58
- scrollContainer,
59
- direction: "horizontal",
60
- offset: space[paddingXForTabSize[size]] * grid * 6,
61
- ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
62
- });
51
+ if (isSelected || isFocused) {
52
+ if (isMobile) require_smoothScroll.smoothScroll(tabRef.current, {
53
+ scrollContainer,
54
+ direction: "horizontal",
55
+ offset: space[paddingXForTabSize[size]] * grid * 3,
56
+ ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
57
+ });
58
+ else require_smoothScroll.smoothScrollIntoView(tabRef.current, {
59
+ scrollContainer,
60
+ direction: "horizontal",
61
+ offset: space[paddingXForTabSize[size]] * grid * 6,
62
+ ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
63
+ });
64
+ }
63
65
  firstRenderRef.current = false;
64
66
  }, [
65
67
  isSelected,
@@ -46,18 +46,20 @@ const Tab = ({ children, data, badge, icon, item, ...restProps }) => {
46
46
  });
47
47
  useEffect(() => {
48
48
  if (!tabRef.current || !scrollContainer) return;
49
- if (isSelected || isFocused) if (isMobile) smoothScroll(tabRef.current, {
50
- scrollContainer,
51
- direction: "horizontal",
52
- offset: space[paddingXForTabSize[size]] * grid * 3,
53
- ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
54
- });
55
- else smoothScrollIntoView(tabRef.current, {
56
- scrollContainer,
57
- direction: "horizontal",
58
- offset: space[paddingXForTabSize[size]] * grid * 6,
59
- ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
60
- });
49
+ if (isSelected || isFocused) {
50
+ if (isMobile) smoothScroll(tabRef.current, {
51
+ scrollContainer,
52
+ direction: "horizontal",
53
+ offset: space[paddingXForTabSize[size]] * grid * 3,
54
+ ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
55
+ });
56
+ else smoothScrollIntoView(tabRef.current, {
57
+ scrollContainer,
58
+ direction: "horizontal",
59
+ offset: space[paddingXForTabSize[size]] * grid * 6,
60
+ ...firstRenderRef.current ? { duration: 0 } : { speed: .7 }
61
+ });
62
+ }
61
63
  firstRenderRef.current = false;
62
64
  }, [
63
65
  isSelected,
@@ -18,7 +18,8 @@ const useLinkStyles = ({ reset = "a", weight, showVisited = false, hitArea = "st
18
18
  const backgroundContext = useBackground();
19
19
  const textContext = useContext(TextContext);
20
20
  const isWeakDueToTextTone = !useContext(HeadingContext_default) && textContext?.tone !== "neutral";
21
- return clsx(base, weight === "weak" || isWeakDueToTextTone ? weakLink : [isPlainBackground(backgroundContext.lightMode, "light") || weight === "regular" ? regularLinkLightMode[backgroundLightness.lightMode] : weakLink, isPlainBackground(backgroundContext.darkMode, "dark") || weight === "regular" ? regularLinkDarkMode[backgroundLightness.darkMode] : weakLink], weight !== "weak" ? fontWeight.medium : void 0, showVisited ? [visitedLightMode[backgroundLightness.lightMode], visitedDarkMode[backgroundLightness.darkMode]] : "", reset !== false ? atoms({ reset: typeof reset === "string" ? reset : "a" }) : null, atoms({ cursor: "pointer" }), hitArea === "large" && virtualTouchable);
21
+ const linkStyles = weight === "weak" || isWeakDueToTextTone ? weakLink : [isPlainBackground(backgroundContext.lightMode, "light") || weight === "regular" ? regularLinkLightMode[backgroundLightness.lightMode] : weakLink, isPlainBackground(backgroundContext.darkMode, "dark") || weight === "regular" ? regularLinkDarkMode[backgroundLightness.darkMode] : weakLink];
22
+ return clsx(base, linkStyles, weight !== "weak" ? fontWeight.medium : void 0, showVisited ? [visitedLightMode[backgroundLightness.lightMode], visitedDarkMode[backgroundLightness.darkMode]] : "", reset !== false ? atoms({ reset: typeof reset === "string" ? reset : "a" }) : null, atoms({ cursor: "pointer" }), hitArea === "large" && virtualTouchable);
22
23
  };
23
24
  const TextLinkContent = ({ icon, iconPosition = "leading", children }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
24
25
  icon && iconPosition === "leading" ? /* @__PURE__ */ jsx(AvoidWidowIcon, {
@@ -7,7 +7,7 @@ autosuggest_highlight_parse_index_js = require_runtime.__toESM(autosuggest_highl
7
7
  const formatRanges = (value, highlightRanges, tone) => {
8
8
  if (highlightRanges && value) {
9
9
  let lastEnd = 0;
10
- return (0, autosuggest_highlight_parse_index_js.default)(value, highlightRanges.sort((a, b) => a.start > b.start ? 1 : -1).reduce((acc, { end, start }) => {
10
+ const validatedAndSortedRanges = highlightRanges.sort((a, b) => a.start > b.start ? 1 : -1).reduce((acc, { end, start }) => {
11
11
  const resolvedEnd = end || value.length;
12
12
  if (resolvedEnd <= start) return acc;
13
13
  const adjustedRange = [];
@@ -19,7 +19,8 @@ const formatRanges = (value, highlightRanges, tone) => {
19
19
  lastEnd = resolvedEnd;
20
20
  }
21
21
  return [...acc, ...adjustedRange];
22
- }, []).map(({ start, end }) => [start, end || value.length])).reduce((acc, { text, highlight }, i) => {
22
+ }, []);
23
+ return (0, autosuggest_highlight_parse_index_js.default)(value, validatedAndSortedRanges.map(({ start, end }) => [start, end || value.length])).reduce((acc, { text, highlight }, i) => {
23
24
  if (text) acc.push(highlight ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Highlight.Highlight, {
24
25
  tone,
25
26
  children: text
@@ -5,7 +5,7 @@ import parseHighlights from "autosuggest-highlight/parse/index.js";
5
5
  const formatRanges = (value, highlightRanges, tone) => {
6
6
  if (highlightRanges && value) {
7
7
  let lastEnd = 0;
8
- return parseHighlights(value, highlightRanges.sort((a, b) => a.start > b.start ? 1 : -1).reduce((acc, { end, start }) => {
8
+ const validatedAndSortedRanges = highlightRanges.sort((a, b) => a.start > b.start ? 1 : -1).reduce((acc, { end, start }) => {
9
9
  const resolvedEnd = end || value.length;
10
10
  if (resolvedEnd <= start) return acc;
11
11
  const adjustedRange = [];
@@ -17,7 +17,8 @@ const formatRanges = (value, highlightRanges, tone) => {
17
17
  lastEnd = resolvedEnd;
18
18
  }
19
19
  return [...acc, ...adjustedRange];
20
- }, []).map(({ start, end }) => [start, end || value.length])).reduce((acc, { text, highlight }, i) => {
20
+ }, []);
21
+ return parseHighlights(value, validatedAndSortedRanges.map(({ start, end }) => [start, end || value.length])).reduce((acc, { text, highlight }, i) => {
21
22
  if (text) acc.push(highlight ? /* @__PURE__ */ jsx(Highlight, {
22
23
  tone,
23
24
  children: text
@@ -17,8 +17,9 @@ const offsetSpace = "small";
17
17
  const StaticTooltipContext = (0, react.createContext)(false);
18
18
  const clamp = (min, value, max) => Math.max(min, Math.min(value, max));
19
19
  const TooltipTextDefaultsProvider = ({ children }) => {
20
+ const themeName = require_useThemeName.useThemeName();
20
21
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_defaultTextProps.DefaultTextPropsProvider, {
21
- size: require_useThemeName.useThemeName() === "docs" ? "small" : void 0,
22
+ size: themeName === "docs" ? "small" : void 0,
22
23
  weight: "medium",
23
24
  children
24
25
  });
@@ -15,8 +15,9 @@ const offsetSpace = "small";
15
15
  const StaticTooltipContext = createContext(false);
16
16
  const clamp = (min, value, max) => Math.max(min, Math.min(value, max));
17
17
  const TooltipTextDefaultsProvider = ({ children }) => {
18
+ const themeName = useThemeName();
18
19
  return /* @__PURE__ */ jsx(DefaultTextPropsProvider, {
19
- size: useThemeName() === "docs" ? "small" : void 0,
20
+ size: themeName === "docs" ? "small" : void 0,
20
21
  weight: "medium",
21
22
  children
22
23
  });
@@ -20,6 +20,7 @@ const Announcement = ({ children }) => {
20
20
  element.setAttribute("class", className);
21
21
  element.setAttribute("aria-live", "polite");
22
22
  element.setAttribute("aria-atomic", "true");
23
+ element.setAttribute("translate", "no");
23
24
  document.body.appendChild(element);
24
25
  setElement(element);
25
26
  return () => {
@@ -20,6 +20,7 @@ const Announcement = ({ children }) => {
20
20
  element.setAttribute("class", className);
21
21
  element.setAttribute("aria-live", "polite");
22
22
  element.setAttribute("aria-atomic", "true");
23
+ element.setAttribute("translate", "no");
23
24
  document.body.appendChild(element);
24
25
  setElement(element);
25
26
  return () => {
@@ -10,6 +10,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
10
10
  let react_focus_lock = require("react-focus-lock");
11
11
  react_focus_lock = require_runtime.__toESM(react_focus_lock, 1);
12
12
  //#region src/lib/components/private/Modal/Modal.tsx
13
+ const FocusLock = react_focus_lock.default.default ?? react_focus_lock.default;
13
14
  const AllowCloseContext = (0, react.createContext)(true);
14
15
  const ModalPortal = ({ children }) => {
15
16
  const [modalElement, setElement] = (0, react.useState)(null);
@@ -106,7 +107,7 @@ const Modal = ({ id, open, children, description, onClose, width, closeLabel, il
106
107
  window.removeEventListener(event, handleEvent);
107
108
  };
108
109
  }, [trapActive]);
109
- return state === OPENING || state === OPEN || state === CLOSING ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_focus_lock.default, {
110
+ return state === OPENING || state === OPEN || state === CLOSING ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FocusLock, {
110
111
  className: require_Modal_css.resetStackingContext,
111
112
  disabled: !trapActive,
112
113
  autoFocus: false,
@@ -6,8 +6,9 @@ import { ModalContent } from "./ModalContent.mjs";
6
6
  import { ariaHideOthers } from "./ariaHideOthers.mjs";
7
7
  import { createContext, useContext, useEffect, useReducer, useRef, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import FocusLock from "react-focus-lock";
9
+ import FocusLockImport from "react-focus-lock";
10
10
  //#region src/lib/components/private/Modal/Modal.tsx
11
+ const FocusLock = FocusLockImport.default ?? FocusLockImport;
11
12
  const AllowCloseContext = createContext(true);
12
13
  const ModalPortal = ({ children }) => {
13
14
  const [modalElement, setElement] = useState(null);
@@ -55,16 +55,18 @@ const PopoverContent = (0, react.forwardRef)(({ id, role, align = "start", width
55
55
  const spaceScale = require_useSpace.useSpace();
56
56
  let offsetSpacePx = 0;
57
57
  if (resolvedOffsetSpace !== "none") offsetSpacePx = spaceScale.space[resolvedOffsetSpace] * spaceScale.grid;
58
+ const floatingUiRequestedPosition = getFloatingUiPosition(placement, align);
59
+ const middleware = [
60
+ (0, _floating_ui_react_dom.offset)(offsetSpacePx),
61
+ !lockPlacement && (0, _floating_ui_react_dom.flip)(),
62
+ width === "full" ? (0, _floating_ui_react_dom.size)({ apply({ rects, elements }) {
63
+ Object.assign(elements.floating.style, { width: `${rects.reference.width}px` });
64
+ } }) : (0, _floating_ui_react_dom.shift)({ crossAxis: align === "center" }),
65
+ arrowRef && (0, _floating_ui_react_dom.arrow)({ element: arrowRef })
66
+ ].filter(Boolean);
58
67
  const { refs, floatingStyles, middlewareData, placement: floatingUiEvaluatedPosition, isPositioned } = (0, _floating_ui_react_dom.useFloating)({
59
- placement: getFloatingUiPosition(placement, align),
60
- middleware: [
61
- (0, _floating_ui_react_dom.offset)(offsetSpacePx),
62
- !lockPlacement && (0, _floating_ui_react_dom.flip)(),
63
- width === "full" ? (0, _floating_ui_react_dom.size)({ apply({ rects, elements }) {
64
- Object.assign(elements.floating.style, { width: `${rects.reference.width}px` });
65
- } }) : (0, _floating_ui_react_dom.shift)({ crossAxis: align === "center" }),
66
- arrowRef && (0, _floating_ui_react_dom.arrow)({ element: arrowRef })
67
- ].filter(Boolean),
68
+ placement: floatingUiRequestedPosition,
69
+ middleware,
68
70
  whileElementsMounted: _floating_ui_react_dom.autoUpdate
69
71
  });
70
72
  (0, react.useEffect)(() => {
@@ -11,11 +11,12 @@ const backdrop = style({
11
11
  const placementModifier = createVar("placementModifier");
12
12
  const invertPlacement = style({ vars: { [placementModifier]: "-1" } }, "invertPlacement");
13
13
  const transitionThreshold = "xxsmall";
14
+ const popupAnimation = keyframes({ from: {
15
+ opacity: 0,
16
+ transform: `translateY(${calc(vars.space[transitionThreshold]).multiply(fallbackVar(placementModifier, "1"))})`
17
+ } }, "popupAnimation");
14
18
  const animation = style({
15
- animationName: keyframes({ from: {
16
- opacity: 0,
17
- transform: `translateY(${calc(vars.space[transitionThreshold]).multiply(fallbackVar(placementModifier, "1"))})`
18
- } }, "popupAnimation"),
19
+ animationName: popupAnimation,
19
20
  animationFillMode: "both",
20
21
  animationTimingFunction: "ease",
21
22
  animationDuration: "0.125s",
@@ -53,16 +53,18 @@ const PopoverContent = forwardRef(({ id, role, align = "start", width = "content
53
53
  const spaceScale = useSpace();
54
54
  let offsetSpacePx = 0;
55
55
  if (resolvedOffsetSpace !== "none") offsetSpacePx = spaceScale.space[resolvedOffsetSpace] * spaceScale.grid;
56
+ const floatingUiRequestedPosition = getFloatingUiPosition(placement, align);
57
+ const middleware = [
58
+ offset(offsetSpacePx),
59
+ !lockPlacement && flip(),
60
+ width === "full" ? size({ apply({ rects, elements }) {
61
+ Object.assign(elements.floating.style, { width: `${rects.reference.width}px` });
62
+ } }) : shift({ crossAxis: align === "center" }),
63
+ arrowRef && arrow({ element: arrowRef })
64
+ ].filter(Boolean);
56
65
  const { refs, floatingStyles, middlewareData, placement: floatingUiEvaluatedPosition, isPositioned } = useFloating({
57
- placement: getFloatingUiPosition(placement, align),
58
- middleware: [
59
- offset(offsetSpacePx),
60
- !lockPlacement && flip(),
61
- width === "full" ? size({ apply({ rects, elements }) {
62
- Object.assign(elements.floating.style, { width: `${rects.reference.width}px` });
63
- } }) : shift({ crossAxis: align === "center" }),
64
- arrowRef && arrow({ element: arrowRef })
65
- ].filter(Boolean),
66
+ placement: floatingUiRequestedPosition,
67
+ middleware,
66
68
  whileElementsMounted: autoUpdate
67
69
  });
68
70
  useEffect(() => {
@@ -25,20 +25,21 @@ const toneToIcon = {
25
25
  critical: require_IconCritical.IconCritical,
26
26
  positive: require_IconPositive.IconPositive
27
27
  };
28
- const toastDuration = 10 * 1e3;
28
+ const toastDuration = 1e4;
29
29
  const borderRadius = "large";
30
30
  const Action = ({ label, onClick, removeToast }) => {
31
+ const handleClick = (0, react.useCallback)((event) => {
32
+ event.stopPropagation();
33
+ removeToast();
34
+ onClick();
35
+ }, [removeToast, onClick]);
31
36
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
32
37
  baseline: false,
33
38
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
34
39
  component: "span",
35
40
  "aria-hidden": true,
36
41
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TextLinkButton.TextLinkButton, {
37
- onClick: (0, react.useCallback)((event) => {
38
- event.stopPropagation();
39
- removeToast();
40
- onClick();
41
- }, [removeToast, onClick]),
42
+ onClick: handleClick,
42
43
  hitArea: "large",
43
44
  children: label
44
45
  })
@@ -23,20 +23,21 @@ const toneToIcon = {
23
23
  critical: IconCritical,
24
24
  positive: IconPositive
25
25
  };
26
- const toastDuration = 10 * 1e3;
26
+ const toastDuration = 1e4;
27
27
  const borderRadius = "large";
28
28
  const Action = ({ label, onClick, removeToast }) => {
29
+ const handleClick = useCallback((event) => {
30
+ event.stopPropagation();
31
+ removeToast();
32
+ onClick();
33
+ }, [removeToast, onClick]);
29
34
  return /* @__PURE__ */ jsx(Text, {
30
35
  baseline: false,
31
36
  children: /* @__PURE__ */ jsx(Box, {
32
37
  component: "span",
33
38
  "aria-hidden": true,
34
39
  children: /* @__PURE__ */ jsx(TextLinkButton, {
35
- onClick: useCallback((event) => {
36
- event.stopPropagation();
37
- removeToast();
38
- onClick();
39
- }, [removeToast, onClick]),
40
+ onClick: handleClick,
40
41
  hitArea: "large",
41
42
  children: label
42
43
  })
@@ -55,8 +55,10 @@ const useFlipList = (expanded) => {
55
55
  };
56
56
  const activeToasts = [];
57
57
  Array.from(refs.entries()).forEach(([toastKey, element]) => {
58
- if (element !== null) if (toastStates.get(toastKey) === "exiting") refs.delete(toastKey);
59
- else activeToasts.push([toastKey, element]);
58
+ if (element !== null) {
59
+ if (toastStates.get(toastKey) === "exiting") refs.delete(toastKey);
60
+ else activeToasts.push([toastKey, element]);
61
+ }
60
62
  });
61
63
  activeToasts.forEach(([toastKey, element], index) => {
62
64
  const position = activeToasts.length - index - 1;
@@ -139,28 +141,26 @@ const useFlipList = (expanded) => {
139
141
  }]
140
142
  });
141
143
  break;
142
- case "become-first":
143
- animations.push({
144
- element,
145
- transition: baseTransition,
146
- transforms: [
147
- {
148
- property: "height",
149
- from: require_px.px(currentHeight),
150
- to: require_px.px(fullHeight)
151
- },
152
- {
153
- property: "transform",
154
- from: transform
155
- },
156
- {
157
- property: "className",
158
- from: expanded ? require_Toast_css.collapsed : void 0,
159
- to: void 0
160
- }
161
- ]
162
- });
163
- break;
144
+ case "become-first": animations.push({
145
+ element,
146
+ transition: baseTransition,
147
+ transforms: [
148
+ {
149
+ property: "height",
150
+ from: require_px.px(currentHeight),
151
+ to: require_px.px(fullHeight)
152
+ },
153
+ {
154
+ property: "transform",
155
+ from: transform
156
+ },
157
+ {
158
+ property: "className",
159
+ from: expanded ? require_Toast_css.collapsed : void 0,
160
+ to: void 0
161
+ }
162
+ ]
163
+ });
164
164
  }
165
165
  toastStates.set(toastKey, "entered");
166
166
  });
@@ -55,8 +55,10 @@ const useFlipList = (expanded) => {
55
55
  };
56
56
  const activeToasts = [];
57
57
  Array.from(refs.entries()).forEach(([toastKey, element]) => {
58
- if (element !== null) if (toastStates.get(toastKey) === "exiting") refs.delete(toastKey);
59
- else activeToasts.push([toastKey, element]);
58
+ if (element !== null) {
59
+ if (toastStates.get(toastKey) === "exiting") refs.delete(toastKey);
60
+ else activeToasts.push([toastKey, element]);
61
+ }
60
62
  });
61
63
  activeToasts.forEach(([toastKey, element], index) => {
62
64
  const position = activeToasts.length - index - 1;
@@ -139,28 +141,26 @@ const useFlipList = (expanded) => {
139
141
  }]
140
142
  });
141
143
  break;
142
- case "become-first":
143
- animations.push({
144
- element,
145
- transition: baseTransition,
146
- transforms: [
147
- {
148
- property: "height",
149
- from: px(currentHeight),
150
- to: px(fullHeight)
151
- },
152
- {
153
- property: "transform",
154
- from: transform
155
- },
156
- {
157
- property: "className",
158
- from: expanded ? collapsed : void 0,
159
- to: void 0
160
- }
161
- ]
162
- });
163
- break;
144
+ case "become-first": animations.push({
145
+ element,
146
+ transition: baseTransition,
147
+ transforms: [
148
+ {
149
+ property: "height",
150
+ from: px(currentHeight),
151
+ to: px(fullHeight)
152
+ },
153
+ {
154
+ property: "transform",
155
+ from: transform
156
+ },
157
+ {
158
+ property: "className",
159
+ from: expanded ? collapsed : void 0,
160
+ to: void 0
161
+ }
162
+ ]
163
+ });
164
164
  }
165
165
  toastStates.set(toastKey, "entered");
166
166
  });
@@ -4,7 +4,7 @@ import { ConditionalValue, RequiredConditionalValue } from "@vanilla-extract/spr
4
4
  declare const colorAtomicProperties: {
5
5
  conditions: {
6
6
  defaultCondition: "lightMode";
7
- conditionNames: ("lightMode" | "darkMode")[];
7
+ conditionNames: ("darkMode" | "lightMode")[];
8
8
  };
9
9
  styles: {
10
10
  readonly background: {
@@ -4,7 +4,7 @@ import { ConditionalValue, RequiredConditionalValue } from "@vanilla-extract/spr
4
4
  declare const colorAtomicProperties: {
5
5
  conditions: {
6
6
  defaultCondition: "lightMode";
7
- conditionNames: ("lightMode" | "darkMode")[];
7
+ conditionNames: ("darkMode" | "lightMode")[];
8
8
  };
9
9
  styles: {
10
10
  readonly background: {
@@ -15,18 +15,15 @@ const inlineCrop = (0, _vanilla_extract_css.style)({
15
15
  marginBottom: `-${iconScaleIncrease}em`
16
16
  }, "inlineCrop");
17
17
  const inline = (0, _vanilla_extract_css.style)({ verticalAlign: "middle" }, "inline");
18
- const uppercaseNudge = -.105;
19
- const lowercaseNudge = -.065;
20
- const verticalCorrection = .06;
21
18
  const alignY = {
22
19
  uppercase: (0, _vanilla_extract_css.styleVariants)({
23
- none: { top: `${uppercaseNudge}em` },
24
- up: { top: `${uppercaseNudge - verticalCorrection}em` },
20
+ none: { top: `-0.105em` },
21
+ up: { top: `-0.16499999999999998em` },
25
22
  down: { top: `-0.045em` }
26
23
  }, "alignY_uppercase"),
27
24
  lowercase: (0, _vanilla_extract_css.styleVariants)({
28
- none: { top: `${lowercaseNudge}em` },
29
- up: { top: `${lowercaseNudge - verticalCorrection}em` },
25
+ none: { top: `-0.065em` },
26
+ up: { top: `-0.125em` },
30
27
  down: { top: `-0.0050000000000000044em` }
31
28
  }, "alignY_lowercase")
32
29
  };
@@ -15,18 +15,15 @@ const inlineCrop = style({
15
15
  marginBottom: `-${iconScaleIncrease}em`
16
16
  }, "inlineCrop");
17
17
  const inline = style({ verticalAlign: "middle" }, "inline");
18
- const uppercaseNudge = -.105;
19
- const lowercaseNudge = -.065;
20
- const verticalCorrection = .06;
21
18
  const alignY = {
22
19
  uppercase: styleVariants({
23
- none: { top: `${uppercaseNudge}em` },
24
- up: { top: `${uppercaseNudge - verticalCorrection}em` },
20
+ none: { top: `-0.105em` },
21
+ up: { top: `-0.16499999999999998em` },
25
22
  down: { top: `-0.045em` }
26
23
  }, "alignY_uppercase"),
27
24
  lowercase: styleVariants({
28
- none: { top: `${lowercaseNudge}em` },
29
- up: { top: `${lowercaseNudge - verticalCorrection}em` },
25
+ none: { top: `-0.065em` },
26
+ up: { top: `-0.125em` },
30
27
  down: { top: `-0.0050000000000000044em` }
31
28
  }, "alignY_lowercase")
32
29
  };
@@ -17,7 +17,8 @@ const PlayroomLink = require_BraidProvider.makeLinkComponent(({ href, onClick, .
17
17
  ...restProps
18
18
  }));
19
19
  const ResponsiveReady = ({ children }) => {
20
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: require_useResponsiveValue.useResponsiveValue()({ mobile: true }) ?? false ? children : null });
20
+ const responsiveReady = require_useResponsiveValue.useResponsiveValue()({ mobile: true }) ?? false;
21
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: responsiveReady ? children : null });
21
22
  };
22
23
  var FrameComponent_default = ({ theme, children, frameSettings }) => {
23
24
  const stackDebug = (0, react.useMemo)(() => frameSettings.stackDebug, [frameSettings.stackDebug]);
@@ -17,7 +17,8 @@ const PlayroomLink = makeLinkComponent(({ href, onClick, ...restProps }, ref) =>
17
17
  ...restProps
18
18
  }));
19
19
  const ResponsiveReady = ({ children }) => {
20
- return /* @__PURE__ */ jsx(Fragment$1, { children: useResponsiveValue()({ mobile: true }) ?? false ? children : null });
20
+ const responsiveReady = useResponsiveValue()({ mobile: true }) ?? false;
21
+ return /* @__PURE__ */ jsx(Fragment$1, { children: responsiveReady ? children : null });
21
22
  };
22
23
  var FrameComponent_default = ({ theme, children, frameSettings }) => {
23
24
  const stackDebug = useMemo(() => frameSettings.stackDebug, [frameSettings.stackDebug]);
@@ -15,7 +15,7 @@ const isLight = (inputColor, foregroundColor = "#000") => {
15
15
  const colors = /^linear-gradient/.test(inputColor) ? getLinearGradientColors(inputColor) : [inputColor];
16
16
  const foregroundYiq = calculateYiq(foregroundColor);
17
17
  return colors.some((color) => {
18
- return calculateYiq(color) >= 256 / 2 + foregroundYiq / 2;
18
+ return calculateYiq(color) >= 128 + foregroundYiq / 2;
19
19
  });
20
20
  };
21
21
  //#endregion
@@ -15,7 +15,7 @@ const isLight = (inputColor, foregroundColor = "#000") => {
15
15
  const colors = /^linear-gradient/.test(inputColor) ? getLinearGradientColors(inputColor) : [inputColor];
16
16
  const foregroundYiq = calculateYiq(foregroundColor);
17
17
  return colors.some((color) => {
18
- return calculateYiq(color) >= 256 / 2 + foregroundYiq / 2;
18
+ return calculateYiq(color) >= 128 + foregroundYiq / 2;
19
19
  });
20
20
  };
21
21
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "34.6.0",
3
+ "version": "34.6.2",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "homepage": "https://seek-oss.github.io/braid-design-system/",
6
6
  "bugs": {