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