@wistia/ui 0.4.2 → 0.4.3-beta.978508e1.854a32c
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 +518 -436
- 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 +412 -332
- 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.978508e1.854a32c
|
|
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 */
|
|
@@ -7404,11 +7529,11 @@ var menuContentCss = import_styled_components38.css`
|
|
|
7404
7529
|
transform: initial;
|
|
7405
7530
|
}
|
|
7406
7531
|
|
|
7407
|
-
|
|
7408
|
-
margin: var(--
|
|
7532
|
+
[role='separator'] {
|
|
7533
|
+
margin: var(--menu-divider-margin) 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;
|
|
@@ -7417,8 +7542,9 @@ var menuItemCss = import_styled_components38.css`
|
|
|
7417
7542
|
--menu-label-font-size: var(--wui-typography-label-3-size);
|
|
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);
|
|
7545
|
+
--menu-divider-margin: var(--wui-space-02);
|
|
7420
7546
|
`;
|
|
7421
|
-
var compactMenuItemCss =
|
|
7547
|
+
var compactMenuItemCss = import_styled_components39.css`
|
|
7422
7548
|
--menu-label-description-gap: 0;
|
|
7423
7549
|
--menu-item-inner-gap: var(--wui-space-02);
|
|
7424
7550
|
--menu-item-left-icon-size: 16px;
|
|
@@ -7427,8 +7553,9 @@ var compactMenuItemCss = import_styled_components38.css`
|
|
|
7427
7553
|
--menu-label-font-size: var(--wui-typography-label-4-size);
|
|
7428
7554
|
--menu-label-font-weight: var(--wui-typography-label-4-weight);
|
|
7429
7555
|
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
7556
|
+
--menu-divider-margin: var(--wui-space-01);
|
|
7430
7557
|
`;
|
|
7431
|
-
var MenuContent = (0,
|
|
7558
|
+
var MenuContent = (0, import_styled_components39.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
7432
7559
|
${menuContentCss}
|
|
7433
7560
|
${({ $compact }) => $compact ? compactMenuItemCss : menuItemCss}
|
|
7434
7561
|
`;
|
|
@@ -7454,24 +7581,24 @@ var Menu = ({
|
|
|
7454
7581
|
onOpenChange: () => null
|
|
7455
7582
|
};
|
|
7456
7583
|
}
|
|
7457
|
-
return /* @__PURE__ */ (0,
|
|
7584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
|
|
7458
7585
|
import_react_dropdown_menu.DropdownMenu,
|
|
7459
7586
|
{
|
|
7460
7587
|
modal: false,
|
|
7461
7588
|
...controlProps,
|
|
7462
7589
|
children: [
|
|
7463
|
-
/* @__PURE__ */ (0,
|
|
7590
|
+
/* @__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
7591
|
Button,
|
|
7465
7592
|
{
|
|
7466
7593
|
"aria-expanded": isOpen,
|
|
7467
7594
|
disabled,
|
|
7468
7595
|
forceState: isOpen ? "active" : void 0,
|
|
7469
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
7596
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Icon, { type: "caret-down" }),
|
|
7470
7597
|
...triggerProps,
|
|
7471
7598
|
children: label
|
|
7472
7599
|
}
|
|
7473
7600
|
) }),
|
|
7474
|
-
/* @__PURE__ */ (0,
|
|
7601
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
7475
7602
|
MenuContent,
|
|
7476
7603
|
{
|
|
7477
7604
|
...props,
|
|
@@ -7491,19 +7618,19 @@ var Menu = ({
|
|
|
7491
7618
|
Menu.displayName = "Menu";
|
|
7492
7619
|
|
|
7493
7620
|
// src/components/Menu/MenuLabel.tsx
|
|
7494
|
-
var
|
|
7621
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
7495
7622
|
var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
|
|
7496
|
-
var
|
|
7497
|
-
var StyledMenuLabel = (0,
|
|
7623
|
+
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
7624
|
+
var StyledMenuLabel = (0, import_styled_components40.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
|
|
7498
7625
|
padding: var(--wui-space-02);
|
|
7499
7626
|
`;
|
|
7500
7627
|
var MenuLabel = ({ children, ...props }) => {
|
|
7501
|
-
return /* @__PURE__ */ (0,
|
|
7628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
7502
7629
|
StyledMenuLabel,
|
|
7503
7630
|
{
|
|
7504
7631
|
asChild: true,
|
|
7505
7632
|
...props,
|
|
7506
|
-
children: /* @__PURE__ */ (0,
|
|
7633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
7507
7634
|
Heading,
|
|
7508
7635
|
{
|
|
7509
7636
|
renderAs: "span",
|
|
@@ -7518,17 +7645,17 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
7518
7645
|
MenuLabel.displayName = "MenuLabel";
|
|
7519
7646
|
|
|
7520
7647
|
// src/components/Menu/SubMenu.tsx
|
|
7521
|
-
var
|
|
7522
|
-
var
|
|
7648
|
+
var import_react31 = require("react");
|
|
7649
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
7523
7650
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
7524
7651
|
var import_type_guards24 = require("@wistia/type-guards");
|
|
7525
7652
|
|
|
7526
7653
|
// src/components/Menu/MenuItemButton.tsx
|
|
7527
|
-
var
|
|
7528
|
-
var
|
|
7654
|
+
var import_react30 = require("react");
|
|
7655
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7529
7656
|
var import_type_guards23 = require("@wistia/type-guards");
|
|
7530
|
-
var
|
|
7531
|
-
var StyledButton3 = (0,
|
|
7657
|
+
var import_jsx_runtime189 = require("react/jsx-runtime");
|
|
7658
|
+
var StyledButton3 = (0, import_styled_components41.default)(Button)`
|
|
7532
7659
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
7533
7660
|
|
|
7534
7661
|
display: flex;
|
|
@@ -7566,7 +7693,7 @@ var StyledButton3 = (0, import_styled_components40.default)(Button)`
|
|
|
7566
7693
|
padding-left: var(--wui-space-04);
|
|
7567
7694
|
}
|
|
7568
7695
|
`;
|
|
7569
|
-
var StyledLeftIconContainer =
|
|
7696
|
+
var StyledLeftIconContainer = import_styled_components41.default.div`
|
|
7570
7697
|
height: var(--menu-item-left-icon-size);
|
|
7571
7698
|
width: var(--menu-item-left-icon-size);
|
|
7572
7699
|
|
|
@@ -7575,7 +7702,7 @@ var StyledLeftIconContainer = import_styled_components40.default.div`
|
|
|
7575
7702
|
width: var(--menu-item-left-icon-size);
|
|
7576
7703
|
}
|
|
7577
7704
|
`;
|
|
7578
|
-
var StyledRightIconContainer =
|
|
7705
|
+
var StyledRightIconContainer = import_styled_components41.default.div`
|
|
7579
7706
|
height: var(--menu-item-right-icon-size);
|
|
7580
7707
|
width: var(--menu-item-right-icon-size);
|
|
7581
7708
|
|
|
@@ -7584,19 +7711,19 @@ var StyledRightIconContainer = import_styled_components40.default.div`
|
|
|
7584
7711
|
width: var(--menu-item-right-icon-size);
|
|
7585
7712
|
}
|
|
7586
7713
|
`;
|
|
7587
|
-
var StyledLabelAndDescriptionContainer =
|
|
7714
|
+
var StyledLabelAndDescriptionContainer = import_styled_components41.default.div`
|
|
7588
7715
|
display: flex;
|
|
7589
7716
|
flex-direction: column;
|
|
7590
7717
|
gap: var(--menu-label-description-gap);
|
|
7591
7718
|
flex-basis: 100%;
|
|
7592
7719
|
`;
|
|
7593
|
-
var StyledBadgeContainer =
|
|
7720
|
+
var StyledBadgeContainer = import_styled_components41.default.div`
|
|
7594
7721
|
align-self: start;
|
|
7595
7722
|
justify-self: end;
|
|
7596
7723
|
font-size: var(--wui-typography-label-4-size);
|
|
7597
7724
|
color: var(--wui-color-text-secondary);
|
|
7598
7725
|
`;
|
|
7599
|
-
var MenuItemButton = (0,
|
|
7726
|
+
var MenuItemButton = (0, import_react30.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
7600
7727
|
let { colorScheme, badge } = props;
|
|
7601
7728
|
if (appearance === "dangerous") {
|
|
7602
7729
|
if ((0, import_type_guards23.isNotUndefined)(colorScheme)) {
|
|
@@ -7605,7 +7732,7 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7605
7732
|
colorScheme = "error";
|
|
7606
7733
|
}
|
|
7607
7734
|
if (appearance === "gated") {
|
|
7608
|
-
badge = /* @__PURE__ */ (0,
|
|
7735
|
+
badge = /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(
|
|
7609
7736
|
Icon,
|
|
7610
7737
|
{
|
|
7611
7738
|
colorScheme: "purple",
|
|
@@ -7617,7 +7744,7 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7617
7744
|
}
|
|
7618
7745
|
);
|
|
7619
7746
|
}
|
|
7620
|
-
return /* @__PURE__ */ (0,
|
|
7747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)(
|
|
7621
7748
|
StyledButton3,
|
|
7622
7749
|
{
|
|
7623
7750
|
...props,
|
|
@@ -7627,10 +7754,10 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7627
7754
|
fullWidth: true,
|
|
7628
7755
|
unstyled: true,
|
|
7629
7756
|
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,
|
|
7757
|
+
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
7758
|
+
/* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
7759
|
+
(0, import_type_guards23.isNotNil)(badge) || (0, import_type_guards23.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
7760
|
+
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
7634
7761
|
]
|
|
7635
7762
|
}
|
|
7636
7763
|
);
|
|
@@ -7638,23 +7765,23 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7638
7765
|
MenuItemButton.displayName = "MenuItemButton";
|
|
7639
7766
|
|
|
7640
7767
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
7641
|
-
var
|
|
7642
|
-
var
|
|
7643
|
-
var StyledMenuItemLabel =
|
|
7644
|
-
var StyledMenuItemDescription = (0,
|
|
7768
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
7769
|
+
var import_jsx_runtime190 = require("react/jsx-runtime");
|
|
7770
|
+
var StyledMenuItemLabel = import_styled_components42.default.span``;
|
|
7771
|
+
var StyledMenuItemDescription = (0, import_styled_components42.default)(Text).attrs({
|
|
7645
7772
|
variant: "body4",
|
|
7646
7773
|
prominence: "secondary"
|
|
7647
7774
|
})``;
|
|
7648
7775
|
var MenuItemLabel = ({ children }) => {
|
|
7649
|
-
return /* @__PURE__ */ (0,
|
|
7776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(StyledMenuItemLabel, { children });
|
|
7650
7777
|
};
|
|
7651
7778
|
var MenuItemDescription = ({ children }) => {
|
|
7652
|
-
return /* @__PURE__ */ (0,
|
|
7779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(StyledMenuItemDescription, { children });
|
|
7653
7780
|
};
|
|
7654
7781
|
|
|
7655
7782
|
// src/components/Menu/SubMenu.tsx
|
|
7656
|
-
var
|
|
7657
|
-
var SubMenuContent = (0,
|
|
7783
|
+
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
7784
|
+
var SubMenuContent = (0, import_styled_components43.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
|
|
7658
7785
|
${menuContentCss}
|
|
7659
7786
|
width: 298px;
|
|
7660
7787
|
|
|
@@ -7662,10 +7789,10 @@ var SubMenuContent = (0, import_styled_components42.default)(import_react_dropdo
|
|
|
7662
7789
|
transform: translateX(-100%) !important;
|
|
7663
7790
|
}
|
|
7664
7791
|
`;
|
|
7665
|
-
var StyledMobileSubMenuItems =
|
|
7792
|
+
var StyledMobileSubMenuItems = import_styled_components43.default.div`
|
|
7666
7793
|
margin-left: var(--wui-space-04);
|
|
7667
7794
|
`;
|
|
7668
|
-
var StyledSubTrigger = (0,
|
|
7795
|
+
var StyledSubTrigger = (0, import_styled_components43.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
|
|
7669
7796
|
outline: none;
|
|
7670
7797
|
|
|
7671
7798
|
&[data-state='open'],
|
|
@@ -7676,11 +7803,11 @@ var StyledSubTrigger = (0, import_styled_components42.default)(import_react_drop
|
|
|
7676
7803
|
var SubMenuTrigger = (props) => {
|
|
7677
7804
|
const { isSmAndUp } = useMq();
|
|
7678
7805
|
const Trigger2 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
|
|
7679
|
-
return /* @__PURE__ */ (0,
|
|
7806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Trigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
7680
7807
|
MenuItemButton,
|
|
7681
7808
|
{
|
|
7682
7809
|
...props,
|
|
7683
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
7810
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Icon, { type: "caret-right" })
|
|
7684
7811
|
}
|
|
7685
7812
|
) });
|
|
7686
7813
|
};
|
|
@@ -7692,15 +7819,15 @@ var SubMenu = ({
|
|
|
7692
7819
|
...props
|
|
7693
7820
|
}) => {
|
|
7694
7821
|
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,
|
|
7822
|
+
const [isExpanded, setIsExpanded] = (0, import_react31.useState)(false);
|
|
7823
|
+
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
7824
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
7825
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemLabel, { children: label }),
|
|
7826
|
+
(0, import_type_guards24.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemDescription, { children: description }) : null
|
|
7700
7827
|
] }),
|
|
7701
|
-
/* @__PURE__ */ (0,
|
|
7702
|
-
] }) : /* @__PURE__ */ (0,
|
|
7703
|
-
/* @__PURE__ */ (0,
|
|
7828
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(SubMenuContent, { children }) })
|
|
7829
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
7830
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
7704
7831
|
SubMenuTrigger,
|
|
7705
7832
|
{
|
|
7706
7833
|
...props,
|
|
@@ -7709,28 +7836,28 @@ var SubMenu = ({
|
|
|
7709
7836
|
setIsExpanded((prev) => !prev);
|
|
7710
7837
|
},
|
|
7711
7838
|
children: [
|
|
7712
|
-
/* @__PURE__ */ (0,
|
|
7713
|
-
/* @__PURE__ */ (0,
|
|
7839
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemLabel, { children: label }),
|
|
7840
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemDescription, { children: description })
|
|
7714
7841
|
]
|
|
7715
7842
|
}
|
|
7716
7843
|
),
|
|
7717
|
-
/* @__PURE__ */ (0,
|
|
7844
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
|
|
7718
7845
|
] });
|
|
7719
7846
|
};
|
|
7720
7847
|
SubMenu.displayName = "SubMenu";
|
|
7721
7848
|
|
|
7722
7849
|
// src/components/Menu/MenuItem.tsx
|
|
7723
|
-
var
|
|
7850
|
+
var import_react32 = require("react");
|
|
7724
7851
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
7725
|
-
var
|
|
7726
|
-
var MenuItem = (0,
|
|
7852
|
+
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
7853
|
+
var MenuItem = (0, import_react32.forwardRef)(
|
|
7727
7854
|
({ onSelect = () => null, ...props }, ref) => {
|
|
7728
|
-
return /* @__PURE__ */ (0,
|
|
7855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7729
7856
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
7730
7857
|
{
|
|
7731
7858
|
asChild: true,
|
|
7732
7859
|
onSelect,
|
|
7733
|
-
children: /* @__PURE__ */ (0,
|
|
7860
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7734
7861
|
MenuItemButton,
|
|
7735
7862
|
{
|
|
7736
7863
|
...props,
|
|
@@ -7746,10 +7873,10 @@ MenuItem.displayName = "MenuItem";
|
|
|
7746
7873
|
|
|
7747
7874
|
// src/components/Menu/MenuRadioGroup.tsx
|
|
7748
7875
|
var import_react_dropdown_menu5 = require("@radix-ui/react-dropdown-menu");
|
|
7749
|
-
var
|
|
7876
|
+
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
7750
7877
|
var MenuRadioGroup = ({ children, label, ...props }) => {
|
|
7751
|
-
return /* @__PURE__ */ (0,
|
|
7752
|
-
/* @__PURE__ */ (0,
|
|
7878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
|
|
7879
|
+
/* @__PURE__ */ (0, import_jsx_runtime193.jsx)(MenuLabel, { children: label }),
|
|
7753
7880
|
children
|
|
7754
7881
|
] });
|
|
7755
7882
|
};
|
|
@@ -7757,11 +7884,11 @@ MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
|
7757
7884
|
|
|
7758
7885
|
// src/components/Menu/RadioMenuItem.tsx
|
|
7759
7886
|
var import_react_dropdown_menu6 = require("@radix-ui/react-dropdown-menu");
|
|
7760
|
-
var
|
|
7887
|
+
var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
7761
7888
|
var RadioMenuItem = ({
|
|
7762
7889
|
onSelect,
|
|
7763
7890
|
value,
|
|
7764
|
-
indicator = /* @__PURE__ */ (0,
|
|
7891
|
+
indicator = /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
7765
7892
|
Icon,
|
|
7766
7893
|
{
|
|
7767
7894
|
size: "sm",
|
|
@@ -7771,17 +7898,17 @@ var RadioMenuItem = ({
|
|
|
7771
7898
|
...props
|
|
7772
7899
|
}) => {
|
|
7773
7900
|
const extraProps = onSelect ? { onSelect } : {};
|
|
7774
|
-
return /* @__PURE__ */ (0,
|
|
7901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
7775
7902
|
import_react_dropdown_menu6.DropdownMenuRadioItem,
|
|
7776
7903
|
{
|
|
7777
7904
|
...extraProps,
|
|
7778
7905
|
asChild: true,
|
|
7779
7906
|
value,
|
|
7780
|
-
children: /* @__PURE__ */ (0,
|
|
7907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
7781
7908
|
MenuItemButton,
|
|
7782
7909
|
{
|
|
7783
7910
|
...props,
|
|
7784
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
7911
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
|
|
7785
7912
|
}
|
|
7786
7913
|
)
|
|
7787
7914
|
}
|
|
@@ -7791,9 +7918,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
7791
7918
|
|
|
7792
7919
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
7793
7920
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
7794
|
-
var
|
|
7921
|
+
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
7795
7922
|
var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
7796
|
-
return checked ? /* @__PURE__ */ (0,
|
|
7923
|
+
return checked ? /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(
|
|
7797
7924
|
"svg",
|
|
7798
7925
|
{
|
|
7799
7926
|
...props,
|
|
@@ -7803,14 +7930,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7803
7930
|
width: "24",
|
|
7804
7931
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7805
7932
|
children: [
|
|
7806
|
-
/* @__PURE__ */ (0,
|
|
7933
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7807
7934
|
"path",
|
|
7808
7935
|
{
|
|
7809
7936
|
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
7937
|
fill: "#2949e5"
|
|
7811
7938
|
}
|
|
7812
7939
|
),
|
|
7813
|
-
/* @__PURE__ */ (0,
|
|
7940
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7814
7941
|
"path",
|
|
7815
7942
|
{
|
|
7816
7943
|
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 +7946,7 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7819
7946
|
)
|
|
7820
7947
|
]
|
|
7821
7948
|
}
|
|
7822
|
-
) : /* @__PURE__ */ (0,
|
|
7949
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(
|
|
7823
7950
|
"svg",
|
|
7824
7951
|
{
|
|
7825
7952
|
...props,
|
|
@@ -7829,14 +7956,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7829
7956
|
width: "24",
|
|
7830
7957
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7831
7958
|
children: [
|
|
7832
|
-
/* @__PURE__ */ (0,
|
|
7959
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7833
7960
|
"path",
|
|
7834
7961
|
{
|
|
7835
7962
|
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
7963
|
fill: "#fcfcfd"
|
|
7837
7964
|
}
|
|
7838
7965
|
),
|
|
7839
|
-
/* @__PURE__ */ (0,
|
|
7966
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7840
7967
|
"path",
|
|
7841
7968
|
{
|
|
7842
7969
|
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 +7980,18 @@ var CheckboxMenuItem = ({
|
|
|
7853
7980
|
onCheckedChange,
|
|
7854
7981
|
...props
|
|
7855
7982
|
}) => {
|
|
7856
|
-
return /* @__PURE__ */ (0,
|
|
7983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7857
7984
|
import_react_dropdown_menu7.DropdownMenuCheckboxItem,
|
|
7858
7985
|
{
|
|
7859
7986
|
asChild: true,
|
|
7860
7987
|
checked,
|
|
7861
7988
|
onCheckedChange,
|
|
7862
7989
|
onSelect,
|
|
7863
|
-
children: /* @__PURE__ */ (0,
|
|
7990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7864
7991
|
MenuItemButton,
|
|
7865
7992
|
{
|
|
7866
7993
|
...props,
|
|
7867
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
7994
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(CheckboxIndicator2, { checked })
|
|
7868
7995
|
}
|
|
7869
7996
|
)
|
|
7870
7997
|
}
|
|
@@ -7873,40 +8000,40 @@ var CheckboxMenuItem = ({
|
|
|
7873
8000
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
7874
8001
|
|
|
7875
8002
|
// src/components/Modal/Modal.tsx
|
|
7876
|
-
var
|
|
7877
|
-
var
|
|
8003
|
+
var import_react36 = require("react");
|
|
8004
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
7878
8005
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
7879
8006
|
var import_type_guards27 = require("@wistia/type-guards");
|
|
7880
8007
|
|
|
7881
8008
|
// src/components/Modal/ModalHeader.tsx
|
|
7882
|
-
var
|
|
8009
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
7883
8010
|
var import_react_dialog2 = require("@radix-ui/react-dialog");
|
|
7884
8011
|
|
|
7885
8012
|
// src/components/Modal/ModalCloseButton.tsx
|
|
7886
|
-
var
|
|
8013
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
7887
8014
|
var import_react_dialog = require("@radix-ui/react-dialog");
|
|
7888
|
-
var
|
|
7889
|
-
var CloseButton = (0,
|
|
8015
|
+
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
8016
|
+
var CloseButton = (0, import_styled_components44.default)(import_react_dialog.Close)`
|
|
7890
8017
|
align-self: start;
|
|
7891
8018
|
`;
|
|
7892
8019
|
var ModalCloseButton = () => {
|
|
7893
|
-
return /* @__PURE__ */ (0,
|
|
8020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(CloseButton, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
7894
8021
|
IconButton,
|
|
7895
8022
|
{
|
|
7896
8023
|
label: "Dismiss modal",
|
|
7897
8024
|
size: "sm",
|
|
7898
8025
|
variant: "ghost",
|
|
7899
|
-
children: /* @__PURE__ */ (0,
|
|
8026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(Icon, { type: "close" })
|
|
7900
8027
|
}
|
|
7901
8028
|
) });
|
|
7902
8029
|
};
|
|
7903
8030
|
|
|
7904
8031
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7905
|
-
var
|
|
8032
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
7906
8033
|
var import_type_guards25 = require("@wistia/type-guards");
|
|
7907
|
-
var
|
|
7908
|
-
var VisuallyHidden =
|
|
7909
|
-
var VisuallyHiddenButFocusable =
|
|
8034
|
+
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
8035
|
+
var VisuallyHidden = import_styled_components45.default.div({ ...visuallyHiddenStyle });
|
|
8036
|
+
var VisuallyHiddenButFocusable = import_styled_components45.default.div({
|
|
7910
8037
|
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7911
8038
|
});
|
|
7912
8039
|
var ScreenReaderOnly = ({
|
|
@@ -7917,15 +8044,15 @@ var ScreenReaderOnly = ({
|
|
|
7917
8044
|
}) => {
|
|
7918
8045
|
const accessibleText = (0, import_type_guards25.isNotNil)(text) ? text : children;
|
|
7919
8046
|
if (focusable) {
|
|
7920
|
-
return /* @__PURE__ */ (0,
|
|
8047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7921
8048
|
}
|
|
7922
|
-
return /* @__PURE__ */ (0,
|
|
8049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7923
8050
|
};
|
|
7924
8051
|
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7925
8052
|
|
|
7926
8053
|
// src/components/Modal/ModalHeader.tsx
|
|
7927
|
-
var
|
|
7928
|
-
var Header =
|
|
8054
|
+
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
8055
|
+
var Header = import_styled_components46.default.header`
|
|
7929
8056
|
display: flex;
|
|
7930
8057
|
order: 1;
|
|
7931
8058
|
gap: var(--wui-space-01);
|
|
@@ -7937,7 +8064,7 @@ var Header = import_styled_components45.default.header`
|
|
|
7937
8064
|
margin-top: 0;
|
|
7938
8065
|
}
|
|
7939
8066
|
`;
|
|
7940
|
-
var Title = (0,
|
|
8067
|
+
var Title = (0, import_styled_components46.default)(import_react_dialog2.Title)`
|
|
7941
8068
|
font-family: var(--wui-typography-heading-2-family);
|
|
7942
8069
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
7943
8070
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -7949,26 +8076,26 @@ var ModalHeader = ({
|
|
|
7949
8076
|
hideCloseButton
|
|
7950
8077
|
}) => {
|
|
7951
8078
|
const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
|
|
7952
|
-
return /* @__PURE__ */ (0,
|
|
7953
|
-
/* @__PURE__ */ (0,
|
|
7954
|
-
hideCloseButton ? null : /* @__PURE__ */ (0,
|
|
8079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(Header, { children: [
|
|
8080
|
+
/* @__PURE__ */ (0, import_jsx_runtime198.jsx)(TitleWrapper, { children: title }),
|
|
8081
|
+
hideCloseButton ? null : /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(ModalCloseButton, {})
|
|
7955
8082
|
] });
|
|
7956
8083
|
};
|
|
7957
8084
|
|
|
7958
8085
|
// src/components/Modal/ModalContent.tsx
|
|
7959
|
-
var
|
|
7960
|
-
var
|
|
8086
|
+
var import_react34 = require("react");
|
|
8087
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
7961
8088
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
7962
8089
|
|
|
7963
8090
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
7964
|
-
var
|
|
8091
|
+
var import_react33 = require("react");
|
|
7965
8092
|
var import_type_guards26 = require("@wistia/type-guards");
|
|
7966
8093
|
var useFocusRestore = () => {
|
|
7967
|
-
const previouslyFocusedRef = (0,
|
|
7968
|
-
(0,
|
|
8094
|
+
const previouslyFocusedRef = (0, import_react33.useRef)(null);
|
|
8095
|
+
(0, import_react33.useEffect)(() => {
|
|
7969
8096
|
previouslyFocusedRef.current = document.activeElement;
|
|
7970
8097
|
}, []);
|
|
7971
|
-
(0,
|
|
8098
|
+
(0, import_react33.useEffect)(() => {
|
|
7972
8099
|
return () => {
|
|
7973
8100
|
if ((0, import_type_guards26.isNotNil)(previouslyFocusedRef.current)) {
|
|
7974
8101
|
setTimeout(() => {
|
|
@@ -7980,8 +8107,8 @@ var useFocusRestore = () => {
|
|
|
7980
8107
|
};
|
|
7981
8108
|
|
|
7982
8109
|
// src/components/Modal/ModalContent.tsx
|
|
7983
|
-
var
|
|
7984
|
-
var StyledModalContent = (0,
|
|
8110
|
+
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
8111
|
+
var StyledModalContent = (0, import_styled_components47.default)(import_react_dialog3.Content)`
|
|
7985
8112
|
background-color: var(--wui-color-bg-app);
|
|
7986
8113
|
box-sizing: border-box;
|
|
7987
8114
|
display: flex;
|
|
@@ -8021,10 +8148,10 @@ var StyledModalContent = (0, import_styled_components46.default)(import_react_di
|
|
|
8021
8148
|
}
|
|
8022
8149
|
}
|
|
8023
8150
|
`;
|
|
8024
|
-
var ModalContent = (0,
|
|
8151
|
+
var ModalContent = (0, import_react34.forwardRef)(
|
|
8025
8152
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
8026
8153
|
useFocusRestore();
|
|
8027
|
-
return /* @__PURE__ */ (0,
|
|
8154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
8028
8155
|
StyledModalContent,
|
|
8029
8156
|
{
|
|
8030
8157
|
ref,
|
|
@@ -8038,9 +8165,9 @@ var ModalContent = (0, import_react31.forwardRef)(
|
|
|
8038
8165
|
);
|
|
8039
8166
|
|
|
8040
8167
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
8041
|
-
var
|
|
8042
|
-
var
|
|
8043
|
-
var
|
|
8168
|
+
var import_react35 = require("react");
|
|
8169
|
+
var import_styled_components48 = __toESM(require("styled-components"));
|
|
8170
|
+
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
8044
8171
|
var backdropAnimationDuration = 150;
|
|
8045
8172
|
var alignVerticalMap = {
|
|
8046
8173
|
stretch: "normal",
|
|
@@ -8053,7 +8180,7 @@ var alignHorizontalMap = {
|
|
|
8053
8180
|
center: "center",
|
|
8054
8181
|
right: "end"
|
|
8055
8182
|
};
|
|
8056
|
-
var BackdropComponent =
|
|
8183
|
+
var BackdropComponent = import_styled_components48.default.div`
|
|
8057
8184
|
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
8058
8185
|
animation-name: backdropShow;
|
|
8059
8186
|
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
@@ -8076,8 +8203,8 @@ var BackdropComponent = import_styled_components47.default.div`
|
|
|
8076
8203
|
}
|
|
8077
8204
|
}
|
|
8078
8205
|
`;
|
|
8079
|
-
var Backdrop = (0,
|
|
8080
|
-
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
8206
|
+
var Backdrop = (0, import_react35.forwardRef)(
|
|
8207
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8081
8208
|
BackdropComponent,
|
|
8082
8209
|
{
|
|
8083
8210
|
ref,
|
|
@@ -8091,13 +8218,13 @@ var Backdrop = (0, import_react32.forwardRef)(
|
|
|
8091
8218
|
Backdrop.displayName = "Backdrop";
|
|
8092
8219
|
|
|
8093
8220
|
// src/components/Modal/Modal.tsx
|
|
8094
|
-
var
|
|
8095
|
-
var ModalBody =
|
|
8221
|
+
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
8222
|
+
var ModalBody = import_styled_components49.default.div`
|
|
8096
8223
|
flex-direction: column;
|
|
8097
8224
|
display: flex;
|
|
8098
8225
|
order: 2;
|
|
8099
8226
|
`;
|
|
8100
|
-
var Modal = (0,
|
|
8227
|
+
var Modal = (0, import_react36.forwardRef)(
|
|
8101
8228
|
({
|
|
8102
8229
|
children,
|
|
8103
8230
|
fullHeight = false,
|
|
@@ -8110,7 +8237,7 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8110
8237
|
width,
|
|
8111
8238
|
...props
|
|
8112
8239
|
}, ref) => {
|
|
8113
|
-
return /* @__PURE__ */ (0,
|
|
8240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8114
8241
|
import_react_dialog4.Root,
|
|
8115
8242
|
{
|
|
8116
8243
|
onOpenChange: (open2) => {
|
|
@@ -8119,9 +8246,9 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8119
8246
|
}
|
|
8120
8247
|
},
|
|
8121
8248
|
open: isOpen,
|
|
8122
|
-
children: /* @__PURE__ */ (0,
|
|
8123
|
-
/* @__PURE__ */ (0,
|
|
8124
|
-
/* @__PURE__ */ (0,
|
|
8249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(import_react_dialog4.Portal, { children: [
|
|
8250
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(Backdrop, {}),
|
|
8251
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
8125
8252
|
ModalContent,
|
|
8126
8253
|
{
|
|
8127
8254
|
ref,
|
|
@@ -8138,8 +8265,8 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8138
8265
|
width,
|
|
8139
8266
|
...props,
|
|
8140
8267
|
children: [
|
|
8141
|
-
/* @__PURE__ */ (0,
|
|
8142
|
-
/* @__PURE__ */ (0,
|
|
8268
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(ModalBody, { children }),
|
|
8269
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8143
8270
|
ModalHeader,
|
|
8144
8271
|
{
|
|
8145
8272
|
hideCloseButton,
|
|
@@ -8158,16 +8285,16 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
8158
8285
|
Modal.displayName = "Modal";
|
|
8159
8286
|
|
|
8160
8287
|
// src/components/Radio/Radio.tsx
|
|
8161
|
-
var
|
|
8162
|
-
var
|
|
8288
|
+
var import_react37 = require("react");
|
|
8289
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
8163
8290
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
8164
|
-
var
|
|
8165
|
-
var StyledLabelWrapper2 =
|
|
8291
|
+
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
8292
|
+
var StyledLabelWrapper2 = import_styled_components50.default.div`
|
|
8166
8293
|
display: flex;
|
|
8167
8294
|
flex-direction: column;
|
|
8168
8295
|
padding-left: var(--wui-space-02);
|
|
8169
8296
|
`;
|
|
8170
|
-
var StyledRadio =
|
|
8297
|
+
var StyledRadio = import_styled_components50.default.input`
|
|
8171
8298
|
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
8172
8299
|
appearance: none;
|
|
8173
8300
|
margin: 0;
|
|
@@ -8193,11 +8320,11 @@ var StyledRadio = import_styled_components49.default.input`
|
|
|
8193
8320
|
transform: scale(1);
|
|
8194
8321
|
}
|
|
8195
8322
|
`;
|
|
8196
|
-
var disabledStyle2 =
|
|
8323
|
+
var disabledStyle2 = import_styled_components50.css`
|
|
8197
8324
|
cursor: not-allowed;
|
|
8198
8325
|
opacity: 0.5;
|
|
8199
8326
|
`;
|
|
8200
|
-
var errorStyle =
|
|
8327
|
+
var errorStyle = import_styled_components50.css`
|
|
8201
8328
|
/* TODO Lamp to design error state */
|
|
8202
8329
|
&:hover,
|
|
8203
8330
|
&:focus,
|
|
@@ -8205,11 +8332,11 @@ var errorStyle = import_styled_components49.css`
|
|
|
8205
8332
|
border-color: transparent !important;
|
|
8206
8333
|
}
|
|
8207
8334
|
`;
|
|
8208
|
-
var defaultHoverStyle =
|
|
8335
|
+
var defaultHoverStyle = import_styled_components50.css`
|
|
8209
8336
|
/* TODO Lamp to design hover state */
|
|
8210
8337
|
cursor: pointer;
|
|
8211
8338
|
`;
|
|
8212
|
-
var StyledRadioWrapper =
|
|
8339
|
+
var StyledRadioWrapper = import_styled_components50.default.div`
|
|
8213
8340
|
align-items: baseline;
|
|
8214
8341
|
border: 1px solid transparent;
|
|
8215
8342
|
border-radius: 4px;
|
|
@@ -8232,7 +8359,7 @@ var StyledRadioWrapper = import_styled_components49.default.div`
|
|
|
8232
8359
|
|
|
8233
8360
|
${({ disabled }) => disabled && disabledStyle2};
|
|
8234
8361
|
`;
|
|
8235
|
-
var Radio = (0,
|
|
8362
|
+
var Radio = (0, import_react37.forwardRef)(
|
|
8236
8363
|
({
|
|
8237
8364
|
checked,
|
|
8238
8365
|
disabled = false,
|
|
@@ -8245,15 +8372,15 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8245
8372
|
value = "false",
|
|
8246
8373
|
...otherProps
|
|
8247
8374
|
}, ref) => {
|
|
8248
|
-
const generatedId = (0,
|
|
8375
|
+
const generatedId = (0, import_react37.useId)();
|
|
8249
8376
|
const computedId = (0, import_type_guards28.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
|
|
8250
|
-
return /* @__PURE__ */ (0,
|
|
8377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(
|
|
8251
8378
|
StyledRadioWrapper,
|
|
8252
8379
|
{
|
|
8253
8380
|
"aria-invalid": otherProps["aria-invalid"],
|
|
8254
8381
|
disabled,
|
|
8255
8382
|
children: [
|
|
8256
|
-
/* @__PURE__ */ (0,
|
|
8383
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8257
8384
|
StyledRadio,
|
|
8258
8385
|
{
|
|
8259
8386
|
ref,
|
|
@@ -8268,8 +8395,8 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8268
8395
|
...otherProps
|
|
8269
8396
|
}
|
|
8270
8397
|
),
|
|
8271
|
-
/* @__PURE__ */ (0,
|
|
8272
|
-
/* @__PURE__ */ (0,
|
|
8398
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(StyledLabelWrapper2, { children: [
|
|
8399
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8273
8400
|
Label,
|
|
8274
8401
|
{
|
|
8275
8402
|
disabled,
|
|
@@ -8278,7 +8405,7 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8278
8405
|
children: label
|
|
8279
8406
|
}
|
|
8280
8407
|
),
|
|
8281
|
-
/* @__PURE__ */ (0,
|
|
8408
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(LabelDescription, { children: description })
|
|
8282
8409
|
] })
|
|
8283
8410
|
]
|
|
8284
8411
|
}
|
|
@@ -8288,11 +8415,11 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8288
8415
|
Radio.displayName = "Radio";
|
|
8289
8416
|
|
|
8290
8417
|
// src/components/Tag/Tag.tsx
|
|
8291
|
-
var
|
|
8292
|
-
var
|
|
8418
|
+
var import_react38 = require("react");
|
|
8419
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
8293
8420
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8294
|
-
var
|
|
8295
|
-
var TagLabel =
|
|
8421
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
8422
|
+
var TagLabel = import_styled_components51.default.a`
|
|
8296
8423
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8297
8424
|
font-size: var(--wui-typography-label-4-size);
|
|
8298
8425
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -8320,14 +8447,14 @@ var TagLabel = import_styled_components50.default.a`
|
|
|
8320
8447
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
8321
8448
|
}
|
|
8322
8449
|
`;
|
|
8323
|
-
var TagDivider =
|
|
8450
|
+
var TagDivider = import_styled_components51.default.div`
|
|
8324
8451
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8325
8452
|
border-left: 1px solid var(--wui-color-border);
|
|
8326
8453
|
display: flex;
|
|
8327
8454
|
height: 14px;
|
|
8328
8455
|
width: 1px;
|
|
8329
8456
|
`;
|
|
8330
|
-
var StyledRemoveButton =
|
|
8457
|
+
var StyledRemoveButton = import_styled_components51.default.button`
|
|
8331
8458
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8332
8459
|
all: unset;
|
|
8333
8460
|
cursor: pointer;
|
|
@@ -8355,7 +8482,7 @@ var StyledRemoveButton = import_styled_components50.default.button`
|
|
|
8355
8482
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
8356
8483
|
}
|
|
8357
8484
|
`;
|
|
8358
|
-
var StyledTag =
|
|
8485
|
+
var StyledTag = import_styled_components51.default.div`
|
|
8359
8486
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8360
8487
|
align-items: center;
|
|
8361
8488
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -8372,39 +8499,39 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
8372
8499
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
8373
8500
|
);
|
|
8374
8501
|
}
|
|
8375
|
-
return /* @__PURE__ */ (0,
|
|
8376
|
-
/* @__PURE__ */ (0,
|
|
8377
|
-
/* @__PURE__ */ (0,
|
|
8502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(import_jsx_runtime203.Fragment, { children: [
|
|
8503
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
8504
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(
|
|
8378
8505
|
StyledRemoveButton,
|
|
8379
8506
|
{
|
|
8380
8507
|
$colorScheme: colorScheme,
|
|
8381
8508
|
onClick: onClickRemove,
|
|
8382
8509
|
type: "button",
|
|
8383
8510
|
children: [
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8511
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8385
8512
|
Icon,
|
|
8386
8513
|
{
|
|
8387
8514
|
size: "sm",
|
|
8388
8515
|
type: "close"
|
|
8389
8516
|
}
|
|
8390
8517
|
),
|
|
8391
|
-
/* @__PURE__ */ (0,
|
|
8518
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
8392
8519
|
]
|
|
8393
8520
|
}
|
|
8394
8521
|
)
|
|
8395
8522
|
] });
|
|
8396
8523
|
};
|
|
8397
|
-
var Tag = (0,
|
|
8524
|
+
var Tag = (0, import_react38.forwardRef)(
|
|
8398
8525
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
8399
8526
|
const labelProps = (0, import_type_guards29.isNotNil)(href) && (0, import_type_guards29.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
8400
|
-
return /* @__PURE__ */ (0,
|
|
8527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(
|
|
8401
8528
|
StyledTag,
|
|
8402
8529
|
{
|
|
8403
8530
|
ref,
|
|
8404
8531
|
$colorScheme: colorScheme,
|
|
8405
8532
|
...otherProps,
|
|
8406
8533
|
children: [
|
|
8407
|
-
/* @__PURE__ */ (0,
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8408
8535
|
TagLabel,
|
|
8409
8536
|
{
|
|
8410
8537
|
...labelProps,
|
|
@@ -8412,7 +8539,7 @@ var Tag = (0, import_react35.forwardRef)(
|
|
|
8412
8539
|
children: label
|
|
8413
8540
|
}
|
|
8414
8541
|
),
|
|
8415
|
-
/* @__PURE__ */ (0,
|
|
8542
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8416
8543
|
RemoveButton,
|
|
8417
8544
|
{
|
|
8418
8545
|
colorScheme,
|
|
@@ -8429,16 +8556,16 @@ Tag.displayName = "Tag";
|
|
|
8429
8556
|
|
|
8430
8557
|
// src/components/Tooltip/Tooltip.tsx
|
|
8431
8558
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
8432
|
-
var
|
|
8433
|
-
var
|
|
8434
|
-
var CompactTooltipStyles =
|
|
8559
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
8560
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8561
|
+
var CompactTooltipStyles = import_styled_components52.css`
|
|
8435
8562
|
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
8436
8563
|
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
8437
8564
|
--tooltip-font-weight: var(--wui-typography-label-4-weight);
|
|
8438
8565
|
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
8439
8566
|
--tooltip-vertical-padding: var(--wui-space-03);
|
|
8440
8567
|
`;
|
|
8441
|
-
var StyledContent = (0,
|
|
8568
|
+
var StyledContent = (0, import_styled_components52.default)(import_react_tooltip2.Content)`
|
|
8442
8569
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
8443
8570
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
8444
8571
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -8496,14 +8623,14 @@ var Tooltip = ({
|
|
|
8496
8623
|
if (forceOpen === true) {
|
|
8497
8624
|
rootProps.open = true;
|
|
8498
8625
|
}
|
|
8499
|
-
return /* @__PURE__ */ (0,
|
|
8626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
|
|
8500
8627
|
import_react_tooltip2.Root,
|
|
8501
8628
|
{
|
|
8502
8629
|
delayDuration: delay,
|
|
8503
8630
|
...rootProps,
|
|
8504
8631
|
children: [
|
|
8505
|
-
/* @__PURE__ */ (0,
|
|
8506
|
-
/* @__PURE__ */ (0,
|
|
8632
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
8633
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
|
|
8507
8634
|
StyledContent,
|
|
8508
8635
|
{
|
|
8509
8636
|
$compact: compact,
|
|
@@ -8511,7 +8638,7 @@ var Tooltip = ({
|
|
|
8511
8638
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
8512
8639
|
children: [
|
|
8513
8640
|
content,
|
|
8514
|
-
!hideArrow ? /* @__PURE__ */ (0,
|
|
8641
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8515
8642
|
"svg",
|
|
8516
8643
|
{
|
|
8517
8644
|
fill: "var(--tooltip-bg)",
|
|
@@ -8520,7 +8647,7 @@ var Tooltip = ({
|
|
|
8520
8647
|
viewBox: "0 0 12 8",
|
|
8521
8648
|
width: "12",
|
|
8522
8649
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8523
|
-
children: /* @__PURE__ */ (0,
|
|
8650
|
+
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
8651
|
}
|
|
8525
8652
|
) }) : null
|
|
8526
8653
|
]
|
|
@@ -8533,26 +8660,26 @@ var Tooltip = ({
|
|
|
8533
8660
|
Tooltip.displayName = "Tooltip";
|
|
8534
8661
|
|
|
8535
8662
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
8536
|
-
var
|
|
8663
|
+
var import_styled_components53 = __toESM(require("styled-components"));
|
|
8537
8664
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8538
|
-
var
|
|
8665
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8539
8666
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
8540
8667
|
if (iconOnly) {
|
|
8541
|
-
return /* @__PURE__ */ (0,
|
|
8668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8542
8669
|
"g",
|
|
8543
8670
|
{
|
|
8544
8671
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
8545
8672
|
fill: brandmarkColor,
|
|
8546
|
-
children: /* @__PURE__ */ (0,
|
|
8673
|
+
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
8674
|
}
|
|
8548
8675
|
);
|
|
8549
8676
|
}
|
|
8550
|
-
return /* @__PURE__ */ (0,
|
|
8677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8551
8678
|
"g",
|
|
8552
8679
|
{
|
|
8553
8680
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
8554
8681
|
fill: brandmarkColor,
|
|
8555
|
-
children: /* @__PURE__ */ (0,
|
|
8682
|
+
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
8683
|
}
|
|
8557
8684
|
);
|
|
8558
8685
|
};
|
|
@@ -8560,12 +8687,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
8560
8687
|
if (iconOnly) {
|
|
8561
8688
|
return null;
|
|
8562
8689
|
}
|
|
8563
|
-
return /* @__PURE__ */ (0,
|
|
8690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8564
8691
|
"g",
|
|
8565
8692
|
{
|
|
8566
8693
|
"data-testid": "ui-wistia-logo-logotype",
|
|
8567
8694
|
fill: logotypeColor,
|
|
8568
|
-
children: /* @__PURE__ */ (0,
|
|
8695
|
+
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
8696
|
}
|
|
8570
8697
|
);
|
|
8571
8698
|
};
|
|
@@ -8575,7 +8702,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
8575
8702
|
}
|
|
8576
8703
|
return "0 0 144 31.47";
|
|
8577
8704
|
};
|
|
8578
|
-
var WistiaLogoComponent =
|
|
8705
|
+
var WistiaLogoComponent = import_styled_components53.default.svg`
|
|
8579
8706
|
height: ${({ height }) => `${height}px`};
|
|
8580
8707
|
|
|
8581
8708
|
/* ensure it will always fit on mobile */
|
|
@@ -8617,7 +8744,7 @@ var WistiaLogo = ({
|
|
|
8617
8744
|
};
|
|
8618
8745
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
8619
8746
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
8620
|
-
const Logo = /* @__PURE__ */ (0,
|
|
8747
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
|
|
8621
8748
|
WistiaLogoComponent,
|
|
8622
8749
|
{
|
|
8623
8750
|
$hoverColor: hoverColor,
|
|
@@ -8627,63 +8754,16 @@ var WistiaLogo = ({
|
|
|
8627
8754
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8628
8755
|
...otherProps,
|
|
8629
8756
|
children: [
|
|
8630
|
-
/* @__PURE__ */ (0,
|
|
8631
|
-
(0, import_type_guards30.isNotNil)(description) ? /* @__PURE__ */ (0,
|
|
8757
|
+
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)("title", { children: title }),
|
|
8758
|
+
(0, import_type_guards30.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("desc", { children: description }) : null,
|
|
8632
8759
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
8633
8760
|
renderLogotype(logotypeColor, iconOnly)
|
|
8634
8761
|
]
|
|
8635
8762
|
}
|
|
8636
8763
|
);
|
|
8637
|
-
return href !== void 0 ? /* @__PURE__ */ (0,
|
|
8764
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("a", { href, children: Logo }) : Logo;
|
|
8638
8765
|
};
|
|
8639
8766
|
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
8767
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8688
8768
|
0 && (module.exports = {
|
|
8689
8769
|
ActionButton,
|
|
@@ -8737,7 +8817,9 @@ var Breadcrumb = ({ icon, href, children }) => {
|
|
|
8737
8817
|
mq,
|
|
8738
8818
|
useActiveMq,
|
|
8739
8819
|
useAriaLive,
|
|
8820
|
+
useBoolean,
|
|
8740
8821
|
useFormState,
|
|
8822
|
+
useKey,
|
|
8741
8823
|
useMq,
|
|
8742
8824
|
useToast,
|
|
8743
8825
|
useWindowSize
|