@wistia/ui 1.0.0-beta.db6bcdef.bed5fc6 → 1.0.0-beta.f55651ae.979e07f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v1.0.0-beta.db6bcdef.bed5fc6
3
+ * @license @wistia/ui v1.0.0-beta.f55651ae.979e07f
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -246,7 +246,7 @@ const AriaLiveProvider = ({ children, debug = false }) => {
246
246
  document.body.append(liveRegion);
247
247
  liveRegionRef.current = liveRegion;
248
248
  return () => {
249
- if (liveRegionRef.current) document.body.removeChild(liveRegionRef.current);
249
+ if (liveRegionRef.current) liveRegionRef.current.remove();
250
250
  };
251
251
  }, [debug]);
252
252
  useEffect(() => {
@@ -734,7 +734,7 @@ const parseDateString = (str) => {
734
734
  return startOfDay(date);
735
735
  }
736
736
  const referenceDate = /* @__PURE__ */ new Date();
737
- const parsedDate = DATE_FORMATS.map((fmt) => parse(trimmed, fmt, referenceDate)).find(isValid);
737
+ const parsedDate = DATE_FORMATS.map((fmt) => parse(trimmed, fmt, referenceDate)).find((date) => isValid(date));
738
738
  if (parsedDate !== void 0) return startOfDay(parsedDate);
739
739
  const native = new Date(trimmed);
740
740
  if (isValid(native)) return startOfDay(native);
@@ -1298,7 +1298,7 @@ const isTabbableElement = (element) => {
1298
1298
  const tabIndex = getElementTabIndex(element);
1299
1299
  return (isTabIndexNaN(element) || tabIndex >= 0) && isFocusableElement(element);
1300
1300
  };
1301
- const findTabbableDescendants = (element) => Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter(isTabbableElement);
1301
+ const findTabbableDescendants = (element) => Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((el) => isTabbableElement(el));
1302
1302
  const focusLaterElements = [];
1303
1303
  let focusElement = null;
1304
1304
  let needToFocus = false;
@@ -1390,7 +1390,7 @@ const useFocusTrap = (active = true, options = {}) => {
1390
1390
  else focusElement = typeof options.focusSelector === "string" ? node2.querySelector(options.focusSelector) : options.focusSelector;
1391
1391
  if (!focusElement) {
1392
1392
  const children = Array.from(node2.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS));
1393
- focusElement = children.find(isTabbableElement) ?? children.find(isFocusableElement) ?? null;
1393
+ focusElement = children.find((element) => isTabbableElement(element)) ?? children.find((element) => isFocusableElement(element)) ?? null;
1394
1394
  if (!focusElement && isFocusableElement(node2)) focusElement = node2;
1395
1395
  }
1396
1396
  if (focusElement) focusElement.focus();
@@ -5806,7 +5806,7 @@ const containsEmojiCharacter = (char) => {
5806
5806
  };
5807
5807
  const formatNameForDisplay = (name) => {
5808
5808
  if (isNil(name) || !isString(name) || isEmptyString(name) || containsEmojiCharacter(name)) return "U";
5809
- return name.trim().substring(0, 1).toUpperCase();
5809
+ return name.trim().slice(0, 1).toUpperCase();
5810
5810
  };
5811
5811
  //#endregion
5812
5812
  //#region src/components/Image/Image.tsx
@@ -14116,7 +14116,7 @@ const nodeToString = (node) => {
14116
14116
  if (typeof node === "string") return node;
14117
14117
  if (typeof node === "number") return String(node);
14118
14118
  if (node == null || typeof node === "boolean") return "";
14119
- if (Array.isArray(node)) return node.map(nodeToString).join("");
14119
+ if (Array.isArray(node)) return node.map((child) => nodeToString(child)).join("");
14120
14120
  if (typeof node === "object" && "props" in node) {
14121
14121
  const element = node;
14122
14122
  if (element.props?.children != null) return nodeToString(element.props.children);
@@ -15632,7 +15632,7 @@ const StyledSidebarGroupList = styled.ul`
15632
15632
  const isLabelChild = (child) => isValidElement(child) && child.type === SidebarGroupLabel;
15633
15633
  const SidebarGroup = ({ children }) => {
15634
15634
  const childArray = Children.toArray(children);
15635
- const labels = childArray.filter(isLabelChild);
15635
+ const labels = childArray.filter((child) => isLabelChild(child));
15636
15636
  const items = childArray.filter((child) => isValidElement(child) && !isLabelChild(child));
15637
15637
  return /* @__PURE__ */ jsxs(StyledSidebarGroup, {
15638
15638
  "data-wui-sidebar-group": true,