@wistia/ui 1.0.0-beta.db6bcdef.bed5fc6 → 1.0.0-beta.dba1dda4.f5f73bd
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 +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v1.0.0-beta.
|
|
3
|
+
* @license @wistia/ui v1.0.0-beta.dba1dda4.f5f73bd
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -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().
|
|
5809
|
+
return name.trim().slice(0, 1).toUpperCase();
|
|
5810
5810
|
};
|
|
5811
5811
|
//#endregion
|
|
5812
5812
|
//#region src/components/Image/Image.tsx
|
|
@@ -7268,8 +7268,8 @@ const isClickableElement = (element) => {
|
|
|
7268
7268
|
*/
|
|
7269
7269
|
const ClickRegion = ({ children, targetRef }) => {
|
|
7270
7270
|
useEffect(() => {
|
|
7271
|
-
if (targetRef.current?.tagName === "A") targetRef.current.
|
|
7272
|
-
else if (targetRef.current?.tagName === "BUTTON") targetRef.current.
|
|
7271
|
+
if (targetRef.current?.tagName === "A") targetRef.current.dataset.clickRegionTargetLink = "";
|
|
7272
|
+
else if (targetRef.current?.tagName === "BUTTON") targetRef.current.dataset.clickRegionTargetButton = "";
|
|
7273
7273
|
}, [targetRef]);
|
|
7274
7274
|
const handleClick = useCallback((event) => {
|
|
7275
7275
|
const node = targetRef.current;
|
|
@@ -7278,7 +7278,7 @@ const ClickRegion = ({ children, targetRef }) => {
|
|
|
7278
7278
|
event.stopPropagation();
|
|
7279
7279
|
return;
|
|
7280
7280
|
}
|
|
7281
|
-
if (node === null || event.defaultPrevented || !node.
|
|
7281
|
+
if (node === null || event.defaultPrevented || !Object.hasOwn(node.dataset, "clickRegionTargetButton")) return;
|
|
7282
7282
|
event.stopPropagation();
|
|
7283
7283
|
event.preventDefault();
|
|
7284
7284
|
node.focus();
|
|
@@ -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,
|