@wistia/ui 0.2.0 → 0.2.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 +156 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.mjs +152 -81
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1203,22 +1203,7 @@ type UncontrolledMenuProps = {
|
|
|
1203
1203
|
onOpenChange?: never;
|
|
1204
1204
|
};
|
|
1205
1205
|
type MenuControlProps = ControlledMenuProps | UncontrolledMenuProps;
|
|
1206
|
-
type
|
|
1207
|
-
/**
|
|
1208
|
-
* The label for the trigger element, this is ignored if `trigger` is defined
|
|
1209
|
-
*/
|
|
1210
|
-
label: string;
|
|
1211
|
-
trigger?: never;
|
|
1212
|
-
};
|
|
1213
|
-
type MenuPropsWithCustomTrigger = {
|
|
1214
|
-
label?: never;
|
|
1215
|
-
/**
|
|
1216
|
-
* Replace the default trigger with a custom button or other element
|
|
1217
|
-
* */
|
|
1218
|
-
trigger: ReactNode;
|
|
1219
|
-
};
|
|
1220
|
-
type MenuTriggerProps = MenuPropsWithCustomTrigger | MenuPropsWithDefaultTrigger;
|
|
1221
|
-
type BaseMenuProps = MenuControlProps & MenuTriggerProps & {
|
|
1206
|
+
type MenuProps = MenuControlProps & {
|
|
1222
1207
|
/**
|
|
1223
1208
|
* The position of the Menu
|
|
1224
1209
|
*/
|
|
@@ -1228,21 +1213,36 @@ type BaseMenuProps = MenuControlProps & MenuTriggerProps & {
|
|
|
1228
1213
|
* Should be made up of `MenuItem`, `SubMenu`, `Divider`, or other subcomponents listed
|
|
1229
1214
|
*/
|
|
1230
1215
|
children: ReactNode;
|
|
1216
|
+
/**
|
|
1217
|
+
* If the menu is compact
|
|
1218
|
+
*/
|
|
1219
|
+
compact?: boolean;
|
|
1220
|
+
/**
|
|
1221
|
+
* If disabled, the trigger will appear disabled and the menu will not open
|
|
1222
|
+
*/
|
|
1223
|
+
disabled?: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
* The label for the trigger element, this is ignored if `trigger` is defined
|
|
1226
|
+
*/
|
|
1227
|
+
label?: string;
|
|
1231
1228
|
/**
|
|
1232
1229
|
* Callback for when the user clicks or focuses outside of the menu
|
|
1233
1230
|
*/
|
|
1234
1231
|
onInteractOutside?: DropdownMenuContentProps['onInteractOutside'];
|
|
1232
|
+
/**
|
|
1233
|
+
* Replace the default trigger with a custom button or other element
|
|
1234
|
+
* */
|
|
1235
|
+
trigger?: ReactNode;
|
|
1235
1236
|
/**
|
|
1236
1237
|
* Props to pass to the trigger component, the default trigger is Button
|
|
1237
1238
|
*/
|
|
1238
|
-
triggerProps?: ButtonProps
|
|
1239
|
+
triggerProps?: Partial<ButtonProps>;
|
|
1239
1240
|
};
|
|
1240
|
-
type MenuProps = BaseMenuProps & {};
|
|
1241
1241
|
/**
|
|
1242
1242
|
* Displays a menu to the users with a set of actions.
|
|
1243
1243
|
*/
|
|
1244
1244
|
declare const Menu: {
|
|
1245
|
-
({ align, children, trigger, label, isOpen, triggerProps, onOpenChange, onInteractOutside, ...props }: MenuProps): JSX.Element;
|
|
1245
|
+
({ align, children, disabled, compact, trigger, label, isOpen, triggerProps, onOpenChange, onInteractOutside, ...props }: MenuProps): JSX.Element;
|
|
1246
1246
|
displayName: string;
|
|
1247
1247
|
};
|
|
1248
1248
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1203,22 +1203,7 @@ type UncontrolledMenuProps = {
|
|
|
1203
1203
|
onOpenChange?: never;
|
|
1204
1204
|
};
|
|
1205
1205
|
type MenuControlProps = ControlledMenuProps | UncontrolledMenuProps;
|
|
1206
|
-
type
|
|
1207
|
-
/**
|
|
1208
|
-
* The label for the trigger element, this is ignored if `trigger` is defined
|
|
1209
|
-
*/
|
|
1210
|
-
label: string;
|
|
1211
|
-
trigger?: never;
|
|
1212
|
-
};
|
|
1213
|
-
type MenuPropsWithCustomTrigger = {
|
|
1214
|
-
label?: never;
|
|
1215
|
-
/**
|
|
1216
|
-
* Replace the default trigger with a custom button or other element
|
|
1217
|
-
* */
|
|
1218
|
-
trigger: ReactNode;
|
|
1219
|
-
};
|
|
1220
|
-
type MenuTriggerProps = MenuPropsWithCustomTrigger | MenuPropsWithDefaultTrigger;
|
|
1221
|
-
type BaseMenuProps = MenuControlProps & MenuTriggerProps & {
|
|
1206
|
+
type MenuProps = MenuControlProps & {
|
|
1222
1207
|
/**
|
|
1223
1208
|
* The position of the Menu
|
|
1224
1209
|
*/
|
|
@@ -1228,21 +1213,36 @@ type BaseMenuProps = MenuControlProps & MenuTriggerProps & {
|
|
|
1228
1213
|
* Should be made up of `MenuItem`, `SubMenu`, `Divider`, or other subcomponents listed
|
|
1229
1214
|
*/
|
|
1230
1215
|
children: ReactNode;
|
|
1216
|
+
/**
|
|
1217
|
+
* If the menu is compact
|
|
1218
|
+
*/
|
|
1219
|
+
compact?: boolean;
|
|
1220
|
+
/**
|
|
1221
|
+
* If disabled, the trigger will appear disabled and the menu will not open
|
|
1222
|
+
*/
|
|
1223
|
+
disabled?: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
* The label for the trigger element, this is ignored if `trigger` is defined
|
|
1226
|
+
*/
|
|
1227
|
+
label?: string;
|
|
1231
1228
|
/**
|
|
1232
1229
|
* Callback for when the user clicks or focuses outside of the menu
|
|
1233
1230
|
*/
|
|
1234
1231
|
onInteractOutside?: DropdownMenuContentProps['onInteractOutside'];
|
|
1232
|
+
/**
|
|
1233
|
+
* Replace the default trigger with a custom button or other element
|
|
1234
|
+
* */
|
|
1235
|
+
trigger?: ReactNode;
|
|
1235
1236
|
/**
|
|
1236
1237
|
* Props to pass to the trigger component, the default trigger is Button
|
|
1237
1238
|
*/
|
|
1238
|
-
triggerProps?: ButtonProps
|
|
1239
|
+
triggerProps?: Partial<ButtonProps>;
|
|
1239
1240
|
};
|
|
1240
|
-
type MenuProps = BaseMenuProps & {};
|
|
1241
1241
|
/**
|
|
1242
1242
|
* Displays a menu to the users with a set of actions.
|
|
1243
1243
|
*/
|
|
1244
1244
|
declare const Menu: {
|
|
1245
|
-
({ align, children, trigger, label, isOpen, triggerProps, onOpenChange, onInteractOutside, ...props }: MenuProps): JSX.Element;
|
|
1245
|
+
({ align, children, disabled, compact, trigger, label, isOpen, triggerProps, onOpenChange, onInteractOutside, ...props }: MenuProps): JSX.Element;
|
|
1246
1246
|
displayName: string;
|
|
1247
1247
|
};
|
|
1248
1248
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.2.
|
|
3
|
+
* @license @wistia/ui v0.2.1
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7215,10 +7215,10 @@ var close = keyframes`
|
|
|
7215
7215
|
`;
|
|
7216
7216
|
var menuContentCss = css20`
|
|
7217
7217
|
--menu-font-family: var(--wui-typography-family-default);
|
|
7218
|
-
--menu-bg: var(--wui-color-bg-
|
|
7218
|
+
--menu-bg: var(--wui-color-bg-surface);
|
|
7219
7219
|
--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-
|
|
7220
|
+
--menu-border-radius: var(--wui-border-radius-02);
|
|
7221
|
+
--menu-padding: var(--wui-space-02);
|
|
7222
7222
|
--menu-min-width: 120px;
|
|
7223
7223
|
--menu-max-width: 284px;
|
|
7224
7224
|
|
|
@@ -7234,6 +7234,7 @@ var menuContentCss = css20`
|
|
|
7234
7234
|
padding: var(--menu-padding);
|
|
7235
7235
|
transform-origin: var(--radix-dropdown-menu-content-transform-origin);
|
|
7236
7236
|
z-index: var(--wui-zindex-menu);
|
|
7237
|
+
border: 1px solid var(--wui-color-border);
|
|
7237
7238
|
|
|
7238
7239
|
&[data-state='closed'] {
|
|
7239
7240
|
animation: ${close}; /* TODO - need easing tokens */
|
|
@@ -7251,12 +7252,35 @@ var menuContentCss = css20`
|
|
|
7251
7252
|
margin: var(--wui-space-02) 0;
|
|
7252
7253
|
}
|
|
7253
7254
|
`;
|
|
7255
|
+
var menuItemCss = css20`
|
|
7256
|
+
--menu-label-description-gap: var(--wui-space-01);
|
|
7257
|
+
--menu-item-inner-gap: var(--wui-space-03);
|
|
7258
|
+
--menu-item-left-icon-size: 24px;
|
|
7259
|
+
--menu-item-right-icon-size: 16px;
|
|
7260
|
+
--menu-item-padding: var(--wui-space-02);
|
|
7261
|
+
--menu-label-font-size: var(--wui-typography-label-3-size);
|
|
7262
|
+
--menu-label-font-weight: var(--wui-typography-label-3-weight);
|
|
7263
|
+
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
7264
|
+
`;
|
|
7265
|
+
var compactMenuItemCss = css20`
|
|
7266
|
+
--menu-label-description-gap: 0;
|
|
7267
|
+
--menu-item-inner-gap: var(--wui-space-02);
|
|
7268
|
+
--menu-item-left-icon-size: 16px;
|
|
7269
|
+
--menu-item-right-icon-size: 12px;
|
|
7270
|
+
--menu-item-padding: 6px;
|
|
7271
|
+
--menu-label-font-size: var(--wui-typography-label-4-size);
|
|
7272
|
+
--menu-label-font-weight: var(--wui-typography-label-4-weight);
|
|
7273
|
+
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
7274
|
+
`;
|
|
7254
7275
|
var MenuContent = styled24(DropdownMenuContent)`
|
|
7255
7276
|
${menuContentCss}
|
|
7277
|
+
${({ $compact }) => $compact ? compactMenuItemCss : menuItemCss}
|
|
7256
7278
|
`;
|
|
7257
7279
|
var Menu = ({
|
|
7258
7280
|
align = "start",
|
|
7259
7281
|
children,
|
|
7282
|
+
disabled = false,
|
|
7283
|
+
compact = false,
|
|
7260
7284
|
trigger,
|
|
7261
7285
|
label,
|
|
7262
7286
|
isOpen,
|
|
@@ -7265,16 +7289,26 @@ var Menu = ({
|
|
|
7265
7289
|
onInteractOutside,
|
|
7266
7290
|
...props
|
|
7267
7291
|
}) => {
|
|
7292
|
+
let controlProps = {
|
|
7293
|
+
...isNotNil9(onOpenChange) && isNotNil9(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
7294
|
+
};
|
|
7295
|
+
if (disabled) {
|
|
7296
|
+
controlProps = {
|
|
7297
|
+
open: false,
|
|
7298
|
+
onOpenChange: () => null
|
|
7299
|
+
};
|
|
7300
|
+
}
|
|
7268
7301
|
return /* @__PURE__ */ jsxs13(
|
|
7269
7302
|
DropdownMenu,
|
|
7270
7303
|
{
|
|
7271
7304
|
modal: false,
|
|
7272
|
-
...
|
|
7305
|
+
...controlProps,
|
|
7273
7306
|
children: [
|
|
7274
7307
|
/* @__PURE__ */ jsx184(DropdownMenuTrigger, { asChild: true, children: isNotUndefined7(trigger) ? trigger : /* @__PURE__ */ jsx184(
|
|
7275
7308
|
Button,
|
|
7276
7309
|
{
|
|
7277
7310
|
"aria-expanded": isOpen,
|
|
7311
|
+
disabled,
|
|
7278
7312
|
forceState: isOpen ? "active" : void 0,
|
|
7279
7313
|
rightIcon: /* @__PURE__ */ jsx184(Icon, { type: "caret-down" }),
|
|
7280
7314
|
...triggerProps,
|
|
@@ -7285,11 +7319,12 @@ var Menu = ({
|
|
|
7285
7319
|
MenuContent,
|
|
7286
7320
|
{
|
|
7287
7321
|
...props,
|
|
7322
|
+
$compact: compact,
|
|
7288
7323
|
align,
|
|
7324
|
+
sideOffset: 6,
|
|
7289
7325
|
onFocusOutside: (event) => {
|
|
7290
7326
|
event.preventDefault();
|
|
7291
7327
|
},
|
|
7292
|
-
sideOffset: 6,
|
|
7293
7328
|
children
|
|
7294
7329
|
}
|
|
7295
7330
|
) })
|
|
@@ -7313,9 +7348,10 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
7313
7348
|
asChild: true,
|
|
7314
7349
|
...props,
|
|
7315
7350
|
children: /* @__PURE__ */ jsx185(
|
|
7316
|
-
|
|
7351
|
+
Heading,
|
|
7317
7352
|
{
|
|
7318
|
-
|
|
7353
|
+
renderAs: "span",
|
|
7354
|
+
variant: "heading6",
|
|
7319
7355
|
...props,
|
|
7320
7356
|
children
|
|
7321
7357
|
}
|
|
@@ -7336,6 +7372,7 @@ import {
|
|
|
7336
7372
|
DropdownMenuSubTrigger,
|
|
7337
7373
|
DropdownMenuItem
|
|
7338
7374
|
} from "@radix-ui/react-dropdown-menu";
|
|
7375
|
+
import { isNotNil as isNotNil11 } from "@wistia/type-guards";
|
|
7339
7376
|
|
|
7340
7377
|
// src/components/Menu/MenuItemButton.tsx
|
|
7341
7378
|
import { forwardRef as forwardRef12 } from "react";
|
|
@@ -7343,38 +7380,74 @@ import styled26 from "styled-components";
|
|
|
7343
7380
|
import { isNotNil as isNotNil10, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
7344
7381
|
import { jsx as jsx186, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7345
7382
|
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);
|
|
7383
|
+
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
7350
7384
|
|
|
7351
|
-
text-align: left;
|
|
7352
|
-
align-items: left;
|
|
7353
|
-
border-radius: var(--menu-item-border-radius);
|
|
7354
7385
|
display: flex;
|
|
7386
|
+
flex-direction: row;
|
|
7387
|
+
gap: var(--menu-item-inner-gap);
|
|
7388
|
+
padding: var(--menu-item-padding);
|
|
7389
|
+
border-radius: var(--wui-border-radius-01);
|
|
7390
|
+
text-align: left;
|
|
7391
|
+
color: var(--wui-color-text);
|
|
7392
|
+
font-size: var(--menu-label-font-size);
|
|
7393
|
+
font-weight: var(--menu-label-font-weight);
|
|
7394
|
+
line-height: var(--menu-label-line-height);
|
|
7395
|
+
|
|
7396
|
+
:active {
|
|
7397
|
+
background-color: var(--wui-color-bg-surface-active);
|
|
7398
|
+
}
|
|
7399
|
+
|
|
7400
|
+
&[data-highlighted] {
|
|
7401
|
+
outline: none;
|
|
7402
|
+
${({ $isGated }) => $isGated && getColorScheme("purple")};
|
|
7403
|
+
background-color: var(--wui-color-bg-surface-hover);
|
|
7404
|
+
}
|
|
7355
7405
|
|
|
7356
7406
|
&[aria-disabled='true'] {
|
|
7357
|
-
|
|
7407
|
+
--wui-color-text: var(--wui-color-text-disabled);
|
|
7408
|
+
--wui-color-text-secondary: var(--wui-color-text-disabled);
|
|
7409
|
+
--wui-color-icon: var(--wui-color-icon-disabled);
|
|
7410
|
+
|
|
7411
|
+
&[data-highlighted] {
|
|
7412
|
+
background-color: transparent;
|
|
7413
|
+
}
|
|
7358
7414
|
}
|
|
7359
7415
|
|
|
7360
|
-
|
|
7416
|
+
&[role='menuitemradio'] {
|
|
7417
|
+
padding-left: var(--wui-space-04);
|
|
7418
|
+
}
|
|
7361
7419
|
`;
|
|
7362
|
-
var
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7420
|
+
var StyledLeftIconContainer = styled26.div`
|
|
7421
|
+
height: var(--menu-item-left-icon-size);
|
|
7422
|
+
width: var(--menu-item-left-icon-size);
|
|
7423
|
+
|
|
7424
|
+
svg {
|
|
7425
|
+
height: var(--menu-item-left-icon-size);
|
|
7426
|
+
width: var(--menu-item-left-icon-size);
|
|
7427
|
+
}
|
|
7428
|
+
`;
|
|
7429
|
+
var StyledRightIconContainer = styled26.div`
|
|
7430
|
+
height: var(--menu-item-right-icon-size);
|
|
7431
|
+
width: var(--menu-item-right-icon-size);
|
|
7432
|
+
|
|
7433
|
+
svg {
|
|
7434
|
+
height: var(--menu-item-right-icon-size);
|
|
7435
|
+
width: var(--menu-item-right-icon-size);
|
|
7436
|
+
}
|
|
7437
|
+
`;
|
|
7438
|
+
var StyledLabelAndDescriptionContainer = styled26.div`
|
|
7439
|
+
display: flex;
|
|
7440
|
+
flex-direction: column;
|
|
7441
|
+
gap: var(--menu-label-description-gap);
|
|
7442
|
+
flex-basis: 100%;
|
|
7370
7443
|
`;
|
|
7371
7444
|
var StyledBadgeContainer = styled26.div`
|
|
7372
|
-
grid-area: badge;
|
|
7373
7445
|
align-self: start;
|
|
7374
7446
|
justify-self: end;
|
|
7375
|
-
|
|
7447
|
+
font-size: var(--wui-typography-label-4-size);
|
|
7448
|
+
color: var(--wui-color-text-secondary);
|
|
7376
7449
|
`;
|
|
7377
|
-
var MenuItemButton = forwardRef12(({ children, appearance, command, ...props }, ref) => {
|
|
7450
|
+
var MenuItemButton = forwardRef12(({ children, appearance, command, icon, ...props }, ref) => {
|
|
7378
7451
|
let { colorScheme, badge } = props;
|
|
7379
7452
|
if (appearance === "dangerous") {
|
|
7380
7453
|
if (isNotUndefined8(colorScheme)) {
|
|
@@ -7383,13 +7456,19 @@ var MenuItemButton = forwardRef12(({ children, appearance, command, ...props },
|
|
|
7383
7456
|
colorScheme = "error";
|
|
7384
7457
|
}
|
|
7385
7458
|
if (appearance === "gated") {
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7459
|
+
badge = /* @__PURE__ */ jsx186(
|
|
7460
|
+
Icon,
|
|
7461
|
+
{
|
|
7462
|
+
colorScheme: "purple",
|
|
7463
|
+
style: {
|
|
7464
|
+
height: "16px",
|
|
7465
|
+
width: "16px"
|
|
7466
|
+
},
|
|
7467
|
+
type: "sparkle"
|
|
7468
|
+
}
|
|
7469
|
+
);
|
|
7391
7470
|
}
|
|
7392
|
-
return /* @__PURE__ */
|
|
7471
|
+
return /* @__PURE__ */ jsxs14(
|
|
7393
7472
|
StyledButton3,
|
|
7394
7473
|
{
|
|
7395
7474
|
...props,
|
|
@@ -7397,11 +7476,13 @@ var MenuItemButton = forwardRef12(({ children, appearance, command, ...props },
|
|
|
7397
7476
|
$isGated: appearance === "gated",
|
|
7398
7477
|
colorScheme: colorScheme ?? "default",
|
|
7399
7478
|
fullWidth: true,
|
|
7400
|
-
|
|
7401
|
-
children:
|
|
7402
|
-
children,
|
|
7403
|
-
|
|
7404
|
-
|
|
7479
|
+
unstyled: true,
|
|
7480
|
+
children: [
|
|
7481
|
+
props.leftIcon ? /* @__PURE__ */ jsx186(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
7482
|
+
/* @__PURE__ */ jsx186(StyledLabelAndDescriptionContainer, { children }),
|
|
7483
|
+
isNotNil10(badge) || isNotNil10(command) ? /* @__PURE__ */ jsx186(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
7484
|
+
props.rightIcon ? /* @__PURE__ */ jsx186(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
7485
|
+
]
|
|
7405
7486
|
}
|
|
7406
7487
|
);
|
|
7407
7488
|
});
|
|
@@ -7410,16 +7491,11 @@ MenuItemButton.displayName = "MenuItemButton";
|
|
|
7410
7491
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
7411
7492
|
import styled27 from "styled-components";
|
|
7412
7493
|
import { jsx as jsx187 } from "react/jsx-runtime";
|
|
7413
|
-
var StyledMenuItemLabel = styled27
|
|
7414
|
-
grid-area: label;
|
|
7415
|
-
`;
|
|
7494
|
+
var StyledMenuItemLabel = styled27.span``;
|
|
7416
7495
|
var StyledMenuItemDescription = styled27(Text).attrs({
|
|
7417
|
-
variant: "
|
|
7496
|
+
variant: "body4",
|
|
7418
7497
|
prominence: "secondary"
|
|
7419
|
-
})
|
|
7420
|
-
margin-top: var(--menu-item-gap);
|
|
7421
|
-
grid-area: description;
|
|
7422
|
-
`;
|
|
7498
|
+
})``;
|
|
7423
7499
|
var MenuItemLabel = ({ children }) => {
|
|
7424
7500
|
return /* @__PURE__ */ jsx187(StyledMenuItemLabel, { children });
|
|
7425
7501
|
};
|
|
@@ -7445,7 +7521,7 @@ var StyledSubTrigger = styled28(DropdownMenuSubTrigger)`
|
|
|
7445
7521
|
|
|
7446
7522
|
&[data-state='open'],
|
|
7447
7523
|
&[data-highlighted] {
|
|
7448
|
-
background-color: var(--
|
|
7524
|
+
background-color: var(--wui-color-bg-surface-hover);
|
|
7449
7525
|
}
|
|
7450
7526
|
`;
|
|
7451
7527
|
var SubMenuTrigger = (props) => {
|
|
@@ -7471,7 +7547,7 @@ var SubMenu = ({
|
|
|
7471
7547
|
return isSmAndUp ? /* @__PURE__ */ jsxs15(DropdownMenuSub, { onOpenChange, children: [
|
|
7472
7548
|
/* @__PURE__ */ jsxs15(SubMenuTrigger, { ...props, children: [
|
|
7473
7549
|
/* @__PURE__ */ jsx188(MenuItemLabel, { children: label }),
|
|
7474
|
-
/* @__PURE__ */ jsx188(MenuItemDescription, { children: description })
|
|
7550
|
+
isNotNil11(description) ? /* @__PURE__ */ jsx188(MenuItemDescription, { children: description }) : null
|
|
7475
7551
|
] }),
|
|
7476
7552
|
/* @__PURE__ */ jsx188(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx188(SubMenuContent, { children }) })
|
|
7477
7553
|
] }) : /* @__PURE__ */ jsxs15(DropdownMenuGroup, { children: [
|
|
@@ -7555,6 +7631,7 @@ var RadioMenuItem = ({
|
|
|
7555
7631
|
DropdownMenuRadioItem,
|
|
7556
7632
|
{
|
|
7557
7633
|
...extraProps,
|
|
7634
|
+
asChild: true,
|
|
7558
7635
|
value,
|
|
7559
7636
|
children: /* @__PURE__ */ jsx191(
|
|
7560
7637
|
MenuItemButton,
|
|
@@ -7579,30 +7656,23 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7579
7656
|
{
|
|
7580
7657
|
...props,
|
|
7581
7658
|
fill: "none",
|
|
7582
|
-
height: "
|
|
7583
|
-
viewBox: "0 0
|
|
7584
|
-
width: "
|
|
7659
|
+
height: "24",
|
|
7660
|
+
viewBox: "0 0 24 24",
|
|
7661
|
+
width: "24",
|
|
7585
7662
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7586
7663
|
children: [
|
|
7587
7664
|
/* @__PURE__ */ jsx192(
|
|
7588
7665
|
"path",
|
|
7589
7666
|
{
|
|
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"
|
|
7667
|
+
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",
|
|
7668
|
+
fill: "#2949e5"
|
|
7599
7669
|
}
|
|
7600
7670
|
),
|
|
7601
7671
|
/* @__PURE__ */ jsx192(
|
|
7602
7672
|
"path",
|
|
7603
7673
|
{
|
|
7604
|
-
d: "
|
|
7605
|
-
fill: "
|
|
7674
|
+
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",
|
|
7675
|
+
fill: "#fff"
|
|
7606
7676
|
}
|
|
7607
7677
|
)
|
|
7608
7678
|
]
|
|
@@ -7612,23 +7682,23 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
7612
7682
|
{
|
|
7613
7683
|
...props,
|
|
7614
7684
|
fill: "none",
|
|
7615
|
-
height: "
|
|
7616
|
-
viewBox: "0 0
|
|
7617
|
-
width: "
|
|
7685
|
+
height: "24",
|
|
7686
|
+
viewBox: "0 0 24 24",
|
|
7687
|
+
width: "24",
|
|
7618
7688
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7619
7689
|
children: [
|
|
7620
7690
|
/* @__PURE__ */ jsx192(
|
|
7621
7691
|
"path",
|
|
7622
7692
|
{
|
|
7623
|
-
d: "
|
|
7624
|
-
fill: "#
|
|
7693
|
+
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",
|
|
7694
|
+
fill: "#fcfcfd"
|
|
7625
7695
|
}
|
|
7626
7696
|
),
|
|
7627
7697
|
/* @__PURE__ */ jsx192(
|
|
7628
7698
|
"path",
|
|
7629
7699
|
{
|
|
7630
|
-
d: "
|
|
7631
|
-
stroke: "#
|
|
7700
|
+
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",
|
|
7701
|
+
stroke: "#bbbbc4"
|
|
7632
7702
|
}
|
|
7633
7703
|
)
|
|
7634
7704
|
]
|
|
@@ -7644,6 +7714,7 @@ var CheckboxMenuItem = ({
|
|
|
7644
7714
|
return /* @__PURE__ */ jsx192(
|
|
7645
7715
|
DropdownMenuCheckboxItem,
|
|
7646
7716
|
{
|
|
7717
|
+
asChild: true,
|
|
7647
7718
|
checked,
|
|
7648
7719
|
onCheckedChange,
|
|
7649
7720
|
onSelect,
|
|
@@ -7663,7 +7734,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
|
7663
7734
|
import { forwardRef as forwardRef16 } from "react";
|
|
7664
7735
|
import styled34 from "styled-components";
|
|
7665
7736
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
7666
|
-
import { isNotNil as
|
|
7737
|
+
import { isNotNil as isNotNil14 } from "@wistia/type-guards";
|
|
7667
7738
|
|
|
7668
7739
|
// src/components/Modal/ModalHeader.tsx
|
|
7669
7740
|
import styled31 from "styled-components";
|
|
@@ -7690,7 +7761,7 @@ var ModalCloseButton = () => {
|
|
|
7690
7761
|
|
|
7691
7762
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7692
7763
|
import styled30 from "styled-components";
|
|
7693
|
-
import { isNotNil as
|
|
7764
|
+
import { isNotNil as isNotNil12 } from "@wistia/type-guards";
|
|
7694
7765
|
import { jsx as jsx194 } from "react/jsx-runtime";
|
|
7695
7766
|
var VisuallyHidden = styled30.div({ ...visuallyHiddenStyle });
|
|
7696
7767
|
var VisuallyHiddenButFocusable = styled30.div({
|
|
@@ -7702,7 +7773,7 @@ var ScreenReaderOnly = ({
|
|
|
7702
7773
|
focusable = false,
|
|
7703
7774
|
...otherProps
|
|
7704
7775
|
}) => {
|
|
7705
|
-
const accessibleText =
|
|
7776
|
+
const accessibleText = isNotNil12(text) ? text : children;
|
|
7706
7777
|
if (focusable) {
|
|
7707
7778
|
return /* @__PURE__ */ jsx194(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7708
7779
|
}
|
|
@@ -7749,7 +7820,7 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
|
7749
7820
|
|
|
7750
7821
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
7751
7822
|
import { useRef as useRef5, useEffect as useEffect2 } from "react";
|
|
7752
|
-
import { isNotNil as
|
|
7823
|
+
import { isNotNil as isNotNil13 } from "@wistia/type-guards";
|
|
7753
7824
|
var useFocusRestore = () => {
|
|
7754
7825
|
const previouslyFocusedRef = useRef5(null);
|
|
7755
7826
|
useEffect2(() => {
|
|
@@ -7757,7 +7828,7 @@ var useFocusRestore = () => {
|
|
|
7757
7828
|
}, []);
|
|
7758
7829
|
useEffect2(() => {
|
|
7759
7830
|
return () => {
|
|
7760
|
-
if (
|
|
7831
|
+
if (isNotNil13(previouslyFocusedRef.current)) {
|
|
7761
7832
|
setTimeout(() => {
|
|
7762
7833
|
previouslyFocusedRef.current?.focus();
|
|
7763
7834
|
}, 0);
|
|
@@ -7901,7 +7972,7 @@ var Modal = forwardRef16(
|
|
|
7901
7972
|
DialogRoot,
|
|
7902
7973
|
{
|
|
7903
7974
|
onOpenChange: (open2) => {
|
|
7904
|
-
if (!open2 &&
|
|
7975
|
+
if (!open2 && isNotNil14(onRequestClose)) {
|
|
7905
7976
|
onRequestClose();
|
|
7906
7977
|
}
|
|
7907
7978
|
},
|
|
@@ -7915,7 +7986,7 @@ var Modal = forwardRef16(
|
|
|
7915
7986
|
"aria-describedby": void 0,
|
|
7916
7987
|
fullHeight,
|
|
7917
7988
|
onOpenAutoFocus: (event) => {
|
|
7918
|
-
if (
|
|
7989
|
+
if (isNotNil14(initialFocusRef) && initialFocusRef.current) {
|
|
7919
7990
|
event.preventDefault();
|
|
7920
7991
|
requestAnimationFrame(() => {
|
|
7921
7992
|
initialFocusRef.current?.focus();
|
|
@@ -8077,7 +8148,7 @@ Radio.displayName = "Radio";
|
|
|
8077
8148
|
// src/components/Tag/Tag.tsx
|
|
8078
8149
|
import { forwardRef as forwardRef18 } from "react";
|
|
8079
8150
|
import styled36 from "styled-components";
|
|
8080
|
-
import { isNil as isNil11, isNotNil as
|
|
8151
|
+
import { isNil as isNil11, isNotNil as isNotNil15, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
8081
8152
|
import { Fragment as Fragment2, jsx as jsx200, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8082
8153
|
var TagLabel = styled36.a`
|
|
8083
8154
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -8183,7 +8254,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
8183
8254
|
};
|
|
8184
8255
|
var Tag = forwardRef18(
|
|
8185
8256
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
8186
|
-
const labelProps =
|
|
8257
|
+
const labelProps = isNotNil15(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
|
|
8187
8258
|
return /* @__PURE__ */ jsxs21(
|
|
8188
8259
|
StyledTag,
|
|
8189
8260
|
{
|
|
@@ -8327,7 +8398,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
8327
8398
|
|
|
8328
8399
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
8329
8400
|
import styled38 from "styled-components";
|
|
8330
|
-
import { isNotNil as
|
|
8401
|
+
import { isNotNil as isNotNil16 } from "@wistia/type-guards";
|
|
8331
8402
|
import { jsx as jsx202, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8332
8403
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
8333
8404
|
if (iconOnly) {
|
|
@@ -8421,7 +8492,7 @@ var WistiaLogo = ({
|
|
|
8421
8492
|
...otherProps,
|
|
8422
8493
|
children: [
|
|
8423
8494
|
/* @__PURE__ */ jsx202("title", { children: title }),
|
|
8424
|
-
|
|
8495
|
+
isNotNil16(description) ? /* @__PURE__ */ jsx202("desc", { children: description }) : null,
|
|
8425
8496
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
8426
8497
|
renderLogotype(logotypeColor, iconOnly)
|
|
8427
8498
|
]
|