@wistia/ui 0.1.0 → 0.1.1
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 +362 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +87 -2
- package/dist/index.d.ts +87 -2
- package/dist/index.mjs +353 -89
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.1.
|
|
3
|
+
* @license @wistia/ui v0.1.1
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -71,12 +71,13 @@ var resetCss = css`
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/* Balance text wrapping on headings */
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
/* h1,
|
|
75
76
|
h2,
|
|
76
77
|
h3,
|
|
77
78
|
h4 {
|
|
78
79
|
text-wrap: balance;
|
|
79
|
-
}
|
|
80
|
+
} */
|
|
80
81
|
|
|
81
82
|
/* A elements that don't have a class get default styles */
|
|
82
83
|
a:not([class]) {
|
|
@@ -1280,6 +1281,7 @@ var typographyTokens = css7`
|
|
|
1280
1281
|
import { css as css8 } from "styled-components";
|
|
1281
1282
|
var zIndexTokens = css8`
|
|
1282
1283
|
--wui-zindex-backdrop: 100;
|
|
1284
|
+
--wui-zindex-modal: 100;
|
|
1283
1285
|
--wui-zindex-menu: 500;
|
|
1284
1286
|
`;
|
|
1285
1287
|
|
|
@@ -7367,17 +7369,300 @@ var CheckboxMenuItem = ({
|
|
|
7367
7369
|
};
|
|
7368
7370
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
7369
7371
|
|
|
7372
|
+
// src/components/Modal/Modal.tsx
|
|
7373
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
7374
|
+
import styled31 from "styled-components";
|
|
7375
|
+
import {
|
|
7376
|
+
Root as DialogRoot,
|
|
7377
|
+
Content as DialogContent,
|
|
7378
|
+
Portal as DialogPortal
|
|
7379
|
+
} from "@radix-ui/react-dialog";
|
|
7380
|
+
import { isNotNil as isNotNil12 } from "@wistia/type-guards";
|
|
7381
|
+
|
|
7382
|
+
// src/components/Modal/ModalHeader.tsx
|
|
7383
|
+
import styled29 from "styled-components";
|
|
7384
|
+
import { Title as DialogTitle } from "@radix-ui/react-dialog";
|
|
7385
|
+
|
|
7386
|
+
// src/components/Modal/ModalCloseButton.tsx
|
|
7387
|
+
import styled27 from "styled-components";
|
|
7388
|
+
import { Close as DialogClose } from "@radix-ui/react-dialog";
|
|
7389
|
+
import { jsx as jsx191 } from "react/jsx-runtime";
|
|
7390
|
+
var CloseButton = styled27(DialogClose)`
|
|
7391
|
+
align-self: start;
|
|
7392
|
+
`;
|
|
7393
|
+
var ModalCloseButton = () => {
|
|
7394
|
+
return /* @__PURE__ */ jsx191(CloseButton, { asChild: true, children: /* @__PURE__ */ jsx191(
|
|
7395
|
+
IconButton,
|
|
7396
|
+
{
|
|
7397
|
+
disableTooltip: true,
|
|
7398
|
+
label: "Dismiss modal",
|
|
7399
|
+
size: "sm",
|
|
7400
|
+
variant: "ghost",
|
|
7401
|
+
children: /* @__PURE__ */ jsx191(Icon, { type: "close" })
|
|
7402
|
+
}
|
|
7403
|
+
) });
|
|
7404
|
+
};
|
|
7405
|
+
|
|
7406
|
+
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7407
|
+
import styled28 from "styled-components";
|
|
7408
|
+
import { isNotNil as isNotNil10 } from "@wistia/type-guards";
|
|
7409
|
+
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
7410
|
+
var VisuallyHidden = styled28.div({ ...visuallyHiddenStyle });
|
|
7411
|
+
var VisuallyHiddenButFocusable = styled28.div({
|
|
7412
|
+
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7413
|
+
});
|
|
7414
|
+
var ScreenReaderOnly = ({
|
|
7415
|
+
text,
|
|
7416
|
+
children,
|
|
7417
|
+
focusable = false,
|
|
7418
|
+
...otherProps
|
|
7419
|
+
}) => {
|
|
7420
|
+
const accessibleText = isNotNil10(text) ? text : children;
|
|
7421
|
+
if (focusable) {
|
|
7422
|
+
return /* @__PURE__ */ jsx192(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7423
|
+
}
|
|
7424
|
+
return /* @__PURE__ */ jsx192(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7425
|
+
};
|
|
7426
|
+
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7427
|
+
|
|
7428
|
+
// src/components/Modal/ModalHeader.tsx
|
|
7429
|
+
import { jsx as jsx193, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7430
|
+
var Header = styled29.header`
|
|
7431
|
+
display: flex;
|
|
7432
|
+
order: 1;
|
|
7433
|
+
gap: var(--wui-space-01);
|
|
7434
|
+
margin-bottom: var(--wui-space-03);
|
|
7435
|
+
justify-content: space-between;
|
|
7436
|
+
|
|
7437
|
+
/* DialogTitle creates an h2 element which inherits some margin */
|
|
7438
|
+
h2 {
|
|
7439
|
+
margin-top: 0;
|
|
7440
|
+
}
|
|
7441
|
+
`;
|
|
7442
|
+
var Title = styled29(DialogTitle)`
|
|
7443
|
+
font-family: var(--wui-typography-heading-2-family);
|
|
7444
|
+
line-height: var(--wui-typography-heading-2-line-height);
|
|
7445
|
+
font-size: var(--wui-typography-heading-2-size);
|
|
7446
|
+
font-weight: var(--wui-typography-heading-2-weight);
|
|
7447
|
+
`;
|
|
7448
|
+
var ModalHeader = ({
|
|
7449
|
+
title,
|
|
7450
|
+
hideTitle,
|
|
7451
|
+
hideCloseButton
|
|
7452
|
+
}) => {
|
|
7453
|
+
const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
|
|
7454
|
+
return /* @__PURE__ */ jsxs16(Header, { children: [
|
|
7455
|
+
/* @__PURE__ */ jsx193(TitleWrapper, { children: title }),
|
|
7456
|
+
hideCloseButton ? null : /* @__PURE__ */ jsx193(ModalCloseButton, {})
|
|
7457
|
+
] });
|
|
7458
|
+
};
|
|
7459
|
+
|
|
7460
|
+
// src/private/components/Backdrop/Backdrop.tsx
|
|
7461
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
7462
|
+
import styled30 from "styled-components";
|
|
7463
|
+
import { jsx as jsx194 } from "react/jsx-runtime";
|
|
7464
|
+
var backdropAnimationDuration = 150;
|
|
7465
|
+
var alignVerticalMap = {
|
|
7466
|
+
stretch: "normal",
|
|
7467
|
+
top: "start",
|
|
7468
|
+
center: "center",
|
|
7469
|
+
bottom: "end"
|
|
7470
|
+
};
|
|
7471
|
+
var alignHorizontalMap = {
|
|
7472
|
+
left: "start",
|
|
7473
|
+
center: "center",
|
|
7474
|
+
right: "end"
|
|
7475
|
+
};
|
|
7476
|
+
var BackdropComponent = styled30.div`
|
|
7477
|
+
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
7478
|
+
animation-name: backdropShow;
|
|
7479
|
+
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
7480
|
+
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
7481
|
+
background: var(--wui-color-backdrop);
|
|
7482
|
+
display: flex;
|
|
7483
|
+
inset: 0;
|
|
7484
|
+
justify-content: ${({ $alignHorizontal }) => alignHorizontalMap[$alignHorizontal]};
|
|
7485
|
+
overflow-y: auto;
|
|
7486
|
+
position: fixed;
|
|
7487
|
+
z-index: var(--wui-zindex-backdrop);
|
|
7488
|
+
|
|
7489
|
+
@keyframes backdropShow {
|
|
7490
|
+
from {
|
|
7491
|
+
opacity: 0;
|
|
7492
|
+
}
|
|
7493
|
+
|
|
7494
|
+
to {
|
|
7495
|
+
opacity: 1;
|
|
7496
|
+
}
|
|
7497
|
+
}
|
|
7498
|
+
`;
|
|
7499
|
+
var Backdrop = forwardRef12(
|
|
7500
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ jsx194(
|
|
7501
|
+
BackdropComponent,
|
|
7502
|
+
{
|
|
7503
|
+
ref,
|
|
7504
|
+
$alignHorizontal: alignHorizontal,
|
|
7505
|
+
$alignVertical: alignVertical,
|
|
7506
|
+
...otherProps,
|
|
7507
|
+
children
|
|
7508
|
+
}
|
|
7509
|
+
)
|
|
7510
|
+
);
|
|
7511
|
+
Backdrop.displayName = "Backdrop";
|
|
7512
|
+
|
|
7513
|
+
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
7514
|
+
import { useRef as useRef5, useEffect as useEffect2 } from "react";
|
|
7515
|
+
import { isNotNil as isNotNil11 } from "@wistia/type-guards";
|
|
7516
|
+
var useFocusRestore = () => {
|
|
7517
|
+
const previouslyFocusedRef = useRef5(null);
|
|
7518
|
+
useEffect2(() => {
|
|
7519
|
+
previouslyFocusedRef.current = document.activeElement;
|
|
7520
|
+
}, []);
|
|
7521
|
+
useEffect2(() => {
|
|
7522
|
+
return () => {
|
|
7523
|
+
if (isNotNil11(previouslyFocusedRef.current)) {
|
|
7524
|
+
setTimeout(() => {
|
|
7525
|
+
previouslyFocusedRef.current?.focus();
|
|
7526
|
+
}, 0);
|
|
7527
|
+
}
|
|
7528
|
+
};
|
|
7529
|
+
}, []);
|
|
7530
|
+
};
|
|
7531
|
+
|
|
7532
|
+
// src/components/Modal/Modal.tsx
|
|
7533
|
+
import { jsx as jsx195, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7534
|
+
var StyledModalContent = styled31(DialogContent)`
|
|
7535
|
+
background-color: var(--wui-color-bg-app);
|
|
7536
|
+
box-sizing: border-box;
|
|
7537
|
+
display: flex;
|
|
7538
|
+
flex-direction: column;
|
|
7539
|
+
height: 100vh;
|
|
7540
|
+
left: 0;
|
|
7541
|
+
overflow: auto;
|
|
7542
|
+
padding: var(--wui-space-05);
|
|
7543
|
+
position: fixed;
|
|
7544
|
+
top: 0;
|
|
7545
|
+
width: 100vw;
|
|
7546
|
+
z-index: var(--wui-zindex-modal);
|
|
7547
|
+
|
|
7548
|
+
${mq.smAndUp} {
|
|
7549
|
+
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
7550
|
+
border-radius: var(--wui-border-radius-03);
|
|
7551
|
+
left: 50%;
|
|
7552
|
+
margin: var(--wui-space-02);
|
|
7553
|
+
height: ${({ $fullHeight }) => $fullHeight ? "min-content" : "auto"};
|
|
7554
|
+
max-height: 90vh;
|
|
7555
|
+
${({ $fullHeight }) => $fullHeight ? "min-height: calc(100vh - 48px);" : ""}
|
|
7556
|
+
max-width: 90vw;
|
|
7557
|
+
top: 50%;
|
|
7558
|
+
transform: translate(-50%, -50%);
|
|
7559
|
+
min-width: ${({ $width }) => $width ?? "80vw"};
|
|
7560
|
+
}
|
|
7561
|
+
|
|
7562
|
+
@keyframes contentShow {
|
|
7563
|
+
from {
|
|
7564
|
+
opacity: 0;
|
|
7565
|
+
transform: translate(-50%, -48%) scale(0.96);
|
|
7566
|
+
}
|
|
7567
|
+
|
|
7568
|
+
to {
|
|
7569
|
+
opacity: 1;
|
|
7570
|
+
transform: translate(-50%, -50%) scale(1);
|
|
7571
|
+
}
|
|
7572
|
+
}
|
|
7573
|
+
`;
|
|
7574
|
+
var ModalContent = forwardRef13(
|
|
7575
|
+
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
7576
|
+
useFocusRestore();
|
|
7577
|
+
return /* @__PURE__ */ jsx195(
|
|
7578
|
+
StyledModalContent,
|
|
7579
|
+
{
|
|
7580
|
+
ref,
|
|
7581
|
+
$fullHeight: fullHeight,
|
|
7582
|
+
$width: width,
|
|
7583
|
+
...otherProps,
|
|
7584
|
+
children
|
|
7585
|
+
}
|
|
7586
|
+
);
|
|
7587
|
+
}
|
|
7588
|
+
);
|
|
7589
|
+
ModalContent.displayName = "ModalContent";
|
|
7590
|
+
var ModalBody = styled31.div`
|
|
7591
|
+
flex-direction: column;
|
|
7592
|
+
display: flex;
|
|
7593
|
+
order: 2;
|
|
7594
|
+
`;
|
|
7595
|
+
var Modal = forwardRef13(
|
|
7596
|
+
({
|
|
7597
|
+
children,
|
|
7598
|
+
fullHeight = false,
|
|
7599
|
+
hideCloseButton = false,
|
|
7600
|
+
hideTitle = false,
|
|
7601
|
+
initialFocusRef,
|
|
7602
|
+
isOpen,
|
|
7603
|
+
onRequestClose,
|
|
7604
|
+
title,
|
|
7605
|
+
width,
|
|
7606
|
+
...props
|
|
7607
|
+
}, ref) => {
|
|
7608
|
+
return /* @__PURE__ */ jsx195(
|
|
7609
|
+
DialogRoot,
|
|
7610
|
+
{
|
|
7611
|
+
onOpenChange: (open2) => {
|
|
7612
|
+
if (!open2 && isNotNil12(onRequestClose)) {
|
|
7613
|
+
onRequestClose();
|
|
7614
|
+
}
|
|
7615
|
+
},
|
|
7616
|
+
open: isOpen,
|
|
7617
|
+
children: /* @__PURE__ */ jsxs17(DialogPortal, { children: [
|
|
7618
|
+
/* @__PURE__ */ jsx195(Backdrop, {}),
|
|
7619
|
+
/* @__PURE__ */ jsxs17(
|
|
7620
|
+
ModalContent,
|
|
7621
|
+
{
|
|
7622
|
+
ref,
|
|
7623
|
+
"aria-describedby": void 0,
|
|
7624
|
+
fullHeight,
|
|
7625
|
+
onOpenAutoFocus: (event) => {
|
|
7626
|
+
if (isNotNil12(initialFocusRef) && initialFocusRef.current) {
|
|
7627
|
+
event.preventDefault();
|
|
7628
|
+
requestAnimationFrame(() => {
|
|
7629
|
+
initialFocusRef.current?.focus();
|
|
7630
|
+
});
|
|
7631
|
+
}
|
|
7632
|
+
},
|
|
7633
|
+
width,
|
|
7634
|
+
...props,
|
|
7635
|
+
children: [
|
|
7636
|
+
/* @__PURE__ */ jsx195(ModalBody, { children }),
|
|
7637
|
+
/* @__PURE__ */ jsx195(
|
|
7638
|
+
ModalHeader,
|
|
7639
|
+
{
|
|
7640
|
+
hideCloseButton,
|
|
7641
|
+
hideTitle,
|
|
7642
|
+
title
|
|
7643
|
+
}
|
|
7644
|
+
)
|
|
7645
|
+
]
|
|
7646
|
+
}
|
|
7647
|
+
)
|
|
7648
|
+
] })
|
|
7649
|
+
}
|
|
7650
|
+
);
|
|
7651
|
+
}
|
|
7652
|
+
);
|
|
7653
|
+
Modal.displayName = "Modal";
|
|
7654
|
+
|
|
7370
7655
|
// src/components/Radio/Radio.tsx
|
|
7371
|
-
import { forwardRef as
|
|
7372
|
-
import
|
|
7656
|
+
import { forwardRef as forwardRef14, useId as useId3 } from "react";
|
|
7657
|
+
import styled32, { css as css18 } from "styled-components";
|
|
7373
7658
|
import { isNonEmptyString as isNonEmptyString3 } from "@wistia/type-guards";
|
|
7374
|
-
import { jsx as
|
|
7375
|
-
var StyledLabelWrapper2 =
|
|
7659
|
+
import { jsx as jsx196, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7660
|
+
var StyledLabelWrapper2 = styled32.div`
|
|
7376
7661
|
display: flex;
|
|
7377
7662
|
flex-direction: column;
|
|
7378
7663
|
padding-left: var(--wui-space-02);
|
|
7379
7664
|
`;
|
|
7380
|
-
var StyledRadio =
|
|
7665
|
+
var StyledRadio = styled32.input`
|
|
7381
7666
|
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
7382
7667
|
appearance: none;
|
|
7383
7668
|
margin: 0;
|
|
@@ -7419,7 +7704,7 @@ var defaultHoverStyle = css18`
|
|
|
7419
7704
|
/* TODO Lamp to design hover state */
|
|
7420
7705
|
cursor: pointer;
|
|
7421
7706
|
`;
|
|
7422
|
-
var StyledRadioWrapper =
|
|
7707
|
+
var StyledRadioWrapper = styled32.div`
|
|
7423
7708
|
align-items: baseline;
|
|
7424
7709
|
border: 1px solid transparent;
|
|
7425
7710
|
border-radius: 4px;
|
|
@@ -7442,7 +7727,7 @@ var StyledRadioWrapper = styled27.div`
|
|
|
7442
7727
|
|
|
7443
7728
|
${({ disabled }) => disabled && disabledStyle2};
|
|
7444
7729
|
`;
|
|
7445
|
-
var Radio =
|
|
7730
|
+
var Radio = forwardRef14(
|
|
7446
7731
|
({
|
|
7447
7732
|
checked,
|
|
7448
7733
|
disabled = false,
|
|
@@ -7457,13 +7742,13 @@ var Radio = forwardRef12(
|
|
|
7457
7742
|
}, ref) => {
|
|
7458
7743
|
const generatedId = useId3();
|
|
7459
7744
|
const computedId = isNonEmptyString3(id) ? id : `ui-radio-${generatedId}`;
|
|
7460
|
-
return /* @__PURE__ */
|
|
7745
|
+
return /* @__PURE__ */ jsxs18(
|
|
7461
7746
|
StyledRadioWrapper,
|
|
7462
7747
|
{
|
|
7463
7748
|
"aria-invalid": otherProps["aria-invalid"],
|
|
7464
7749
|
disabled,
|
|
7465
7750
|
children: [
|
|
7466
|
-
/* @__PURE__ */
|
|
7751
|
+
/* @__PURE__ */ jsx196(
|
|
7467
7752
|
StyledRadio,
|
|
7468
7753
|
{
|
|
7469
7754
|
ref,
|
|
@@ -7478,8 +7763,8 @@ var Radio = forwardRef12(
|
|
|
7478
7763
|
...otherProps
|
|
7479
7764
|
}
|
|
7480
7765
|
),
|
|
7481
|
-
/* @__PURE__ */
|
|
7482
|
-
/* @__PURE__ */
|
|
7766
|
+
/* @__PURE__ */ jsxs18(StyledLabelWrapper2, { children: [
|
|
7767
|
+
/* @__PURE__ */ jsx196(
|
|
7483
7768
|
Label,
|
|
7484
7769
|
{
|
|
7485
7770
|
disabled,
|
|
@@ -7488,7 +7773,7 @@ var Radio = forwardRef12(
|
|
|
7488
7773
|
children: label
|
|
7489
7774
|
}
|
|
7490
7775
|
),
|
|
7491
|
-
/* @__PURE__ */
|
|
7776
|
+
/* @__PURE__ */ jsx196(LabelDescription, { children: description })
|
|
7492
7777
|
] })
|
|
7493
7778
|
]
|
|
7494
7779
|
}
|
|
@@ -7497,34 +7782,12 @@ var Radio = forwardRef12(
|
|
|
7497
7782
|
);
|
|
7498
7783
|
Radio.displayName = "Radio";
|
|
7499
7784
|
|
|
7500
|
-
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7501
|
-
import styled28 from "styled-components";
|
|
7502
|
-
import { isNotNil as isNotNil10 } from "@wistia/type-guards";
|
|
7503
|
-
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
7504
|
-
var VisuallyHidden = styled28.div({ ...visuallyHiddenStyle });
|
|
7505
|
-
var VisuallyHiddenButFocusable = styled28.div({
|
|
7506
|
-
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7507
|
-
});
|
|
7508
|
-
var ScreenReaderOnly = ({
|
|
7509
|
-
text,
|
|
7510
|
-
children,
|
|
7511
|
-
focusable = false,
|
|
7512
|
-
...otherProps
|
|
7513
|
-
}) => {
|
|
7514
|
-
const accessibleText = isNotNil10(text) ? text : children;
|
|
7515
|
-
if (focusable) {
|
|
7516
|
-
return /* @__PURE__ */ jsx192(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7517
|
-
}
|
|
7518
|
-
return /* @__PURE__ */ jsx192(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7519
|
-
};
|
|
7520
|
-
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7521
|
-
|
|
7522
7785
|
// src/components/Tag/Tag.tsx
|
|
7523
|
-
import { forwardRef as
|
|
7524
|
-
import
|
|
7525
|
-
import { isNil as isNil10, isNotNil as
|
|
7526
|
-
import { Fragment as Fragment2, jsx as
|
|
7527
|
-
var TagLabel =
|
|
7786
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
7787
|
+
import styled33 from "styled-components";
|
|
7788
|
+
import { isNil as isNil10, isNotNil as isNotNil13, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
7789
|
+
import { Fragment as Fragment2, jsx as jsx197, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7790
|
+
var TagLabel = styled33.a`
|
|
7528
7791
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7529
7792
|
font-size: var(--wui-typography-label-4-size);
|
|
7530
7793
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -7552,14 +7815,14 @@ var TagLabel = styled29.a`
|
|
|
7552
7815
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
7553
7816
|
}
|
|
7554
7817
|
`;
|
|
7555
|
-
var TagDivider =
|
|
7818
|
+
var TagDivider = styled33.div`
|
|
7556
7819
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7557
7820
|
border-left: 1px solid var(--wui-color-border);
|
|
7558
7821
|
display: flex;
|
|
7559
7822
|
height: 14px;
|
|
7560
7823
|
width: 1px;
|
|
7561
7824
|
`;
|
|
7562
|
-
var StyledRemoveButton =
|
|
7825
|
+
var StyledRemoveButton = styled33.button`
|
|
7563
7826
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7564
7827
|
all: unset;
|
|
7565
7828
|
cursor: pointer;
|
|
@@ -7587,7 +7850,7 @@ var StyledRemoveButton = styled29.button`
|
|
|
7587
7850
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
7588
7851
|
}
|
|
7589
7852
|
`;
|
|
7590
|
-
var StyledTag =
|
|
7853
|
+
var StyledTag = styled33.div`
|
|
7591
7854
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7592
7855
|
align-items: center;
|
|
7593
7856
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -7604,39 +7867,39 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
7604
7867
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
7605
7868
|
);
|
|
7606
7869
|
}
|
|
7607
|
-
return /* @__PURE__ */
|
|
7608
|
-
/* @__PURE__ */
|
|
7609
|
-
/* @__PURE__ */
|
|
7870
|
+
return /* @__PURE__ */ jsxs19(Fragment2, { children: [
|
|
7871
|
+
/* @__PURE__ */ jsx197(TagDivider, { $colorScheme: colorScheme }),
|
|
7872
|
+
/* @__PURE__ */ jsxs19(
|
|
7610
7873
|
StyledRemoveButton,
|
|
7611
7874
|
{
|
|
7612
7875
|
$colorScheme: colorScheme,
|
|
7613
7876
|
onClick: onClickRemove,
|
|
7614
7877
|
type: "button",
|
|
7615
7878
|
children: [
|
|
7616
|
-
/* @__PURE__ */
|
|
7879
|
+
/* @__PURE__ */ jsx197(
|
|
7617
7880
|
Icon,
|
|
7618
7881
|
{
|
|
7619
7882
|
size: "sm",
|
|
7620
7883
|
type: "close"
|
|
7621
7884
|
}
|
|
7622
7885
|
),
|
|
7623
|
-
/* @__PURE__ */
|
|
7886
|
+
/* @__PURE__ */ jsx197(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
7624
7887
|
]
|
|
7625
7888
|
}
|
|
7626
7889
|
)
|
|
7627
7890
|
] });
|
|
7628
7891
|
};
|
|
7629
|
-
var Tag =
|
|
7892
|
+
var Tag = forwardRef15(
|
|
7630
7893
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
7631
|
-
const labelProps =
|
|
7632
|
-
return /* @__PURE__ */
|
|
7894
|
+
const labelProps = isNotNil13(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
|
|
7895
|
+
return /* @__PURE__ */ jsxs19(
|
|
7633
7896
|
StyledTag,
|
|
7634
7897
|
{
|
|
7635
7898
|
ref,
|
|
7636
7899
|
$colorScheme: colorScheme,
|
|
7637
7900
|
...otherProps,
|
|
7638
7901
|
children: [
|
|
7639
|
-
/* @__PURE__ */
|
|
7902
|
+
/* @__PURE__ */ jsx197(
|
|
7640
7903
|
TagLabel,
|
|
7641
7904
|
{
|
|
7642
7905
|
...labelProps,
|
|
@@ -7644,7 +7907,7 @@ var Tag = forwardRef13(
|
|
|
7644
7907
|
children: label
|
|
7645
7908
|
}
|
|
7646
7909
|
),
|
|
7647
|
-
/* @__PURE__ */
|
|
7910
|
+
/* @__PURE__ */ jsx197(
|
|
7648
7911
|
RemoveButton,
|
|
7649
7912
|
{
|
|
7650
7913
|
colorScheme,
|
|
@@ -7667,8 +7930,8 @@ import {
|
|
|
7667
7930
|
Portal,
|
|
7668
7931
|
Arrow
|
|
7669
7932
|
} from "@radix-ui/react-tooltip";
|
|
7670
|
-
import
|
|
7671
|
-
import { jsx as
|
|
7933
|
+
import styled34, { css as css19 } from "styled-components";
|
|
7934
|
+
import { jsx as jsx198, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
7672
7935
|
var CompactTooltipStyles = css19`
|
|
7673
7936
|
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
7674
7937
|
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
@@ -7676,7 +7939,7 @@ var CompactTooltipStyles = css19`
|
|
|
7676
7939
|
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
7677
7940
|
--tooltip-vertical-padding: var(--wui-space-03);
|
|
7678
7941
|
`;
|
|
7679
|
-
var StyledContent =
|
|
7942
|
+
var StyledContent = styled34(Content)`
|
|
7680
7943
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
7681
7944
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
7682
7945
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -7734,14 +7997,14 @@ var Tooltip = ({
|
|
|
7734
7997
|
if (forceOpen === true) {
|
|
7735
7998
|
rootProps.open = true;
|
|
7736
7999
|
}
|
|
7737
|
-
return /* @__PURE__ */
|
|
8000
|
+
return /* @__PURE__ */ jsxs20(
|
|
7738
8001
|
Root,
|
|
7739
8002
|
{
|
|
7740
8003
|
delayDuration: delay,
|
|
7741
8004
|
...rootProps,
|
|
7742
8005
|
children: [
|
|
7743
|
-
/* @__PURE__ */
|
|
7744
|
-
/* @__PURE__ */
|
|
8006
|
+
/* @__PURE__ */ jsx198(Trigger, { asChild: true, children }),
|
|
8007
|
+
/* @__PURE__ */ jsx198(Portal, { children: /* @__PURE__ */ jsxs20(
|
|
7745
8008
|
StyledContent,
|
|
7746
8009
|
{
|
|
7747
8010
|
$compact: compact,
|
|
@@ -7749,7 +8012,7 @@ var Tooltip = ({
|
|
|
7749
8012
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
7750
8013
|
children: [
|
|
7751
8014
|
content,
|
|
7752
|
-
!hideArrow ? /* @__PURE__ */
|
|
8015
|
+
!hideArrow ? /* @__PURE__ */ jsx198(Arrow, { asChild: true, children: /* @__PURE__ */ jsx198(
|
|
7753
8016
|
"svg",
|
|
7754
8017
|
{
|
|
7755
8018
|
fill: "var(--tooltip-bg)",
|
|
@@ -7758,7 +8021,7 @@ var Tooltip = ({
|
|
|
7758
8021
|
viewBox: "0 0 12 8",
|
|
7759
8022
|
width: "12",
|
|
7760
8023
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7761
|
-
children: /* @__PURE__ */
|
|
8024
|
+
children: /* @__PURE__ */ jsx198("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" })
|
|
7762
8025
|
}
|
|
7763
8026
|
) }) : null
|
|
7764
8027
|
]
|
|
@@ -7771,26 +8034,26 @@ var Tooltip = ({
|
|
|
7771
8034
|
Tooltip.displayName = "Tooltip";
|
|
7772
8035
|
|
|
7773
8036
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
7774
|
-
import
|
|
7775
|
-
import { isNotNil as
|
|
7776
|
-
import { jsx as
|
|
8037
|
+
import styled35 from "styled-components";
|
|
8038
|
+
import { isNotNil as isNotNil14 } from "@wistia/type-guards";
|
|
8039
|
+
import { jsx as jsx199, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
7777
8040
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
7778
8041
|
if (iconOnly) {
|
|
7779
|
-
return /* @__PURE__ */
|
|
8042
|
+
return /* @__PURE__ */ jsx199(
|
|
7780
8043
|
"g",
|
|
7781
8044
|
{
|
|
7782
8045
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
7783
8046
|
fill: brandmarkColor,
|
|
7784
|
-
children: /* @__PURE__ */
|
|
8047
|
+
children: /* @__PURE__ */ jsx199("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" })
|
|
7785
8048
|
}
|
|
7786
8049
|
);
|
|
7787
8050
|
}
|
|
7788
|
-
return /* @__PURE__ */
|
|
8051
|
+
return /* @__PURE__ */ jsx199(
|
|
7789
8052
|
"g",
|
|
7790
8053
|
{
|
|
7791
8054
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
7792
8055
|
fill: brandmarkColor,
|
|
7793
|
-
children: /* @__PURE__ */
|
|
8056
|
+
children: /* @__PURE__ */ jsx199("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" })
|
|
7794
8057
|
}
|
|
7795
8058
|
);
|
|
7796
8059
|
};
|
|
@@ -7798,12 +8061,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
7798
8061
|
if (iconOnly) {
|
|
7799
8062
|
return null;
|
|
7800
8063
|
}
|
|
7801
|
-
return /* @__PURE__ */
|
|
8064
|
+
return /* @__PURE__ */ jsx199(
|
|
7802
8065
|
"g",
|
|
7803
8066
|
{
|
|
7804
8067
|
"data-testid": "ui-wistia-logo-logotype",
|
|
7805
8068
|
fill: logotypeColor,
|
|
7806
|
-
children: /* @__PURE__ */
|
|
8069
|
+
children: /* @__PURE__ */ jsx199("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" })
|
|
7807
8070
|
}
|
|
7808
8071
|
);
|
|
7809
8072
|
};
|
|
@@ -7813,7 +8076,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
7813
8076
|
}
|
|
7814
8077
|
return "0 0 144 31.47";
|
|
7815
8078
|
};
|
|
7816
|
-
var WistiaLogoComponent =
|
|
8079
|
+
var WistiaLogoComponent = styled35.svg`
|
|
7817
8080
|
height: ${({ height }) => `${height}px`};
|
|
7818
8081
|
|
|
7819
8082
|
/* ensure it will always fit on mobile */
|
|
@@ -7855,7 +8118,7 @@ var WistiaLogo = ({
|
|
|
7855
8118
|
};
|
|
7856
8119
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
7857
8120
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
7858
|
-
const Logo = /* @__PURE__ */
|
|
8121
|
+
const Logo = /* @__PURE__ */ jsxs21(
|
|
7859
8122
|
WistiaLogoComponent,
|
|
7860
8123
|
{
|
|
7861
8124
|
$hoverColor: hoverColor,
|
|
@@ -7865,22 +8128,22 @@ var WistiaLogo = ({
|
|
|
7865
8128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7866
8129
|
...otherProps,
|
|
7867
8130
|
children: [
|
|
7868
|
-
/* @__PURE__ */
|
|
7869
|
-
|
|
8131
|
+
/* @__PURE__ */ jsx199("title", { children: title }),
|
|
8132
|
+
isNotNil14(description) ? /* @__PURE__ */ jsx199("desc", { children: description }) : null,
|
|
7870
8133
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
7871
8134
|
renderLogotype(logotypeColor, iconOnly)
|
|
7872
8135
|
]
|
|
7873
8136
|
}
|
|
7874
8137
|
);
|
|
7875
|
-
return href !== void 0 ? /* @__PURE__ */
|
|
8138
|
+
return href !== void 0 ? /* @__PURE__ */ jsx199("a", { href, children: Logo }) : Logo;
|
|
7876
8139
|
};
|
|
7877
8140
|
WistiaLogo.displayName = "WistiaLogo";
|
|
7878
8141
|
|
|
7879
8142
|
// src/components/Input/Input.tsx
|
|
7880
|
-
import { forwardRef as
|
|
7881
|
-
import
|
|
7882
|
-
import { isNil as isNil11, isNotNil as
|
|
7883
|
-
import { jsx as
|
|
8143
|
+
import { forwardRef as forwardRef16, cloneElement as cloneElement5 } from "react";
|
|
8144
|
+
import styled36, { css as css20 } from "styled-components";
|
|
8145
|
+
import { isNil as isNil11, isNotNil as isNotNil15 } from "@wistia/type-guards";
|
|
8146
|
+
import { jsx as jsx200, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
7884
8147
|
var inputStyles = css20`
|
|
7885
8148
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7886
8149
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -7922,7 +8185,7 @@ var inputStyles = css20`
|
|
|
7922
8185
|
}
|
|
7923
8186
|
}
|
|
7924
8187
|
`;
|
|
7925
|
-
var StyledInputContainer =
|
|
8188
|
+
var StyledInputContainer = styled36.div`
|
|
7926
8189
|
display: inline-flex;
|
|
7927
8190
|
position: relative;
|
|
7928
8191
|
${inputStyles};
|
|
@@ -7966,7 +8229,7 @@ var StyledInputContainer = styled32.div`
|
|
|
7966
8229
|
padding-right: 32px;
|
|
7967
8230
|
}
|
|
7968
8231
|
`;
|
|
7969
|
-
var Input =
|
|
8232
|
+
var Input = forwardRef16(
|
|
7970
8233
|
({
|
|
7971
8234
|
fullWidth = false,
|
|
7972
8235
|
monospace = false,
|
|
@@ -7977,35 +8240,35 @@ var Input = forwardRef14(
|
|
|
7977
8240
|
}, ref) => {
|
|
7978
8241
|
let leftIconToDisplay = leftIcon;
|
|
7979
8242
|
if (isNil11(leftIcon) && type === "search") {
|
|
7980
|
-
leftIconToDisplay = /* @__PURE__ */
|
|
8243
|
+
leftIconToDisplay = /* @__PURE__ */ jsx200(Icon, { type: "search" });
|
|
7981
8244
|
}
|
|
7982
|
-
if (
|
|
8245
|
+
if (isNotNil15(leftIconToDisplay)) {
|
|
7983
8246
|
leftIconToDisplay = cloneElement5(leftIconToDisplay, {
|
|
7984
8247
|
size: "md",
|
|
7985
8248
|
className: "wui-input-left-icon"
|
|
7986
8249
|
});
|
|
7987
8250
|
}
|
|
7988
8251
|
let rightIconToDisplay = rightIcon;
|
|
7989
|
-
if (
|
|
8252
|
+
if (isNotNil15(rightIconToDisplay)) {
|
|
7990
8253
|
rightIconToDisplay = cloneElement5(rightIconToDisplay, {
|
|
7991
8254
|
size: "md",
|
|
7992
8255
|
className: "wui-input-right-icon"
|
|
7993
8256
|
});
|
|
7994
8257
|
}
|
|
7995
|
-
return /* @__PURE__ */
|
|
8258
|
+
return /* @__PURE__ */ jsxs22(
|
|
7996
8259
|
StyledInputContainer,
|
|
7997
8260
|
{
|
|
7998
8261
|
$fullWidth: fullWidth,
|
|
7999
8262
|
$monospace: monospace,
|
|
8000
8263
|
children: [
|
|
8001
8264
|
leftIconToDisplay ?? null,
|
|
8002
|
-
type === "multiline" ? /* @__PURE__ */
|
|
8265
|
+
type === "multiline" ? /* @__PURE__ */ jsx200(
|
|
8003
8266
|
"textarea",
|
|
8004
8267
|
{
|
|
8005
8268
|
...props,
|
|
8006
8269
|
ref
|
|
8007
8270
|
}
|
|
8008
|
-
) : /* @__PURE__ */
|
|
8271
|
+
) : /* @__PURE__ */ jsx200(
|
|
8009
8272
|
"input",
|
|
8010
8273
|
{
|
|
8011
8274
|
...props,
|
|
@@ -8048,6 +8311,7 @@ export {
|
|
|
8048
8311
|
MenuItemLabel,
|
|
8049
8312
|
MenuLabel,
|
|
8050
8313
|
MenuRadioGroup,
|
|
8314
|
+
Modal,
|
|
8051
8315
|
Radio,
|
|
8052
8316
|
RadioGroup,
|
|
8053
8317
|
RadioMenuItem,
|