@wistia/ui 0.4.2 → 0.4.3-beta.a3a51555.977dc5c
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.cjs +514 -434
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +60 -37
- package/dist/index.d.ts +60 -37
- package/dist/index.mjs +408 -330
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.4.
|
|
3
|
+
* @license @wistia/ui v0.4.3-beta.a3a51555.977dc5c
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -90,7 +90,9 @@ __export(index_exports, {
|
|
|
90
90
|
mq: () => mq,
|
|
91
91
|
useActiveMq: () => useActiveMq,
|
|
92
92
|
useAriaLive: () => useAriaLive,
|
|
93
|
+
useBoolean: () => useBoolean,
|
|
93
94
|
useFormState: () => useFormState,
|
|
95
|
+
useKey: () => useKey,
|
|
94
96
|
useMq: () => useMq,
|
|
95
97
|
useToast: () => useToast,
|
|
96
98
|
useWindowSize: () => useWindowSize
|
|
@@ -1556,11 +1558,21 @@ var mq = {
|
|
|
1556
1558
|
xlAndDown
|
|
1557
1559
|
};
|
|
1558
1560
|
|
|
1561
|
+
// src/hooks/useBoolean/useBoolean.ts
|
|
1562
|
+
var import_react3 = require("react");
|
|
1563
|
+
var useBoolean = (initialValue = false) => {
|
|
1564
|
+
const [value, setValue] = (0, import_react3.useState)(initialValue);
|
|
1565
|
+
const toggle = (0, import_react3.useCallback)(() => setValue((val) => !val), []);
|
|
1566
|
+
const setTrue = (0, import_react3.useCallback)(() => setValue(true), []);
|
|
1567
|
+
const setFalse = (0, import_react3.useCallback)(() => setValue(false), []);
|
|
1568
|
+
return [value, toggle, setTrue, setFalse, setValue];
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1559
1571
|
// src/hooks/useMq/useMq.ts
|
|
1560
1572
|
var import_type_guards3 = require("@wistia/type-guards");
|
|
1561
1573
|
|
|
1562
1574
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
1563
|
-
var
|
|
1575
|
+
var import_react4 = require("react");
|
|
1564
1576
|
var import_throttle_debounce = require("throttle-debounce");
|
|
1565
1577
|
|
|
1566
1578
|
// src/private/helpers/isClient/isClient.ts
|
|
@@ -1568,11 +1580,11 @@ var isClient = () => typeof window !== "undefined" && typeof document !== "undef
|
|
|
1568
1580
|
|
|
1569
1581
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
1570
1582
|
var useWindowSize = (interval = 0) => {
|
|
1571
|
-
const [dimensions, setDimensions] = (0,
|
|
1583
|
+
const [dimensions, setDimensions] = (0, import_react4.useState)({
|
|
1572
1584
|
width: isClient() ? window.innerWidth : 0,
|
|
1573
1585
|
height: isClient() ? window.innerHeight : 0
|
|
1574
1586
|
});
|
|
1575
|
-
(0,
|
|
1587
|
+
(0, import_react4.useLayoutEffect)(() => {
|
|
1576
1588
|
const handleResize = (0, import_throttle_debounce.debounce)(
|
|
1577
1589
|
interval,
|
|
1578
1590
|
() => setDimensions({
|
|
@@ -1623,17 +1635,94 @@ var useActiveMq = () => {
|
|
|
1623
1635
|
});
|
|
1624
1636
|
};
|
|
1625
1637
|
|
|
1626
|
-
// src/hooks/
|
|
1638
|
+
// src/hooks/useKey/useKey.ts
|
|
1639
|
+
var import_react6 = require("react");
|
|
1640
|
+
|
|
1641
|
+
// src/private/hooks/useEvent/useEvent.ts
|
|
1627
1642
|
var import_react5 = require("react");
|
|
1643
|
+
var isEventTargetSupported = (eventTarget) => (
|
|
1644
|
+
// @ts-expect-error the compiler thinks that addEventListener may not exist on eventTarget, but we still need to check it.
|
|
1645
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
1646
|
+
!!(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
1647
|
+
);
|
|
1648
|
+
var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
|
|
1649
|
+
const savedEventHandler = (0, import_react5.useRef)();
|
|
1650
|
+
const savedEventOptions = (0, import_react5.useRef)();
|
|
1651
|
+
(0, import_react5.useEffect)(() => {
|
|
1652
|
+
savedEventHandler.current = eventHandler;
|
|
1653
|
+
}, [eventHandler]);
|
|
1654
|
+
(0, import_react5.useEffect)(() => {
|
|
1655
|
+
savedEventOptions.current = eventOptions;
|
|
1656
|
+
}, [eventOptions]);
|
|
1657
|
+
(0, import_react5.useEffect)(() => {
|
|
1658
|
+
if (!eventName || !isEventTargetSupported(eventTarget)) {
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
const eventListener = (event) => {
|
|
1662
|
+
if (savedEventHandler.current !== void 0) {
|
|
1663
|
+
return savedEventHandler.current(event);
|
|
1664
|
+
}
|
|
1665
|
+
return () => {
|
|
1666
|
+
};
|
|
1667
|
+
};
|
|
1668
|
+
eventTarget.addEventListener(eventName, eventListener, savedEventOptions.current);
|
|
1669
|
+
return () => {
|
|
1670
|
+
eventTarget.removeEventListener(eventName, eventListener, savedEventOptions.current);
|
|
1671
|
+
};
|
|
1672
|
+
}, [eventName, eventTarget, savedEventOptions]);
|
|
1673
|
+
};
|
|
1674
|
+
|
|
1675
|
+
// src/hooks/useKey/useKey.ts
|
|
1676
|
+
var createKeyPredicate = (keyFilter) => {
|
|
1677
|
+
if (typeof keyFilter === "function") {
|
|
1678
|
+
return keyFilter;
|
|
1679
|
+
}
|
|
1680
|
+
if (typeof keyFilter === "string") {
|
|
1681
|
+
return (event) => event.key === keyFilter;
|
|
1682
|
+
}
|
|
1683
|
+
if (keyFilter !== null && keyFilter !== void 0 && !!keyFilter) {
|
|
1684
|
+
return () => true;
|
|
1685
|
+
}
|
|
1686
|
+
return () => false;
|
|
1687
|
+
};
|
|
1688
|
+
var useKey = (key, eventHandler, options = {}, dependencies = [key]) => {
|
|
1689
|
+
const { eventName = "keydown", eventTarget, eventOptions } = options;
|
|
1690
|
+
const memoizedEventHandler = (0, import_react6.useMemo)(() => {
|
|
1691
|
+
const predicate = createKeyPredicate(key);
|
|
1692
|
+
return (handlerEvent) => {
|
|
1693
|
+
if (["INPUT", "TEXTAREA", "SELECT"].includes(document.activeElement?.nodeName ?? "") || document.activeElement?.isContentEditable) {
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1696
|
+
if (predicate(handlerEvent)) {
|
|
1697
|
+
return eventHandler(handlerEvent);
|
|
1698
|
+
}
|
|
1699
|
+
};
|
|
1700
|
+
}, dependencies);
|
|
1701
|
+
useEvent(eventName, memoizedEventHandler, eventTarget, eventOptions);
|
|
1702
|
+
};
|
|
1703
|
+
|
|
1704
|
+
// src/hooks/useAriaLive/useAriaLive.tsx
|
|
1705
|
+
var import_react7 = require("react");
|
|
1706
|
+
var import_type_guards4 = require("@wistia/type-guards");
|
|
1707
|
+
var useAriaLive = () => {
|
|
1708
|
+
const context = (0, import_react7.useContext)(AriaLiveContext);
|
|
1709
|
+
if ((0, import_type_guards4.isNil)(context)) {
|
|
1710
|
+
throw new Error("useAriaLive must be used within an AriaLiveProvider");
|
|
1711
|
+
}
|
|
1712
|
+
return context;
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1715
|
+
// src/hooks/useToast/useToast.tsx
|
|
1716
|
+
var import_react9 = require("react");
|
|
1628
1717
|
var import_sonner2 = require("sonner");
|
|
1629
1718
|
|
|
1630
1719
|
// src/private/components/Toast/Toast.tsx
|
|
1631
|
-
var
|
|
1720
|
+
var import_react8 = require("react");
|
|
1632
1721
|
var import_styled_components13 = __toESM(require("styled-components"));
|
|
1633
|
-
var
|
|
1722
|
+
var import_type_guards6 = require("@wistia/type-guards");
|
|
1634
1723
|
|
|
1635
1724
|
// src/components/Ellipsis/Ellipsis.tsx
|
|
1636
|
-
var
|
|
1725
|
+
var import_type_guards5 = require("@wistia/type-guards");
|
|
1637
1726
|
var import_styled_components11 = __toESM(require("styled-components"));
|
|
1638
1727
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1639
1728
|
var ellipsisStyle = import_styled_components11.css`
|
|
@@ -1665,7 +1754,7 @@ var ellipsisFlexParentStyle = import_styled_components11.css`
|
|
|
1665
1754
|
var EllipsisComponent = import_styled_components11.default.div`
|
|
1666
1755
|
${ellipsisStyle};
|
|
1667
1756
|
${({ $lines }) => {
|
|
1668
|
-
if ((0,
|
|
1757
|
+
if ((0, import_type_guards5.isNotNil)($lines)) {
|
|
1669
1758
|
return import_styled_components11.css`
|
|
1670
1759
|
-webkit-box-orient: vertical;
|
|
1671
1760
|
-webkit-line-clamp: ${$lines};
|
|
@@ -1849,8 +1938,8 @@ var StyledToast = import_styled_components13.default.div`
|
|
|
1849
1938
|
}
|
|
1850
1939
|
`;
|
|
1851
1940
|
var Action = ({ actionButton }) => {
|
|
1852
|
-
if ((0,
|
|
1853
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0,
|
|
1941
|
+
if ((0, import_type_guards6.isNotNil)(actionButton) && (0, import_react8.isValidElement)(actionButton)) {
|
|
1942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0, import_react8.cloneElement)(actionButton, {
|
|
1854
1943
|
variant: "soft",
|
|
1855
1944
|
// force Button variant
|
|
1856
1945
|
size: "sm"
|
|
@@ -1873,7 +1962,7 @@ var Toast = ({
|
|
|
1873
1962
|
$colorScheme: colorScheme,
|
|
1874
1963
|
children: [
|
|
1875
1964
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(MessageWrapper, { children: [
|
|
1876
|
-
(0,
|
|
1965
|
+
(0, import_type_guards6.isNotNil)(icon) ? icon : null,
|
|
1877
1966
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message, { lines: 3, children: message })
|
|
1878
1967
|
] }),
|
|
1879
1968
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Action, { actionButton: action })
|
|
@@ -1886,7 +1975,7 @@ Toast.displayName = "Toast";
|
|
|
1886
1975
|
// src/hooks/useToast/useToast.tsx
|
|
1887
1976
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1888
1977
|
var useToast = () => {
|
|
1889
|
-
return (0,
|
|
1978
|
+
return (0, import_react9.useCallback)(
|
|
1890
1979
|
({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
|
|
1891
1980
|
import_sonner2.toast.custom(
|
|
1892
1981
|
() => {
|
|
@@ -1907,23 +1996,12 @@ var useToast = () => {
|
|
|
1907
1996
|
);
|
|
1908
1997
|
};
|
|
1909
1998
|
|
|
1910
|
-
// src/hooks/useAriaLive/useAriaLive.tsx
|
|
1911
|
-
var import_react6 = require("react");
|
|
1912
|
-
var import_type_guards6 = require("@wistia/type-guards");
|
|
1913
|
-
var useAriaLive = () => {
|
|
1914
|
-
const context = (0, import_react6.useContext)(AriaLiveContext);
|
|
1915
|
-
if ((0, import_type_guards6.isNil)(context)) {
|
|
1916
|
-
throw new Error("useAriaLive must be used within an AriaLiveProvider");
|
|
1917
|
-
}
|
|
1918
|
-
return context;
|
|
1919
|
-
};
|
|
1920
|
-
|
|
1921
1999
|
// src/components/ActionButton/ActionButton.tsx
|
|
1922
|
-
var
|
|
2000
|
+
var import_react13 = require("react");
|
|
1923
2001
|
var import_styled_components19 = __toESM(require("styled-components"));
|
|
1924
2002
|
|
|
1925
2003
|
// src/components/Button/Button.tsx
|
|
1926
|
-
var
|
|
2004
|
+
var import_react12 = require("react");
|
|
1927
2005
|
var import_styled_components18 = __toESM(require("styled-components"));
|
|
1928
2006
|
var import_type_guards10 = require("@wistia/type-guards");
|
|
1929
2007
|
|
|
@@ -5290,13 +5368,13 @@ var iconMap = {
|
|
|
5290
5368
|
|
|
5291
5369
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
5292
5370
|
var import_type_guards7 = require("@wistia/type-guards");
|
|
5293
|
-
var
|
|
5371
|
+
var import_react10 = require("react");
|
|
5294
5372
|
var isResponsiveObject = (values) => {
|
|
5295
5373
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
5296
5374
|
};
|
|
5297
5375
|
var useResponsiveProp = (values) => {
|
|
5298
5376
|
const activeMediaQueries = useActiveMq();
|
|
5299
|
-
return (0,
|
|
5377
|
+
return (0, import_react10.useMemo)(() => {
|
|
5300
5378
|
if ((0, import_type_guards7.isRecord)(values) && isResponsiveObject(values)) {
|
|
5301
5379
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
5302
5380
|
return (0, import_type_guards7.isNotUndefined)(mq2) && (0, import_type_guards7.isNotUndefined)(values[mq2]) ? values[mq2] : values.base;
|
|
@@ -5363,7 +5441,7 @@ var Icon = ({
|
|
|
5363
5441
|
Icon.displayName = "Icon";
|
|
5364
5442
|
|
|
5365
5443
|
// src/components/Link/Link.tsx
|
|
5366
|
-
var
|
|
5444
|
+
var import_react11 = require("react");
|
|
5367
5445
|
var import_type_guards9 = require("@wistia/type-guards");
|
|
5368
5446
|
var import_styled_components17 = __toESM(require("styled-components"));
|
|
5369
5447
|
var import_react_router_dom = require("react-router-dom");
|
|
@@ -5391,7 +5469,7 @@ var StyledLink = import_styled_components17.default.a`
|
|
|
5391
5469
|
color: var(--wui-color-text-link);
|
|
5392
5470
|
text-decoration: ${({ $underline }) => $underline ? "underline" : "none"};
|
|
5393
5471
|
`;
|
|
5394
|
-
var Link = (0,
|
|
5472
|
+
var Link = (0, import_react11.forwardRef)(
|
|
5395
5473
|
({
|
|
5396
5474
|
beforeAction,
|
|
5397
5475
|
children,
|
|
@@ -5527,7 +5605,7 @@ var ButtonContent = ({
|
|
|
5527
5605
|
)
|
|
5528
5606
|
] });
|
|
5529
5607
|
};
|
|
5530
|
-
var Button = (0,
|
|
5608
|
+
var Button = (0, import_react12.forwardRef)(
|
|
5531
5609
|
({
|
|
5532
5610
|
children,
|
|
5533
5611
|
forceState,
|
|
@@ -5700,7 +5778,7 @@ var StyledLabel = import_styled_components19.default.span`
|
|
|
5700
5778
|
grid-row: 2;
|
|
5701
5779
|
text-align: left;
|
|
5702
5780
|
`;
|
|
5703
|
-
var ActionButton = (0,
|
|
5781
|
+
var ActionButton = (0, import_react13.forwardRef)(
|
|
5704
5782
|
({
|
|
5705
5783
|
icon,
|
|
5706
5784
|
colorScheme = "default",
|
|
@@ -5744,7 +5822,7 @@ var ActionButton = (0, import_react10.forwardRef)(
|
|
|
5744
5822
|
ActionButton.displayName = "ActionButton";
|
|
5745
5823
|
|
|
5746
5824
|
// src/components/Avatar/Avatar.tsx
|
|
5747
|
-
var
|
|
5825
|
+
var import_react14 = require("react");
|
|
5748
5826
|
var import_type_guards12 = require("@wistia/type-guards");
|
|
5749
5827
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
5750
5828
|
|
|
@@ -5875,7 +5953,7 @@ var Avatar = ({
|
|
|
5875
5953
|
onImageLoad,
|
|
5876
5954
|
...otherProps
|
|
5877
5955
|
}) => {
|
|
5878
|
-
const [imageLoadState, setImageLoadState] = (0,
|
|
5956
|
+
const [imageLoadState, setImageLoadState] = (0, import_react14.useState)(null);
|
|
5879
5957
|
const handleImageLoad = () => {
|
|
5880
5958
|
setImageLoadState("loaded");
|
|
5881
5959
|
onImageLoad?.("image");
|
|
@@ -5885,7 +5963,7 @@ var Avatar = ({
|
|
|
5885
5963
|
onImageLoad?.("initials");
|
|
5886
5964
|
};
|
|
5887
5965
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
5888
|
-
const avatarColor = (0,
|
|
5966
|
+
const avatarColor = (0, import_react14.useMemo)(() => chooseColorScheme(name), [name]);
|
|
5889
5967
|
const showInitials = (0, import_type_guards12.isNil)(imageUrl) || imageLoadState === "error";
|
|
5890
5968
|
return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(
|
|
5891
5969
|
AvatarWrapper,
|
|
@@ -5915,7 +5993,7 @@ var Avatar = ({
|
|
|
5915
5993
|
Avatar.displayName = "Avatar";
|
|
5916
5994
|
|
|
5917
5995
|
// src/components/Badge/Badge.tsx
|
|
5918
|
-
var
|
|
5996
|
+
var import_react15 = require("react");
|
|
5919
5997
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
5920
5998
|
var import_type_guards13 = require("@wistia/type-guards");
|
|
5921
5999
|
var import_jsx_runtime166 = require("react/jsx-runtime");
|
|
@@ -5939,7 +6017,7 @@ var StyledBadge = import_styled_components22.default.div`
|
|
|
5939
6017
|
width: 12px;
|
|
5940
6018
|
}
|
|
5941
6019
|
`;
|
|
5942
|
-
var Badge = (0,
|
|
6020
|
+
var Badge = (0, import_react15.forwardRef)(
|
|
5943
6021
|
({ colorScheme = "inherit", label, icon, ...otherProps }, ref) => {
|
|
5944
6022
|
const hasIcon = (0, import_type_guards13.isNotNil)(icon);
|
|
5945
6023
|
return /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(
|
|
@@ -5960,7 +6038,7 @@ var Badge = (0, import_react12.forwardRef)(
|
|
|
5960
6038
|
Badge.displayName = "Badge";
|
|
5961
6039
|
|
|
5962
6040
|
// src/components/Box/Box.tsx
|
|
5963
|
-
var
|
|
6041
|
+
var import_react16 = require("react");
|
|
5964
6042
|
var import_styled_components23 = __toESM(require("styled-components"));
|
|
5965
6043
|
var import_type_guards14 = require("@wistia/type-guards");
|
|
5966
6044
|
var import_jsx_runtime167 = require("react/jsx-runtime");
|
|
@@ -6027,13 +6105,13 @@ var BoxComponent = import_styled_components23.default.div`
|
|
|
6027
6105
|
var wrapChildren = (children) => {
|
|
6028
6106
|
if ((0, import_type_guards14.isNotNil)(children)) {
|
|
6029
6107
|
if (typeof children === "object" && isDev) {
|
|
6030
|
-
return
|
|
6108
|
+
return import_react16.Children.map(children, (child) => {
|
|
6031
6109
|
if ((0, import_type_guards14.isNil)(child)) return null;
|
|
6032
6110
|
const elementParams = {};
|
|
6033
6111
|
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
6034
6112
|
elementParams.hasBoxParent = true;
|
|
6035
6113
|
}
|
|
6036
|
-
return (0,
|
|
6114
|
+
return (0, import_react16.cloneElement)(child, elementParams);
|
|
6037
6115
|
});
|
|
6038
6116
|
}
|
|
6039
6117
|
return children;
|
|
@@ -6085,10 +6163,57 @@ var Box = ({
|
|
|
6085
6163
|
};
|
|
6086
6164
|
Box.displayName = "Box";
|
|
6087
6165
|
|
|
6088
|
-
// src/components/
|
|
6166
|
+
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
6089
6167
|
var import_styled_components24 = __toESM(require("styled-components"));
|
|
6090
|
-
var import_type_guards15 = require("@wistia/type-guards");
|
|
6091
6168
|
var import_jsx_runtime168 = require("react/jsx-runtime");
|
|
6169
|
+
var StyledBreadcrumbs = import_styled_components24.default.nav`
|
|
6170
|
+
display: flex;
|
|
6171
|
+
align-items: center;
|
|
6172
|
+
gap: var(--wui-space-01);
|
|
6173
|
+
|
|
6174
|
+
> svg:last-of-type {
|
|
6175
|
+
display: none;
|
|
6176
|
+
}
|
|
6177
|
+
`;
|
|
6178
|
+
var Breadcrumbs = ({ children, ...props }) => {
|
|
6179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
|
|
6180
|
+
StyledBreadcrumbs,
|
|
6181
|
+
{
|
|
6182
|
+
"aria-label": "Breadcrumbs",
|
|
6183
|
+
...props,
|
|
6184
|
+
children
|
|
6185
|
+
}
|
|
6186
|
+
);
|
|
6187
|
+
};
|
|
6188
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
6189
|
+
|
|
6190
|
+
// src/components/Breadcrumbs/Breadcrumb.tsx
|
|
6191
|
+
var import_jsx_runtime169 = require("react/jsx-runtime");
|
|
6192
|
+
var Breadcrumb = ({ icon, href, children }) => {
|
|
6193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)(import_jsx_runtime169.Fragment, { children: [
|
|
6194
|
+
/* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
6195
|
+
Button,
|
|
6196
|
+
{
|
|
6197
|
+
href,
|
|
6198
|
+
leftIcon: icon,
|
|
6199
|
+
variant: "ghost",
|
|
6200
|
+
children
|
|
6201
|
+
}
|
|
6202
|
+
),
|
|
6203
|
+
/* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
6204
|
+
Icon,
|
|
6205
|
+
{
|
|
6206
|
+
size: "sm",
|
|
6207
|
+
type: "caret-right"
|
|
6208
|
+
}
|
|
6209
|
+
)
|
|
6210
|
+
] });
|
|
6211
|
+
};
|
|
6212
|
+
|
|
6213
|
+
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
6214
|
+
var import_styled_components25 = __toESM(require("styled-components"));
|
|
6215
|
+
var import_type_guards15 = require("@wistia/type-guards");
|
|
6216
|
+
var import_jsx_runtime170 = require("react/jsx-runtime");
|
|
6092
6217
|
var getAlignment = (align) => {
|
|
6093
6218
|
if (align === "center") {
|
|
6094
6219
|
return "center";
|
|
@@ -6101,7 +6226,7 @@ var getAlignment = (align) => {
|
|
|
6101
6226
|
}
|
|
6102
6227
|
return "flex-start";
|
|
6103
6228
|
};
|
|
6104
|
-
var ButtonGroupComponent =
|
|
6229
|
+
var ButtonGroupComponent = import_styled_components25.default.div`
|
|
6105
6230
|
display: flex;
|
|
6106
6231
|
|
|
6107
6232
|
/* this helps ensure that primary buttons appear at the top of the column */
|
|
@@ -6130,7 +6255,7 @@ var ButtonGroup = ({
|
|
|
6130
6255
|
if ((0, import_type_guards15.isNil)(children)) {
|
|
6131
6256
|
return null;
|
|
6132
6257
|
}
|
|
6133
|
-
return /* @__PURE__ */ (0,
|
|
6258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
6134
6259
|
ButtonGroupComponent,
|
|
6135
6260
|
{
|
|
6136
6261
|
$align: align,
|
|
@@ -6143,9 +6268,9 @@ var ButtonGroup = ({
|
|
|
6143
6268
|
ButtonGroup.displayName = "ButtonGroup";
|
|
6144
6269
|
|
|
6145
6270
|
// src/components/Card/Card.tsx
|
|
6146
|
-
var
|
|
6147
|
-
var
|
|
6148
|
-
var StyledCard = (0,
|
|
6271
|
+
var import_styled_components26 = __toESM(require("styled-components"));
|
|
6272
|
+
var import_jsx_runtime171 = require("react/jsx-runtime");
|
|
6273
|
+
var StyledCard = (0, import_styled_components26.default)(Box)`
|
|
6149
6274
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
6150
6275
|
box-sizing: border-box;
|
|
6151
6276
|
padding: ${({ $paddingSize }) => `var(--wui-${$paddingSize})`};
|
|
@@ -6178,7 +6303,7 @@ var Card = ({
|
|
|
6178
6303
|
prominence = "secondary",
|
|
6179
6304
|
border = false,
|
|
6180
6305
|
...props
|
|
6181
|
-
}) => /* @__PURE__ */ (0,
|
|
6306
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
6182
6307
|
StyledCard,
|
|
6183
6308
|
{
|
|
6184
6309
|
$backgroundColor: prominenceMap[prominence].backgroundColor,
|
|
@@ -6194,17 +6319,17 @@ var Card = ({
|
|
|
6194
6319
|
Card.displayName = "Card";
|
|
6195
6320
|
|
|
6196
6321
|
// src/components/Checkbox/Checkbox.tsx
|
|
6197
|
-
var
|
|
6322
|
+
var import_react18 = require("react");
|
|
6198
6323
|
var import_react_checkbox = require("@radix-ui/react-checkbox");
|
|
6199
|
-
var
|
|
6324
|
+
var import_styled_components30 = __toESM(require("styled-components"));
|
|
6200
6325
|
var import_type_guards17 = require("@wistia/type-guards");
|
|
6201
6326
|
|
|
6202
6327
|
// src/components/Label/Label.tsx
|
|
6203
|
-
var
|
|
6328
|
+
var import_styled_components28 = __toESM(require("styled-components"));
|
|
6204
6329
|
|
|
6205
6330
|
// src/components/Heading/Heading.tsx
|
|
6206
|
-
var
|
|
6207
|
-
var
|
|
6331
|
+
var import_react17 = require("react");
|
|
6332
|
+
var import_styled_components27 = __toESM(require("styled-components"));
|
|
6208
6333
|
|
|
6209
6334
|
// src/private/helpers/makePolymorphic/makePolymorphic.tsx
|
|
6210
6335
|
var makePolymorphic = (component) => {
|
|
@@ -6212,44 +6337,44 @@ var makePolymorphic = (component) => {
|
|
|
6212
6337
|
};
|
|
6213
6338
|
|
|
6214
6339
|
// src/components/Heading/Heading.tsx
|
|
6215
|
-
var
|
|
6216
|
-
var heroStyle =
|
|
6340
|
+
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
6341
|
+
var heroStyle = import_styled_components27.css`
|
|
6217
6342
|
--font-family: var(--wui-typography-heading-hero-family);
|
|
6218
6343
|
--font-size: var(--wui-typography-heading-hero-size);
|
|
6219
6344
|
--font-weight: var(--wui-typography-heading-hero-weight);
|
|
6220
6345
|
--line-height: var(--wui-typography-heading-hero-line-height);
|
|
6221
6346
|
`;
|
|
6222
|
-
var heading1TextStyle =
|
|
6347
|
+
var heading1TextStyle = import_styled_components27.css`
|
|
6223
6348
|
--font-family: var(--wui-typography-heading-1-family);
|
|
6224
6349
|
--font-size: var(--wui-typography-heading-1-size);
|
|
6225
6350
|
--font-weight: var(--wui-typography-heading-1-weight);
|
|
6226
6351
|
--line-height: var(--wui-typography-heading-1-line-height);
|
|
6227
6352
|
`;
|
|
6228
|
-
var heading2TextStyle =
|
|
6353
|
+
var heading2TextStyle = import_styled_components27.css`
|
|
6229
6354
|
--font-family: var(--wui-typography-heading-2-family);
|
|
6230
6355
|
--font-size: var(--wui-typography-heading-2-size);
|
|
6231
6356
|
--font-weight: var(--wui-typography-heading-2-weight);
|
|
6232
6357
|
--line-height: var(--wui-typography-heading-2-line-height);
|
|
6233
6358
|
`;
|
|
6234
|
-
var heading3TextStyle =
|
|
6359
|
+
var heading3TextStyle = import_styled_components27.css`
|
|
6235
6360
|
--font-family: var(--wui-typography-heading-3-family);
|
|
6236
6361
|
--font-size: var(--wui-typography-heading-3-size);
|
|
6237
6362
|
--font-weight: var(--wui-typography-heading-3-weight);
|
|
6238
6363
|
--line-height: var(--wui-typography-heading-3-line-height);
|
|
6239
6364
|
`;
|
|
6240
|
-
var heading4TextStyle =
|
|
6365
|
+
var heading4TextStyle = import_styled_components27.css`
|
|
6241
6366
|
--font-family: var(--wui-typography-heading-4-family);
|
|
6242
6367
|
--font-size: var(--wui-typography-heading-4-size);
|
|
6243
6368
|
--font-weight: var(--wui-typography-heading-4-weight);
|
|
6244
6369
|
--line-height: var(--wui-typography-heading-4-line-height);
|
|
6245
6370
|
`;
|
|
6246
|
-
var heading5TextStyle =
|
|
6371
|
+
var heading5TextStyle = import_styled_components27.css`
|
|
6247
6372
|
--font-family: var(--wui-typography-heading-5-family);
|
|
6248
6373
|
--font-size: var(--wui-typography-heading-5-size);
|
|
6249
6374
|
--font-weight: var(--wui-typography-heading-5-weight);
|
|
6250
6375
|
--line-height: var(--wui-typography-heading-5-line-height);
|
|
6251
6376
|
`;
|
|
6252
|
-
var heading6TextStyle =
|
|
6377
|
+
var heading6TextStyle = import_styled_components27.css`
|
|
6253
6378
|
--font-family: var(--wui-typography-heading-6-family);
|
|
6254
6379
|
--font-size: var(--wui-typography-heading-6-size);
|
|
6255
6380
|
--font-weight: var(--wui-typography-heading-6-weight);
|
|
@@ -6265,7 +6390,7 @@ var variantStyleMap = {
|
|
|
6265
6390
|
heading6: heading6TextStyle
|
|
6266
6391
|
};
|
|
6267
6392
|
var DEFAULT_ELEMENT = "h1";
|
|
6268
|
-
var StyledHeading =
|
|
6393
|
+
var StyledHeading = import_styled_components27.default.div`
|
|
6269
6394
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
6270
6395
|
font-family: var(--font-family);
|
|
6271
6396
|
font-size: var(--font-size);
|
|
@@ -6274,16 +6399,16 @@ var StyledHeading = import_styled_components26.default.div`
|
|
|
6274
6399
|
color: var(--wui-color-text);
|
|
6275
6400
|
${({ $variant }) => variantStyleMap[$variant]}
|
|
6276
6401
|
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
6277
|
-
${({ $inline }) => $inline &&
|
|
6402
|
+
${({ $inline }) => $inline && import_styled_components27.css`
|
|
6278
6403
|
display: inline-block;
|
|
6279
6404
|
`}
|
|
6280
|
-
${({ $disabled }) => $disabled &&
|
|
6405
|
+
${({ $disabled }) => $disabled && import_styled_components27.css`
|
|
6281
6406
|
color: var(--wui-color-text-disabled);
|
|
6282
6407
|
`}
|
|
6283
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
6408
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components27.css`
|
|
6284
6409
|
user-select: none;
|
|
6285
6410
|
`}
|
|
6286
|
-
${({ $align }) =>
|
|
6411
|
+
${({ $align }) => import_styled_components27.css`
|
|
6287
6412
|
text-align: ${$align};
|
|
6288
6413
|
`}
|
|
6289
6414
|
margin: 0;
|
|
@@ -6297,7 +6422,7 @@ var variantElementMap = {
|
|
|
6297
6422
|
heading5: "h5",
|
|
6298
6423
|
heading6: "h6"
|
|
6299
6424
|
};
|
|
6300
|
-
var HeadingComponent = (0,
|
|
6425
|
+
var HeadingComponent = (0, import_react17.forwardRef)(
|
|
6301
6426
|
({
|
|
6302
6427
|
align = "left",
|
|
6303
6428
|
colorScheme = "inherit",
|
|
@@ -6308,7 +6433,7 @@ var HeadingComponent = (0, import_react14.forwardRef)(
|
|
|
6308
6433
|
variant = "heading1",
|
|
6309
6434
|
renderAs,
|
|
6310
6435
|
...otherProps
|
|
6311
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
6436
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
|
|
6312
6437
|
StyledHeading,
|
|
6313
6438
|
{
|
|
6314
6439
|
ref,
|
|
@@ -6328,8 +6453,8 @@ HeadingComponent.displayName = "Heading";
|
|
|
6328
6453
|
var Heading = makePolymorphic(HeadingComponent);
|
|
6329
6454
|
|
|
6330
6455
|
// src/components/Label/Label.tsx
|
|
6331
|
-
var
|
|
6332
|
-
var requiredStyle =
|
|
6456
|
+
var import_jsx_runtime173 = require("react/jsx-runtime");
|
|
6457
|
+
var requiredStyle = import_styled_components28.css`
|
|
6333
6458
|
&::after {
|
|
6334
6459
|
color: var(--wui-color-text-error);
|
|
6335
6460
|
display: inline;
|
|
@@ -6337,10 +6462,10 @@ var requiredStyle = import_styled_components27.css`
|
|
|
6337
6462
|
content: '*';
|
|
6338
6463
|
}
|
|
6339
6464
|
`;
|
|
6340
|
-
var disabledStyle =
|
|
6465
|
+
var disabledStyle = import_styled_components28.css`
|
|
6341
6466
|
color: var(--wui-color-text-disabled);
|
|
6342
6467
|
`;
|
|
6343
|
-
var StyledLabel2 = (0,
|
|
6468
|
+
var StyledLabel2 = (0, import_styled_components28.default)(Heading).attrs({
|
|
6344
6469
|
variant: "heading6",
|
|
6345
6470
|
renderAs: "label"
|
|
6346
6471
|
})`
|
|
@@ -6369,7 +6494,7 @@ var Label = ({
|
|
|
6369
6494
|
required = false,
|
|
6370
6495
|
screenReaderOnly = false,
|
|
6371
6496
|
...otherProps
|
|
6372
|
-
}) => /* @__PURE__ */ (0,
|
|
6497
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
|
|
6373
6498
|
StyledLabel2,
|
|
6374
6499
|
{
|
|
6375
6500
|
...otherProps,
|
|
@@ -6383,10 +6508,10 @@ var Label = ({
|
|
|
6383
6508
|
Label.displayName = "Label";
|
|
6384
6509
|
|
|
6385
6510
|
// src/components/Label/LabelDescription.tsx
|
|
6386
|
-
var
|
|
6511
|
+
var import_styled_components29 = __toESM(require("styled-components"));
|
|
6387
6512
|
var import_type_guards16 = require("@wistia/type-guards");
|
|
6388
|
-
var
|
|
6389
|
-
var StyledLabelDescription =
|
|
6513
|
+
var import_jsx_runtime174 = require("react/jsx-runtime");
|
|
6514
|
+
var StyledLabelDescription = import_styled_components29.default.div`
|
|
6390
6515
|
color: var(--wui-color-text-secondary);
|
|
6391
6516
|
font-size: var(--wui-typography-body-4-size);
|
|
6392
6517
|
font-weight: var(--wui-typography-body-4-weight);
|
|
@@ -6399,13 +6524,13 @@ var LabelDescription = ({
|
|
|
6399
6524
|
if ((0, import_type_guards16.isNil)(children)) {
|
|
6400
6525
|
return null;
|
|
6401
6526
|
}
|
|
6402
|
-
return /* @__PURE__ */ (0,
|
|
6527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(StyledLabelDescription, { ...props, children });
|
|
6403
6528
|
};
|
|
6404
6529
|
LabelDescription.displayName = "LabelDescription";
|
|
6405
6530
|
|
|
6406
6531
|
// src/components/Checkbox/Checkbox.tsx
|
|
6407
|
-
var
|
|
6408
|
-
var CheckIcon = () => /* @__PURE__ */ (0,
|
|
6532
|
+
var import_jsx_runtime175 = require("react/jsx-runtime");
|
|
6533
|
+
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
|
|
6409
6534
|
"svg",
|
|
6410
6535
|
{
|
|
6411
6536
|
fill: "inherit",
|
|
@@ -6413,7 +6538,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
|
|
|
6413
6538
|
viewBox: "0 0 10 8",
|
|
6414
6539
|
width: "10",
|
|
6415
6540
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6416
|
-
children: /* @__PURE__ */ (0,
|
|
6541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
|
|
6417
6542
|
"path",
|
|
6418
6543
|
{
|
|
6419
6544
|
d: "M3.47281 7.19303L0.377565 4.07999C0.191609 3.89297 0.191609 3.58973 0.377565 3.40268L1.05098 2.72537C1.23694 2.53833 1.53847 2.53833 1.72442 2.72537L3.80953 4.82245L8.27558 0.330729C8.46154 0.143704 8.76306 0.143704 8.94902 0.330729L9.62244 1.00804C9.8084 1.19506 9.8084 1.49831 9.62244 1.68535L4.14624 7.19305C3.96027 7.38008 3.65876 7.38008 3.47281 7.19303Z",
|
|
@@ -6422,7 +6547,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
|
|
|
6422
6547
|
)
|
|
6423
6548
|
}
|
|
6424
6549
|
);
|
|
6425
|
-
var StyledCheckboxWrapper =
|
|
6550
|
+
var StyledCheckboxWrapper = import_styled_components30.default.div`
|
|
6426
6551
|
display: flex;
|
|
6427
6552
|
align-items: center;
|
|
6428
6553
|
cursor: pointer;
|
|
@@ -6436,7 +6561,7 @@ var StyledCheckboxWrapper = import_styled_components29.default.div`
|
|
|
6436
6561
|
background-color: #efefef;
|
|
6437
6562
|
}
|
|
6438
6563
|
`;
|
|
6439
|
-
var StyledCheckboxRoot = (0,
|
|
6564
|
+
var StyledCheckboxRoot = (0, import_styled_components30.default)(import_react_checkbox.Root)`
|
|
6440
6565
|
all: unset; /* CheckboxRoot renders as a button element, so we need to reset all styles */
|
|
6441
6566
|
background-color: var(--wui-color-bg-fill-white);
|
|
6442
6567
|
min-width: 16px;
|
|
@@ -6470,15 +6595,15 @@ var StyledCheckboxRoot = (0, import_styled_components29.default)(import_react_ch
|
|
|
6470
6595
|
/* TODO Lamp to design focus state */
|
|
6471
6596
|
}
|
|
6472
6597
|
`;
|
|
6473
|
-
var StyledCheckboxIndicator = (0,
|
|
6598
|
+
var StyledCheckboxIndicator = (0, import_styled_components30.default)(import_react_checkbox.Indicator)`
|
|
6474
6599
|
display: flex;
|
|
6475
6600
|
`;
|
|
6476
|
-
var StyledLabelWrapper =
|
|
6601
|
+
var StyledLabelWrapper = import_styled_components30.default.div`
|
|
6477
6602
|
display: flex;
|
|
6478
6603
|
flex-direction: column;
|
|
6479
6604
|
margin-left: var(--wui-space-02);
|
|
6480
6605
|
`;
|
|
6481
|
-
var Checkbox = (0,
|
|
6606
|
+
var Checkbox = (0, import_react18.forwardRef)(
|
|
6482
6607
|
({
|
|
6483
6608
|
checked,
|
|
6484
6609
|
disabled = false,
|
|
@@ -6492,10 +6617,10 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
6492
6617
|
value = "false",
|
|
6493
6618
|
...otherProps
|
|
6494
6619
|
}, ref) => {
|
|
6495
|
-
const generatedId = (0,
|
|
6620
|
+
const generatedId = (0, import_react18.useId)();
|
|
6496
6621
|
const computedId = (0, import_type_guards17.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-group-${generatedId}`;
|
|
6497
|
-
return /* @__PURE__ */ (0,
|
|
6498
|
-
/* @__PURE__ */ (0,
|
|
6622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(StyledCheckboxWrapper, { children: [
|
|
6623
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
|
|
6499
6624
|
StyledCheckboxRoot,
|
|
6500
6625
|
{
|
|
6501
6626
|
ref,
|
|
@@ -6520,11 +6645,11 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
6520
6645
|
required,
|
|
6521
6646
|
value,
|
|
6522
6647
|
...otherProps,
|
|
6523
|
-
children: /* @__PURE__ */ (0,
|
|
6648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(StyledCheckboxIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(CheckIcon, {}) })
|
|
6524
6649
|
}
|
|
6525
6650
|
),
|
|
6526
|
-
/* @__PURE__ */ (0,
|
|
6527
|
-
/* @__PURE__ */ (0,
|
|
6651
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(StyledLabelWrapper, { children: [
|
|
6652
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
|
|
6528
6653
|
Label,
|
|
6529
6654
|
{
|
|
6530
6655
|
disabled,
|
|
@@ -6533,7 +6658,7 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
6533
6658
|
children: label
|
|
6534
6659
|
}
|
|
6535
6660
|
),
|
|
6536
|
-
/* @__PURE__ */ (0,
|
|
6661
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(LabelDescription, { children: description })
|
|
6537
6662
|
] })
|
|
6538
6663
|
] });
|
|
6539
6664
|
}
|
|
@@ -6541,22 +6666,22 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
6541
6666
|
Checkbox.displayName = "Checkbox";
|
|
6542
6667
|
|
|
6543
6668
|
// src/components/Divider/Divider.tsx
|
|
6544
|
-
var
|
|
6545
|
-
var
|
|
6546
|
-
var horizontalBorderCss =
|
|
6669
|
+
var import_styled_components31 = __toESM(require("styled-components"));
|
|
6670
|
+
var import_jsx_runtime176 = require("react/jsx-runtime");
|
|
6671
|
+
var horizontalBorderCss = import_styled_components31.css`
|
|
6547
6672
|
border-top-color: var(--wui-color-border);
|
|
6548
6673
|
border-top-style: solid;
|
|
6549
6674
|
border-top-width: 1px;
|
|
6550
6675
|
clear: both; /* for horizontal dividers, ensure it clears any floats */
|
|
6551
6676
|
height: 0;
|
|
6552
6677
|
`;
|
|
6553
|
-
var verticalBorderCss =
|
|
6678
|
+
var verticalBorderCss = import_styled_components31.css`
|
|
6554
6679
|
background-color: var(--wui-color-border);
|
|
6555
6680
|
max-width: 1px;
|
|
6556
6681
|
min-height: 100%;
|
|
6557
6682
|
width: 1px;
|
|
6558
6683
|
`;
|
|
6559
|
-
var DividerComponent =
|
|
6684
|
+
var DividerComponent = import_styled_components31.default.div`
|
|
6560
6685
|
${({ $orientation }) => {
|
|
6561
6686
|
switch ($orientation) {
|
|
6562
6687
|
case "vertical":
|
|
@@ -6571,7 +6696,7 @@ var Divider = ({
|
|
|
6571
6696
|
orientation = "horizontal",
|
|
6572
6697
|
...otherProps
|
|
6573
6698
|
}) => {
|
|
6574
|
-
return /* @__PURE__ */ (0,
|
|
6699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
6575
6700
|
DividerComponent,
|
|
6576
6701
|
{
|
|
6577
6702
|
$orientation: orientation,
|
|
@@ -6584,25 +6709,25 @@ var Divider = ({
|
|
|
6584
6709
|
Divider.displayName = "Divider";
|
|
6585
6710
|
|
|
6586
6711
|
// src/components/Form/Form.tsx
|
|
6587
|
-
var
|
|
6588
|
-
var
|
|
6712
|
+
var import_react20 = require("react");
|
|
6713
|
+
var import_styled_components33 = __toESM(require("styled-components"));
|
|
6589
6714
|
var import_type_guards18 = require("@wistia/type-guards");
|
|
6590
6715
|
|
|
6591
6716
|
// src/components/Stack/Stack.tsx
|
|
6592
|
-
var
|
|
6593
|
-
var
|
|
6594
|
-
var
|
|
6717
|
+
var import_react19 = require("react");
|
|
6718
|
+
var import_styled_components32 = __toESM(require("styled-components"));
|
|
6719
|
+
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
6595
6720
|
var DEFAULT_ELEMENT2 = "div";
|
|
6596
|
-
var StyledStack =
|
|
6721
|
+
var StyledStack = import_styled_components32.default.div`
|
|
6597
6722
|
display: flex;
|
|
6598
6723
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
6599
6724
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
6600
6725
|
`;
|
|
6601
|
-
var StackComponent = (0,
|
|
6726
|
+
var StackComponent = (0, import_react19.forwardRef)(
|
|
6602
6727
|
({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
|
|
6603
6728
|
const responsiveGap = useResponsiveProp(gap);
|
|
6604
6729
|
const responsiveDirection = useResponsiveProp(direction);
|
|
6605
|
-
return /* @__PURE__ */ (0,
|
|
6730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
|
|
6606
6731
|
StyledStack,
|
|
6607
6732
|
{
|
|
6608
6733
|
ref,
|
|
@@ -6618,25 +6743,25 @@ StackComponent.displayName = "Stack";
|
|
|
6618
6743
|
var Stack = makePolymorphic(StackComponent);
|
|
6619
6744
|
|
|
6620
6745
|
// src/components/Form/Form.tsx
|
|
6621
|
-
var
|
|
6622
|
-
var StyledForm =
|
|
6746
|
+
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
6747
|
+
var StyledForm = import_styled_components33.default.form`
|
|
6623
6748
|
--form-default-width: 690px;
|
|
6624
6749
|
|
|
6625
6750
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
6626
6751
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
6627
6752
|
`;
|
|
6628
|
-
var FormContext = (0,
|
|
6753
|
+
var FormContext = (0, import_react20.createContext)({
|
|
6629
6754
|
values: {},
|
|
6630
6755
|
errors: {},
|
|
6631
6756
|
hasSubmitted: false,
|
|
6632
6757
|
formId: ""
|
|
6633
6758
|
});
|
|
6634
6759
|
var FormComponent = ({ children, action, values = {}, validate, fullWidth = false, ...props }, forwardedRef) => {
|
|
6635
|
-
const [errors, setErrors] = (0,
|
|
6636
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
6637
|
-
const innerRef = (0,
|
|
6760
|
+
const [errors, setErrors] = (0, import_react20.useState)({});
|
|
6761
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react20.useState)(false);
|
|
6762
|
+
const innerRef = (0, import_react20.useRef)();
|
|
6638
6763
|
const ref = forwardedRef ?? innerRef;
|
|
6639
|
-
const autoId = (0,
|
|
6764
|
+
const autoId = (0, import_react20.useId)();
|
|
6640
6765
|
const id = props.id ?? autoId;
|
|
6641
6766
|
const handleValidate = (nextFormData) => {
|
|
6642
6767
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -6678,7 +6803,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
6678
6803
|
void action(null);
|
|
6679
6804
|
}
|
|
6680
6805
|
};
|
|
6681
|
-
const context = (0,
|
|
6806
|
+
const context = (0, import_react20.useMemo)(() => {
|
|
6682
6807
|
return {
|
|
6683
6808
|
values,
|
|
6684
6809
|
errors,
|
|
@@ -6688,7 +6813,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
6688
6813
|
}, [values, errors, id, hasSubmitted]);
|
|
6689
6814
|
return (
|
|
6690
6815
|
// @ts-expect-error - generic context providers are a giant pain
|
|
6691
|
-
/* @__PURE__ */ (0,
|
|
6816
|
+
/* @__PURE__ */ (0, import_jsx_runtime178.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
|
|
6692
6817
|
Stack,
|
|
6693
6818
|
{
|
|
6694
6819
|
gap: "space-05",
|
|
@@ -6706,15 +6831,15 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
6706
6831
|
);
|
|
6707
6832
|
};
|
|
6708
6833
|
FormComponent.displayName = "Form";
|
|
6709
|
-
var Form = (0,
|
|
6834
|
+
var Form = (0, import_react20.forwardRef)(FormComponent);
|
|
6710
6835
|
|
|
6711
6836
|
// src/components/Form/useFormState.tsx
|
|
6712
|
-
var
|
|
6837
|
+
var import_react21 = require("react");
|
|
6713
6838
|
var useFormState = (action, initialData = {}) => {
|
|
6714
|
-
const [data, setData] = (0,
|
|
6715
|
-
const [isPending, setIsPending] = (0,
|
|
6716
|
-
const [error, setError] = (0,
|
|
6717
|
-
const formAction = (0,
|
|
6839
|
+
const [data, setData] = (0, import_react21.useState)(initialData);
|
|
6840
|
+
const [isPending, setIsPending] = (0, import_react21.useState)(false);
|
|
6841
|
+
const [error, setError] = (0, import_react21.useState)(null);
|
|
6842
|
+
const formAction = (0, import_react21.useCallback)(
|
|
6718
6843
|
async (nextFormData) => {
|
|
6719
6844
|
if (nextFormData === null) {
|
|
6720
6845
|
setData(initialData);
|
|
@@ -6745,23 +6870,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
6745
6870
|
};
|
|
6746
6871
|
|
|
6747
6872
|
// src/components/Form/FormErrorSummary.tsx
|
|
6748
|
-
var
|
|
6873
|
+
var import_react22 = require("react");
|
|
6749
6874
|
var import_type_guards19 = require("@wistia/type-guards");
|
|
6750
|
-
var
|
|
6875
|
+
var import_jsx_runtime179 = require("react/jsx-runtime");
|
|
6751
6876
|
var ErrorItem = ({ name, error, formId }) => {
|
|
6752
|
-
return /* @__PURE__ */ (0,
|
|
6877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(Link, { href: `${formId}-${name}`, children: error }) }, name);
|
|
6753
6878
|
};
|
|
6754
6879
|
var FormErrorSummary = ({ description }) => {
|
|
6755
|
-
const ref = (0,
|
|
6756
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
6880
|
+
const ref = (0, import_react22.useRef)(null);
|
|
6881
|
+
const { formId, errors, hasSubmitted } = (0, import_react22.useContext)(FormContext);
|
|
6757
6882
|
const isValid = Object.keys(errors).length === 0;
|
|
6758
6883
|
if (isValid || !hasSubmitted) {
|
|
6759
6884
|
return null;
|
|
6760
6885
|
}
|
|
6761
|
-
return /* @__PURE__ */ (0,
|
|
6762
|
-
/* @__PURE__ */ (0,
|
|
6763
|
-
/* @__PURE__ */ (0,
|
|
6764
|
-
([name, error]) => (0, import_type_guards19.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0,
|
|
6886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)("div", { ref, children: [
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)("p", { children: description }),
|
|
6888
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards19.isNotUndefined)(error)).map(
|
|
6889
|
+
([name, error]) => (0, import_type_guards19.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
6765
6890
|
ErrorItem,
|
|
6766
6891
|
{
|
|
6767
6892
|
error: err,
|
|
@@ -6769,7 +6894,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
6769
6894
|
name
|
|
6770
6895
|
},
|
|
6771
6896
|
err
|
|
6772
|
-
)) : /* @__PURE__ */ (0,
|
|
6897
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
6773
6898
|
ErrorItem,
|
|
6774
6899
|
{
|
|
6775
6900
|
error: error ?? "",
|
|
@@ -6783,95 +6908,95 @@ var FormErrorSummary = ({ description }) => {
|
|
|
6783
6908
|
};
|
|
6784
6909
|
|
|
6785
6910
|
// src/components/FormField/FormField.tsx
|
|
6786
|
-
var
|
|
6787
|
-
var
|
|
6911
|
+
var import_react26 = require("react");
|
|
6912
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
6788
6913
|
var import_type_guards20 = require("@wistia/type-guards");
|
|
6789
6914
|
|
|
6790
6915
|
// src/components/Text/Text.tsx
|
|
6791
|
-
var
|
|
6792
|
-
var
|
|
6793
|
-
var
|
|
6794
|
-
var bodyBoldStyles =
|
|
6916
|
+
var import_react23 = require("react");
|
|
6917
|
+
var import_styled_components34 = __toESM(require("styled-components"));
|
|
6918
|
+
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
6919
|
+
var bodyBoldStyles = import_styled_components34.css`
|
|
6795
6920
|
> strong,
|
|
6796
6921
|
b {
|
|
6797
6922
|
font-weight: var(--wui-typography-weight-body-bold);
|
|
6798
6923
|
}
|
|
6799
6924
|
`;
|
|
6800
|
-
var labelBoldStyles =
|
|
6925
|
+
var labelBoldStyles = import_styled_components34.css`
|
|
6801
6926
|
> strong,
|
|
6802
6927
|
b {
|
|
6803
6928
|
font-weight: var(--wui-typography-weight-label-bold);
|
|
6804
6929
|
}
|
|
6805
6930
|
`;
|
|
6806
|
-
var body1TextStyle =
|
|
6931
|
+
var body1TextStyle = import_styled_components34.css`
|
|
6807
6932
|
--font-family: var(--wui-typography-body-1-family);
|
|
6808
6933
|
--font-size: var(--wui-typography-body-1-size);
|
|
6809
6934
|
--font-weight: var(--wui-typography-body-1-weight);
|
|
6810
6935
|
--line-height: var(--wui-typography-body-1-line-height);
|
|
6811
6936
|
${bodyBoldStyles}
|
|
6812
6937
|
`;
|
|
6813
|
-
var body2TextStyle =
|
|
6938
|
+
var body2TextStyle = import_styled_components34.css`
|
|
6814
6939
|
--font-family: var(--wui-typography-body-2-family);
|
|
6815
6940
|
--font-size: var(--wui-typography-body-2-size);
|
|
6816
6941
|
--font-weight: var(--wui-typography-body-2-weight);
|
|
6817
6942
|
--line-height: var(--wui-typography-body-2-line-height);
|
|
6818
6943
|
${bodyBoldStyles}
|
|
6819
6944
|
`;
|
|
6820
|
-
var body3TextStyle =
|
|
6945
|
+
var body3TextStyle = import_styled_components34.css`
|
|
6821
6946
|
--font-family: var(--wui-typography-body-3-family);
|
|
6822
6947
|
--font-size: var(--wui-typography-body-3-size);
|
|
6823
6948
|
--font-weight: var(--wui-typography-body-3-weight);
|
|
6824
6949
|
--line-height: var(--wui-typography-body-3-line-height);
|
|
6825
6950
|
${bodyBoldStyles}
|
|
6826
6951
|
`;
|
|
6827
|
-
var body4TextStyle =
|
|
6952
|
+
var body4TextStyle = import_styled_components34.css`
|
|
6828
6953
|
--font-family: var(--wui-typography-body-4-family);
|
|
6829
6954
|
--font-size: var(--wui-typography-body-4-size);
|
|
6830
6955
|
--font-weight: var(--wui-typography-body-4-weight);
|
|
6831
6956
|
--line-height: var(--wui-typography-body-4-line-height);
|
|
6832
6957
|
${bodyBoldStyles}
|
|
6833
6958
|
`;
|
|
6834
|
-
var label1TextStyle =
|
|
6959
|
+
var label1TextStyle = import_styled_components34.css`
|
|
6835
6960
|
--font-family: var(--wui-typography-label-1-family);
|
|
6836
6961
|
--font-size: var(--wui-typography-label-1-size);
|
|
6837
6962
|
--font-weight: var(--wui-typography-label-1-weight);
|
|
6838
6963
|
--line-height: var(--wui-typography-label-1-line-height);
|
|
6839
6964
|
${labelBoldStyles}
|
|
6840
6965
|
`;
|
|
6841
|
-
var label2TextStyle =
|
|
6966
|
+
var label2TextStyle = import_styled_components34.css`
|
|
6842
6967
|
--font-family: var(--wui-typography-label-2-family);
|
|
6843
6968
|
--font-size: var(--wui-typography-label-2-size);
|
|
6844
6969
|
--font-weight: var(--wui-typography-label-2-weight);
|
|
6845
6970
|
--line-height: var(--wui-typography-label-2-line-height);
|
|
6846
6971
|
${labelBoldStyles}
|
|
6847
6972
|
`;
|
|
6848
|
-
var label3TextStyle =
|
|
6973
|
+
var label3TextStyle = import_styled_components34.css`
|
|
6849
6974
|
--font-family: var(--wui-typography-label-3-family);
|
|
6850
6975
|
--font-size: var(--wui-typography-label-3-size);
|
|
6851
6976
|
--font-weight: var(--wui-typography-label-3-weight);
|
|
6852
6977
|
--line-height: var(--wui-typography-label-3-line-height);
|
|
6853
6978
|
${labelBoldStyles}
|
|
6854
6979
|
`;
|
|
6855
|
-
var label4TextStyle =
|
|
6980
|
+
var label4TextStyle = import_styled_components34.css`
|
|
6856
6981
|
--font-family: var(--wui-typography-label-4-family);
|
|
6857
6982
|
--font-size: var(--wui-typography-label-4-size);
|
|
6858
6983
|
--font-weight: var(--wui-typography-label-4-weight);
|
|
6859
6984
|
--line-height: var(--wui-typography-label-4-line-height);
|
|
6860
6985
|
${labelBoldStyles}
|
|
6861
6986
|
`;
|
|
6862
|
-
var body1MonoTextStyle =
|
|
6987
|
+
var body1MonoTextStyle = import_styled_components34.css`
|
|
6863
6988
|
${body1TextStyle};
|
|
6864
6989
|
--font-family: var(--wui-typography-family-mono);
|
|
6865
6990
|
`;
|
|
6866
|
-
var body2MonoTextStyle =
|
|
6991
|
+
var body2MonoTextStyle = import_styled_components34.css`
|
|
6867
6992
|
${body2TextStyle};
|
|
6868
6993
|
--font-family: var(--wui-typography-family-mono);
|
|
6869
6994
|
`;
|
|
6870
|
-
var body3MonoTextStyle =
|
|
6995
|
+
var body3MonoTextStyle = import_styled_components34.css`
|
|
6871
6996
|
${body3TextStyle};
|
|
6872
6997
|
--font-family: var(--wui-typography-family-mono);
|
|
6873
6998
|
`;
|
|
6874
|
-
var body4MonoTextStyle =
|
|
6999
|
+
var body4MonoTextStyle = import_styled_components34.css`
|
|
6875
7000
|
${body4TextStyle};
|
|
6876
7001
|
--font-family: var(--wui-typography-family-mono);
|
|
6877
7002
|
`;
|
|
@@ -6889,7 +7014,7 @@ var variantStyleMap2 = {
|
|
|
6889
7014
|
label3: label3TextStyle,
|
|
6890
7015
|
label4: label4TextStyle
|
|
6891
7016
|
};
|
|
6892
|
-
var StyledText =
|
|
7017
|
+
var StyledText = import_styled_components34.default.div`
|
|
6893
7018
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
6894
7019
|
--text-color: ${({ $prominence, $disabled }) => {
|
|
6895
7020
|
if ($disabled) {
|
|
@@ -6913,24 +7038,24 @@ var StyledText = import_styled_components33.default.div`
|
|
|
6913
7038
|
margin: 0;
|
|
6914
7039
|
${({ $variant }) => variantStyleMap2[$variant]}
|
|
6915
7040
|
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
6916
|
-
${({ $inline }) => $inline &&
|
|
7041
|
+
${({ $inline }) => $inline && import_styled_components34.css`
|
|
6917
7042
|
display: inline-block;
|
|
6918
7043
|
`}
|
|
6919
|
-
${({ $disabled }) => $disabled &&
|
|
7044
|
+
${({ $disabled }) => $disabled && import_styled_components34.css`
|
|
6920
7045
|
--text-color: var(--wui-color-text-disabled);
|
|
6921
7046
|
`}
|
|
6922
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
7047
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components34.css`
|
|
6923
7048
|
user-select: none;
|
|
6924
7049
|
`}
|
|
6925
|
-
${({ $align }) =>
|
|
7050
|
+
${({ $align }) => import_styled_components34.css`
|
|
6926
7051
|
text-align: ${$align};
|
|
6927
7052
|
`}
|
|
6928
|
-
${({ as }) => as === "p" &&
|
|
7053
|
+
${({ as }) => as === "p" && import_styled_components34.css`
|
|
6929
7054
|
display: block;
|
|
6930
7055
|
`}
|
|
6931
7056
|
`;
|
|
6932
7057
|
var DEFAULT_ELEMENT3 = "div";
|
|
6933
|
-
var TextComponent = (0,
|
|
7058
|
+
var TextComponent = (0, import_react23.forwardRef)(
|
|
6934
7059
|
({
|
|
6935
7060
|
align = "left",
|
|
6936
7061
|
colorScheme = "inherit",
|
|
@@ -6943,7 +7068,7 @@ var TextComponent = (0, import_react20.forwardRef)(
|
|
|
6943
7068
|
renderAs,
|
|
6944
7069
|
...otherProps
|
|
6945
7070
|
}, ref) => {
|
|
6946
|
-
return /* @__PURE__ */ (0,
|
|
7071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
|
|
6947
7072
|
StyledText,
|
|
6948
7073
|
{
|
|
6949
7074
|
ref,
|
|
@@ -6965,28 +7090,28 @@ TextComponent.displayName = "Text";
|
|
|
6965
7090
|
var Text = makePolymorphic(TextComponent);
|
|
6966
7091
|
|
|
6967
7092
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
6968
|
-
var
|
|
7093
|
+
var import_react25 = require("react");
|
|
6969
7094
|
|
|
6970
7095
|
// src/components/FormGroup/FormGroup.tsx
|
|
6971
|
-
var
|
|
6972
|
-
var
|
|
6973
|
-
var
|
|
6974
|
-
var StyledFieldset =
|
|
7096
|
+
var import_styled_components35 = __toESM(require("styled-components"));
|
|
7097
|
+
var import_react24 = require("react");
|
|
7098
|
+
var import_jsx_runtime181 = require("react/jsx-runtime");
|
|
7099
|
+
var StyledFieldset = import_styled_components35.default.fieldset`
|
|
6975
7100
|
border: 0;
|
|
6976
7101
|
`;
|
|
6977
|
-
var StyledLegend =
|
|
7102
|
+
var StyledLegend = import_styled_components35.default.legend`
|
|
6978
7103
|
margin-bottom: var(--space-01);
|
|
6979
7104
|
`;
|
|
6980
7105
|
var FormGroup = ({ children, label, ...props }) => {
|
|
6981
|
-
const ref = (0,
|
|
6982
|
-
return /* @__PURE__ */ (0,
|
|
7106
|
+
const ref = (0, import_react24.useRef)();
|
|
7107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)(
|
|
6983
7108
|
Stack,
|
|
6984
7109
|
{
|
|
6985
7110
|
...props,
|
|
6986
7111
|
ref,
|
|
6987
7112
|
renderAs: StyledFieldset,
|
|
6988
7113
|
children: [
|
|
6989
|
-
/* @__PURE__ */ (0,
|
|
7114
|
+
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
|
|
6990
7115
|
Heading,
|
|
6991
7116
|
{
|
|
6992
7117
|
renderAs: StyledLegend,
|
|
@@ -7002,8 +7127,8 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
7002
7127
|
FormGroup.displayName = "FormGroup";
|
|
7003
7128
|
|
|
7004
7129
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
7005
|
-
var
|
|
7006
|
-
var CheckboxGroupContext = (0,
|
|
7130
|
+
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
7131
|
+
var CheckboxGroupContext = (0, import_react25.createContext)(null);
|
|
7007
7132
|
var CheckboxGroup = ({
|
|
7008
7133
|
children,
|
|
7009
7134
|
name,
|
|
@@ -7011,19 +7136,19 @@ var CheckboxGroup = ({
|
|
|
7011
7136
|
value,
|
|
7012
7137
|
...props
|
|
7013
7138
|
}) => {
|
|
7014
|
-
const context = (0,
|
|
7139
|
+
const context = (0, import_react25.useMemo)(() => {
|
|
7015
7140
|
return {
|
|
7016
7141
|
name,
|
|
7017
7142
|
onChange
|
|
7018
7143
|
};
|
|
7019
7144
|
}, [name, onChange]);
|
|
7020
|
-
return /* @__PURE__ */ (0,
|
|
7145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(FormGroup, { ...props, children }) });
|
|
7021
7146
|
};
|
|
7022
7147
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
7023
7148
|
|
|
7024
7149
|
// src/components/FormField/FormField.tsx
|
|
7025
|
-
var
|
|
7026
|
-
var StyledFormField =
|
|
7150
|
+
var import_jsx_runtime183 = require("react/jsx-runtime");
|
|
7151
|
+
var StyledFormField = import_styled_components36.default.div`
|
|
7027
7152
|
--form-field-spacing: var(--wui-space-01);
|
|
7028
7153
|
--form-field-error-color: var(--wui-color-text-secondary-error);
|
|
7029
7154
|
|
|
@@ -7031,7 +7156,7 @@ var StyledFormField = import_styled_components35.default.div`
|
|
|
7031
7156
|
flex-direction: column;
|
|
7032
7157
|
gap: var(--form-field-spacing);
|
|
7033
7158
|
`;
|
|
7034
|
-
var StyledErrorList =
|
|
7159
|
+
var StyledErrorList = import_styled_components36.default.ul`
|
|
7035
7160
|
margin: 0;
|
|
7036
7161
|
padding: 0;
|
|
7037
7162
|
padding-left: var(--wui-space-04);
|
|
@@ -7041,7 +7166,7 @@ var StyledErrorList = import_styled_components35.default.ul`
|
|
|
7041
7166
|
`;
|
|
7042
7167
|
var ErrorMessages = ({ errors, id }) => {
|
|
7043
7168
|
const isMultipleErrors = (0, import_type_guards20.isArray)(errors);
|
|
7044
|
-
return isMultipleErrors ? /* @__PURE__ */ (0,
|
|
7169
|
+
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7045
7170
|
Text,
|
|
7046
7171
|
{
|
|
7047
7172
|
colorScheme: "error",
|
|
@@ -7051,7 +7176,7 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
7051
7176
|
children: error
|
|
7052
7177
|
},
|
|
7053
7178
|
`${id}-${index}`
|
|
7054
|
-
)) }) : /* @__PURE__ */ (0,
|
|
7179
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7055
7180
|
Text,
|
|
7056
7181
|
{
|
|
7057
7182
|
colorScheme: "error",
|
|
@@ -7071,8 +7196,8 @@ var FormField = ({
|
|
|
7071
7196
|
value,
|
|
7072
7197
|
...props
|
|
7073
7198
|
}) => {
|
|
7074
|
-
const formState = (0,
|
|
7075
|
-
const checkboxGroup = (0,
|
|
7199
|
+
const formState = (0, import_react26.useContext)(FormContext);
|
|
7200
|
+
const checkboxGroup = (0, import_react26.useContext)(CheckboxGroupContext);
|
|
7076
7201
|
const id = props.id ?? `${formState.formId}-${name}`;
|
|
7077
7202
|
const isInlineLabel = children.type === Checkbox;
|
|
7078
7203
|
const computedError = error ?? formState.errors[name];
|
|
@@ -7107,11 +7232,11 @@ var FormField = ({
|
|
|
7107
7232
|
"aria-describedby": (0, import_type_guards20.isNotNil)(error) ? `${id}-error` : void 0
|
|
7108
7233
|
};
|
|
7109
7234
|
}
|
|
7110
|
-
|
|
7111
|
-
return /* @__PURE__ */ (0,
|
|
7112
|
-
!isInlineLabel && /* @__PURE__ */ (0,
|
|
7113
|
-
(0,
|
|
7114
|
-
(0, import_type_guards20.isNotNil)(computedError) ? /* @__PURE__ */ (0,
|
|
7235
|
+
import_react26.Children.only(children);
|
|
7236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(StyledFormField, { ...props, children: [
|
|
7237
|
+
!isInlineLabel && /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(Label, { htmlFor: id, children: label }),
|
|
7238
|
+
(0, import_react26.cloneElement)(children, childProps),
|
|
7239
|
+
(0, import_type_guards20.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7115
7240
|
ErrorMessages,
|
|
7116
7241
|
{
|
|
7117
7242
|
errors: computedError,
|
|
@@ -7123,9 +7248,9 @@ var FormField = ({
|
|
|
7123
7248
|
FormField.displayName = "FormField";
|
|
7124
7249
|
|
|
7125
7250
|
// src/components/FormGroup/RadioGroup.tsx
|
|
7126
|
-
var
|
|
7127
|
-
var
|
|
7128
|
-
var RadioGroupContext = (0,
|
|
7251
|
+
var import_react27 = require("react");
|
|
7252
|
+
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
7253
|
+
var RadioGroupContext = (0, import_react27.createContext)(null);
|
|
7129
7254
|
var RadioGroup = ({
|
|
7130
7255
|
children,
|
|
7131
7256
|
name,
|
|
@@ -7133,21 +7258,21 @@ var RadioGroup = ({
|
|
|
7133
7258
|
value,
|
|
7134
7259
|
...props
|
|
7135
7260
|
}) => {
|
|
7136
|
-
const context = (0,
|
|
7261
|
+
const context = (0, import_react27.useMemo)(() => {
|
|
7137
7262
|
return {
|
|
7138
7263
|
name,
|
|
7139
7264
|
onChange
|
|
7140
7265
|
};
|
|
7141
7266
|
}, [name, onChange]);
|
|
7142
|
-
return /* @__PURE__ */ (0,
|
|
7267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(FormGroup, { ...props, children }) });
|
|
7143
7268
|
};
|
|
7144
7269
|
RadioGroup.displayName = "RadioGroup";
|
|
7145
7270
|
|
|
7146
7271
|
// src/components/IconButton/IconButton.tsx
|
|
7147
|
-
var
|
|
7148
|
-
var
|
|
7149
|
-
var
|
|
7150
|
-
var StyledButton2 = (0,
|
|
7272
|
+
var import_react28 = require("react");
|
|
7273
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
7274
|
+
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
7275
|
+
var StyledButton2 = (0, import_styled_components37.default)(Button)`
|
|
7151
7276
|
--icon-button-size-sm: 24px;
|
|
7152
7277
|
--icon-button-size-md: 32px;
|
|
7153
7278
|
--icon-button-size-lg: 40px;
|
|
@@ -7161,10 +7286,10 @@ var StyledButton2 = (0, import_styled_components36.default)(Button)`
|
|
|
7161
7286
|
align-items: center;
|
|
7162
7287
|
line-height: 1;
|
|
7163
7288
|
`;
|
|
7164
|
-
var IconButton = (0,
|
|
7289
|
+
var IconButton = (0, import_react28.forwardRef)(
|
|
7165
7290
|
({ children, label, size = "md", ...props }, ref) => {
|
|
7166
7291
|
const responsiveSize = useResponsiveProp(size);
|
|
7167
|
-
return /* @__PURE__ */ (0,
|
|
7292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7168
7293
|
StyledButton2,
|
|
7169
7294
|
{
|
|
7170
7295
|
...props,
|
|
@@ -7172,7 +7297,7 @@ var IconButton = (0, import_react25.forwardRef)(
|
|
|
7172
7297
|
"aria-label": label,
|
|
7173
7298
|
"data-wistia-ui-icon-button": true,
|
|
7174
7299
|
size: responsiveSize,
|
|
7175
|
-
children: (0,
|
|
7300
|
+
children: (0, import_react28.cloneElement)(import_react28.Children.only(children), {
|
|
7176
7301
|
size: responsiveSize
|
|
7177
7302
|
})
|
|
7178
7303
|
}
|
|
@@ -7182,11 +7307,11 @@ var IconButton = (0, import_react25.forwardRef)(
|
|
|
7182
7307
|
IconButton.displayName = "IconButton";
|
|
7183
7308
|
|
|
7184
7309
|
// src/components/Input/Input.tsx
|
|
7185
|
-
var
|
|
7186
|
-
var
|
|
7310
|
+
var import_react29 = require("react");
|
|
7311
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
7187
7312
|
var import_type_guards21 = require("@wistia/type-guards");
|
|
7188
|
-
var
|
|
7189
|
-
var inputStyles =
|
|
7313
|
+
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
7314
|
+
var inputStyles = import_styled_components38.css`
|
|
7190
7315
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7191
7316
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
7192
7317
|
--wui-input-color-border: var(--wui-color-border);
|
|
@@ -7227,7 +7352,7 @@ var inputStyles = import_styled_components37.css`
|
|
|
7227
7352
|
}
|
|
7228
7353
|
}
|
|
7229
7354
|
`;
|
|
7230
|
-
var StyledInputContainer =
|
|
7355
|
+
var StyledInputContainer = import_styled_components38.default.div`
|
|
7231
7356
|
display: inline-flex;
|
|
7232
7357
|
position: relative;
|
|
7233
7358
|
${inputStyles};
|
|
@@ -7274,7 +7399,7 @@ var StyledInputContainer = import_styled_components37.default.div`
|
|
|
7274
7399
|
var isValidRef = (ref) => {
|
|
7275
7400
|
return typeof ref === "object" && ref !== null && "current" in ref && (0, import_type_guards21.isNotNil)(ref.current);
|
|
7276
7401
|
};
|
|
7277
|
-
var Input = (0,
|
|
7402
|
+
var Input = (0, import_react29.forwardRef)(
|
|
7278
7403
|
({
|
|
7279
7404
|
fullWidth = false,
|
|
7280
7405
|
monospace = false,
|
|
@@ -7284,21 +7409,21 @@ var Input = (0, import_react26.forwardRef)(
|
|
|
7284
7409
|
rightIcon,
|
|
7285
7410
|
...props
|
|
7286
7411
|
}, externalRef) => {
|
|
7287
|
-
const internalRef = (0,
|
|
7412
|
+
const internalRef = (0, import_react29.useRef)();
|
|
7288
7413
|
const ref = isValidRef(externalRef) ? externalRef : internalRef;
|
|
7289
7414
|
let leftIconToDisplay = leftIcon;
|
|
7290
7415
|
if ((0, import_type_guards21.isNil)(leftIcon) && type === "search") {
|
|
7291
|
-
leftIconToDisplay = /* @__PURE__ */ (0,
|
|
7416
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(Icon, { type: "search" });
|
|
7292
7417
|
}
|
|
7293
7418
|
if ((0, import_type_guards21.isNotNil)(leftIconToDisplay)) {
|
|
7294
|
-
leftIconToDisplay = (0,
|
|
7419
|
+
leftIconToDisplay = (0, import_react29.cloneElement)(leftIconToDisplay, {
|
|
7295
7420
|
size: "md",
|
|
7296
7421
|
className: "wui-input-left-icon"
|
|
7297
7422
|
});
|
|
7298
7423
|
}
|
|
7299
7424
|
let rightIconToDisplay = rightIcon;
|
|
7300
7425
|
if ((0, import_type_guards21.isNotNil)(rightIconToDisplay)) {
|
|
7301
|
-
rightIconToDisplay = (0,
|
|
7426
|
+
rightIconToDisplay = (0, import_react29.cloneElement)(rightIconToDisplay, {
|
|
7302
7427
|
size: "md",
|
|
7303
7428
|
className: "wui-input-right-icon"
|
|
7304
7429
|
});
|
|
@@ -7313,21 +7438,21 @@ var Input = (0, import_react26.forwardRef)(
|
|
|
7313
7438
|
});
|
|
7314
7439
|
}
|
|
7315
7440
|
};
|
|
7316
|
-
return /* @__PURE__ */ (0,
|
|
7441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(
|
|
7317
7442
|
StyledInputContainer,
|
|
7318
7443
|
{
|
|
7319
7444
|
$fullWidth: fullWidth,
|
|
7320
7445
|
$monospace: monospace,
|
|
7321
7446
|
children: [
|
|
7322
7447
|
leftIconToDisplay ?? null,
|
|
7323
|
-
type === "multiline" ? /* @__PURE__ */ (0,
|
|
7448
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7324
7449
|
"textarea",
|
|
7325
7450
|
{
|
|
7326
7451
|
...props,
|
|
7327
7452
|
ref,
|
|
7328
7453
|
onFocus: handleFocus
|
|
7329
7454
|
}
|
|
7330
|
-
) : /* @__PURE__ */ (0,
|
|
7455
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7331
7456
|
"input",
|
|
7332
7457
|
{
|
|
7333
7458
|
...props,
|
|
@@ -7345,11 +7470,11 @@ var Input = (0, import_react26.forwardRef)(
|
|
|
7345
7470
|
Input.displayName = "Input";
|
|
7346
7471
|
|
|
7347
7472
|
// src/components/Menu/Menu.tsx
|
|
7348
|
-
var
|
|
7473
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7349
7474
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
7350
7475
|
var import_type_guards22 = require("@wistia/type-guards");
|
|
7351
|
-
var
|
|
7352
|
-
var open =
|
|
7476
|
+
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
7477
|
+
var open = import_styled_components39.keyframes`
|
|
7353
7478
|
from {
|
|
7354
7479
|
opacity: 0;
|
|
7355
7480
|
transform: scale(.97) translateY(-8px);
|
|
@@ -7359,7 +7484,7 @@ var open = import_styled_components38.keyframes`
|
|
|
7359
7484
|
transform: scale(1);
|
|
7360
7485
|
}
|
|
7361
7486
|
`;
|
|
7362
|
-
var close =
|
|
7487
|
+
var close = import_styled_components39.keyframes`
|
|
7363
7488
|
from {
|
|
7364
7489
|
opacity: 1;
|
|
7365
7490
|
transform: scale(1);
|
|
@@ -7369,7 +7494,7 @@ var close = import_styled_components38.keyframes`
|
|
|
7369
7494
|
transform: scale(.97) translateY(-8px);
|
|
7370
7495
|
}
|
|
7371
7496
|
`;
|
|
7372
|
-
var menuContentCss =
|
|
7497
|
+
var menuContentCss = import_styled_components39.css`
|
|
7373
7498
|
--menu-font-family: var(--wui-typography-family-default);
|
|
7374
7499
|
--menu-bg: var(--wui-color-bg-surface);
|
|
7375
7500
|
--menu-shadow: 0 0 64px 0 rgba(0 0 0 / 8%); /* TODO - Need a box-shadow token */
|
|
@@ -7408,7 +7533,7 @@ var menuContentCss = import_styled_components38.css`
|
|
|
7408
7533
|
margin: var(--wui-space-02) 0;
|
|
7409
7534
|
}
|
|
7410
7535
|
`;
|
|
7411
|
-
var menuItemCss =
|
|
7536
|
+
var menuItemCss = import_styled_components39.css`
|
|
7412
7537
|
--menu-label-description-gap: var(--wui-space-01);
|
|
7413
7538
|
--menu-item-inner-gap: var(--wui-space-03);
|
|
7414
7539
|
--menu-item-left-icon-size: 24px;
|
|
@@ -7418,7 +7543,7 @@ var menuItemCss = import_styled_components38.css`
|
|
|
7418
7543
|
--menu-label-font-weight: var(--wui-typography-label-3-weight);
|
|
7419
7544
|
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
7420
7545
|
`;
|
|
7421
|
-
var compactMenuItemCss =
|
|
7546
|
+
var compactMenuItemCss = import_styled_components39.css`
|
|
7422
7547
|
--menu-label-description-gap: 0;
|
|
7423
7548
|
--menu-item-inner-gap: var(--wui-space-02);
|
|
7424
7549
|
--menu-item-left-icon-size: 16px;
|
|
@@ -7428,7 +7553,7 @@ var compactMenuItemCss = import_styled_components38.css`
|
|
|
7428
7553
|
--menu-label-font-weight: var(--wui-typography-label-4-weight);
|
|
7429
7554
|
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
7430
7555
|
`;
|
|
7431
|
-
var MenuContent = (0,
|
|
7556
|
+
var MenuContent = (0, import_styled_components39.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
7432
7557
|
${menuContentCss}
|
|
7433
7558
|
${({ $compact }) => $compact ? compactMenuItemCss : menuItemCss}
|
|
7434
7559
|
`;
|
|
@@ -7454,24 +7579,24 @@ var Menu = ({
|
|
|
7454
7579
|
onOpenChange: () => null
|
|
7455
7580
|
};
|
|
7456
7581
|
}
|
|
7457
|
-
return /* @__PURE__ */ (0,
|
|
7582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
|
|
7458
7583
|
import_react_dropdown_menu.DropdownMenu,
|
|
7459
7584
|
{
|
|
7460
7585
|
modal: false,
|
|
7461
7586
|
...controlProps,
|
|
7462
7587
|
children: [
|
|
7463
|
-
/* @__PURE__ */ (0,
|
|
7588
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards22.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
7464
7589
|
Button,
|
|
7465
7590
|
{
|
|
7466
7591
|
"aria-expanded": isOpen,
|
|
7467
7592
|
disabled,
|
|
7468
7593
|
forceState: isOpen ? "active" : void 0,
|
|
7469
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
7594
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Icon, { type: "caret-down" }),
|
|
7470
7595
|
...triggerProps,
|
|
7471
7596
|
children: label
|
|
7472
7597
|
}
|
|
7473
7598
|
) }),
|
|
7474
|
-
/* @__PURE__ */ (0,
|
|
7599
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
7475
7600
|
MenuContent,
|
|
7476
7601
|
{
|
|
7477
7602
|
...props,
|
|
@@ -7491,19 +7616,19 @@ var Menu = ({
|
|
|
7491
7616
|
Menu.displayName = "Menu";
|
|
7492
7617
|
|
|
7493
7618
|
// src/components/Menu/MenuLabel.tsx
|
|
7494
|
-
var
|
|
7619
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
7495
7620
|
var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
|
|
7496
|
-
var
|
|
7497
|
-
var StyledMenuLabel = (0,
|
|
7621
|
+
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
7622
|
+
var StyledMenuLabel = (0, import_styled_components40.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
|
|
7498
7623
|
padding: var(--wui-space-02);
|
|
7499
7624
|
`;
|
|
7500
7625
|
var MenuLabel = ({ children, ...props }) => {
|
|
7501
|
-
return /* @__PURE__ */ (0,
|
|
7626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
7502
7627
|
StyledMenuLabel,
|
|
7503
7628
|
{
|
|
7504
7629
|
asChild: true,
|
|
7505
7630
|
...props,
|
|
7506
|
-
children: /* @__PURE__ */ (0,
|
|
7631
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
7507
7632
|
Heading,
|
|
7508
7633
|
{
|
|
7509
7634
|
renderAs: "span",
|
|
@@ -7518,17 +7643,17 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
7518
7643
|
MenuLabel.displayName = "MenuLabel";
|
|
7519
7644
|
|
|
7520
7645
|
// src/components/Menu/SubMenu.tsx
|
|
7521
|
-
var
|
|
7522
|
-
var
|
|
7646
|
+
var import_react31 = require("react");
|
|
7647
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
7523
7648
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
7524
7649
|
var import_type_guards24 = require("@wistia/type-guards");
|
|
7525
7650
|
|
|
7526
7651
|
// src/components/Menu/MenuItemButton.tsx
|
|
7527
|
-
var
|
|
7528
|
-
var
|
|
7652
|
+
var import_react30 = require("react");
|
|
7653
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7529
7654
|
var import_type_guards23 = require("@wistia/type-guards");
|
|
7530
|
-
var
|
|
7531
|
-
var StyledButton3 = (0,
|
|
7655
|
+
var import_jsx_runtime189 = require("react/jsx-runtime");
|
|
7656
|
+
var StyledButton3 = (0, import_styled_components41.default)(Button)`
|
|
7532
7657
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
7533
7658
|
|
|
7534
7659
|
display: flex;
|
|
@@ -7566,7 +7691,7 @@ var StyledButton3 = (0, import_styled_components40.default)(Button)`
|
|
|
7566
7691
|
padding-left: var(--wui-space-04);
|
|
7567
7692
|
}
|
|
7568
7693
|
`;
|
|
7569
|
-
var StyledLeftIconContainer =
|
|
7694
|
+
var StyledLeftIconContainer = import_styled_components41.default.div`
|
|
7570
7695
|
height: var(--menu-item-left-icon-size);
|
|
7571
7696
|
width: var(--menu-item-left-icon-size);
|
|
7572
7697
|
|
|
@@ -7575,7 +7700,7 @@ var StyledLeftIconContainer = import_styled_components40.default.div`
|
|
|
7575
7700
|
width: var(--menu-item-left-icon-size);
|
|
7576
7701
|
}
|
|
7577
7702
|
`;
|
|
7578
|
-
var StyledRightIconContainer =
|
|
7703
|
+
var StyledRightIconContainer = import_styled_components41.default.div`
|
|
7579
7704
|
height: var(--menu-item-right-icon-size);
|
|
7580
7705
|
width: var(--menu-item-right-icon-size);
|
|
7581
7706
|
|
|
@@ -7584,19 +7709,19 @@ var StyledRightIconContainer = import_styled_components40.default.div`
|
|
|
7584
7709
|
width: var(--menu-item-right-icon-size);
|
|
7585
7710
|
}
|
|
7586
7711
|
`;
|
|
7587
|
-
var StyledLabelAndDescriptionContainer =
|
|
7712
|
+
var StyledLabelAndDescriptionContainer = import_styled_components41.default.div`
|
|
7588
7713
|
display: flex;
|
|
7589
7714
|
flex-direction: column;
|
|
7590
7715
|
gap: var(--menu-label-description-gap);
|
|
7591
7716
|
flex-basis: 100%;
|
|
7592
7717
|
`;
|
|
7593
|
-
var StyledBadgeContainer =
|
|
7718
|
+
var StyledBadgeContainer = import_styled_components41.default.div`
|
|
7594
7719
|
align-self: start;
|
|
7595
7720
|
justify-self: end;
|
|
7596
7721
|
font-size: var(--wui-typography-label-4-size);
|
|
7597
7722
|
color: var(--wui-color-text-secondary);
|
|
7598
7723
|
`;
|
|
7599
|
-
var MenuItemButton = (0,
|
|
7724
|
+
var MenuItemButton = (0, import_react30.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
7600
7725
|
let { colorScheme, badge } = props;
|
|
7601
7726
|
if (appearance === "dangerous") {
|
|
7602
7727
|
if ((0, import_type_guards23.isNotUndefined)(colorScheme)) {
|
|
@@ -7605,7 +7730,7 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7605
7730
|
colorScheme = "error";
|
|
7606
7731
|
}
|
|
7607
7732
|
if (appearance === "gated") {
|
|
7608
|
-
badge = /* @__PURE__ */ (0,
|
|
7733
|
+
badge = /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(
|
|
7609
7734
|
Icon,
|
|
7610
7735
|
{
|
|
7611
7736
|
colorScheme: "purple",
|
|
@@ -7617,7 +7742,7 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7617
7742
|
}
|
|
7618
7743
|
);
|
|
7619
7744
|
}
|
|
7620
|
-
return /* @__PURE__ */ (0,
|
|
7745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)(
|
|
7621
7746
|
StyledButton3,
|
|
7622
7747
|
{
|
|
7623
7748
|
...props,
|
|
@@ -7627,10 +7752,10 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7627
7752
|
fullWidth: true,
|
|
7628
7753
|
unstyled: true,
|
|
7629
7754
|
children: [
|
|
7630
|
-
props.leftIcon ? /* @__PURE__ */ (0,
|
|
7631
|
-
/* @__PURE__ */ (0,
|
|
7632
|
-
(0, import_type_guards23.isNotNil)(badge) || (0, import_type_guards23.isNotNil)(command) ? /* @__PURE__ */ (0,
|
|
7633
|
-
props.rightIcon ? /* @__PURE__ */ (0,
|
|
7755
|
+
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
7756
|
+
/* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
7757
|
+
(0, import_type_guards23.isNotNil)(badge) || (0, import_type_guards23.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
7758
|
+
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
7634
7759
|
]
|
|
7635
7760
|
}
|
|
7636
7761
|
);
|
|
@@ -7638,23 +7763,23 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7638
7763
|
MenuItemButton.displayName = "MenuItemButton";
|
|
7639
7764
|
|
|
7640
7765
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
7641
|
-
var
|
|
7642
|
-
var
|
|
7643
|
-
var StyledMenuItemLabel =
|
|
7644
|
-
var StyledMenuItemDescription = (0,
|
|
7766
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
7767
|
+
var import_jsx_runtime190 = require("react/jsx-runtime");
|
|
7768
|
+
var StyledMenuItemLabel = import_styled_components42.default.span``;
|
|
7769
|
+
var StyledMenuItemDescription = (0, import_styled_components42.default)(Text).attrs({
|
|
7645
7770
|
variant: "body4",
|
|
7646
7771
|
prominence: "secondary"
|
|
7647
7772
|
})``;
|
|
7648
7773
|
var MenuItemLabel = ({ children }) => {
|
|
7649
|
-
return /* @__PURE__ */ (0,
|
|
7774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(StyledMenuItemLabel, { children });
|
|
7650
7775
|
};
|
|
7651
7776
|
var MenuItemDescription = ({ children }) => {
|
|
7652
|
-
return /* @__PURE__ */ (0,
|
|
7777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(StyledMenuItemDescription, { children });
|
|
7653
7778
|
};
|
|
7654
7779
|
|
|
7655
7780
|
// src/components/Menu/SubMenu.tsx
|
|
7656
|
-
var
|
|
7657
|
-
var SubMenuContent = (0,
|
|
7781
|
+
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
7782
|
+
var SubMenuContent = (0, import_styled_components43.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
|
|
7658
7783
|
${menuContentCss}
|
|
7659
7784
|
width: 298px;
|
|
7660
7785
|
|
|
@@ -7662,10 +7787,10 @@ var SubMenuContent = (0, import_styled_components42.default)(import_react_dropdo
|
|
|
7662
7787
|
transform: translateX(-100%) !important;
|
|
7663
7788
|
}
|
|
7664
7789
|
`;
|
|
7665
|
-
var StyledMobileSubMenuItems =
|
|
7790
|
+
var StyledMobileSubMenuItems = import_styled_components43.default.div`
|
|
7666
7791
|
margin-left: var(--wui-space-04);
|
|
7667
7792
|
`;
|
|
7668
|
-
var StyledSubTrigger = (0,
|
|
7793
|
+
var StyledSubTrigger = (0, import_styled_components43.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
|
|
7669
7794
|
outline: none;
|
|
7670
7795
|
|
|
7671
7796
|
&[data-state='open'],
|
|
@@ -7676,11 +7801,11 @@ var StyledSubTrigger = (0, import_styled_components42.default)(import_react_drop
|
|
|
7676
7801
|
var SubMenuTrigger = (props) => {
|
|
7677
7802
|
const { isSmAndUp } = useMq();
|
|
7678
7803
|
const Trigger2 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
|
|
7679
|
-
return /* @__PURE__ */ (0,
|
|
7804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Trigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
7680
7805
|
MenuItemButton,
|
|
7681
7806
|
{
|
|
7682
7807
|
...props,
|
|
7683
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
7808
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Icon, { type: "caret-right" })
|
|
7684
7809
|
}
|
|
7685
7810
|
) });
|
|
7686
7811
|
};
|
|
@@ -7692,15 +7817,15 @@ var SubMenu = ({
|
|
|
7692
7817
|
...props
|
|
7693
7818
|
}) => {
|
|
7694
7819
|
const { isSmAndUp } = useMq();
|
|
7695
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
7696
|
-
return isSmAndUp ? /* @__PURE__ */ (0,
|
|
7697
|
-
/* @__PURE__ */ (0,
|
|
7698
|
-
/* @__PURE__ */ (0,
|
|
7699
|
-
(0, import_type_guards24.isNotNil)(description) ? /* @__PURE__ */ (0,
|
|
7820
|
+
const [isExpanded, setIsExpanded] = (0, import_react31.useState)(false);
|
|
7821
|
+
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
7822
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
7823
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemLabel, { children: label }),
|
|
7824
|
+
(0, import_type_guards24.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemDescription, { children: description }) : null
|
|
7700
7825
|
] }),
|
|
7701
|
-
/* @__PURE__ */ (0,
|
|
7702
|
-
] }) : /* @__PURE__ */ (0,
|
|
7703
|
-
/* @__PURE__ */ (0,
|
|
7826
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(SubMenuContent, { children }) })
|
|
7827
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
7828
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
7704
7829
|
SubMenuTrigger,
|
|
7705
7830
|
{
|
|
7706
7831
|
...props,
|
|
@@ -7709,28 +7834,28 @@ var SubMenu = ({
|
|
|
7709
7834
|
setIsExpanded((prev) => !prev);
|
|
7710
7835
|
},
|
|
7711
7836
|
children: [
|
|
7712
|
-
/* @__PURE__ */ (0,
|
|
7713
|
-
/* @__PURE__ */ (0,
|
|
7837
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemLabel, { children: label }),
|
|
7838
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemDescription, { children: description })
|
|
7714
7839
|
]
|
|
7715
7840
|
}
|
|
7716
7841
|
),
|
|
7717
|
-
/* @__PURE__ */ (0,
|
|
7842
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
|
|
7718
7843
|
] });
|
|
7719
7844
|
};
|
|
7720
7845
|
SubMenu.displayName = "SubMenu";
|
|
7721
7846
|
|
|
7722
7847
|
// src/components/Menu/MenuItem.tsx
|
|
7723
|
-
var
|
|
7848
|
+
var import_react32 = require("react");
|
|
7724
7849
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
7725
|
-
var
|
|
7726
|
-
var MenuItem = (0,
|
|
7850
|
+
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
7851
|
+
var MenuItem = (0, import_react32.forwardRef)(
|
|
7727
7852
|
({ onSelect = () => null, ...props }, ref) => {
|
|
7728
|
-
return /* @__PURE__ */ (0,
|
|
7853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7729
7854
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
7730
7855
|
{
|
|
7731
7856
|
asChild: true,
|
|
7732
7857
|
onSelect,
|
|
7733
|
-
children: /* @__PURE__ */ (0,
|
|
7858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7734
7859
|
MenuItemButton,
|
|
7735
7860
|
{
|
|
7736
7861
|
...props,
|
|
@@ -7746,10 +7871,10 @@ MenuItem.displayName = "MenuItem";
|
|
|
7746
7871
|
|
|
7747
7872
|
// src/components/Menu/MenuRadioGroup.tsx
|
|
7748
7873
|
var import_react_dropdown_menu5 = require("@radix-ui/react-dropdown-menu");
|
|
7749
|
-
var
|
|
7874
|
+
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
7750
7875
|
var MenuRadioGroup = ({ children, label, ...props }) => {
|
|
7751
|
-
return /* @__PURE__ */ (0,
|
|
7752
|
-
/* @__PURE__ */ (0,
|
|
7876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
|
|
7877
|
+
/* @__PURE__ */ (0, import_jsx_runtime193.jsx)(MenuLabel, { children: label }),
|
|
7753
7878
|
children
|
|
7754
7879
|
] });
|
|
7755
7880
|
};
|
|
@@ -7757,11 +7882,11 @@ MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
|
7757
7882
|
|
|
7758
7883
|
// src/components/Menu/RadioMenuItem.tsx
|
|
7759
7884
|
var import_react_dropdown_menu6 = require("@radix-ui/react-dropdown-menu");
|
|
7760
|
-
var
|
|
7885
|
+
var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
7761
7886
|
var RadioMenuItem = ({
|
|
7762
7887
|
onSelect,
|
|
7763
7888
|
value,
|
|
7764
|
-
indicator = /* @__PURE__ */ (0,
|
|
7889
|
+
indicator = /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
7765
7890
|
Icon,
|
|
7766
7891
|
{
|
|
7767
7892
|
size: "sm",
|
|
@@ -7771,17 +7896,17 @@ var RadioMenuItem = ({
|
|
|
7771
7896
|
...props
|
|
7772
7897
|
}) => {
|
|
7773
7898
|
const extraProps = onSelect ? { onSelect } : {};
|
|
7774
|
-
return /* @__PURE__ */ (0,
|
|
7899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
7775
7900
|
import_react_dropdown_menu6.DropdownMenuRadioItem,
|
|
7776
7901
|
{
|
|
7777
7902
|
...extraProps,
|
|
7778
7903
|
asChild: true,
|
|
7779
7904
|
value,
|
|
7780
|
-
children: /* @__PURE__ */ (0,
|
|
7905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
7781
7906
|
MenuItemButton,
|
|
7782
7907
|
{
|
|
7783
7908
|
...props,
|
|
7784
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
7909
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
|
|
7785
7910
|
}
|
|
7786
7911
|
)
|
|
7787
7912
|
}
|
|
@@ -7791,9 +7916,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
7791
7916
|
|
|
7792
7917
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
7793
7918
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
7794
|
-
var
|
|
7919
|
+
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
7795
7920
|
var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
7796
|
-
return checked ? /* @__PURE__ */ (0,
|
|
7921
|
+
return checked ? /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(
|
|
7797
7922
|
"svg",
|
|
7798
7923
|
{
|
|
7799
7924
|
...props,
|
|
@@ -7803,14 +7928,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7803
7928
|
width: "24",
|
|
7804
7929
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7805
7930
|
children: [
|
|
7806
|
-
/* @__PURE__ */ (0,
|
|
7931
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7807
7932
|
"path",
|
|
7808
7933
|
{
|
|
7809
7934
|
d: "m4 8c0-2.20914 1.79086-4 4-4h8c2.2091 0 4 1.79086 4 4v8c0 2.2091-1.7909 4-4 4h-8c-2.20914 0-4-1.7909-4-4z",
|
|
7810
7935
|
fill: "#2949e5"
|
|
7811
7936
|
}
|
|
7812
7937
|
),
|
|
7813
|
-
/* @__PURE__ */ (0,
|
|
7938
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7814
7939
|
"path",
|
|
7815
7940
|
{
|
|
7816
7941
|
d: "m10.4728 15.1931-3.09523-3.1131c-.18596-.187-.18596-.4902 0-.6773l.67341-.6773c.18596-.187.48749-.187.67344 0l2.08508 2.0971 4.4661-4.49174c.1859-.18703.4875-.18703.6734 0l.6734.67731c.186.18703.186.49027 0 .67731l-5.4762 5.50772c-.1859.187-.4874.187-.6734 0z",
|
|
@@ -7819,7 +7944,7 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7819
7944
|
)
|
|
7820
7945
|
]
|
|
7821
7946
|
}
|
|
7822
|
-
) : /* @__PURE__ */ (0,
|
|
7947
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(
|
|
7823
7948
|
"svg",
|
|
7824
7949
|
{
|
|
7825
7950
|
...props,
|
|
@@ -7829,14 +7954,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7829
7954
|
width: "24",
|
|
7830
7955
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7831
7956
|
children: [
|
|
7832
|
-
/* @__PURE__ */ (0,
|
|
7957
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7833
7958
|
"path",
|
|
7834
7959
|
{
|
|
7835
7960
|
d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
|
|
7836
7961
|
fill: "#fcfcfd"
|
|
7837
7962
|
}
|
|
7838
7963
|
),
|
|
7839
|
-
/* @__PURE__ */ (0,
|
|
7964
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7840
7965
|
"path",
|
|
7841
7966
|
{
|
|
7842
7967
|
d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
|
|
@@ -7853,18 +7978,18 @@ var CheckboxMenuItem = ({
|
|
|
7853
7978
|
onCheckedChange,
|
|
7854
7979
|
...props
|
|
7855
7980
|
}) => {
|
|
7856
|
-
return /* @__PURE__ */ (0,
|
|
7981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7857
7982
|
import_react_dropdown_menu7.DropdownMenuCheckboxItem,
|
|
7858
7983
|
{
|
|
7859
7984
|
asChild: true,
|
|
7860
7985
|
checked,
|
|
7861
7986
|
onCheckedChange,
|
|
7862
7987
|
onSelect,
|
|
7863
|
-
children: /* @__PURE__ */ (0,
|
|
7988
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7864
7989
|
MenuItemButton,
|
|
7865
7990
|
{
|
|
7866
7991
|
...props,
|
|
7867
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
7992
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(CheckboxIndicator2, { checked })
|
|
7868
7993
|
}
|
|
7869
7994
|
)
|
|
7870
7995
|
}
|
|
@@ -7873,40 +7998,40 @@ var CheckboxMenuItem = ({
|
|
|
7873
7998
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
7874
7999
|
|
|
7875
8000
|
// src/components/Modal/Modal.tsx
|
|
7876
|
-
var
|
|
7877
|
-
var
|
|
8001
|
+
var import_react36 = require("react");
|
|
8002
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
7878
8003
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
7879
8004
|
var import_type_guards27 = require("@wistia/type-guards");
|
|
7880
8005
|
|
|
7881
8006
|
// src/components/Modal/ModalHeader.tsx
|
|
7882
|
-
var
|
|
8007
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
7883
8008
|
var import_react_dialog2 = require("@radix-ui/react-dialog");
|
|
7884
8009
|
|
|
7885
8010
|
// src/components/Modal/ModalCloseButton.tsx
|
|
7886
|
-
var
|
|
8011
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
7887
8012
|
var import_react_dialog = require("@radix-ui/react-dialog");
|
|
7888
|
-
var
|
|
7889
|
-
var CloseButton = (0,
|
|
8013
|
+
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
8014
|
+
var CloseButton = (0, import_styled_components44.default)(import_react_dialog.Close)`
|
|
7890
8015
|
align-self: start;
|
|
7891
8016
|
`;
|
|
7892
8017
|
var ModalCloseButton = () => {
|
|
7893
|
-
return /* @__PURE__ */ (0,
|
|
8018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(CloseButton, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
7894
8019
|
IconButton,
|
|
7895
8020
|
{
|
|
7896
8021
|
label: "Dismiss modal",
|
|
7897
8022
|
size: "sm",
|
|
7898
8023
|
variant: "ghost",
|
|
7899
|
-
children: /* @__PURE__ */ (0,
|
|
8024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(Icon, { type: "close" })
|
|
7900
8025
|
}
|
|
7901
8026
|
) });
|
|
7902
8027
|
};
|
|
7903
8028
|
|
|
7904
8029
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7905
|
-
var
|
|
8030
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
7906
8031
|
var import_type_guards25 = require("@wistia/type-guards");
|
|
7907
|
-
var
|
|
7908
|
-
var VisuallyHidden =
|
|
7909
|
-
var VisuallyHiddenButFocusable =
|
|
8032
|
+
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
8033
|
+
var VisuallyHidden = import_styled_components45.default.div({ ...visuallyHiddenStyle });
|
|
8034
|
+
var VisuallyHiddenButFocusable = import_styled_components45.default.div({
|
|
7910
8035
|
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7911
8036
|
});
|
|
7912
8037
|
var ScreenReaderOnly = ({
|
|
@@ -7917,15 +8042,15 @@ var ScreenReaderOnly = ({
|
|
|
7917
8042
|
}) => {
|
|
7918
8043
|
const accessibleText = (0, import_type_guards25.isNotNil)(text) ? text : children;
|
|
7919
8044
|
if (focusable) {
|
|
7920
|
-
return /* @__PURE__ */ (0,
|
|
8045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7921
8046
|
}
|
|
7922
|
-
return /* @__PURE__ */ (0,
|
|
8047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7923
8048
|
};
|
|
7924
8049
|
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7925
8050
|
|
|
7926
8051
|
// src/components/Modal/ModalHeader.tsx
|
|
7927
|
-
var
|
|
7928
|
-
var Header =
|
|
8052
|
+
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
8053
|
+
var Header = import_styled_components46.default.header`
|
|
7929
8054
|
display: flex;
|
|
7930
8055
|
order: 1;
|
|
7931
8056
|
gap: var(--wui-space-01);
|
|
@@ -7937,7 +8062,7 @@ var Header = import_styled_components45.default.header`
|
|
|
7937
8062
|
margin-top: 0;
|
|
7938
8063
|
}
|
|
7939
8064
|
`;
|
|
7940
|
-
var Title = (0,
|
|
8065
|
+
var Title = (0, import_styled_components46.default)(import_react_dialog2.Title)`
|
|
7941
8066
|
font-family: var(--wui-typography-heading-2-family);
|
|
7942
8067
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
7943
8068
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -7949,26 +8074,26 @@ var ModalHeader = ({
|
|
|
7949
8074
|
hideCloseButton
|
|
7950
8075
|
}) => {
|
|
7951
8076
|
const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
|
|
7952
|
-
return /* @__PURE__ */ (0,
|
|
7953
|
-
/* @__PURE__ */ (0,
|
|
7954
|
-
hideCloseButton ? null : /* @__PURE__ */ (0,
|
|
8077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(Header, { children: [
|
|
8078
|
+
/* @__PURE__ */ (0, import_jsx_runtime198.jsx)(TitleWrapper, { children: title }),
|
|
8079
|
+
hideCloseButton ? null : /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(ModalCloseButton, {})
|
|
7955
8080
|
] });
|
|
7956
8081
|
};
|
|
7957
8082
|
|
|
7958
8083
|
// src/components/Modal/ModalContent.tsx
|
|
7959
|
-
var
|
|
7960
|
-
var
|
|
8084
|
+
var import_react34 = require("react");
|
|
8085
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
7961
8086
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
7962
8087
|
|
|
7963
8088
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
7964
|
-
var
|
|
8089
|
+
var import_react33 = require("react");
|
|
7965
8090
|
var import_type_guards26 = require("@wistia/type-guards");
|
|
7966
8091
|
var useFocusRestore = () => {
|
|
7967
|
-
const previouslyFocusedRef = (0,
|
|
7968
|
-
(0,
|
|
8092
|
+
const previouslyFocusedRef = (0, import_react33.useRef)(null);
|
|
8093
|
+
(0, import_react33.useEffect)(() => {
|
|
7969
8094
|
previouslyFocusedRef.current = document.activeElement;
|
|
7970
8095
|
}, []);
|
|
7971
|
-
(0,
|
|
8096
|
+
(0, import_react33.useEffect)(() => {
|
|
7972
8097
|
return () => {
|
|
7973
8098
|
if ((0, import_type_guards26.isNotNil)(previouslyFocusedRef.current)) {
|
|
7974
8099
|
setTimeout(() => {
|
|
@@ -7980,8 +8105,8 @@ var useFocusRestore = () => {
|
|
|
7980
8105
|
};
|
|
7981
8106
|
|
|
7982
8107
|
// src/components/Modal/ModalContent.tsx
|
|
7983
|
-
var
|
|
7984
|
-
var StyledModalContent = (0,
|
|
8108
|
+
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
8109
|
+
var StyledModalContent = (0, import_styled_components47.default)(import_react_dialog3.Content)`
|
|
7985
8110
|
background-color: var(--wui-color-bg-app);
|
|
7986
8111
|
box-sizing: border-box;
|
|
7987
8112
|
display: flex;
|
|
@@ -8021,10 +8146,10 @@ var StyledModalContent = (0, import_styled_components46.default)(import_react_di
|
|
|
8021
8146
|
}
|
|
8022
8147
|
}
|
|
8023
8148
|
`;
|
|
8024
|
-
var ModalContent = (0,
|
|
8149
|
+
var ModalContent = (0, import_react34.forwardRef)(
|
|
8025
8150
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
8026
8151
|
useFocusRestore();
|
|
8027
|
-
return /* @__PURE__ */ (0,
|
|
8152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
8028
8153
|
StyledModalContent,
|
|
8029
8154
|
{
|
|
8030
8155
|
ref,
|
|
@@ -8038,9 +8163,9 @@ var ModalContent = (0, import_react31.forwardRef)(
|
|
|
8038
8163
|
);
|
|
8039
8164
|
|
|
8040
8165
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
8041
|
-
var
|
|
8042
|
-
var
|
|
8043
|
-
var
|
|
8166
|
+
var import_react35 = require("react");
|
|
8167
|
+
var import_styled_components48 = __toESM(require("styled-components"));
|
|
8168
|
+
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
8044
8169
|
var backdropAnimationDuration = 150;
|
|
8045
8170
|
var alignVerticalMap = {
|
|
8046
8171
|
stretch: "normal",
|
|
@@ -8053,7 +8178,7 @@ var alignHorizontalMap = {
|
|
|
8053
8178
|
center: "center",
|
|
8054
8179
|
right: "end"
|
|
8055
8180
|
};
|
|
8056
|
-
var BackdropComponent =
|
|
8181
|
+
var BackdropComponent = import_styled_components48.default.div`
|
|
8057
8182
|
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
8058
8183
|
animation-name: backdropShow;
|
|
8059
8184
|
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
@@ -8076,8 +8201,8 @@ var BackdropComponent = import_styled_components47.default.div`
|
|
|
8076
8201
|
}
|
|
8077
8202
|
}
|
|
8078
8203
|
`;
|
|
8079
|
-
var Backdrop = (0,
|
|
8080
|
-
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
8204
|
+
var Backdrop = (0, import_react35.forwardRef)(
|
|
8205
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8081
8206
|
BackdropComponent,
|
|
8082
8207
|
{
|
|
8083
8208
|
ref,
|
|
@@ -8091,13 +8216,13 @@ var Backdrop = (0, import_react32.forwardRef)(
|
|
|
8091
8216
|
Backdrop.displayName = "Backdrop";
|
|
8092
8217
|
|
|
8093
8218
|
// src/components/Modal/Modal.tsx
|
|
8094
|
-
var
|
|
8095
|
-
var ModalBody =
|
|
8219
|
+
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
8220
|
+
var ModalBody = import_styled_components49.default.div`
|
|
8096
8221
|
flex-direction: column;
|
|
8097
8222
|
display: flex;
|
|
8098
8223
|
order: 2;
|
|
8099
8224
|
`;
|
|
8100
|
-
var Modal = (0,
|
|
8225
|
+
var Modal = (0, import_react36.forwardRef)(
|
|
8101
8226
|
({
|
|
8102
8227
|
children,
|
|
8103
8228
|
fullHeight = false,
|
|
@@ -8110,7 +8235,7 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8110
8235
|
width,
|
|
8111
8236
|
...props
|
|
8112
8237
|
}, ref) => {
|
|
8113
|
-
return /* @__PURE__ */ (0,
|
|
8238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8114
8239
|
import_react_dialog4.Root,
|
|
8115
8240
|
{
|
|
8116
8241
|
onOpenChange: (open2) => {
|
|
@@ -8119,9 +8244,9 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8119
8244
|
}
|
|
8120
8245
|
},
|
|
8121
8246
|
open: isOpen,
|
|
8122
|
-
children: /* @__PURE__ */ (0,
|
|
8123
|
-
/* @__PURE__ */ (0,
|
|
8124
|
-
/* @__PURE__ */ (0,
|
|
8247
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(import_react_dialog4.Portal, { children: [
|
|
8248
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(Backdrop, {}),
|
|
8249
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
8125
8250
|
ModalContent,
|
|
8126
8251
|
{
|
|
8127
8252
|
ref,
|
|
@@ -8138,8 +8263,8 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8138
8263
|
width,
|
|
8139
8264
|
...props,
|
|
8140
8265
|
children: [
|
|
8141
|
-
/* @__PURE__ */ (0,
|
|
8142
|
-
/* @__PURE__ */ (0,
|
|
8266
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(ModalBody, { children }),
|
|
8267
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8143
8268
|
ModalHeader,
|
|
8144
8269
|
{
|
|
8145
8270
|
hideCloseButton,
|
|
@@ -8158,16 +8283,16 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8158
8283
|
Modal.displayName = "Modal";
|
|
8159
8284
|
|
|
8160
8285
|
// src/components/Radio/Radio.tsx
|
|
8161
|
-
var
|
|
8162
|
-
var
|
|
8286
|
+
var import_react37 = require("react");
|
|
8287
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
8163
8288
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
8164
|
-
var
|
|
8165
|
-
var StyledLabelWrapper2 =
|
|
8289
|
+
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
8290
|
+
var StyledLabelWrapper2 = import_styled_components50.default.div`
|
|
8166
8291
|
display: flex;
|
|
8167
8292
|
flex-direction: column;
|
|
8168
8293
|
padding-left: var(--wui-space-02);
|
|
8169
8294
|
`;
|
|
8170
|
-
var StyledRadio =
|
|
8295
|
+
var StyledRadio = import_styled_components50.default.input`
|
|
8171
8296
|
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
8172
8297
|
appearance: none;
|
|
8173
8298
|
margin: 0;
|
|
@@ -8193,11 +8318,11 @@ var StyledRadio = import_styled_components49.default.input`
|
|
|
8193
8318
|
transform: scale(1);
|
|
8194
8319
|
}
|
|
8195
8320
|
`;
|
|
8196
|
-
var disabledStyle2 =
|
|
8321
|
+
var disabledStyle2 = import_styled_components50.css`
|
|
8197
8322
|
cursor: not-allowed;
|
|
8198
8323
|
opacity: 0.5;
|
|
8199
8324
|
`;
|
|
8200
|
-
var errorStyle =
|
|
8325
|
+
var errorStyle = import_styled_components50.css`
|
|
8201
8326
|
/* TODO Lamp to design error state */
|
|
8202
8327
|
&:hover,
|
|
8203
8328
|
&:focus,
|
|
@@ -8205,11 +8330,11 @@ var errorStyle = import_styled_components49.css`
|
|
|
8205
8330
|
border-color: transparent !important;
|
|
8206
8331
|
}
|
|
8207
8332
|
`;
|
|
8208
|
-
var defaultHoverStyle =
|
|
8333
|
+
var defaultHoverStyle = import_styled_components50.css`
|
|
8209
8334
|
/* TODO Lamp to design hover state */
|
|
8210
8335
|
cursor: pointer;
|
|
8211
8336
|
`;
|
|
8212
|
-
var StyledRadioWrapper =
|
|
8337
|
+
var StyledRadioWrapper = import_styled_components50.default.div`
|
|
8213
8338
|
align-items: baseline;
|
|
8214
8339
|
border: 1px solid transparent;
|
|
8215
8340
|
border-radius: 4px;
|
|
@@ -8232,7 +8357,7 @@ var StyledRadioWrapper = import_styled_components49.default.div`
|
|
|
8232
8357
|
|
|
8233
8358
|
${({ disabled }) => disabled && disabledStyle2};
|
|
8234
8359
|
`;
|
|
8235
|
-
var Radio = (0,
|
|
8360
|
+
var Radio = (0, import_react37.forwardRef)(
|
|
8236
8361
|
({
|
|
8237
8362
|
checked,
|
|
8238
8363
|
disabled = false,
|
|
@@ -8245,15 +8370,15 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8245
8370
|
value = "false",
|
|
8246
8371
|
...otherProps
|
|
8247
8372
|
}, ref) => {
|
|
8248
|
-
const generatedId = (0,
|
|
8373
|
+
const generatedId = (0, import_react37.useId)();
|
|
8249
8374
|
const computedId = (0, import_type_guards28.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
|
|
8250
|
-
return /* @__PURE__ */ (0,
|
|
8375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(
|
|
8251
8376
|
StyledRadioWrapper,
|
|
8252
8377
|
{
|
|
8253
8378
|
"aria-invalid": otherProps["aria-invalid"],
|
|
8254
8379
|
disabled,
|
|
8255
8380
|
children: [
|
|
8256
|
-
/* @__PURE__ */ (0,
|
|
8381
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8257
8382
|
StyledRadio,
|
|
8258
8383
|
{
|
|
8259
8384
|
ref,
|
|
@@ -8268,8 +8393,8 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8268
8393
|
...otherProps
|
|
8269
8394
|
}
|
|
8270
8395
|
),
|
|
8271
|
-
/* @__PURE__ */ (0,
|
|
8272
|
-
/* @__PURE__ */ (0,
|
|
8396
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(StyledLabelWrapper2, { children: [
|
|
8397
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8273
8398
|
Label,
|
|
8274
8399
|
{
|
|
8275
8400
|
disabled,
|
|
@@ -8278,7 +8403,7 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8278
8403
|
children: label
|
|
8279
8404
|
}
|
|
8280
8405
|
),
|
|
8281
|
-
/* @__PURE__ */ (0,
|
|
8406
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(LabelDescription, { children: description })
|
|
8282
8407
|
] })
|
|
8283
8408
|
]
|
|
8284
8409
|
}
|
|
@@ -8288,11 +8413,11 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8288
8413
|
Radio.displayName = "Radio";
|
|
8289
8414
|
|
|
8290
8415
|
// src/components/Tag/Tag.tsx
|
|
8291
|
-
var
|
|
8292
|
-
var
|
|
8416
|
+
var import_react38 = require("react");
|
|
8417
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
8293
8418
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8294
|
-
var
|
|
8295
|
-
var TagLabel =
|
|
8419
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
8420
|
+
var TagLabel = import_styled_components51.default.a`
|
|
8296
8421
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8297
8422
|
font-size: var(--wui-typography-label-4-size);
|
|
8298
8423
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -8320,14 +8445,14 @@ var TagLabel = import_styled_components50.default.a`
|
|
|
8320
8445
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
8321
8446
|
}
|
|
8322
8447
|
`;
|
|
8323
|
-
var TagDivider =
|
|
8448
|
+
var TagDivider = import_styled_components51.default.div`
|
|
8324
8449
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8325
8450
|
border-left: 1px solid var(--wui-color-border);
|
|
8326
8451
|
display: flex;
|
|
8327
8452
|
height: 14px;
|
|
8328
8453
|
width: 1px;
|
|
8329
8454
|
`;
|
|
8330
|
-
var StyledRemoveButton =
|
|
8455
|
+
var StyledRemoveButton = import_styled_components51.default.button`
|
|
8331
8456
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8332
8457
|
all: unset;
|
|
8333
8458
|
cursor: pointer;
|
|
@@ -8355,7 +8480,7 @@ var StyledRemoveButton = import_styled_components50.default.button`
|
|
|
8355
8480
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
8356
8481
|
}
|
|
8357
8482
|
`;
|
|
8358
|
-
var StyledTag =
|
|
8483
|
+
var StyledTag = import_styled_components51.default.div`
|
|
8359
8484
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8360
8485
|
align-items: center;
|
|
8361
8486
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -8372,39 +8497,39 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
8372
8497
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
8373
8498
|
);
|
|
8374
8499
|
}
|
|
8375
|
-
return /* @__PURE__ */ (0,
|
|
8376
|
-
/* @__PURE__ */ (0,
|
|
8377
|
-
/* @__PURE__ */ (0,
|
|
8500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(import_jsx_runtime203.Fragment, { children: [
|
|
8501
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
8502
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(
|
|
8378
8503
|
StyledRemoveButton,
|
|
8379
8504
|
{
|
|
8380
8505
|
$colorScheme: colorScheme,
|
|
8381
8506
|
onClick: onClickRemove,
|
|
8382
8507
|
type: "button",
|
|
8383
8508
|
children: [
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8509
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8385
8510
|
Icon,
|
|
8386
8511
|
{
|
|
8387
8512
|
size: "sm",
|
|
8388
8513
|
type: "close"
|
|
8389
8514
|
}
|
|
8390
8515
|
),
|
|
8391
|
-
/* @__PURE__ */ (0,
|
|
8516
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
8392
8517
|
]
|
|
8393
8518
|
}
|
|
8394
8519
|
)
|
|
8395
8520
|
] });
|
|
8396
8521
|
};
|
|
8397
|
-
var Tag = (0,
|
|
8522
|
+
var Tag = (0, import_react38.forwardRef)(
|
|
8398
8523
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
8399
8524
|
const labelProps = (0, import_type_guards29.isNotNil)(href) && (0, import_type_guards29.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
8400
|
-
return /* @__PURE__ */ (0,
|
|
8525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(
|
|
8401
8526
|
StyledTag,
|
|
8402
8527
|
{
|
|
8403
8528
|
ref,
|
|
8404
8529
|
$colorScheme: colorScheme,
|
|
8405
8530
|
...otherProps,
|
|
8406
8531
|
children: [
|
|
8407
|
-
/* @__PURE__ */ (0,
|
|
8532
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8408
8533
|
TagLabel,
|
|
8409
8534
|
{
|
|
8410
8535
|
...labelProps,
|
|
@@ -8412,7 +8537,7 @@ var Tag = (0, import_react35.forwardRef)(
|
|
|
8412
8537
|
children: label
|
|
8413
8538
|
}
|
|
8414
8539
|
),
|
|
8415
|
-
/* @__PURE__ */ (0,
|
|
8540
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8416
8541
|
RemoveButton,
|
|
8417
8542
|
{
|
|
8418
8543
|
colorScheme,
|
|
@@ -8429,16 +8554,16 @@ Tag.displayName = "Tag";
|
|
|
8429
8554
|
|
|
8430
8555
|
// src/components/Tooltip/Tooltip.tsx
|
|
8431
8556
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
8432
|
-
var
|
|
8433
|
-
var
|
|
8434
|
-
var CompactTooltipStyles =
|
|
8557
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
8558
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8559
|
+
var CompactTooltipStyles = import_styled_components52.css`
|
|
8435
8560
|
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
8436
8561
|
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
8437
8562
|
--tooltip-font-weight: var(--wui-typography-label-4-weight);
|
|
8438
8563
|
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
8439
8564
|
--tooltip-vertical-padding: var(--wui-space-03);
|
|
8440
8565
|
`;
|
|
8441
|
-
var StyledContent = (0,
|
|
8566
|
+
var StyledContent = (0, import_styled_components52.default)(import_react_tooltip2.Content)`
|
|
8442
8567
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
8443
8568
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
8444
8569
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -8496,14 +8621,14 @@ var Tooltip = ({
|
|
|
8496
8621
|
if (forceOpen === true) {
|
|
8497
8622
|
rootProps.open = true;
|
|
8498
8623
|
}
|
|
8499
|
-
return /* @__PURE__ */ (0,
|
|
8624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
|
|
8500
8625
|
import_react_tooltip2.Root,
|
|
8501
8626
|
{
|
|
8502
8627
|
delayDuration: delay,
|
|
8503
8628
|
...rootProps,
|
|
8504
8629
|
children: [
|
|
8505
|
-
/* @__PURE__ */ (0,
|
|
8506
|
-
/* @__PURE__ */ (0,
|
|
8630
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
8631
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
|
|
8507
8632
|
StyledContent,
|
|
8508
8633
|
{
|
|
8509
8634
|
$compact: compact,
|
|
@@ -8511,7 +8636,7 @@ var Tooltip = ({
|
|
|
8511
8636
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
8512
8637
|
children: [
|
|
8513
8638
|
content,
|
|
8514
|
-
!hideArrow ? /* @__PURE__ */ (0,
|
|
8639
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8515
8640
|
"svg",
|
|
8516
8641
|
{
|
|
8517
8642
|
fill: "var(--tooltip-bg)",
|
|
@@ -8520,7 +8645,7 @@ var Tooltip = ({
|
|
|
8520
8645
|
viewBox: "0 0 12 8",
|
|
8521
8646
|
width: "12",
|
|
8522
8647
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8523
|
-
children: /* @__PURE__ */ (0,
|
|
8648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
|
|
8524
8649
|
}
|
|
8525
8650
|
) }) : null
|
|
8526
8651
|
]
|
|
@@ -8533,26 +8658,26 @@ var Tooltip = ({
|
|
|
8533
8658
|
Tooltip.displayName = "Tooltip";
|
|
8534
8659
|
|
|
8535
8660
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
8536
|
-
var
|
|
8661
|
+
var import_styled_components53 = __toESM(require("styled-components"));
|
|
8537
8662
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8538
|
-
var
|
|
8663
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8539
8664
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
8540
8665
|
if (iconOnly) {
|
|
8541
|
-
return /* @__PURE__ */ (0,
|
|
8666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8542
8667
|
"g",
|
|
8543
8668
|
{
|
|
8544
8669
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
8545
8670
|
fill: brandmarkColor,
|
|
8546
|
-
children: /* @__PURE__ */ (0,
|
|
8671
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
8547
8672
|
}
|
|
8548
8673
|
);
|
|
8549
8674
|
}
|
|
8550
|
-
return /* @__PURE__ */ (0,
|
|
8675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8551
8676
|
"g",
|
|
8552
8677
|
{
|
|
8553
8678
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
8554
8679
|
fill: brandmarkColor,
|
|
8555
|
-
children: /* @__PURE__ */ (0,
|
|
8680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
8556
8681
|
}
|
|
8557
8682
|
);
|
|
8558
8683
|
};
|
|
@@ -8560,12 +8685,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
8560
8685
|
if (iconOnly) {
|
|
8561
8686
|
return null;
|
|
8562
8687
|
}
|
|
8563
|
-
return /* @__PURE__ */ (0,
|
|
8688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8564
8689
|
"g",
|
|
8565
8690
|
{
|
|
8566
8691
|
"data-testid": "ui-wistia-logo-logotype",
|
|
8567
8692
|
fill: logotypeColor,
|
|
8568
|
-
children: /* @__PURE__ */ (0,
|
|
8693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
|
|
8569
8694
|
}
|
|
8570
8695
|
);
|
|
8571
8696
|
};
|
|
@@ -8575,7 +8700,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
8575
8700
|
}
|
|
8576
8701
|
return "0 0 144 31.47";
|
|
8577
8702
|
};
|
|
8578
|
-
var WistiaLogoComponent =
|
|
8703
|
+
var WistiaLogoComponent = import_styled_components53.default.svg`
|
|
8579
8704
|
height: ${({ height }) => `${height}px`};
|
|
8580
8705
|
|
|
8581
8706
|
/* ensure it will always fit on mobile */
|
|
@@ -8617,7 +8742,7 @@ var WistiaLogo = ({
|
|
|
8617
8742
|
};
|
|
8618
8743
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
8619
8744
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
8620
|
-
const Logo = /* @__PURE__ */ (0,
|
|
8745
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
|
|
8621
8746
|
WistiaLogoComponent,
|
|
8622
8747
|
{
|
|
8623
8748
|
$hoverColor: hoverColor,
|
|
@@ -8627,63 +8752,16 @@ var WistiaLogo = ({
|
|
|
8627
8752
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8628
8753
|
...otherProps,
|
|
8629
8754
|
children: [
|
|
8630
|
-
/* @__PURE__ */ (0,
|
|
8631
|
-
(0, import_type_guards30.isNotNil)(description) ? /* @__PURE__ */ (0,
|
|
8755
|
+
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)("title", { children: title }),
|
|
8756
|
+
(0, import_type_guards30.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("desc", { children: description }) : null,
|
|
8632
8757
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
8633
8758
|
renderLogotype(logotypeColor, iconOnly)
|
|
8634
8759
|
]
|
|
8635
8760
|
}
|
|
8636
8761
|
);
|
|
8637
|
-
return href !== void 0 ? /* @__PURE__ */ (0,
|
|
8762
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("a", { href, children: Logo }) : Logo;
|
|
8638
8763
|
};
|
|
8639
8764
|
WistiaLogo.displayName = "WistiaLogo";
|
|
8640
|
-
|
|
8641
|
-
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
8642
|
-
var import_styled_components53 = __toESM(require("styled-components"));
|
|
8643
|
-
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8644
|
-
var StyledBreadcrumbs = import_styled_components53.default.nav`
|
|
8645
|
-
display: flex;
|
|
8646
|
-
align-items: center;
|
|
8647
|
-
gap: var(--wui-space-01);
|
|
8648
|
-
|
|
8649
|
-
> svg:last-of-type {
|
|
8650
|
-
display: none;
|
|
8651
|
-
}
|
|
8652
|
-
`;
|
|
8653
|
-
var Breadcrumbs = ({ children, ...props }) => {
|
|
8654
|
-
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8655
|
-
StyledBreadcrumbs,
|
|
8656
|
-
{
|
|
8657
|
-
"aria-label": "Breadcrumbs",
|
|
8658
|
-
...props,
|
|
8659
|
-
children
|
|
8660
|
-
}
|
|
8661
|
-
);
|
|
8662
|
-
};
|
|
8663
|
-
Breadcrumbs.displayName = "Breadcrumbs";
|
|
8664
|
-
|
|
8665
|
-
// src/components/Breadcrumbs/Breadcrumb.tsx
|
|
8666
|
-
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8667
|
-
var Breadcrumb = ({ icon, href, children }) => {
|
|
8668
|
-
return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(import_jsx_runtime205.Fragment, { children: [
|
|
8669
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8670
|
-
Button,
|
|
8671
|
-
{
|
|
8672
|
-
href,
|
|
8673
|
-
leftIcon: icon,
|
|
8674
|
-
variant: "ghost",
|
|
8675
|
-
children
|
|
8676
|
-
}
|
|
8677
|
-
),
|
|
8678
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8679
|
-
Icon,
|
|
8680
|
-
{
|
|
8681
|
-
size: "sm",
|
|
8682
|
-
type: "caret-right"
|
|
8683
|
-
}
|
|
8684
|
-
)
|
|
8685
|
-
] });
|
|
8686
|
-
};
|
|
8687
8765
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8688
8766
|
0 && (module.exports = {
|
|
8689
8767
|
ActionButton,
|
|
@@ -8737,7 +8815,9 @@ var Breadcrumb = ({ icon, href, children }) => {
|
|
|
8737
8815
|
mq,
|
|
8738
8816
|
useActiveMq,
|
|
8739
8817
|
useAriaLive,
|
|
8818
|
+
useBoolean,
|
|
8740
8819
|
useFormState,
|
|
8820
|
+
useKey,
|
|
8741
8821
|
useMq,
|
|
8742
8822
|
useToast,
|
|
8743
8823
|
useWindowSize
|