@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.cjs
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
|
*
|
|
@@ -5967,9 +5967,11 @@ var propsForFlexChildren = /* @__PURE__ */ new Set(["alignSelf", "basis", "grow"
|
|
|
5967
5967
|
var getGapStyle = (gap) => {
|
|
5968
5968
|
if ((0, import_type_guards14.isNotNil)(gap)) {
|
|
5969
5969
|
if ((0, import_type_guards14.isRecord)(gap)) {
|
|
5970
|
-
return Object.entries(gap).map(([key, value]) =>
|
|
5970
|
+
return Object.entries(gap).map(([key, value]) => {
|
|
5971
|
+
return `${key}-gap: var(--wui-${value})};`;
|
|
5972
|
+
}).join("");
|
|
5971
5973
|
}
|
|
5972
|
-
return `gap:
|
|
5974
|
+
return `gap: var(--wui-${gap.toString()})};`;
|
|
5973
5975
|
}
|
|
5974
5976
|
return void 0;
|
|
5975
5977
|
};
|
|
@@ -7296,10 +7298,10 @@ var close = import_styled_components37.keyframes`
|
|
|
7296
7298
|
`;
|
|
7297
7299
|
var menuContentCss = import_styled_components37.css`
|
|
7298
7300
|
--menu-font-family: var(--wui-typography-family-default);
|
|
7299
|
-
--menu-bg: var(--wui-color-bg-
|
|
7301
|
+
--menu-bg: var(--wui-color-bg-surface);
|
|
7300
7302
|
--menu-shadow: 0 0 64px 0 rgba(0 0 0 / 8%); /* TODO - Need a box-shadow token */
|
|
7301
|
-
--menu-border-radius: var(--wui-border-radius-
|
|
7302
|
-
--menu-padding: var(--wui-space-
|
|
7303
|
+
--menu-border-radius: var(--wui-border-radius-02);
|
|
7304
|
+
--menu-padding: var(--wui-space-02);
|
|
7303
7305
|
--menu-min-width: 120px;
|
|
7304
7306
|
--menu-max-width: 284px;
|
|
7305
7307
|
|
|
@@ -7315,6 +7317,7 @@ var menuContentCss = import_styled_components37.css`
|
|
|
7315
7317
|
padding: var(--menu-padding);
|
|
7316
7318
|
transform-origin: var(--radix-dropdown-menu-content-transform-origin);
|
|
7317
7319
|
z-index: var(--wui-zindex-menu);
|
|
7320
|
+
border: 1px solid var(--wui-color-border);
|
|
7318
7321
|
|
|
7319
7322
|
&[data-state='closed'] {
|
|
7320
7323
|
animation: ${close}; /* TODO - need easing tokens */
|
|
@@ -7332,12 +7335,35 @@ var menuContentCss = import_styled_components37.css`
|
|
|
7332
7335
|
margin: var(--wui-space-02) 0;
|
|
7333
7336
|
}
|
|
7334
7337
|
`;
|
|
7338
|
+
var menuItemCss = import_styled_components37.css`
|
|
7339
|
+
--menu-label-description-gap: var(--wui-space-01);
|
|
7340
|
+
--menu-item-inner-gap: var(--wui-space-03);
|
|
7341
|
+
--menu-item-left-icon-size: 24px;
|
|
7342
|
+
--menu-item-right-icon-size: 16px;
|
|
7343
|
+
--menu-item-padding: var(--wui-space-02);
|
|
7344
|
+
--menu-label-font-size: var(--wui-typography-label-3-size);
|
|
7345
|
+
--menu-label-font-weight: var(--wui-typography-label-3-weight);
|
|
7346
|
+
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
7347
|
+
`;
|
|
7348
|
+
var compactMenuItemCss = import_styled_components37.css`
|
|
7349
|
+
--menu-label-description-gap: 0;
|
|
7350
|
+
--menu-item-inner-gap: var(--wui-space-02);
|
|
7351
|
+
--menu-item-left-icon-size: 16px;
|
|
7352
|
+
--menu-item-right-icon-size: 12px;
|
|
7353
|
+
--menu-item-padding: 6px;
|
|
7354
|
+
--menu-label-font-size: var(--wui-typography-label-4-size);
|
|
7355
|
+
--menu-label-font-weight: var(--wui-typography-label-4-weight);
|
|
7356
|
+
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
7357
|
+
`;
|
|
7335
7358
|
var MenuContent = (0, import_styled_components37.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
7336
7359
|
${menuContentCss}
|
|
7360
|
+
${({ $compact }) => $compact ? compactMenuItemCss : menuItemCss}
|
|
7337
7361
|
`;
|
|
7338
7362
|
var Menu = ({
|
|
7339
7363
|
align = "start",
|
|
7340
7364
|
children,
|
|
7365
|
+
disabled = false,
|
|
7366
|
+
compact = false,
|
|
7341
7367
|
trigger,
|
|
7342
7368
|
label,
|
|
7343
7369
|
isOpen,
|
|
@@ -7346,16 +7372,26 @@ var Menu = ({
|
|
|
7346
7372
|
onInteractOutside,
|
|
7347
7373
|
...props
|
|
7348
7374
|
}) => {
|
|
7375
|
+
let controlProps = {
|
|
7376
|
+
...(0, import_type_guards22.isNotNil)(onOpenChange) && (0, import_type_guards22.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
7377
|
+
};
|
|
7378
|
+
if (disabled) {
|
|
7379
|
+
controlProps = {
|
|
7380
|
+
open: false,
|
|
7381
|
+
onOpenChange: () => null
|
|
7382
|
+
};
|
|
7383
|
+
}
|
|
7349
7384
|
return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(
|
|
7350
7385
|
import_react_dropdown_menu.DropdownMenu,
|
|
7351
7386
|
{
|
|
7352
7387
|
modal: false,
|
|
7353
|
-
...
|
|
7388
|
+
...controlProps,
|
|
7354
7389
|
children: [
|
|
7355
7390
|
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards22.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7356
7391
|
Button,
|
|
7357
7392
|
{
|
|
7358
7393
|
"aria-expanded": isOpen,
|
|
7394
|
+
disabled,
|
|
7359
7395
|
forceState: isOpen ? "active" : void 0,
|
|
7360
7396
|
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(Icon, { type: "caret-down" }),
|
|
7361
7397
|
...triggerProps,
|
|
@@ -7366,11 +7402,12 @@ var Menu = ({
|
|
|
7366
7402
|
MenuContent,
|
|
7367
7403
|
{
|
|
7368
7404
|
...props,
|
|
7405
|
+
$compact: compact,
|
|
7369
7406
|
align,
|
|
7407
|
+
sideOffset: 6,
|
|
7370
7408
|
onFocusOutside: (event) => {
|
|
7371
7409
|
event.preventDefault();
|
|
7372
7410
|
},
|
|
7373
|
-
sideOffset: 6,
|
|
7374
7411
|
children
|
|
7375
7412
|
}
|
|
7376
7413
|
) })
|
|
@@ -7394,9 +7431,10 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
7394
7431
|
asChild: true,
|
|
7395
7432
|
...props,
|
|
7396
7433
|
children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7397
|
-
|
|
7434
|
+
Heading,
|
|
7398
7435
|
{
|
|
7399
|
-
|
|
7436
|
+
renderAs: "span",
|
|
7437
|
+
variant: "heading6",
|
|
7400
7438
|
...props,
|
|
7401
7439
|
children
|
|
7402
7440
|
}
|
|
@@ -7410,6 +7448,7 @@ MenuLabel.displayName = "MenuLabel";
|
|
|
7410
7448
|
var import_react28 = require("react");
|
|
7411
7449
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7412
7450
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
7451
|
+
var import_type_guards24 = require("@wistia/type-guards");
|
|
7413
7452
|
|
|
7414
7453
|
// src/components/Menu/MenuItemButton.tsx
|
|
7415
7454
|
var import_react27 = require("react");
|
|
@@ -7417,38 +7456,74 @@ var import_styled_components39 = __toESM(require("styled-components"));
|
|
|
7417
7456
|
var import_type_guards23 = require("@wistia/type-guards");
|
|
7418
7457
|
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
7419
7458
|
var StyledButton3 = (0, import_styled_components39.default)(Button)`
|
|
7420
|
-
|
|
7421
|
-
--menu-item-gap: var(--wui-space-01);
|
|
7422
|
-
--menu-item-inner-gap: var(--wui-space-04);
|
|
7423
|
-
--menu-item-disabled-bg: var(--wui-color-white);
|
|
7459
|
+
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
7424
7460
|
|
|
7425
|
-
text-align: left;
|
|
7426
|
-
align-items: left;
|
|
7427
|
-
border-radius: var(--menu-item-border-radius);
|
|
7428
7461
|
display: flex;
|
|
7462
|
+
flex-direction: row;
|
|
7463
|
+
gap: var(--menu-item-inner-gap);
|
|
7464
|
+
padding: var(--menu-item-padding);
|
|
7465
|
+
border-radius: var(--wui-border-radius-01);
|
|
7466
|
+
text-align: left;
|
|
7467
|
+
color: var(--wui-color-text);
|
|
7468
|
+
font-size: var(--menu-label-font-size);
|
|
7469
|
+
font-weight: var(--menu-label-font-weight);
|
|
7470
|
+
line-height: var(--menu-label-line-height);
|
|
7471
|
+
|
|
7472
|
+
:active {
|
|
7473
|
+
background-color: var(--wui-color-bg-surface-active);
|
|
7474
|
+
}
|
|
7475
|
+
|
|
7476
|
+
&[data-highlighted] {
|
|
7477
|
+
outline: none;
|
|
7478
|
+
${({ $isGated }) => $isGated && getColorScheme("purple")};
|
|
7479
|
+
background-color: var(--wui-color-bg-surface-hover);
|
|
7480
|
+
}
|
|
7429
7481
|
|
|
7430
7482
|
&[aria-disabled='true'] {
|
|
7431
|
-
|
|
7483
|
+
--wui-color-text: var(--wui-color-text-disabled);
|
|
7484
|
+
--wui-color-text-secondary: var(--wui-color-text-disabled);
|
|
7485
|
+
--wui-color-icon: var(--wui-color-icon-disabled);
|
|
7486
|
+
|
|
7487
|
+
&[data-highlighted] {
|
|
7488
|
+
background-color: transparent;
|
|
7489
|
+
}
|
|
7432
7490
|
}
|
|
7433
7491
|
|
|
7434
|
-
|
|
7492
|
+
&[role='menuitemradio'] {
|
|
7493
|
+
padding-left: var(--wui-space-04);
|
|
7494
|
+
}
|
|
7435
7495
|
`;
|
|
7436
|
-
var
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7496
|
+
var StyledLeftIconContainer = import_styled_components39.default.div`
|
|
7497
|
+
height: var(--menu-item-left-icon-size);
|
|
7498
|
+
width: var(--menu-item-left-icon-size);
|
|
7499
|
+
|
|
7500
|
+
svg {
|
|
7501
|
+
height: var(--menu-item-left-icon-size);
|
|
7502
|
+
width: var(--menu-item-left-icon-size);
|
|
7503
|
+
}
|
|
7504
|
+
`;
|
|
7505
|
+
var StyledRightIconContainer = import_styled_components39.default.div`
|
|
7506
|
+
height: var(--menu-item-right-icon-size);
|
|
7507
|
+
width: var(--menu-item-right-icon-size);
|
|
7508
|
+
|
|
7509
|
+
svg {
|
|
7510
|
+
height: var(--menu-item-right-icon-size);
|
|
7511
|
+
width: var(--menu-item-right-icon-size);
|
|
7512
|
+
}
|
|
7513
|
+
`;
|
|
7514
|
+
var StyledLabelAndDescriptionContainer = import_styled_components39.default.div`
|
|
7515
|
+
display: flex;
|
|
7516
|
+
flex-direction: column;
|
|
7517
|
+
gap: var(--menu-label-description-gap);
|
|
7518
|
+
flex-basis: 100%;
|
|
7444
7519
|
`;
|
|
7445
7520
|
var StyledBadgeContainer = import_styled_components39.default.div`
|
|
7446
|
-
grid-area: badge;
|
|
7447
7521
|
align-self: start;
|
|
7448
7522
|
justify-self: end;
|
|
7449
|
-
|
|
7523
|
+
font-size: var(--wui-typography-label-4-size);
|
|
7524
|
+
color: var(--wui-color-text-secondary);
|
|
7450
7525
|
`;
|
|
7451
|
-
var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, command, ...props }, ref) => {
|
|
7526
|
+
var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
7452
7527
|
let { colorScheme, badge } = props;
|
|
7453
7528
|
if (appearance === "dangerous") {
|
|
7454
7529
|
if ((0, import_type_guards23.isNotUndefined)(colorScheme)) {
|
|
@@ -7457,13 +7532,19 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7457
7532
|
colorScheme = "error";
|
|
7458
7533
|
}
|
|
7459
7534
|
if (appearance === "gated") {
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7535
|
+
badge = /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7536
|
+
Icon,
|
|
7537
|
+
{
|
|
7538
|
+
colorScheme: "purple",
|
|
7539
|
+
style: {
|
|
7540
|
+
height: "16px",
|
|
7541
|
+
width: "16px"
|
|
7542
|
+
},
|
|
7543
|
+
type: "sparkle"
|
|
7544
|
+
}
|
|
7545
|
+
);
|
|
7465
7546
|
}
|
|
7466
|
-
return /* @__PURE__ */ (0, import_jsx_runtime186.
|
|
7547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(
|
|
7467
7548
|
StyledButton3,
|
|
7468
7549
|
{
|
|
7469
7550
|
...props,
|
|
@@ -7471,11 +7552,13 @@ var MenuItemButton = (0, import_react27.forwardRef)(({ children, appearance, com
|
|
|
7471
7552
|
$isGated: appearance === "gated",
|
|
7472
7553
|
colorScheme: colorScheme ?? "default",
|
|
7473
7554
|
fullWidth: true,
|
|
7474
|
-
|
|
7475
|
-
children:
|
|
7476
|
-
children,
|
|
7477
|
-
|
|
7478
|
-
|
|
7555
|
+
unstyled: true,
|
|
7556
|
+
children: [
|
|
7557
|
+
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
7558
|
+
/* @__PURE__ */ (0, import_jsx_runtime186.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
7559
|
+
(0, import_type_guards23.isNotNil)(badge) || (0, import_type_guards23.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
7560
|
+
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
7561
|
+
]
|
|
7479
7562
|
}
|
|
7480
7563
|
);
|
|
7481
7564
|
});
|
|
@@ -7484,16 +7567,11 @@ MenuItemButton.displayName = "MenuItemButton";
|
|
|
7484
7567
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
7485
7568
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
7486
7569
|
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
7487
|
-
var StyledMenuItemLabel =
|
|
7488
|
-
grid-area: label;
|
|
7489
|
-
`;
|
|
7570
|
+
var StyledMenuItemLabel = import_styled_components40.default.span``;
|
|
7490
7571
|
var StyledMenuItemDescription = (0, import_styled_components40.default)(Text).attrs({
|
|
7491
|
-
variant: "
|
|
7572
|
+
variant: "body4",
|
|
7492
7573
|
prominence: "secondary"
|
|
7493
|
-
})
|
|
7494
|
-
margin-top: var(--menu-item-gap);
|
|
7495
|
-
grid-area: description;
|
|
7496
|
-
`;
|
|
7574
|
+
})``;
|
|
7497
7575
|
var MenuItemLabel = ({ children }) => {
|
|
7498
7576
|
return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(StyledMenuItemLabel, { children });
|
|
7499
7577
|
};
|
|
@@ -7519,7 +7597,7 @@ var StyledSubTrigger = (0, import_styled_components41.default)(import_react_drop
|
|
|
7519
7597
|
|
|
7520
7598
|
&[data-state='open'],
|
|
7521
7599
|
&[data-highlighted] {
|
|
7522
|
-
background-color: var(--
|
|
7600
|
+
background-color: var(--wui-color-bg-surface-hover);
|
|
7523
7601
|
}
|
|
7524
7602
|
`;
|
|
7525
7603
|
var SubMenuTrigger = (props) => {
|
|
@@ -7545,7 +7623,7 @@ var SubMenu = ({
|
|
|
7545
7623
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
7546
7624
|
/* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
7547
7625
|
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(MenuItemLabel, { children: label }),
|
|
7548
|
-
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(MenuItemDescription, { children: description })
|
|
7626
|
+
(0, import_type_guards24.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(MenuItemDescription, { children: description }) : null
|
|
7549
7627
|
] }),
|
|
7550
7628
|
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(SubMenuContent, { children }) })
|
|
7551
7629
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -7624,6 +7702,7 @@ var RadioMenuItem = ({
|
|
|
7624
7702
|
import_react_dropdown_menu6.DropdownMenuRadioItem,
|
|
7625
7703
|
{
|
|
7626
7704
|
...extraProps,
|
|
7705
|
+
asChild: true,
|
|
7627
7706
|
value,
|
|
7628
7707
|
children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
7629
7708
|
MenuItemButton,
|
|
@@ -7646,30 +7725,23 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7646
7725
|
{
|
|
7647
7726
|
...props,
|
|
7648
7727
|
fill: "none",
|
|
7649
|
-
height: "
|
|
7650
|
-
viewBox: "0 0
|
|
7651
|
-
width: "
|
|
7728
|
+
height: "24",
|
|
7729
|
+
viewBox: "0 0 24 24",
|
|
7730
|
+
width: "24",
|
|
7652
7731
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7653
7732
|
children: [
|
|
7654
7733
|
/* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7655
7734
|
"path",
|
|
7656
7735
|
{
|
|
7657
|
-
d: "
|
|
7658
|
-
fill: "#
|
|
7736
|
+
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",
|
|
7737
|
+
fill: "#2949e5"
|
|
7659
7738
|
}
|
|
7660
7739
|
),
|
|
7661
7740
|
/* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7662
7741
|
"path",
|
|
7663
7742
|
{
|
|
7664
|
-
d: "
|
|
7665
|
-
|
|
7666
|
-
}
|
|
7667
|
-
),
|
|
7668
|
-
/* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7669
|
-
"path",
|
|
7670
|
-
{
|
|
7671
|
-
d: "M6.47275 11.1931L3.3775 8.08009C3.19155 7.89306 3.19155 7.58982 3.3775 7.40278L4.05092 6.72547C4.23688 6.53842 4.53841 6.53842 4.72436 6.72547L6.80947 8.82254L11.2755 4.33082C11.4615 4.1438 11.763 4.1438 11.949 4.33082L12.6224 5.00813C12.8083 5.19516 12.8083 5.4984 12.6224 5.68544L7.14618 11.1931C6.96021 11.3802 6.6587 11.3802 6.47275 11.1931Z",
|
|
7672
|
-
fill: "white"
|
|
7743
|
+
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",
|
|
7744
|
+
fill: "#fff"
|
|
7673
7745
|
}
|
|
7674
7746
|
)
|
|
7675
7747
|
]
|
|
@@ -7679,23 +7751,23 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7679
7751
|
{
|
|
7680
7752
|
...props,
|
|
7681
7753
|
fill: "none",
|
|
7682
|
-
height: "
|
|
7683
|
-
viewBox: "0 0
|
|
7684
|
-
width: "
|
|
7754
|
+
height: "24",
|
|
7755
|
+
viewBox: "0 0 24 24",
|
|
7756
|
+
width: "24",
|
|
7685
7757
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7686
7758
|
children: [
|
|
7687
7759
|
/* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7688
7760
|
"path",
|
|
7689
7761
|
{
|
|
7690
|
-
d: "
|
|
7691
|
-
fill: "#
|
|
7762
|
+
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",
|
|
7763
|
+
fill: "#fcfcfd"
|
|
7692
7764
|
}
|
|
7693
7765
|
),
|
|
7694
7766
|
/* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7695
7767
|
"path",
|
|
7696
7768
|
{
|
|
7697
|
-
d: "
|
|
7698
|
-
stroke: "#
|
|
7769
|
+
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",
|
|
7770
|
+
stroke: "#bbbbc4"
|
|
7699
7771
|
}
|
|
7700
7772
|
)
|
|
7701
7773
|
]
|
|
@@ -7711,6 +7783,7 @@ var CheckboxMenuItem = ({
|
|
|
7711
7783
|
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7712
7784
|
import_react_dropdown_menu7.DropdownMenuCheckboxItem,
|
|
7713
7785
|
{
|
|
7786
|
+
asChild: true,
|
|
7714
7787
|
checked,
|
|
7715
7788
|
onCheckedChange,
|
|
7716
7789
|
onSelect,
|
|
@@ -7730,7 +7803,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
|
7730
7803
|
var import_react33 = require("react");
|
|
7731
7804
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
7732
7805
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
7733
|
-
var
|
|
7806
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
7734
7807
|
|
|
7735
7808
|
// src/components/Modal/ModalHeader.tsx
|
|
7736
7809
|
var import_styled_components44 = __toESM(require("styled-components"));
|
|
@@ -7757,7 +7830,7 @@ var ModalCloseButton = () => {
|
|
|
7757
7830
|
|
|
7758
7831
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7759
7832
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
7760
|
-
var
|
|
7833
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
7761
7834
|
var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
7762
7835
|
var VisuallyHidden = import_styled_components43.default.div({ ...visuallyHiddenStyle });
|
|
7763
7836
|
var VisuallyHiddenButFocusable = import_styled_components43.default.div({
|
|
@@ -7769,7 +7842,7 @@ var ScreenReaderOnly = ({
|
|
|
7769
7842
|
focusable = false,
|
|
7770
7843
|
...otherProps
|
|
7771
7844
|
}) => {
|
|
7772
|
-
const accessibleText = (0,
|
|
7845
|
+
const accessibleText = (0, import_type_guards25.isNotNil)(text) ? text : children;
|
|
7773
7846
|
if (focusable) {
|
|
7774
7847
|
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7775
7848
|
}
|
|
@@ -7816,7 +7889,7 @@ var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
|
7816
7889
|
|
|
7817
7890
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
7818
7891
|
var import_react30 = require("react");
|
|
7819
|
-
var
|
|
7892
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
7820
7893
|
var useFocusRestore = () => {
|
|
7821
7894
|
const previouslyFocusedRef = (0, import_react30.useRef)(null);
|
|
7822
7895
|
(0, import_react30.useEffect)(() => {
|
|
@@ -7824,7 +7897,7 @@ var useFocusRestore = () => {
|
|
|
7824
7897
|
}, []);
|
|
7825
7898
|
(0, import_react30.useEffect)(() => {
|
|
7826
7899
|
return () => {
|
|
7827
|
-
if ((0,
|
|
7900
|
+
if ((0, import_type_guards26.isNotNil)(previouslyFocusedRef.current)) {
|
|
7828
7901
|
setTimeout(() => {
|
|
7829
7902
|
previouslyFocusedRef.current?.focus();
|
|
7830
7903
|
}, 0);
|
|
@@ -7968,7 +8041,7 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
7968
8041
|
import_react_dialog4.Root,
|
|
7969
8042
|
{
|
|
7970
8043
|
onOpenChange: (open2) => {
|
|
7971
|
-
if (!open2 && (0,
|
|
8044
|
+
if (!open2 && (0, import_type_guards27.isNotNil)(onRequestClose)) {
|
|
7972
8045
|
onRequestClose();
|
|
7973
8046
|
}
|
|
7974
8047
|
},
|
|
@@ -7982,7 +8055,7 @@ var Modal = (0, import_react33.forwardRef)(
|
|
|
7982
8055
|
"aria-describedby": void 0,
|
|
7983
8056
|
fullHeight,
|
|
7984
8057
|
onOpenAutoFocus: (event) => {
|
|
7985
|
-
if ((0,
|
|
8058
|
+
if ((0, import_type_guards27.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
7986
8059
|
event.preventDefault();
|
|
7987
8060
|
requestAnimationFrame(() => {
|
|
7988
8061
|
initialFocusRef.current?.focus();
|
|
@@ -8014,7 +8087,7 @@ Modal.displayName = "Modal";
|
|
|
8014
8087
|
// src/components/Radio/Radio.tsx
|
|
8015
8088
|
var import_react34 = require("react");
|
|
8016
8089
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
8017
|
-
var
|
|
8090
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8018
8091
|
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
8019
8092
|
var StyledLabelWrapper2 = import_styled_components48.default.div`
|
|
8020
8093
|
display: flex;
|
|
@@ -8100,7 +8173,7 @@ var Radio = (0, import_react34.forwardRef)(
|
|
|
8100
8173
|
...otherProps
|
|
8101
8174
|
}, ref) => {
|
|
8102
8175
|
const generatedId = (0, import_react34.useId)();
|
|
8103
|
-
const computedId = (0,
|
|
8176
|
+
const computedId = (0, import_type_guards28.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
|
|
8104
8177
|
return /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)(
|
|
8105
8178
|
StyledRadioWrapper,
|
|
8106
8179
|
{
|
|
@@ -8144,7 +8217,7 @@ Radio.displayName = "Radio";
|
|
|
8144
8217
|
// src/components/Tag/Tag.tsx
|
|
8145
8218
|
var import_react35 = require("react");
|
|
8146
8219
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
8147
|
-
var
|
|
8220
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
8148
8221
|
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
8149
8222
|
var TagLabel = import_styled_components49.default.a`
|
|
8150
8223
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -8218,10 +8291,10 @@ var StyledTag = import_styled_components49.default.div`
|
|
|
8218
8291
|
overflow: hidden;
|
|
8219
8292
|
`;
|
|
8220
8293
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
8221
|
-
if ((0,
|
|
8294
|
+
if ((0, import_type_guards29.isNil)(onClickRemove)) {
|
|
8222
8295
|
return null;
|
|
8223
8296
|
}
|
|
8224
|
-
if ((0,
|
|
8297
|
+
if ((0, import_type_guards29.isNil)(onClickRemoveLabel)) {
|
|
8225
8298
|
throw new Error(
|
|
8226
8299
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
8227
8300
|
);
|
|
@@ -8250,7 +8323,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
8250
8323
|
};
|
|
8251
8324
|
var Tag = (0, import_react35.forwardRef)(
|
|
8252
8325
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
8253
|
-
const labelProps = (0,
|
|
8326
|
+
const labelProps = (0, import_type_guards29.isNotNil)(href) && (0, import_type_guards29.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
8254
8327
|
return /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(
|
|
8255
8328
|
StyledTag,
|
|
8256
8329
|
{
|
|
@@ -8388,7 +8461,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
8388
8461
|
|
|
8389
8462
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
8390
8463
|
var import_styled_components51 = __toESM(require("styled-components"));
|
|
8391
|
-
var
|
|
8464
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
8392
8465
|
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
8393
8466
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
8394
8467
|
if (iconOnly) {
|
|
@@ -8482,7 +8555,7 @@ var WistiaLogo = ({
|
|
|
8482
8555
|
...otherProps,
|
|
8483
8556
|
children: [
|
|
8484
8557
|
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)("title", { children: title }),
|
|
8485
|
-
(0,
|
|
8558
|
+
(0, import_type_guards30.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("desc", { children: description }) : null,
|
|
8486
8559
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
8487
8560
|
renderLogotype(logotypeColor, iconOnly)
|
|
8488
8561
|
]
|