braid-design-system 34.6.1 → 34.7.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 (52) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/color-mode/query-param.d.cts +1 -1
  3. package/dist/color-mode/query-param.d.mts +1 -1
  4. package/dist/lib/components/Actions/Actions.cjs +0 -1
  5. package/dist/lib/components/Actions/Actions.mjs +1 -1
  6. package/dist/lib/components/Autosuggest/Autosuggest.cjs +16 -23
  7. package/dist/lib/components/Autosuggest/Autosuggest.mjs +17 -24
  8. package/dist/lib/components/Autosuggest/useScrollIntoView.cjs +14 -0
  9. package/dist/lib/components/Autosuggest/useScrollIntoView.mjs +14 -0
  10. package/dist/lib/components/ButtonIcon/ButtonIcon.cjs +16 -2
  11. package/dist/lib/components/ButtonIcon/ButtonIcon.d.cts +1 -1
  12. package/dist/lib/components/ButtonIcon/ButtonIcon.d.mts +1 -1
  13. package/dist/lib/components/ButtonIcon/ButtonIcon.mjs +16 -2
  14. package/dist/lib/components/Inline/Inline.d.cts +3 -3
  15. package/dist/lib/components/Inline/Inline.d.mts +3 -3
  16. package/dist/lib/components/MenuRenderer/MenuRenderer.css.cjs +0 -17
  17. package/dist/lib/components/MenuRenderer/MenuRenderer.css.mjs +1 -17
  18. package/dist/lib/components/MonthPicker/MonthPicker.d.cts +1 -1
  19. package/dist/lib/components/MonthPicker/MonthPicker.d.mts +1 -1
  20. package/dist/lib/components/Pagination/Pagination.css.cjs +0 -1
  21. package/dist/lib/components/Pagination/Pagination.css.mjs +0 -1
  22. package/dist/lib/components/Rating/Rating.cjs +1 -0
  23. package/dist/lib/components/Rating/Rating.mjs +1 -0
  24. package/dist/lib/components/Stepper/StepperContext.cjs +30 -20
  25. package/dist/lib/components/Stepper/StepperContext.mjs +30 -20
  26. package/dist/lib/components/Tabs/Tab.cjs +14 -12
  27. package/dist/lib/components/Tabs/Tab.mjs +14 -12
  28. package/dist/lib/components/TooltipRenderer/TooltipRenderer.cjs +0 -2
  29. package/dist/lib/components/TooltipRenderer/TooltipRenderer.mjs +1 -1
  30. package/dist/lib/components/private/Announcement/Announcement.cjs +1 -0
  31. package/dist/lib/components/private/Announcement/Announcement.mjs +1 -0
  32. package/dist/lib/components/private/InlineField/InlineField.css.cjs +0 -1
  33. package/dist/lib/components/private/InlineField/InlineField.css.mjs +1 -1
  34. package/dist/lib/components/private/InlineField/StyledInput.d.cts +1 -1
  35. package/dist/lib/components/private/InlineField/StyledInput.d.mts +1 -1
  36. package/dist/lib/components/private/Popover/Popover.css.cjs +1 -3
  37. package/dist/lib/components/private/Popover/Popover.css.mjs +2 -3
  38. package/dist/lib/components/private/Popover/Popover.d.cts +1 -1
  39. package/dist/lib/components/private/Popover/Popover.d.mts +1 -1
  40. package/dist/lib/components/useToast/useFlipList.cjs +4 -2
  41. package/dist/lib/components/useToast/useFlipList.mjs +4 -2
  42. package/dist/lib/css/atoms/sprinkles.css.d.cts +1 -1
  43. package/dist/lib/css/atoms/sprinkles.css.d.mts +1 -1
  44. package/dist/lib/playroom/snippets/ButtonIcon.cjs +4 -0
  45. package/dist/lib/playroom/snippets/ButtonIcon.mjs +4 -0
  46. package/dist/lib/themes/tokenType.d.cts +1 -1
  47. package/dist/lib/themes/tokenType.d.mts +1 -1
  48. package/dist/lib/utils/a11y/index.cjs +0 -2
  49. package/dist/lib/utils/a11y/index.mjs +1 -1
  50. package/dist/lib/utils/isLight/index.cjs +1 -1
  51. package/dist/lib/utils/isLight/index.mjs +1 -1
  52. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 34.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **ButtonIcon:** Add `brandAccent` tone ([#2125](https://github.com/seek-oss/braid-design-system/pull/2125))
8
+
9
+ Introduces support for the `brandAccent` tone on `ButtonIcon`.
10
+
11
+ **EXAMPLE USAGE:**
12
+
13
+ ```jsx
14
+ <ButtonIcon tone="brandAccent" icon={<IconAdd />} label="Add" />
15
+ ```
16
+
17
+ - **ButtonIcon:** Default accent tones to `solid` when `variant` is omitted ([#2125](https://github.com/seek-oss/braid-design-system/pull/2125))
18
+
19
+ Accent tones (`formAccent`, `brandAccent`) now default to `solid` when `variant` is omitted — existing `formAccent` usage can pass `variant="soft"` to keep the previous look.
20
+
21
+ **EXAMPLE USAGE:**
22
+
23
+ ```jsx
24
+ <ButtonIcon tone="formAccent" icon={<IconAdd />} label="Add" />
25
+ ```
26
+
27
+ ### Patch Changes
28
+
29
+ - **Rating:** Expose the star graphic with `role="img"` so the `aria-label` is announced reliably by assistive technologies. ([#2122](https://github.com/seek-oss/braid-design-system/pull/2122))
30
+
31
+ ## 34.6.2
32
+
33
+ ### Patch Changes
34
+
35
+ - **Autosuggest:** Add `translate="no"` to the suggestion list and the ARIA live announcement region to prevent browser translations from wrapping text nodes in `<font>` elements, which breaks React DOM updates. Also key suggestion rows by index instead of `index + text`, so locale changes to suggestion labels no longer remount the list, and numeric text can no longer collide keys via string concatenation. ([#2117](https://github.com/seek-oss/braid-design-system/pull/2117))
36
+
37
+ - **Autosuggest:** Allow the suggestions list to flip above the field when there is insufficient space below, and keep keyboard highlight scrolling inside the menu so it no longer jumps the page ([#2113](https://github.com/seek-oss/braid-design-system/pull/2113))
38
+
3
39
  ## 34.6.1
4
40
 
5
41
  ### Patch Changes
@@ -43,6 +43,6 @@ declare const colorModeQueryParamCheck: string;
43
43
  *
44
44
  * @returns Braid color mode preference as query string parameter
45
45
  */
46
- declare const getColorModeQueryParam: () => "" | "_bdsdm=1" | "_bdsdm=2" | "_bdsdm=0";
46
+ declare const getColorModeQueryParam: () => "_bdsdm=0" | "_bdsdm=1" | "_bdsdm=2" | "";
47
47
  //#endregion
48
48
  export { colorModeQueryParamCheck, getColorModeQueryParam };
@@ -43,6 +43,6 @@ declare const colorModeQueryParamCheck: string;
43
43
  *
44
44
  * @returns Braid color mode preference as query string parameter
45
45
  */
46
- declare const getColorModeQueryParam: () => "" | "_bdsdm=1" | "_bdsdm=2" | "_bdsdm=0";
46
+ declare const getColorModeQueryParam: () => "_bdsdm=0" | "_bdsdm=1" | "_bdsdm=2" | "";
47
47
  //#endregion
48
48
  export { colorModeQueryParamCheck, getColorModeQueryParam };
@@ -25,4 +25,3 @@ const Actions = ({ size, data, children }) => {
25
25
  };
26
26
  //#endregion
27
27
  exports.Actions = Actions;
28
- exports.actionsSpace = actionsSpace;
@@ -24,4 +24,4 @@ const Actions = ({ size, data, children }) => {
24
24
  });
25
25
  };
26
26
  //#endregion
27
- export { Actions, actionsSpace };
27
+ export { Actions };
@@ -20,6 +20,7 @@ const require_normalizeKey = require("../private/normalizeKey.cjs");
20
20
  const require_smoothScroll = require("../private/smoothScroll.cjs");
21
21
  const require_createAccessibilityProps = require("./createAccessibilityProps.cjs");
22
22
  const require_reverseMatches = require("./reverseMatches.cjs");
23
+ const require_useScrollIntoView = require("./useScrollIntoView.cjs");
23
24
  const require_Autosuggest_css = require("./Autosuggest.css.cjs");
24
25
  let dedent = require("dedent");
25
26
  dedent = require_runtime.__toESM(dedent, 1);
@@ -257,24 +258,15 @@ const Autosuggest = (0, react.forwardRef)(function({ id, value = fallbackValue,
257
258
  isFocused: false
258
259
  });
259
260
  const isOpen = showSuggestionsIfAvailable && hasItems;
260
- (typeof highlightedIndex === "number" ? document.getElementById(require_createAccessibilityProps.getItemId(resolvedId, highlightedIndex)) : null)?.scrollIntoView({ block: "nearest" });
261
- (0, react.useEffect)(() => {
261
+ const highlightedItem = typeof highlightedIndex === "number" ? document.getElementById(require_createAccessibilityProps.getItemId(resolvedId, highlightedIndex)) : null;
262
+ (0, react.useLayoutEffect)(() => {
262
263
  dispatch({ type: HAS_SUGGESTIONS_CHANGED });
263
264
  }, [hasSuggestions]);
264
265
  const isMobile = require_useResponsiveValue.useResponsiveValue()({
265
266
  mobile: true,
266
267
  tablet: false
267
268
  });
268
- (0, react.useEffect)(() => {
269
- if (menuRef.current && isOpen && !isMobile) {
270
- const { bottom: menuBottom } = menuRef.current.getBoundingClientRect();
271
- if (menuBottom > document.documentElement.clientHeight) menuRef.current.scrollIntoView(false);
272
- }
273
- }, [
274
- isOpen,
275
- isMobile,
276
- suggestionCount
277
- ]);
269
+ require_useScrollIntoView.useScrollIntoView(highlightedItem, menuRef);
278
270
  const inputProps = {
279
271
  value: previewValue ? previewValue.text : value.text,
280
272
  type: type === "search" ? type : "text",
@@ -337,14 +329,16 @@ const Autosuggest = (0, react.forwardRef)(function({ id, value = fallbackValue,
337
329
  const clearable = Boolean(typeof onClear !== "undefined" && !restProps.disabled && typeof value !== "undefined" && value.text.length > 0);
338
330
  const announcements = [];
339
331
  const hasAutomaticSelection = automaticSelection && previewValue === null && highlightedIndex === 0;
340
- if (isFocused && isOpen && (highlightedIndex === null || hasAutomaticSelection)) if (hasSuggestions) {
341
- announcements.push(translations.suggestionsAvailableAnnouncement(suggestionCount));
342
- if (hasAutomaticSelection) announcements.push(translations.suggestionAutoSelectedAnnouncement(normalisedSuggestions[0].text));
343
- announcements.push(translations.suggestionInstructions);
344
- } else if (noSuggestionsMessage) {
345
- if (noSuggestionsMessage.title) announcements.push(noSuggestionsMessage.title);
346
- announcements.push(noSuggestionsMessage.description);
347
- } else announcements.push(translations.noSuggestionsAvailableAnnouncement);
332
+ if (isFocused && isOpen && (highlightedIndex === null || hasAutomaticSelection)) {
333
+ if (hasSuggestions) {
334
+ announcements.push(translations.suggestionsAvailableAnnouncement(suggestionCount));
335
+ if (hasAutomaticSelection) announcements.push(translations.suggestionAutoSelectedAnnouncement(normalisedSuggestions[0].text));
336
+ announcements.push(translations.suggestionInstructions);
337
+ } else if (noSuggestionsMessage) {
338
+ if (noSuggestionsMessage.title) announcements.push(noSuggestionsMessage.title);
339
+ announcements.push(noSuggestionsMessage.description);
340
+ } else announcements.push(translations.noSuggestionsAvailableAnnouncement);
341
+ }
348
342
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [showMobileBackdrop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
349
343
  position: "fixed",
350
344
  zIndex: "dropdownBackdrop",
@@ -397,7 +391,6 @@ const Autosuggest = (0, react.forwardRef)(function({ id, value = fallbackValue,
397
391
  triggerRef: fieldRef,
398
392
  open: isOpen,
399
393
  width: "full",
400
- lockPlacement: true,
401
394
  offsetSpace: "xxsmall",
402
395
  modal: false,
403
396
  role: false,
@@ -408,6 +401,7 @@ const Autosuggest = (0, react.forwardRef)(function({ id, value = fallbackValue,
408
401
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
409
402
  textAlign: "left",
410
403
  component: "ul",
404
+ translate: "no",
411
405
  background: !hasSuggestions && noSuggestionsMessage ? {
412
406
  lightMode: "neutralSoft",
413
407
  darkMode: "neutral"
@@ -433,7 +427,6 @@ const Autosuggest = (0, react.forwardRef)(function({ id, value = fallbackValue,
433
427
  children: noSuggestionsMessage.description
434
428
  })]
435
429
  }) : null, hasSuggestions ? normalisedSuggestions.map((suggestion, index) => {
436
- const { text } = suggestion;
437
430
  const groupHeading = groupHeadingIndexes.get(index);
438
431
  const highlights = suggestionHighlight ? highlightSuggestions(suggestion.text, value.text, suggestionHighlight) : suggestion.highlights;
439
432
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [groupHeading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupHeading, { children: groupHeading }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SuggestionItem, {
@@ -459,7 +452,7 @@ const Autosuggest = (0, react.forwardRef)(function({ id, value = fallbackValue,
459
452
  description: suggestion.description,
460
453
  groupHeading: groupHeadingForSuggestion.get(suggestion)
461
454
  })
462
- })] }, index + text);
455
+ })] }, index);
463
456
  }) : null]
464
457
  })
465
458
  })
@@ -19,9 +19,10 @@ import { normalizeKey } from "../private/normalizeKey.mjs";
19
19
  import { smoothScroll } from "../private/smoothScroll.mjs";
20
20
  import { createAccessibilityProps, getItemId } from "./createAccessibilityProps.mjs";
21
21
  import { reverseMatches } from "./reverseMatches.mjs";
22
+ import { useScrollIntoView } from "./useScrollIntoView.mjs";
22
23
  import { backdrop, backdropVisible, menu } from "./Autosuggest.css.mjs";
23
24
  import dedent from "dedent";
24
- import { Fragment, forwardRef, useCallback, useEffect, useReducer, useRef } from "react";
25
+ import { Fragment, forwardRef, useCallback, useLayoutEffect, useReducer, useRef } from "react";
25
26
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
26
27
  import matchHighlights from "autosuggest-highlight/match/index.js";
27
28
  import parseHighlights from "autosuggest-highlight/parse/index.js";
@@ -253,24 +254,15 @@ const Autosuggest = forwardRef(function({ id, value = fallbackValue, suggestions
253
254
  isFocused: false
254
255
  });
255
256
  const isOpen = showSuggestionsIfAvailable && hasItems;
256
- (typeof highlightedIndex === "number" ? document.getElementById(getItemId(resolvedId, highlightedIndex)) : null)?.scrollIntoView({ block: "nearest" });
257
- useEffect(() => {
257
+ const highlightedItem = typeof highlightedIndex === "number" ? document.getElementById(getItemId(resolvedId, highlightedIndex)) : null;
258
+ useLayoutEffect(() => {
258
259
  dispatch({ type: HAS_SUGGESTIONS_CHANGED });
259
260
  }, [hasSuggestions]);
260
261
  const isMobile = useResponsiveValue()({
261
262
  mobile: true,
262
263
  tablet: false
263
264
  });
264
- useEffect(() => {
265
- if (menuRef.current && isOpen && !isMobile) {
266
- const { bottom: menuBottom } = menuRef.current.getBoundingClientRect();
267
- if (menuBottom > document.documentElement.clientHeight) menuRef.current.scrollIntoView(false);
268
- }
269
- }, [
270
- isOpen,
271
- isMobile,
272
- suggestionCount
273
- ]);
265
+ useScrollIntoView(highlightedItem, menuRef);
274
266
  const inputProps = {
275
267
  value: previewValue ? previewValue.text : value.text,
276
268
  type: type === "search" ? type : "text",
@@ -333,14 +325,16 @@ const Autosuggest = forwardRef(function({ id, value = fallbackValue, suggestions
333
325
  const clearable = Boolean(typeof onClear !== "undefined" && !restProps.disabled && typeof value !== "undefined" && value.text.length > 0);
334
326
  const announcements = [];
335
327
  const hasAutomaticSelection = automaticSelection && previewValue === null && highlightedIndex === 0;
336
- if (isFocused && isOpen && (highlightedIndex === null || hasAutomaticSelection)) if (hasSuggestions) {
337
- announcements.push(translations.suggestionsAvailableAnnouncement(suggestionCount));
338
- if (hasAutomaticSelection) announcements.push(translations.suggestionAutoSelectedAnnouncement(normalisedSuggestions[0].text));
339
- announcements.push(translations.suggestionInstructions);
340
- } else if (noSuggestionsMessage) {
341
- if (noSuggestionsMessage.title) announcements.push(noSuggestionsMessage.title);
342
- announcements.push(noSuggestionsMessage.description);
343
- } else announcements.push(translations.noSuggestionsAvailableAnnouncement);
328
+ if (isFocused && isOpen && (highlightedIndex === null || hasAutomaticSelection)) {
329
+ if (hasSuggestions) {
330
+ announcements.push(translations.suggestionsAvailableAnnouncement(suggestionCount));
331
+ if (hasAutomaticSelection) announcements.push(translations.suggestionAutoSelectedAnnouncement(normalisedSuggestions[0].text));
332
+ announcements.push(translations.suggestionInstructions);
333
+ } else if (noSuggestionsMessage) {
334
+ if (noSuggestionsMessage.title) announcements.push(noSuggestionsMessage.title);
335
+ announcements.push(noSuggestionsMessage.description);
336
+ } else announcements.push(translations.noSuggestionsAvailableAnnouncement);
337
+ }
344
338
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [showMobileBackdrop ? /* @__PURE__ */ jsx(Box, {
345
339
  position: "fixed",
346
340
  zIndex: "dropdownBackdrop",
@@ -393,7 +387,6 @@ const Autosuggest = forwardRef(function({ id, value = fallbackValue, suggestions
393
387
  triggerRef: fieldRef,
394
388
  open: isOpen,
395
389
  width: "full",
396
- lockPlacement: true,
397
390
  offsetSpace: "xxsmall",
398
391
  modal: false,
399
392
  role: false,
@@ -404,6 +397,7 @@ const Autosuggest = forwardRef(function({ id, value = fallbackValue, suggestions
404
397
  children: /* @__PURE__ */ jsxs(Box, {
405
398
  textAlign: "left",
406
399
  component: "ul",
400
+ translate: "no",
407
401
  background: !hasSuggestions && noSuggestionsMessage ? {
408
402
  lightMode: "neutralSoft",
409
403
  darkMode: "neutral"
@@ -429,7 +423,6 @@ const Autosuggest = forwardRef(function({ id, value = fallbackValue, suggestions
429
423
  children: noSuggestionsMessage.description
430
424
  })]
431
425
  }) : null, hasSuggestions ? normalisedSuggestions.map((suggestion, index) => {
432
- const { text } = suggestion;
433
426
  const groupHeading = groupHeadingIndexes.get(index);
434
427
  const highlights = suggestionHighlight ? highlightSuggestions(suggestion.text, value.text, suggestionHighlight) : suggestion.highlights;
435
428
  return /* @__PURE__ */ jsxs(Fragment, { children: [groupHeading ? /* @__PURE__ */ jsx(GroupHeading, { children: groupHeading }) : null, /* @__PURE__ */ jsx(SuggestionItem, {
@@ -455,7 +448,7 @@ const Autosuggest = forwardRef(function({ id, value = fallbackValue, suggestions
455
448
  description: suggestion.description,
456
449
  groupHeading: groupHeadingForSuggestion.get(suggestion)
457
450
  })
458
- })] }, index + text);
451
+ })] }, index);
459
452
  }) : null]
460
453
  })
461
454
  })
@@ -0,0 +1,14 @@
1
+ let react = require("react");
2
+ //#region src/lib/components/Autosuggest/useScrollIntoView.ts
3
+ function useScrollIntoView(element, scrollContainerRef) {
4
+ (0, react.useEffect)(() => {
5
+ const scrollContainer = scrollContainerRef.current;
6
+ if (!scrollContainer || !element) return;
7
+ const containerRect = scrollContainer.getBoundingClientRect();
8
+ const elementRect = element.getBoundingClientRect();
9
+ if (elementRect.top < containerRect.top) scrollContainer.scrollTop -= containerRect.top - elementRect.top;
10
+ else if (elementRect.bottom > containerRect.bottom) scrollContainer.scrollTop += elementRect.bottom - containerRect.bottom;
11
+ }, [scrollContainerRef, element]);
12
+ }
13
+ //#endregion
14
+ exports.useScrollIntoView = useScrollIntoView;
@@ -0,0 +1,14 @@
1
+ import { useEffect } from "react";
2
+ //#region src/lib/components/Autosuggest/useScrollIntoView.ts
3
+ function useScrollIntoView(element, scrollContainerRef) {
4
+ useEffect(() => {
5
+ const scrollContainer = scrollContainerRef.current;
6
+ if (!scrollContainer || !element) return;
7
+ const containerRect = scrollContainer.getBoundingClientRect();
8
+ const elementRect = element.getBoundingClientRect();
9
+ if (elementRect.top < containerRect.top) scrollContainer.scrollTop -= containerRect.top - elementRect.top;
10
+ else if (elementRect.bottom > containerRect.bottom) scrollContainer.scrollTop += elementRect.bottom - containerRect.bottom;
11
+ }, [scrollContainerRef, element]);
12
+ }
13
+ //#endregion
14
+ export { useScrollIntoView };
@@ -19,7 +19,11 @@ const buttonIconVariants = [
19
19
  "transparent",
20
20
  "solid"
21
21
  ];
22
- const buttonIconTones = ["neutral", "formAccent"];
22
+ const buttonIconTones = [
23
+ "neutral",
24
+ "formAccent",
25
+ "brandAccent"
26
+ ];
23
27
  const buttonIconSizes = [
24
28
  "small",
25
29
  "standard",
@@ -30,7 +34,17 @@ const padding = {
30
34
  standard: "xsmall",
31
35
  large: "xsmall"
32
36
  };
33
- const ButtonIconContent = (0, react.forwardRef)(({ icon, label, id, size = "standard", tone = "neutral", variant = "soft", type = "button", bleed, tooltipPlacement, loading, onClick, onMouseDown, onKeyUp, onKeyDown, "aria-haspopup": ariaHasPopUp, "aria-expanded": ariaExpanded, "aria-describedby": ariaDescribedBy, "aria-pressed": ariaPressed, tabIndex, data, ...restProps }, forwardedRef) => {
37
+ const resolveToneAndVariant = ({ variant: variantProp, tone: toneProp }) => {
38
+ return {
39
+ variant: variantProp ?? (toneProp === "formAccent" || toneProp === "brandAccent" ? "solid" : "soft"),
40
+ tone: toneProp ?? "neutral"
41
+ };
42
+ };
43
+ const ButtonIconContent = (0, react.forwardRef)(({ icon, label, id, size = "standard", tone: toneProp, variant: variantProp, type = "button", bleed, tooltipPlacement, loading, onClick, onMouseDown, onKeyUp, onKeyDown, "aria-haspopup": ariaHasPopUp, "aria-expanded": ariaExpanded, "aria-describedby": ariaDescribedBy, "aria-pressed": ariaPressed, tabIndex, data, ...restProps }, forwardedRef) => {
44
+ const { tone, variant } = resolveToneAndVariant({
45
+ variant: variantProp,
46
+ tone: toneProp
47
+ });
34
48
  const { root, content } = require_Button.useButtonStyles({
35
49
  variant,
36
50
  tone,
@@ -4,7 +4,7 @@ import { ButtonStyleProps } from "../Button/Button.cjs";
4
4
  import { AllHTMLAttributes, ReactElement } from "react";
5
5
  //#region src/lib/components/ButtonIcon/ButtonIcon.d.ts
6
6
  declare const buttonIconVariants: Array<Extract<ButtonStyleProps['variant'], 'soft' | 'transparent' | 'solid'>>;
7
- declare const buttonIconTones: Array<Extract<ButtonStyleProps['tone'], 'neutral' | 'formAccent'>>;
7
+ declare const buttonIconTones: Array<Extract<ButtonStyleProps['tone'], 'neutral' | 'formAccent' | 'brandAccent'>>;
8
8
  declare const buttonIconSizes: readonly ["small", "standard", "large"];
9
9
  type ButtonIconSize = (typeof buttonIconSizes)[number];
10
10
  type NativeButtonProps = AllHTMLAttributes<HTMLButtonElement>;
@@ -4,7 +4,7 @@ import { ButtonStyleProps } from "../Button/Button.mjs";
4
4
  import { AllHTMLAttributes, ReactElement } from "react";
5
5
  //#region src/lib/components/ButtonIcon/ButtonIcon.d.ts
6
6
  declare const buttonIconVariants: Array<Extract<ButtonStyleProps['variant'], 'soft' | 'transparent' | 'solid'>>;
7
- declare const buttonIconTones: Array<Extract<ButtonStyleProps['tone'], 'neutral' | 'formAccent'>>;
7
+ declare const buttonIconTones: Array<Extract<ButtonStyleProps['tone'], 'neutral' | 'formAccent' | 'brandAccent'>>;
8
8
  declare const buttonIconSizes: readonly ["small", "standard", "large"];
9
9
  type ButtonIconSize = (typeof buttonIconSizes)[number];
10
10
  type NativeButtonProps = AllHTMLAttributes<HTMLButtonElement>;
@@ -17,7 +17,11 @@ const buttonIconVariants = [
17
17
  "transparent",
18
18
  "solid"
19
19
  ];
20
- const buttonIconTones = ["neutral", "formAccent"];
20
+ const buttonIconTones = [
21
+ "neutral",
22
+ "formAccent",
23
+ "brandAccent"
24
+ ];
21
25
  const buttonIconSizes = [
22
26
  "small",
23
27
  "standard",
@@ -28,7 +32,17 @@ const padding = {
28
32
  standard: "xsmall",
29
33
  large: "xsmall"
30
34
  };
31
- const ButtonIconContent = forwardRef(({ icon, label, id, size = "standard", tone = "neutral", variant = "soft", type = "button", bleed, tooltipPlacement, loading, onClick, onMouseDown, onKeyUp, onKeyDown, "aria-haspopup": ariaHasPopUp, "aria-expanded": ariaExpanded, "aria-describedby": ariaDescribedBy, "aria-pressed": ariaPressed, tabIndex, data, ...restProps }, forwardedRef) => {
35
+ const resolveToneAndVariant = ({ variant: variantProp, tone: toneProp }) => {
36
+ return {
37
+ variant: variantProp ?? (toneProp === "formAccent" || toneProp === "brandAccent" ? "solid" : "soft"),
38
+ tone: toneProp ?? "neutral"
39
+ };
40
+ };
41
+ const ButtonIconContent = forwardRef(({ icon, label, id, size = "standard", tone: toneProp, variant: variantProp, type = "button", bleed, tooltipPlacement, loading, onClick, onMouseDown, onKeyUp, onKeyDown, "aria-haspopup": ariaHasPopUp, "aria-expanded": ariaExpanded, "aria-describedby": ariaDescribedBy, "aria-pressed": ariaPressed, tabIndex, data, ...restProps }, forwardedRef) => {
42
+ const { tone, variant } = resolveToneAndVariant({
43
+ variant: variantProp,
44
+ tone: toneProp
45
+ });
32
46
  const { root, content } = useButtonStyles({
33
47
  variant,
34
48
  tone,
@@ -4,14 +4,14 @@ import { DataAttributeMap } from "../private/buildDataAttributes.cjs";
4
4
  import { CollapsibleAlignmentProps } from "../../utils/collapsibleAlignmentProps.cjs";
5
5
  import { FC } from "react";
6
6
  //#region src/lib/components/Inline/Inline.d.ts
7
- declare const validInlineComponents: readonly ["div", "span", "p", "nav", "ul", "ol", "li"];
7
+ type ValidInlineComponent = 'div' | 'span' | 'p' | 'nav' | 'ul' | 'ol' | 'li';
8
8
  type InlineProps = CollapsibleAlignmentProps & {
9
9
  space: ResponsiveSpace;
10
- component?: (typeof validInlineComponents)[number];
10
+ component?: ValidInlineComponent;
11
11
  data?: DataAttributeMap;
12
12
  children: ReactNodeNoStrings;
13
13
  noWrap?: boolean;
14
14
  };
15
15
  declare const Inline: FC<InlineProps>;
16
16
  //#endregion
17
- export { Inline, InlineProps, validInlineComponents };
17
+ export { Inline, InlineProps };
@@ -4,14 +4,14 @@ import { DataAttributeMap } from "../private/buildDataAttributes.mjs";
4
4
  import { CollapsibleAlignmentProps } from "../../utils/collapsibleAlignmentProps.mjs";
5
5
  import { FC } from "react";
6
6
  //#region src/lib/components/Inline/Inline.d.ts
7
- declare const validInlineComponents: readonly ["div", "span", "p", "nav", "ul", "ol", "li"];
7
+ type ValidInlineComponent = 'div' | 'span' | 'p' | 'nav' | 'ul' | 'ol' | 'li';
8
8
  type InlineProps = CollapsibleAlignmentProps & {
9
9
  space: ResponsiveSpace;
10
- component?: (typeof validInlineComponents)[number];
10
+ component?: ValidInlineComponent;
11
11
  data?: DataAttributeMap;
12
12
  children: ReactNodeNoStrings;
13
13
  noWrap?: boolean;
14
14
  };
15
15
  declare const Inline: FC<InlineProps>;
16
16
  //#endregion
17
- export { Inline, InlineProps, validInlineComponents };
17
+ export { Inline, InlineProps };
@@ -5,22 +5,6 @@ let _vanilla_extract_css_utils = require("@vanilla-extract/css-utils");
5
5
  //#region src/lib/components/MenuRenderer/MenuRenderer.css.ts
6
6
  (0, _vanilla_extract_css_fileScope.setFileScope)("src/lib/components/MenuRenderer/MenuRenderer.css.ts", "braid-design-system");
7
7
  const menuYPadding = (0, _vanilla_extract_css.createVar)("menuYPadding");
8
- (0, _vanilla_extract_css.style)({
9
- width: "100vw",
10
- height: "100vh"
11
- }, "backdrop");
12
- const triggerVars = {
13
- top: (0, _vanilla_extract_css.createVar)("triggerVars_top"),
14
- left: (0, _vanilla_extract_css.createVar)("triggerVars_left"),
15
- bottom: (0, _vanilla_extract_css.createVar)("triggerVars_bottom"),
16
- right: (0, _vanilla_extract_css.createVar)("triggerVars_right")
17
- };
18
- (0, _vanilla_extract_css.style)({
19
- top: triggerVars.bottom,
20
- bottom: triggerVars.top,
21
- left: triggerVars.left,
22
- right: triggerVars.right
23
- }, "menuPosition");
24
8
  const widthVar = (0, _vanilla_extract_css.createVar)("widthVar");
25
9
  const baseWidth = (0, _vanilla_extract_css.style)({ width: (0, _vanilla_extract_css_utils.calc)(widthVar).divide(4).toString() }, "baseWidth");
26
10
  const { small, medium, large } = require_vars_css.vars.contentWidth;
@@ -34,5 +18,4 @@ const menuHeightLimit = (0, _vanilla_extract_css.style)({ maxHeight: (0, _vanill
34
18
  //#endregion
35
19
  exports.menuHeightLimit = menuHeightLimit;
36
20
  exports.menuYPadding = menuYPadding;
37
- exports.triggerVars = triggerVars;
38
21
  exports.width = width;
@@ -5,22 +5,6 @@ import { calc } from "@vanilla-extract/css-utils";
5
5
  //#region src/lib/components/MenuRenderer/MenuRenderer.css.ts
6
6
  setFileScope("src/lib/components/MenuRenderer/MenuRenderer.css.ts", "braid-design-system");
7
7
  const menuYPadding = createVar("menuYPadding");
8
- style({
9
- width: "100vw",
10
- height: "100vh"
11
- }, "backdrop");
12
- const triggerVars = {
13
- top: createVar("triggerVars_top"),
14
- left: createVar("triggerVars_left"),
15
- bottom: createVar("triggerVars_bottom"),
16
- right: createVar("triggerVars_right")
17
- };
18
- style({
19
- top: triggerVars.bottom,
20
- bottom: triggerVars.top,
21
- left: triggerVars.left,
22
- right: triggerVars.right
23
- }, "menuPosition");
24
8
  const widthVar = createVar("widthVar");
25
9
  const baseWidth = style({ width: calc(widthVar).divide(4).toString() }, "baseWidth");
26
10
  const { small, medium, large } = vars.contentWidth;
@@ -32,4 +16,4 @@ const width = styleVariants({
32
16
  const menuHeightLimit = style({ maxHeight: calc(vars.touchableSize).multiply(9.5).add(calc(menuYPadding).multiply(2)).toString() }, "menuHeightLimit");
33
17
  endFileScope();
34
18
  //#endregion
35
- export { menuHeightLimit, menuYPadding, triggerVars, width };
19
+ export { menuHeightLimit, menuYPadding, width };
@@ -26,4 +26,4 @@ declare const MonthPicker: {
26
26
  displayName: string;
27
27
  };
28
28
  //#endregion
29
- export { MonthPicker, MonthPickerBaseProps, MonthPickerLabelProps, MonthPickerProps };
29
+ export { MonthPicker, MonthPickerBaseProps, MonthPickerLabelProps };
@@ -26,4 +26,4 @@ declare const MonthPicker: {
26
26
  displayName: string;
27
27
  };
28
28
  //#endregion
29
- export { MonthPicker, MonthPickerBaseProps, MonthPickerLabelProps, MonthPickerProps };
29
+ export { MonthPicker, MonthPickerBaseProps, MonthPickerLabelProps };
@@ -11,7 +11,6 @@ const focusRing = (0, _vanilla_extract_css.style)([{ outlineOffset: 0 }, require
11
11
  borderRadius
12
12
  })], "focusRing");
13
13
  const hover = (0, _vanilla_extract_css.style)({}, "hover");
14
- (0, _vanilla_extract_css.style)(require_colorModeStyle.colorModeStyle({ lightMode: { opacity: .3 } }), "lightModeCurrentKeyline");
15
14
  const darkModeCurrentKeyline = (0, _vanilla_extract_css.style)(require_colorModeStyle.colorModeStyle({ darkMode: { opacity: .3 } }), "darkModeCurrentKeyline");
16
15
  const current = (0, _vanilla_extract_css.style)({ opacity: .075 }, "current");
17
16
  const background = (0, _vanilla_extract_css.style)({ selectors: { [`${hover}:hover &:not(${current})`]: { opacity: .5 } } }, "background");
@@ -11,7 +11,6 @@ const focusRing = style([{ outlineOffset: 0 }, atoms({
11
11
  borderRadius
12
12
  })], "focusRing");
13
13
  const hover = style({}, "hover");
14
- style(colorModeStyle({ lightMode: { opacity: .3 } }), "lightModeCurrentKeyline");
15
14
  const darkModeCurrentKeyline = style(colorModeStyle({ darkMode: { opacity: .3 } }), "darkModeCurrentKeyline");
16
15
  const current = style({ opacity: .075 }, "current");
17
16
  const background = style({ selectors: { [`${hover}:hover &:not(${current})`]: { opacity: .5 } } }, "background");
@@ -45,6 +45,7 @@ const Rating = ({ rating, size = "standard", weight, variant = "full", tone = "b
45
45
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
46
46
  component: "span",
47
47
  className: require_Rating_css.inlineFlex,
48
+ role: "img",
48
49
  "aria-label": ariaLabel || `${rating.toFixed(1)} out of ${ratingArr.length}`,
49
50
  children: variant === "minimal" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RatingStar, {
50
51
  percent: 100,
@@ -42,6 +42,7 @@ const Rating = ({ rating, size = "standard", weight, variant = "full", tone = "b
42
42
  children: [/* @__PURE__ */ jsx(Box, {
43
43
  component: "span",
44
44
  className: inlineFlex,
45
+ role: "img",
45
46
  "aria-label": ariaLabel || `${rating.toFixed(1)} out of ${ratingArr.length}`,
46
47
  children: variant === "minimal" ? /* @__PURE__ */ jsx(RatingStar, {
47
48
  percent: 100,
@@ -6,6 +6,16 @@ const StepContext = (0, react.createContext)({
6
6
  stepNumber: 0,
7
7
  isLast: false
8
8
  });
9
+ const NAV_RIGHT = 0;
10
+ const NAV_DOWN = 1;
11
+ const NAV_LEFT = 2;
12
+ const NAV_UP = 3;
13
+ const NAV_HOME = 4;
14
+ const NAV_END = 5;
15
+ const NAV_TAB = 6;
16
+ const NAV_CLICKED = 7;
17
+ const NAV_FOCUSED = 8;
18
+ const NAV_BLURRED = 9;
9
19
  const StepperContext = (0, react.createContext)(null);
10
20
  const getNextStep = (moveAmount, current, maxStep) => {
11
21
  if (current === null) return moveAmount > 0 ? 1 : maxStep;
@@ -18,34 +28,34 @@ const StepperContextProvider = ({ children, activeStep, stepCount: stepCountProp
18
28
  const stepCount = isLinear ? progress : stepCountProp;
19
29
  const [stepperState, dispatch] = (0, react.useReducer)((state, action) => {
20
30
  switch (action.type) {
21
- case 3:
22
- case 2: return {
31
+ case NAV_UP:
32
+ case NAV_LEFT: return {
23
33
  ...state,
24
34
  focusedStep: getNextStep(-1, state.focusedStep, stepCount)
25
35
  };
26
- case 1:
27
- case 0: return {
36
+ case NAV_DOWN:
37
+ case NAV_RIGHT: return {
28
38
  ...state,
29
39
  focusedStep: getNextStep(1, state.focusedStep, stepCount)
30
40
  };
31
- case 4: return {
41
+ case NAV_HOME: return {
32
42
  ...state,
33
43
  focusedStep: 1
34
44
  };
35
- case 5: return {
45
+ case NAV_END: return {
36
46
  ...state,
37
47
  focusedStep: stepCount
38
48
  };
39
- case 9:
40
- case 6: return {
49
+ case NAV_BLURRED:
50
+ case NAV_TAB: return {
41
51
  ...state,
42
52
  focusedStep: null
43
53
  };
44
- case 7: return {
54
+ case NAV_CLICKED: return {
45
55
  ...state,
46
56
  focusedStep: action.value
47
57
  };
48
- case 8: return {
58
+ case NAV_FOCUSED: return {
49
59
  ...state,
50
60
  focusedStep: state.focusedStep === null ? activeStep : state.focusedStep
51
61
  };
@@ -64,27 +74,27 @@ const StepperContextProvider = ({ children, activeStep, stepCount: stepCountProp
64
74
  const targetKey = require_normalizeKey.normalizeKey(event);
65
75
  if (targetKey === "Tab") return;
66
76
  const action = {
67
- ArrowRight: { type: 0 },
68
- ArrowLeft: { type: 2 },
69
- ArrowUp: { type: 3 },
70
- ArrowDown: { type: 1 },
71
- Home: { type: 4 },
72
- End: { type: 5 }
77
+ ArrowRight: { type: NAV_RIGHT },
78
+ ArrowLeft: { type: NAV_LEFT },
79
+ ArrowUp: { type: NAV_UP },
80
+ ArrowDown: { type: NAV_DOWN },
81
+ Home: { type: NAV_HOME },
82
+ End: { type: NAV_END }
73
83
  };
74
84
  if (action[targetKey]) dispatch(action[targetKey]);
75
85
  };
76
86
  const onKeyDown = (event) => {
77
87
  const targetKey = require_normalizeKey.normalizeKey(event);
78
88
  if (targetKey === "Tab") {
79
- dispatch({ type: 6 });
89
+ dispatch({ type: NAV_TAB });
80
90
  return;
81
91
  }
82
92
  if (targetKey.indexOf("Arrow") === 0 || ["Home", "End"].includes(targetKey)) event.preventDefault();
83
93
  };
84
- const onFocus = () => dispatch({ type: 8 });
85
- const onBlur = () => dispatch({ type: 9 });
94
+ const onFocus = () => dispatch({ type: NAV_FOCUSED });
95
+ const onBlur = () => dispatch({ type: NAV_BLURRED });
86
96
  const onClick = (index) => dispatch({
87
- type: 7,
97
+ type: NAV_CLICKED,
88
98
  value: index
89
99
  });
90
100
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepperContext.Provider, {
@@ -6,6 +6,16 @@ const StepContext = createContext({
6
6
  stepNumber: 0,
7
7
  isLast: false
8
8
  });
9
+ const NAV_RIGHT = 0;
10
+ const NAV_DOWN = 1;
11
+ const NAV_LEFT = 2;
12
+ const NAV_UP = 3;
13
+ const NAV_HOME = 4;
14
+ const NAV_END = 5;
15
+ const NAV_TAB = 6;
16
+ const NAV_CLICKED = 7;
17
+ const NAV_FOCUSED = 8;
18
+ const NAV_BLURRED = 9;
9
19
  const StepperContext = createContext(null);
10
20
  const getNextStep = (moveAmount, current, maxStep) => {
11
21
  if (current === null) return moveAmount > 0 ? 1 : maxStep;
@@ -18,34 +28,34 @@ const StepperContextProvider = ({ children, activeStep, stepCount: stepCountProp
18
28
  const stepCount = isLinear ? progress : stepCountProp;
19
29
  const [stepperState, dispatch] = useReducer((state, action) => {
20
30
  switch (action.type) {
21
- case 3:
22
- case 2: return {
31
+ case NAV_UP:
32
+ case NAV_LEFT: return {
23
33
  ...state,
24
34
  focusedStep: getNextStep(-1, state.focusedStep, stepCount)
25
35
  };
26
- case 1:
27
- case 0: return {
36
+ case NAV_DOWN:
37
+ case NAV_RIGHT: return {
28
38
  ...state,
29
39
  focusedStep: getNextStep(1, state.focusedStep, stepCount)
30
40
  };
31
- case 4: return {
41
+ case NAV_HOME: return {
32
42
  ...state,
33
43
  focusedStep: 1
34
44
  };
35
- case 5: return {
45
+ case NAV_END: return {
36
46
  ...state,
37
47
  focusedStep: stepCount
38
48
  };
39
- case 9:
40
- case 6: return {
49
+ case NAV_BLURRED:
50
+ case NAV_TAB: return {
41
51
  ...state,
42
52
  focusedStep: null
43
53
  };
44
- case 7: return {
54
+ case NAV_CLICKED: return {
45
55
  ...state,
46
56
  focusedStep: action.value
47
57
  };
48
- case 8: return {
58
+ case NAV_FOCUSED: return {
49
59
  ...state,
50
60
  focusedStep: state.focusedStep === null ? activeStep : state.focusedStep
51
61
  };
@@ -64,27 +74,27 @@ const StepperContextProvider = ({ children, activeStep, stepCount: stepCountProp
64
74
  const targetKey = normalizeKey(event);
65
75
  if (targetKey === "Tab") return;
66
76
  const action = {
67
- ArrowRight: { type: 0 },
68
- ArrowLeft: { type: 2 },
69
- ArrowUp: { type: 3 },
70
- ArrowDown: { type: 1 },
71
- Home: { type: 4 },
72
- End: { type: 5 }
77
+ ArrowRight: { type: NAV_RIGHT },
78
+ ArrowLeft: { type: NAV_LEFT },
79
+ ArrowUp: { type: NAV_UP },
80
+ ArrowDown: { type: NAV_DOWN },
81
+ Home: { type: NAV_HOME },
82
+ End: { type: NAV_END }
73
83
  };
74
84
  if (action[targetKey]) dispatch(action[targetKey]);
75
85
  };
76
86
  const onKeyDown = (event) => {
77
87
  const targetKey = normalizeKey(event);
78
88
  if (targetKey === "Tab") {
79
- dispatch({ type: 6 });
89
+ dispatch({ type: NAV_TAB });
80
90
  return;
81
91
  }
82
92
  if (targetKey.indexOf("Arrow") === 0 || ["Home", "End"].includes(targetKey)) event.preventDefault();
83
93
  };
84
- const onFocus = () => dispatch({ type: 8 });
85
- const onBlur = () => dispatch({ type: 9 });
94
+ const onFocus = () => dispatch({ type: NAV_FOCUSED });
95
+ const onBlur = () => dispatch({ type: NAV_BLURRED });
86
96
  const onClick = (index) => dispatch({
87
- type: 7,
97
+ type: NAV_CLICKED,
88
98
  value: index
89
99
  });
90
100
  return /* @__PURE__ */ jsx(StepperContext.Provider, {
@@ -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,
@@ -156,5 +156,3 @@ const TooltipRenderer = ({ id, tooltip, placement = "top", children }) => {
156
156
  //#endregion
157
157
  exports.TooltipContent = TooltipContent;
158
158
  exports.TooltipRenderer = TooltipRenderer;
159
- exports.TooltipTextDefaultsProvider = TooltipTextDefaultsProvider;
160
- exports.offsetSpace = offsetSpace;
@@ -152,4 +152,4 @@ const TooltipRenderer = ({ id, tooltip, placement = "top", children }) => {
152
152
  })] });
153
153
  };
154
154
  //#endregion
155
- export { TooltipContent, TooltipRenderer, TooltipTextDefaultsProvider, offsetSpace };
155
+ export { TooltipContent, TooltipRenderer };
@@ -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 () => {
@@ -67,7 +67,6 @@ exports.disabledRadioIndicator = disabledRadioIndicator;
67
67
  exports.fakeField = fakeField;
68
68
  exports.hideBorderOnDarkBackgroundInLightMode = hideBorderOnDarkBackgroundInLightMode;
69
69
  exports.hoverOverlay = hoverOverlay;
70
- exports.indicator = indicator;
71
70
  exports.isMixed = isMixed;
72
71
  exports.labelOffset = labelOffset;
73
72
  exports.radioIndicator = radioIndicator;
@@ -61,4 +61,4 @@ const radioIndicator = [indicator, style({
61
61
  }, "radioScale")];
62
62
  endFileScope();
63
63
  //#endregion
64
- export { checkboxIndicator, children, disabledRadioIndicator, fakeField, hideBorderOnDarkBackgroundInLightMode, hoverOverlay, indicator, isMixed, labelOffset, radioIndicator, realField, selected, sizeVars };
64
+ export { checkboxIndicator, children, disabledRadioIndicator, fakeField, hideBorderOnDarkBackgroundInLightMode, hoverOverlay, isMixed, labelOffset, radioIndicator, realField, selected, sizeVars };
@@ -22,4 +22,4 @@ interface StyledInputProps {
22
22
  tabIndex?: 0 | -1;
23
23
  }
24
24
  //#endregion
25
- export { CheckboxChecked, InlineFieldTone, StyledInputProps };
25
+ export { CheckboxChecked, StyledInputProps };
@@ -22,4 +22,4 @@ interface StyledInputProps {
22
22
  tabIndex?: 0 | -1;
23
23
  }
24
24
  //#endregion
25
- export { CheckboxChecked, InlineFieldTone, StyledInputProps };
25
+ export { CheckboxChecked, StyledInputProps };
@@ -10,10 +10,9 @@ const backdrop = (0, _vanilla_extract_css.style)({
10
10
  }, "backdrop");
11
11
  const placementModifier = (0, _vanilla_extract_css.createVar)("placementModifier");
12
12
  const invertPlacement = (0, _vanilla_extract_css.style)({ vars: { [placementModifier]: "-1" } }, "invertPlacement");
13
- const transitionThreshold = "xxsmall";
14
13
  const popupAnimation = (0, _vanilla_extract_css.keyframes)({ from: {
15
14
  opacity: 0,
16
- transform: `translateY(${(0, _vanilla_extract_css_utils.calc)(require_vars_css.vars.space[transitionThreshold]).multiply((0, _vanilla_extract_css.fallbackVar)(placementModifier, "1"))})`
15
+ transform: `translateY(${(0, _vanilla_extract_css_utils.calc)(require_vars_css.vars.space["xxsmall"]).multiply((0, _vanilla_extract_css.fallbackVar)(placementModifier, "1"))})`
17
16
  } }, "popupAnimation");
18
17
  const animation = (0, _vanilla_extract_css.style)({
19
18
  animationName: popupAnimation,
@@ -29,4 +28,3 @@ exports.animation = animation;
29
28
  exports.backdrop = backdrop;
30
29
  exports.delayVisibility = delayVisibility;
31
30
  exports.invertPlacement = invertPlacement;
32
- exports.transitionThreshold = transitionThreshold;
@@ -10,10 +10,9 @@ const backdrop = style({
10
10
  }, "backdrop");
11
11
  const placementModifier = createVar("placementModifier");
12
12
  const invertPlacement = style({ vars: { [placementModifier]: "-1" } }, "invertPlacement");
13
- const transitionThreshold = "xxsmall";
14
13
  const popupAnimation = keyframes({ from: {
15
14
  opacity: 0,
16
- transform: `translateY(${calc(vars.space[transitionThreshold]).multiply(fallbackVar(placementModifier, "1"))})`
15
+ transform: `translateY(${calc(vars.space["xxsmall"]).multiply(fallbackVar(placementModifier, "1"))})`
17
16
  } }, "popupAnimation");
18
17
  const animation = style({
19
18
  animationName: popupAnimation,
@@ -25,4 +24,4 @@ const animation = style({
25
24
  const delayVisibility = style({ animationDelay: "250ms" }, "delayVisibility");
26
25
  endFileScope();
27
26
  //#endregion
28
- export { animation, backdrop, delayVisibility, invertPlacement, transitionThreshold };
27
+ export { animation, backdrop, delayVisibility, invertPlacement };
@@ -28,4 +28,4 @@ interface PopoverProps {
28
28
  children: ReactNode;
29
29
  }
30
30
  //#endregion
31
- export { PopoverPlacementData, PopoverProps };
31
+ export { PopoverProps };
@@ -28,4 +28,4 @@ interface PopoverProps {
28
28
  children: ReactNode;
29
29
  }
30
30
  //#endregion
31
- export { PopoverPlacementData, PopoverProps };
31
+ export { PopoverProps };
@@ -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;
@@ -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;
@@ -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: {
@@ -23,6 +23,10 @@ const snippets = [
23
23
  {
24
24
  description: "Form accent",
25
25
  code: "<ButtonIcon tone=\"formAccent\" icon={<IconAdd />} label=\"Add\" />"
26
+ },
27
+ {
28
+ description: "Brand accent",
29
+ code: "<ButtonIcon tone=\"brandAccent\" icon={<IconAdd />} label=\"Add\" />"
26
30
  }
27
31
  ];
28
32
  //#endregion
@@ -23,6 +23,10 @@ const snippets = [
23
23
  {
24
24
  description: "Form accent",
25
25
  code: "<ButtonIcon tone=\"formAccent\" icon={<IconAdd />} label=\"Add\" />"
26
+ },
27
+ {
28
+ description: "Brand accent",
29
+ code: "<ButtonIcon tone=\"brandAccent\" icon={<IconAdd />} label=\"Add\" />"
26
30
  }
27
31
  ];
28
32
  //#endregion
@@ -174,4 +174,4 @@ interface BraidTokens {
174
174
  };
175
175
  }
176
176
  //#endregion
177
- export { BraidTokens, TextBreakpoint, TextDefinition };
177
+ export { BraidTokens, TextDefinition };
@@ -174,4 +174,4 @@ interface BraidTokens {
174
174
  };
175
175
  }
176
176
  //#endregion
177
- export { BraidTokens, TextBreakpoint, TextDefinition };
177
+ export { BraidTokens, TextDefinition };
@@ -103,8 +103,6 @@ function getAccessibleVariant(color, background) {
103
103
  return findClosestAccessibleDarkerColor(color, background ?? getLightVariant(color), AA_TEXT_CONTRAST);
104
104
  }
105
105
  //#endregion
106
- exports.contrast = contrast;
107
- exports.findClosestAccessibleDarkerColor = findClosestAccessibleDarkerColor;
108
106
  exports.findClosestAccessibleLighterColor = findClosestAccessibleLighterColor;
109
107
  exports.getAccessibleVariant = getAccessibleVariant;
110
108
  exports.getLightVariant = getLightVariant;
@@ -103,4 +103,4 @@ function getAccessibleVariant(color, background) {
103
103
  return findClosestAccessibleDarkerColor(color, background ?? getLightVariant(color), AA_TEXT_CONTRAST);
104
104
  }
105
105
  //#endregion
106
- export { contrast, findClosestAccessibleDarkerColor, findClosestAccessibleLighterColor, getAccessibleVariant, getLightVariant };
106
+ export { findClosestAccessibleLighterColor, getAccessibleVariant, getLightVariant };
@@ -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.1",
3
+ "version": "34.7.0",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "homepage": "https://seek-oss.github.io/braid-design-system/",
6
6
  "bugs": {