@wistia/ui 0.2.0 → 0.3.0
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 +160 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.mjs +156 -83
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.
|
|
3
|
+
* @license @wistia/ui v0.3.0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -5881,9 +5881,11 @@ var propsForFlexChildren = /* @__PURE__ */ new Set(["alignSelf", "basis", "grow"
|
|
|
5881
5881
|
var getGapStyle = (gap) => {
|
|
5882
5882
|
if (isNotNil6(gap)) {
|
|
5883
5883
|
if (isRecord2(gap)) {
|
|
5884
|
-
return Object.entries(gap).map(([key, value]) =>
|
|
5884
|
+
return Object.entries(gap).map(([key, value]) => {
|
|
5885
|
+
return `${key}-gap: var(--wui-${value})};`;
|
|
5886
|
+
}).join("");
|
|
5885
5887
|
}
|
|
5886
|
-
return `gap:
|
|
5888
|
+
return `gap: var(--wui-${gap.toString()})};`;
|
|
5887
5889
|
}
|
|
5888
5890
|
return void 0;
|
|
5889
5891
|
};
|
|
@@ -7215,10 +7217,10 @@ var close = keyframes`
|
|
|
7215
7217
|
`;
|
|
7216
7218
|
var menuContentCss = css20`
|
|
7217
7219
|
--menu-font-family: var(--wui-typography-family-default);
|
|
7218
|
-
--menu-bg: var(--wui-color-bg-
|
|
7220
|
+
--menu-bg: var(--wui-color-bg-surface);
|
|
7219
7221
|
--menu-shadow: 0 0 64px 0 rgba(0 0 0 / 8%); /* TODO - Need a box-shadow token */
|
|
7220
|
-
--menu-border-radius: var(--wui-border-radius-
|
|
7221
|
-
--menu-padding: var(--wui-space-
|
|
7222
|
+
--menu-border-radius: var(--wui-border-radius-02);
|
|
7223
|
+
--menu-padding: var(--wui-space-02);
|
|
7222
7224
|
--menu-min-width: 120px;
|
|
7223
7225
|
--menu-max-width: 284px;
|
|
7224
7226
|
|
|
@@ -7234,6 +7236,7 @@ var menuContentCss = css20`
|
|
|
7234
7236
|
padding: var(--menu-padding);
|
|
7235
7237
|
transform-origin: var(--radix-dropdown-menu-content-transform-origin);
|
|
7236
7238
|
z-index: var(--wui-zindex-menu);
|
|
7239
|
+
border: 1px solid var(--wui-color-border);
|
|
7237
7240
|
|
|
7238
7241
|
&[data-state='closed'] {
|
|
7239
7242
|
animation: ${close}; /* TODO - need easing tokens */
|
|
@@ -7251,12 +7254,35 @@ var menuContentCss = css20`
|
|
|
7251
7254
|
margin: var(--wui-space-02) 0;
|
|
7252
7255
|
}
|
|
7253
7256
|
`;
|
|
7257
|
+
var menuItemCss = css20`
|
|
7258
|
+
--menu-label-description-gap: var(--wui-space-01);
|
|
7259
|
+
--menu-item-inner-gap: var(--wui-space-03);
|
|
7260
|
+
--menu-item-left-icon-size: 24px;
|
|
7261
|
+
--menu-item-right-icon-size: 16px;
|
|
7262
|
+
--menu-item-padding: var(--wui-space-02);
|
|
7263
|
+
--menu-label-font-size: var(--wui-typography-label-3-size);
|
|
7264
|
+
--menu-label-font-weight: var(--wui-typography-label-3-weight);
|
|
7265
|
+
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
7266
|
+
`;
|
|
7267
|
+
var compactMenuItemCss = css20`
|
|
7268
|
+
--menu-label-description-gap: 0;
|
|
7269
|
+
--menu-item-inner-gap: var(--wui-space-02);
|
|
7270
|
+
--menu-item-left-icon-size: 16px;
|
|
7271
|
+
--menu-item-right-icon-size: 12px;
|
|
7272
|
+
--menu-item-padding: 6px;
|
|
7273
|
+
--menu-label-font-size: var(--wui-typography-label-4-size);
|
|
7274
|
+
--menu-label-font-weight: var(--wui-typography-label-4-weight);
|
|
7275
|
+
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
7276
|
+
`;
|
|
7254
7277
|
var MenuContent = styled24(DropdownMenuContent)`
|
|
7255
7278
|
${menuContentCss}
|
|
7279
|
+
${({ $compact }) => $compact ? compactMenuItemCss : menuItemCss}
|
|
7256
7280
|
`;
|
|
7257
7281
|
var Menu = ({
|
|
7258
7282
|
align = "start",
|
|
7259
7283
|
children,
|
|
7284
|
+
disabled = false,
|
|
7285
|
+
compact = false,
|
|
7260
7286
|
trigger,
|
|
7261
7287
|
label,
|
|
7262
7288
|
isOpen,
|
|
@@ -7265,16 +7291,26 @@ var Menu = ({
|
|
|
7265
7291
|
onInteractOutside,
|
|
7266
7292
|
...props
|
|
7267
7293
|
}) => {
|
|
7294
|
+
let controlProps = {
|
|
7295
|
+
...isNotNil9(onOpenChange) && isNotNil9(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
7296
|
+
};
|
|
7297
|
+
if (disabled) {
|
|
7298
|
+
controlProps = {
|
|
7299
|
+
open: false,
|
|
7300
|
+
onOpenChange: () => null
|
|
7301
|
+
};
|
|
7302
|
+
}
|
|
7268
7303
|
return /* @__PURE__ */ jsxs13(
|
|
7269
7304
|
DropdownMenu,
|
|
7270
7305
|
{
|
|
7271
7306
|
modal: false,
|
|
7272
|
-
...
|
|
7307
|
+
...controlProps,
|
|
7273
7308
|
children: [
|
|
7274
7309
|
/* @__PURE__ */ jsx184(DropdownMenuTrigger, { asChild: true, children: isNotUndefined7(trigger) ? trigger : /* @__PURE__ */ jsx184(
|
|
7275
7310
|
Button,
|
|
7276
7311
|
{
|
|
7277
7312
|
"aria-expanded": isOpen,
|
|
7313
|
+
disabled,
|
|
7278
7314
|
forceState: isOpen ? "active" : void 0,
|
|
7279
7315
|
rightIcon: /* @__PURE__ */ jsx184(Icon, { type: "caret-down" }),
|
|
7280
7316
|
...triggerProps,
|
|
@@ -7285,11 +7321,12 @@ var Menu = ({
|
|
|
7285
7321
|
MenuContent,
|
|
7286
7322
|
{
|
|
7287
7323
|
...props,
|
|
7324
|
+
$compact: compact,
|
|
7288
7325
|
align,
|
|
7326
|
+
sideOffset: 6,
|
|
7289
7327
|
onFocusOutside: (event) => {
|
|
7290
7328
|
event.preventDefault();
|
|
7291
7329
|
},
|
|
7292
|
-
sideOffset: 6,
|
|
7293
7330
|
children
|
|
7294
7331
|
}
|
|
7295
7332
|
) })
|
|
@@ -7313,9 +7350,10 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
7313
7350
|
asChild: true,
|
|
7314
7351
|
...props,
|
|
7315
7352
|
children: /* @__PURE__ */ jsx185(
|
|
7316
|
-
|
|
7353
|
+
Heading,
|
|
7317
7354
|
{
|
|
7318
|
-
|
|
7355
|
+
renderAs: "span",
|
|
7356
|
+
variant: "heading6",
|
|
7319
7357
|
...props,
|
|
7320
7358
|
children
|
|
7321
7359
|
}
|
|
@@ -7336,6 +7374,7 @@ import {
|
|
|
7336
7374
|
DropdownMenuSubTrigger,
|
|
7337
7375
|
DropdownMenuItem
|
|
7338
7376
|
} from "@radix-ui/react-dropdown-menu";
|
|
7377
|
+
import { isNotNil as isNotNil11 } from "@wistia/type-guards";
|
|
7339
7378
|
|
|
7340
7379
|
// src/components/Menu/MenuItemButton.tsx
|
|
7341
7380
|
import { forwardRef as forwardRef12 } from "react";
|
|
@@ -7343,38 +7382,74 @@ import styled26 from "styled-components";
|
|
|
7343
7382
|
import { isNotNil as isNotNil10, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
7344
7383
|
import { jsx as jsx186, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7345
7384
|
var StyledButton3 = styled26(Button)`
|
|
7346
|
-
|
|
7347
|
-
--menu-item-gap: var(--wui-space-01);
|
|
7348
|
-
--menu-item-inner-gap: var(--wui-space-04);
|
|
7349
|
-
--menu-item-disabled-bg: var(--wui-color-white);
|
|
7385
|
+
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
7350
7386
|
|
|
7351
|
-
text-align: left;
|
|
7352
|
-
align-items: left;
|
|
7353
|
-
border-radius: var(--menu-item-border-radius);
|
|
7354
7387
|
display: flex;
|
|
7388
|
+
flex-direction: row;
|
|
7389
|
+
gap: var(--menu-item-inner-gap);
|
|
7390
|
+
padding: var(--menu-item-padding);
|
|
7391
|
+
border-radius: var(--wui-border-radius-01);
|
|
7392
|
+
text-align: left;
|
|
7393
|
+
color: var(--wui-color-text);
|
|
7394
|
+
font-size: var(--menu-label-font-size);
|
|
7395
|
+
font-weight: var(--menu-label-font-weight);
|
|
7396
|
+
line-height: var(--menu-label-line-height);
|
|
7397
|
+
|
|
7398
|
+
:active {
|
|
7399
|
+
background-color: var(--wui-color-bg-surface-active);
|
|
7400
|
+
}
|
|
7401
|
+
|
|
7402
|
+
&[data-highlighted] {
|
|
7403
|
+
outline: none;
|
|
7404
|
+
${({ $isGated }) => $isGated && getColorScheme("purple")};
|
|
7405
|
+
background-color: var(--wui-color-bg-surface-hover);
|
|
7406
|
+
}
|
|
7355
7407
|
|
|
7356
7408
|
&[aria-disabled='true'] {
|
|
7357
|
-
|
|
7409
|
+
--wui-color-text: var(--wui-color-text-disabled);
|
|
7410
|
+
--wui-color-text-secondary: var(--wui-color-text-disabled);
|
|
7411
|
+
--wui-color-icon: var(--wui-color-icon-disabled);
|
|
7412
|
+
|
|
7413
|
+
&[data-highlighted] {
|
|
7414
|
+
background-color: transparent;
|
|
7415
|
+
}
|
|
7358
7416
|
}
|
|
7359
7417
|
|
|
7360
|
-
|
|
7418
|
+
&[role='menuitemradio'] {
|
|
7419
|
+
padding-left: var(--wui-space-04);
|
|
7420
|
+
}
|
|
7361
7421
|
`;
|
|
7362
|
-
var
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7422
|
+
var StyledLeftIconContainer = styled26.div`
|
|
7423
|
+
height: var(--menu-item-left-icon-size);
|
|
7424
|
+
width: var(--menu-item-left-icon-size);
|
|
7425
|
+
|
|
7426
|
+
svg {
|
|
7427
|
+
height: var(--menu-item-left-icon-size);
|
|
7428
|
+
width: var(--menu-item-left-icon-size);
|
|
7429
|
+
}
|
|
7430
|
+
`;
|
|
7431
|
+
var StyledRightIconContainer = styled26.div`
|
|
7432
|
+
height: var(--menu-item-right-icon-size);
|
|
7433
|
+
width: var(--menu-item-right-icon-size);
|
|
7434
|
+
|
|
7435
|
+
svg {
|
|
7436
|
+
height: var(--menu-item-right-icon-size);
|
|
7437
|
+
width: var(--menu-item-right-icon-size);
|
|
7438
|
+
}
|
|
7439
|
+
`;
|
|
7440
|
+
var StyledLabelAndDescriptionContainer = styled26.div`
|
|
7441
|
+
display: flex;
|
|
7442
|
+
flex-direction: column;
|
|
7443
|
+
gap: var(--menu-label-description-gap);
|
|
7444
|
+
flex-basis: 100%;
|
|
7370
7445
|
`;
|
|
7371
7446
|
var StyledBadgeContainer = styled26.div`
|
|
7372
|
-
grid-area: badge;
|
|
7373
7447
|
align-self: start;
|
|
7374
7448
|
justify-self: end;
|
|
7375
|
-
|
|
7449
|
+
font-size: var(--wui-typography-label-4-size);
|
|
7450
|
+
color: var(--wui-color-text-secondary);
|
|
7376
7451
|
`;
|
|
7377
|
-
var MenuItemButton = forwardRef12(({ children, appearance, command, ...props }, ref) => {
|
|
7452
|
+
var MenuItemButton = forwardRef12(({ children, appearance, command, icon, ...props }, ref) => {
|
|
7378
7453
|
let { colorScheme, badge } = props;
|
|
7379
7454
|
if (appearance === "dangerous") {
|
|
7380
7455
|
if (isNotUndefined8(colorScheme)) {
|
|
@@ -7383,13 +7458,19 @@ var MenuItemButton = forwardRef12(({ children, appearance, command, ...props },
|
|
|
7383
7458
|
colorScheme = "error";
|
|
7384
7459
|
}
|
|
7385
7460
|
if (appearance === "gated") {
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7461
|
+
badge = /* @__PURE__ */ jsx186(
|
|
7462
|
+
Icon,
|
|
7463
|
+
{
|
|
7464
|
+
colorScheme: "purple",
|
|
7465
|
+
style: {
|
|
7466
|
+
height: "16px",
|
|
7467
|
+
width: "16px"
|
|
7468
|
+
},
|
|
7469
|
+
type: "sparkle"
|
|
7470
|
+
}
|
|
7471
|
+
);
|
|
7391
7472
|
}
|
|
7392
|
-
return /* @__PURE__ */
|
|
7473
|
+
return /* @__PURE__ */ jsxs14(
|
|
7393
7474
|
StyledButton3,
|
|
7394
7475
|
{
|
|
7395
7476
|
...props,
|
|
@@ -7397,11 +7478,13 @@ var MenuItemButton = forwardRef12(({ children, appearance, command, ...props },
|
|
|
7397
7478
|
$isGated: appearance === "gated",
|
|
7398
7479
|
colorScheme: colorScheme ?? "default",
|
|
7399
7480
|
fullWidth: true,
|
|
7400
|
-
|
|
7401
|
-
children:
|
|
7402
|
-
children,
|
|
7403
|
-
|
|
7404
|
-
|
|
7481
|
+
unstyled: true,
|
|
7482
|
+
children: [
|
|
7483
|
+
props.leftIcon ? /* @__PURE__ */ jsx186(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
7484
|
+
/* @__PURE__ */ jsx186(StyledLabelAndDescriptionContainer, { children }),
|
|
7485
|
+
isNotNil10(badge) || isNotNil10(command) ? /* @__PURE__ */ jsx186(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
7486
|
+
props.rightIcon ? /* @__PURE__ */ jsx186(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
7487
|
+
]
|
|
7405
7488
|
}
|
|
7406
7489
|
);
|
|
7407
7490
|
});
|
|
@@ -7410,16 +7493,11 @@ MenuItemButton.displayName = "MenuItemButton";
|
|
|
7410
7493
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
7411
7494
|
import styled27 from "styled-components";
|
|
7412
7495
|
import { jsx as jsx187 } from "react/jsx-runtime";
|
|
7413
|
-
var StyledMenuItemLabel = styled27
|
|
7414
|
-
grid-area: label;
|
|
7415
|
-
`;
|
|
7496
|
+
var StyledMenuItemLabel = styled27.span``;
|
|
7416
7497
|
var StyledMenuItemDescription = styled27(Text).attrs({
|
|
7417
|
-
variant: "
|
|
7498
|
+
variant: "body4",
|
|
7418
7499
|
prominence: "secondary"
|
|
7419
|
-
})
|
|
7420
|
-
margin-top: var(--menu-item-gap);
|
|
7421
|
-
grid-area: description;
|
|
7422
|
-
`;
|
|
7500
|
+
})``;
|
|
7423
7501
|
var MenuItemLabel = ({ children }) => {
|
|
7424
7502
|
return /* @__PURE__ */ jsx187(StyledMenuItemLabel, { children });
|
|
7425
7503
|
};
|
|
@@ -7445,7 +7523,7 @@ var StyledSubTrigger = styled28(DropdownMenuSubTrigger)`
|
|
|
7445
7523
|
|
|
7446
7524
|
&[data-state='open'],
|
|
7447
7525
|
&[data-highlighted] {
|
|
7448
|
-
background-color: var(--
|
|
7526
|
+
background-color: var(--wui-color-bg-surface-hover);
|
|
7449
7527
|
}
|
|
7450
7528
|
`;
|
|
7451
7529
|
var SubMenuTrigger = (props) => {
|
|
@@ -7471,7 +7549,7 @@ var SubMenu = ({
|
|
|
7471
7549
|
return isSmAndUp ? /* @__PURE__ */ jsxs15(DropdownMenuSub, { onOpenChange, children: [
|
|
7472
7550
|
/* @__PURE__ */ jsxs15(SubMenuTrigger, { ...props, children: [
|
|
7473
7551
|
/* @__PURE__ */ jsx188(MenuItemLabel, { children: label }),
|
|
7474
|
-
/* @__PURE__ */ jsx188(MenuItemDescription, { children: description })
|
|
7552
|
+
isNotNil11(description) ? /* @__PURE__ */ jsx188(MenuItemDescription, { children: description }) : null
|
|
7475
7553
|
] }),
|
|
7476
7554
|
/* @__PURE__ */ jsx188(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx188(SubMenuContent, { children }) })
|
|
7477
7555
|
] }) : /* @__PURE__ */ jsxs15(DropdownMenuGroup, { children: [
|
|
@@ -7555,6 +7633,7 @@ var RadioMenuItem = ({
|
|
|
7555
7633
|
DropdownMenuRadioItem,
|
|
7556
7634
|
{
|
|
7557
7635
|
...extraProps,
|
|
7636
|
+
asChild: true,
|
|
7558
7637
|
value,
|
|
7559
7638
|
children: /* @__PURE__ */ jsx191(
|
|
7560
7639
|
MenuItemButton,
|
|
@@ -7579,30 +7658,23 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7579
7658
|
{
|
|
7580
7659
|
...props,
|
|
7581
7660
|
fill: "none",
|
|
7582
|
-
height: "
|
|
7583
|
-
viewBox: "0 0
|
|
7584
|
-
width: "
|
|
7661
|
+
height: "24",
|
|
7662
|
+
viewBox: "0 0 24 24",
|
|
7663
|
+
width: "24",
|
|
7585
7664
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7586
7665
|
children: [
|
|
7587
7666
|
/* @__PURE__ */ jsx192(
|
|
7588
7667
|
"path",
|
|
7589
7668
|
{
|
|
7590
|
-
d: "
|
|
7591
|
-
fill: "#
|
|
7592
|
-
}
|
|
7593
|
-
),
|
|
7594
|
-
/* @__PURE__ */ jsx192(
|
|
7595
|
-
"path",
|
|
7596
|
-
{
|
|
7597
|
-
d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z",
|
|
7598
|
-
stroke: "#D9D9DE"
|
|
7669
|
+
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",
|
|
7670
|
+
fill: "#2949e5"
|
|
7599
7671
|
}
|
|
7600
7672
|
),
|
|
7601
7673
|
/* @__PURE__ */ jsx192(
|
|
7602
7674
|
"path",
|
|
7603
7675
|
{
|
|
7604
|
-
d: "
|
|
7605
|
-
fill: "
|
|
7676
|
+
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",
|
|
7677
|
+
fill: "#fff"
|
|
7606
7678
|
}
|
|
7607
7679
|
)
|
|
7608
7680
|
]
|
|
@@ -7612,23 +7684,23 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7612
7684
|
{
|
|
7613
7685
|
...props,
|
|
7614
7686
|
fill: "none",
|
|
7615
|
-
height: "
|
|
7616
|
-
viewBox: "0 0
|
|
7617
|
-
width: "
|
|
7687
|
+
height: "24",
|
|
7688
|
+
viewBox: "0 0 24 24",
|
|
7689
|
+
width: "24",
|
|
7618
7690
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7619
7691
|
children: [
|
|
7620
7692
|
/* @__PURE__ */ jsx192(
|
|
7621
7693
|
"path",
|
|
7622
7694
|
{
|
|
7623
|
-
d: "
|
|
7624
|
-
fill: "#
|
|
7695
|
+
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",
|
|
7696
|
+
fill: "#fcfcfd"
|
|
7625
7697
|
}
|
|
7626
7698
|
),
|
|
7627
7699
|
/* @__PURE__ */ jsx192(
|
|
7628
7700
|
"path",
|
|
7629
7701
|
{
|
|
7630
|
-
d: "
|
|
7631
|
-
stroke: "#
|
|
7702
|
+
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",
|
|
7703
|
+
stroke: "#bbbbc4"
|
|
7632
7704
|
}
|
|
7633
7705
|
)
|
|
7634
7706
|
]
|
|
@@ -7644,6 +7716,7 @@ var CheckboxMenuItem = ({
|
|
|
7644
7716
|
return /* @__PURE__ */ jsx192(
|
|
7645
7717
|
DropdownMenuCheckboxItem,
|
|
7646
7718
|
{
|
|
7719
|
+
asChild: true,
|
|
7647
7720
|
checked,
|
|
7648
7721
|
onCheckedChange,
|
|
7649
7722
|
onSelect,
|
|
@@ -7663,7 +7736,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
|
7663
7736
|
import { forwardRef as forwardRef16 } from "react";
|
|
7664
7737
|
import styled34 from "styled-components";
|
|
7665
7738
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
7666
|
-
import { isNotNil as
|
|
7739
|
+
import { isNotNil as isNotNil14 } from "@wistia/type-guards";
|
|
7667
7740
|
|
|
7668
7741
|
// src/components/Modal/ModalHeader.tsx
|
|
7669
7742
|
import styled31 from "styled-components";
|
|
@@ -7690,7 +7763,7 @@ var ModalCloseButton = () => {
|
|
|
7690
7763
|
|
|
7691
7764
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7692
7765
|
import styled30 from "styled-components";
|
|
7693
|
-
import { isNotNil as
|
|
7766
|
+
import { isNotNil as isNotNil12 } from "@wistia/type-guards";
|
|
7694
7767
|
import { jsx as jsx194 } from "react/jsx-runtime";
|
|
7695
7768
|
var VisuallyHidden = styled30.div({ ...visuallyHiddenStyle });
|
|
7696
7769
|
var VisuallyHiddenButFocusable = styled30.div({
|
|
@@ -7702,7 +7775,7 @@ var ScreenReaderOnly = ({
|
|
|
7702
7775
|
focusable = false,
|
|
7703
7776
|
...otherProps
|
|
7704
7777
|
}) => {
|
|
7705
|
-
const accessibleText =
|
|
7778
|
+
const accessibleText = isNotNil12(text) ? text : children;
|
|
7706
7779
|
if (focusable) {
|
|
7707
7780
|
return /* @__PURE__ */ jsx194(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7708
7781
|
}
|
|
@@ -7749,7 +7822,7 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
|
7749
7822
|
|
|
7750
7823
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
7751
7824
|
import { useRef as useRef5, useEffect as useEffect2 } from "react";
|
|
7752
|
-
import { isNotNil as
|
|
7825
|
+
import { isNotNil as isNotNil13 } from "@wistia/type-guards";
|
|
7753
7826
|
var useFocusRestore = () => {
|
|
7754
7827
|
const previouslyFocusedRef = useRef5(null);
|
|
7755
7828
|
useEffect2(() => {
|
|
@@ -7757,7 +7830,7 @@ var useFocusRestore = () => {
|
|
|
7757
7830
|
}, []);
|
|
7758
7831
|
useEffect2(() => {
|
|
7759
7832
|
return () => {
|
|
7760
|
-
if (
|
|
7833
|
+
if (isNotNil13(previouslyFocusedRef.current)) {
|
|
7761
7834
|
setTimeout(() => {
|
|
7762
7835
|
previouslyFocusedRef.current?.focus();
|
|
7763
7836
|
}, 0);
|
|
@@ -7901,7 +7974,7 @@ var Modal = forwardRef16(
|
|
|
7901
7974
|
DialogRoot,
|
|
7902
7975
|
{
|
|
7903
7976
|
onOpenChange: (open2) => {
|
|
7904
|
-
if (!open2 &&
|
|
7977
|
+
if (!open2 && isNotNil14(onRequestClose)) {
|
|
7905
7978
|
onRequestClose();
|
|
7906
7979
|
}
|
|
7907
7980
|
},
|
|
@@ -7915,7 +7988,7 @@ var Modal = forwardRef16(
|
|
|
7915
7988
|
"aria-describedby": void 0,
|
|
7916
7989
|
fullHeight,
|
|
7917
7990
|
onOpenAutoFocus: (event) => {
|
|
7918
|
-
if (
|
|
7991
|
+
if (isNotNil14(initialFocusRef) && initialFocusRef.current) {
|
|
7919
7992
|
event.preventDefault();
|
|
7920
7993
|
requestAnimationFrame(() => {
|
|
7921
7994
|
initialFocusRef.current?.focus();
|
|
@@ -8077,7 +8150,7 @@ Radio.displayName = "Radio";
|
|
|
8077
8150
|
// src/components/Tag/Tag.tsx
|
|
8078
8151
|
import { forwardRef as forwardRef18 } from "react";
|
|
8079
8152
|
import styled36 from "styled-components";
|
|
8080
|
-
import { isNil as isNil11, isNotNil as
|
|
8153
|
+
import { isNil as isNil11, isNotNil as isNotNil15, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
8081
8154
|
import { Fragment as Fragment2, jsx as jsx200, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8082
8155
|
var TagLabel = styled36.a`
|
|
8083
8156
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -8183,7 +8256,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
8183
8256
|
};
|
|
8184
8257
|
var Tag = forwardRef18(
|
|
8185
8258
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
8186
|
-
const labelProps =
|
|
8259
|
+
const labelProps = isNotNil15(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
|
|
8187
8260
|
return /* @__PURE__ */ jsxs21(
|
|
8188
8261
|
StyledTag,
|
|
8189
8262
|
{
|
|
@@ -8327,7 +8400,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
8327
8400
|
|
|
8328
8401
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
8329
8402
|
import styled38 from "styled-components";
|
|
8330
|
-
import { isNotNil as
|
|
8403
|
+
import { isNotNil as isNotNil16 } from "@wistia/type-guards";
|
|
8331
8404
|
import { jsx as jsx202, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8332
8405
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
8333
8406
|
if (iconOnly) {
|
|
@@ -8421,7 +8494,7 @@ var WistiaLogo = ({
|
|
|
8421
8494
|
...otherProps,
|
|
8422
8495
|
children: [
|
|
8423
8496
|
/* @__PURE__ */ jsx202("title", { children: title }),
|
|
8424
|
-
|
|
8497
|
+
isNotNil16(description) ? /* @__PURE__ */ jsx202("desc", { children: description }) : null,
|
|
8425
8498
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
8426
8499
|
renderLogotype(logotypeColor, iconOnly)
|
|
8427
8500
|
]
|