@wistia/ui 0.5.3 → 0.5.4-beta.31b8aad1.95d4301

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.5.3
3
+ * @license @wistia/ui v0.5.4-beta.31b8aad1.95d4301
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -7073,75 +7073,886 @@ var Checkbox = forwardRef7(
7073
7073
  );
7074
7074
  Checkbox.displayName = "Checkbox";
7075
7075
 
7076
+ // src/components/DataCards/DataCard.tsx
7077
+ import styled19, { keyframes } from "styled-components";
7078
+ import { isNotNull } from "@wistia/type-guards";
7079
+ import { jsx as jsx176, jsxs as jsxs12 } from "react/jsx-runtime";
7080
+ var StyledDataCard = styled19.div`
7081
+ ${({ $colorScheme }) => getColorScheme($colorScheme)}
7082
+ display: grid;
7083
+ grid-template-areas: 'label slot' 'value value';
7084
+ grid-template-rows: auto auto;
7085
+ grid-template-columns: auto auto;
7086
+ gap: var(--wui-space-01);
7087
+ padding: var(--wui-space-03);
7088
+ background: var(--wui-color-bg-surface-secondary);
7089
+ flex: 1;
7090
+ border-radius: var(--wui-border-radius-02);
7091
+ position: relative;
7092
+ `;
7093
+ var shimmer = keyframes`
7094
+ 0% {
7095
+ background-position: 200% 0;
7096
+ }
7097
+ 100% {
7098
+ background-position: -200% 0;
7099
+ }
7100
+ `;
7101
+ var LoadingBackground = styled19.div`
7102
+ background: linear-gradient(
7103
+ 90deg,
7104
+ var(--wui-color-bg-surface-tertiary) 25%,
7105
+ var(--wui-color-bg-surface-secondary) 37%,
7106
+ var(--wui-color-bg-surface-tertiary) 63%
7107
+ );
7108
+ background-size: 200% 100%;
7109
+ animation: ${shimmer} 1.5s infinite;
7110
+ border-radius: var(--wui-border-radius-01);
7111
+ `;
7112
+ var StyledLoadingLabel = styled19(LoadingBackground)`
7113
+ width: 80px;
7114
+ height: var(--wui-typography-heading-6-line-height);
7115
+ `;
7116
+ var StyledLoadingValue = styled19(LoadingBackground)`
7117
+ width: 90%;
7118
+ height: var(--wui-typography-heading-3-line-height);
7119
+ `;
7120
+ var StyledLabel3 = styled19(Heading)`
7121
+ grid-area: label;
7122
+ `;
7123
+ var StyledValue = styled19(Heading)`
7124
+ grid-area: value;
7125
+ `;
7126
+ var StyledSlot = styled19.div`
7127
+ display: flex;
7128
+ justify-content: flex-end;
7129
+ grid-area: slot;
7130
+ align-self: center;
7131
+ `;
7132
+ var StyledDataCardTrendContainer = styled19.div`
7133
+ position: absolute;
7134
+ bottom: var(--wui-space-01);
7135
+ right: var(--wui-space-01);
7136
+ `;
7137
+ var DataCard = ({
7138
+ label,
7139
+ value,
7140
+ upperRightSlot,
7141
+ colorScheme = "inherit",
7142
+ isLoading = false,
7143
+ trend,
7144
+ ...props
7145
+ }) => /* @__PURE__ */ jsxs12(
7146
+ StyledDataCard,
7147
+ {
7148
+ $colorScheme: colorScheme,
7149
+ ...props,
7150
+ children: [
7151
+ /* @__PURE__ */ jsx176(
7152
+ StyledLabel3,
7153
+ {
7154
+ renderAs: "dt",
7155
+ variant: "heading6",
7156
+ children: isLoading ? /* @__PURE__ */ jsx176(StyledLoadingLabel, {}) : label
7157
+ }
7158
+ ),
7159
+ /* @__PURE__ */ jsx176(
7160
+ StyledValue,
7161
+ {
7162
+ renderAs: "dd",
7163
+ variant: "heading3",
7164
+ children: isLoading ? /* @__PURE__ */ jsx176(StyledLoadingValue, {}) : value
7165
+ }
7166
+ ),
7167
+ isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */ jsx176(StyledSlot, { children: upperRightSlot }),
7168
+ isNotNull(trend) && !isLoading && /* @__PURE__ */ jsx176(StyledDataCardTrendContainer, { children: trend })
7169
+ ]
7170
+ }
7171
+ );
7172
+ DataCard.displayName = "DataCard";
7173
+
7174
+ // src/components/DataCards/DataCards.tsx
7175
+ import styled20 from "styled-components";
7176
+ import { jsx as jsx177 } from "react/jsx-runtime";
7177
+ var StyledDataCards = styled20(Box)`
7178
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
7179
+ margin-top: 0; /* Remove default <dl> style */
7180
+ > * {
7181
+ min-width: 120px;
7182
+ max-width: ${({ $cardMaxWidth }) => $cardMaxWidth};
7183
+ }
7184
+ `;
7185
+ var DataCards = ({
7186
+ children,
7187
+ cardMaxWidth = "none",
7188
+ colorScheme = "inherit",
7189
+ ...props
7190
+ }) => {
7191
+ return /* @__PURE__ */ jsx177(
7192
+ StyledDataCards,
7193
+ {
7194
+ ...props,
7195
+ $cardMaxWidth: cardMaxWidth,
7196
+ $colorScheme: colorScheme,
7197
+ direction: "row",
7198
+ fill: "horizontal",
7199
+ gap: "space-02",
7200
+ renderAs: "dl",
7201
+ wrapItems: true,
7202
+ children
7203
+ }
7204
+ );
7205
+ };
7206
+ DataCards.displayName = "DataCards";
7207
+
7208
+ // src/components/DataCards/DataCardTrend.tsx
7209
+ import styled22 from "styled-components";
7210
+
7211
+ // src/components/Text/Text.tsx
7212
+ import { forwardRef as forwardRef8 } from "react";
7213
+ import styled21, { css as css19 } from "styled-components";
7214
+ import { jsx as jsx178 } from "react/jsx-runtime";
7215
+ var bodyBoldStyles = css19`
7216
+ > strong,
7217
+ b {
7218
+ font-weight: var(--wui-typography-weight-body-bold);
7219
+ }
7220
+ `;
7221
+ var labelBoldStyles = css19`
7222
+ > strong,
7223
+ b {
7224
+ font-weight: var(--wui-typography-weight-label-bold);
7225
+ }
7226
+ `;
7227
+ var body1TextStyle = css19`
7228
+ --font-family: var(--wui-typography-body-1-family);
7229
+ --font-size: var(--wui-typography-body-1-size);
7230
+ --font-weight: var(--wui-typography-body-1-weight);
7231
+ --line-height: var(--wui-typography-body-1-line-height);
7232
+ --paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
7233
+ ${bodyBoldStyles}
7234
+ `;
7235
+ var body2TextStyle = css19`
7236
+ --font-family: var(--wui-typography-body-2-family);
7237
+ --font-size: var(--wui-typography-body-2-size);
7238
+ --font-weight: var(--wui-typography-body-2-weight);
7239
+ --line-height: var(--wui-typography-body-2-line-height);
7240
+ --paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
7241
+ ${bodyBoldStyles}
7242
+ `;
7243
+ var body3TextStyle = css19`
7244
+ --font-family: var(--wui-typography-body-3-family);
7245
+ --font-size: var(--wui-typography-body-3-size);
7246
+ --font-weight: var(--wui-typography-body-3-weight);
7247
+ --line-height: var(--wui-typography-body-3-line-height);
7248
+ --paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
7249
+ ${bodyBoldStyles}
7250
+ `;
7251
+ var body4TextStyle = css19`
7252
+ --font-family: var(--wui-typography-body-4-family);
7253
+ --font-size: var(--wui-typography-body-4-size);
7254
+ --font-weight: var(--wui-typography-body-4-weight);
7255
+ --line-height: var(--wui-typography-body-4-line-height);
7256
+ --paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
7257
+ ${bodyBoldStyles}
7258
+ `;
7259
+ var label1TextStyle = css19`
7260
+ --font-family: var(--wui-typography-label-1-family);
7261
+ --font-size: var(--wui-typography-label-1-size);
7262
+ --font-weight: var(--wui-typography-label-1-weight);
7263
+ --line-height: var(--wui-typography-label-1-line-height);
7264
+ ${labelBoldStyles}
7265
+ `;
7266
+ var label2TextStyle = css19`
7267
+ --font-family: var(--wui-typography-label-2-family);
7268
+ --font-size: var(--wui-typography-label-2-size);
7269
+ --font-weight: var(--wui-typography-label-2-weight);
7270
+ --line-height: var(--wui-typography-label-2-line-height);
7271
+ ${labelBoldStyles}
7272
+ `;
7273
+ var label3TextStyle = css19`
7274
+ --font-family: var(--wui-typography-label-3-family);
7275
+ --font-size: var(--wui-typography-label-3-size);
7276
+ --font-weight: var(--wui-typography-label-3-weight);
7277
+ --line-height: var(--wui-typography-label-3-line-height);
7278
+ ${labelBoldStyles}
7279
+ `;
7280
+ var label4TextStyle = css19`
7281
+ --font-family: var(--wui-typography-label-4-family);
7282
+ --font-size: var(--wui-typography-label-4-size);
7283
+ --font-weight: var(--wui-typography-label-4-weight);
7284
+ --line-height: var(--wui-typography-label-4-line-height);
7285
+ ${labelBoldStyles}
7286
+ `;
7287
+ var body1MonoTextStyle = css19`
7288
+ ${body1TextStyle};
7289
+ --font-family: var(--wui-typography-family-mono);
7290
+ `;
7291
+ var body2MonoTextStyle = css19`
7292
+ ${body2TextStyle};
7293
+ --font-family: var(--wui-typography-family-mono);
7294
+ `;
7295
+ var body3MonoTextStyle = css19`
7296
+ ${body3TextStyle};
7297
+ --font-family: var(--wui-typography-family-mono);
7298
+ `;
7299
+ var body4MonoTextStyle = css19`
7300
+ ${body4TextStyle};
7301
+ --font-family: var(--wui-typography-family-mono);
7302
+ `;
7303
+ var variantStyleMap2 = {
7304
+ body1: body1TextStyle,
7305
+ body2: body2TextStyle,
7306
+ body3: body3TextStyle,
7307
+ body4: body4TextStyle,
7308
+ body1Mono: body1MonoTextStyle,
7309
+ body2Mono: body2MonoTextStyle,
7310
+ body3Mono: body3MonoTextStyle,
7311
+ body4Mono: body4MonoTextStyle,
7312
+ label1: label1TextStyle,
7313
+ label2: label2TextStyle,
7314
+ label3: label3TextStyle,
7315
+ label4: label4TextStyle
7316
+ };
7317
+ var bodyElement = "p";
7318
+ var labelElement = "span";
7319
+ var DEFAULT_ELEMENT3 = bodyElement;
7320
+ var variantElementMap2 = {
7321
+ body1: DEFAULT_ELEMENT3,
7322
+ body2: DEFAULT_ELEMENT3,
7323
+ body3: DEFAULT_ELEMENT3,
7324
+ body4: DEFAULT_ELEMENT3,
7325
+ body1Mono: DEFAULT_ELEMENT3,
7326
+ body2Mono: DEFAULT_ELEMENT3,
7327
+ body3Mono: DEFAULT_ELEMENT3,
7328
+ body4Mono: DEFAULT_ELEMENT3,
7329
+ label1: labelElement,
7330
+ label2: labelElement,
7331
+ label3: labelElement,
7332
+ label4: labelElement
7333
+ };
7334
+ var StyledText = styled21.div`
7335
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
7336
+ --text-color: ${({ $prominence, $disabled }) => {
7337
+ if ($disabled) {
7338
+ return "var(--wui-color-text-disabled)";
7339
+ }
7340
+ if ($prominence === "secondary") {
7341
+ return "var(--wui-color-text-secondary)";
7342
+ }
7343
+ if ($prominence === "button") {
7344
+ return "var(--wui-color-text-button)";
7345
+ }
7346
+ return "var(--wui-color-text)";
7347
+ }};
7348
+
7349
+ color: var(--text-color);
7350
+ font-family: var(--font-family);
7351
+ font-size: var(--font-size);
7352
+ font-weight: var(--font-weight);
7353
+ line-height: var(--line-height);
7354
+ font-style: normal;
7355
+ margin: 0;
7356
+ ${({ $variant }) => variantStyleMap2[$variant]}
7357
+ ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
7358
+ ${({ $inline }) => $inline && css19`
7359
+ display: inline-block;
7360
+ `}
7361
+ ${({ $disabled }) => $disabled && css19`
7362
+ --text-color: var(--wui-color-text-disabled);
7363
+ `}
7364
+ ${({ $preventUserSelect }) => $preventUserSelect && css19`
7365
+ user-select: none;
7366
+ `}
7367
+ ${({ $align }) => css19`
7368
+ text-align: ${$align};
7369
+ `}
7370
+ ${({ as }) => as === "p" && css19`
7371
+ display: block;
7372
+
7373
+ + p {
7374
+ margin-top: var(--paragraph-spacing, var(--wui-space-04));
7375
+ }
7376
+ `}
7377
+ `;
7378
+ var TextComponent = forwardRef8(
7379
+ ({
7380
+ align = "left",
7381
+ colorScheme = "inherit",
7382
+ disabled = false,
7383
+ ellipsis = false,
7384
+ inline = false,
7385
+ preventUserSelect = false,
7386
+ prominence = "primary",
7387
+ variant = "body2",
7388
+ renderAs,
7389
+ ...otherProps
7390
+ }, ref) => {
7391
+ return /* @__PURE__ */ jsx178(
7392
+ StyledText,
7393
+ {
7394
+ ref,
7395
+ $align: align,
7396
+ $colorScheme: colorScheme,
7397
+ $disabled: disabled,
7398
+ $ellipsis: ellipsis,
7399
+ $inline: inline,
7400
+ $preventUserSelect: preventUserSelect,
7401
+ $prominence: prominence,
7402
+ $variant: variant,
7403
+ as: renderAs ?? variantElementMap2[variant],
7404
+ ...otherProps
7405
+ }
7406
+ );
7407
+ }
7408
+ );
7409
+ TextComponent.displayName = "Text";
7410
+ var Text = makePolymorphic(TextComponent);
7411
+
7412
+ // src/components/DataCards/DataCardTrend.tsx
7413
+ import { jsx as jsx179, jsxs as jsxs13 } from "react/jsx-runtime";
7414
+ var StyledDataCardTrend = styled22.div`
7415
+ ${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
7416
+ background: var(--wui-color-bg-app);
7417
+ border-radius: var(--wui-border-radius-rounded);
7418
+ padding: var(--wui-space-01);
7419
+ display: flex;
7420
+ align-items: center;
7421
+ gap: 2px;
7422
+ `;
7423
+ var DataCardTrend = ({
7424
+ direction = "up",
7425
+ outlook = "positive",
7426
+ children,
7427
+ ...props
7428
+ }) => {
7429
+ return /* @__PURE__ */ jsxs13(StyledDataCardTrend, { $outlook: outlook, children: [
7430
+ /* @__PURE__ */ jsx179(
7431
+ Icon,
7432
+ {
7433
+ size: "md",
7434
+ type: direction === "up" ? "arrow-up" : "arrow-down",
7435
+ ...props
7436
+ }
7437
+ ),
7438
+ /* @__PURE__ */ jsx179(
7439
+ Text,
7440
+ {
7441
+ prominence: "secondary",
7442
+ variant: "label4",
7443
+ children
7444
+ }
7445
+ )
7446
+ ] });
7447
+ };
7448
+
7076
7449
  // src/components/Divider/Divider.tsx
7077
- import styled19, { css as css19 } from "styled-components";
7078
- import { jsx as jsx176 } from "react/jsx-runtime";
7079
- var horizontalBorderCss = css19`
7450
+ import styled23, { css as css20 } from "styled-components";
7451
+ import { jsx as jsx180 } from "react/jsx-runtime";
7452
+ var horizontalBorderCss = css20`
7080
7453
  border-top-color: var(--wui-color-border);
7081
7454
  border-top-style: solid;
7082
7455
  border-top-width: 1px;
7083
7456
  clear: both; /* for horizontal dividers, ensure it clears any floats */
7084
7457
  height: 0;
7085
7458
  `;
7086
- var verticalBorderCss = css19`
7087
- background-color: var(--wui-color-border);
7088
- max-width: 1px;
7089
- min-height: 100%;
7090
- width: 1px;
7459
+ var verticalBorderCss = css20`
7460
+ background-color: var(--wui-color-border);
7461
+ max-width: 1px;
7462
+ min-height: 100%;
7463
+ width: 1px;
7464
+ `;
7465
+ var DividerComponent = styled23.div`
7466
+ ${({ $orientation }) => {
7467
+ switch ($orientation) {
7468
+ case "vertical":
7469
+ return verticalBorderCss;
7470
+ case "horizontal":
7471
+ default:
7472
+ return horizontalBorderCss;
7473
+ }
7474
+ }}
7475
+ `;
7476
+ var Divider = ({
7477
+ orientation = "horizontal",
7478
+ ...otherProps
7479
+ }) => {
7480
+ return /* @__PURE__ */ jsx180(
7481
+ DividerComponent,
7482
+ {
7483
+ $orientation: orientation,
7484
+ "aria-orientation": orientation,
7485
+ role: "separator",
7486
+ ...otherProps
7487
+ }
7488
+ );
7489
+ };
7490
+ Divider.displayName = "Divider";
7491
+
7492
+ // src/components/EditableHeading/EditableHeading.tsx
7493
+ import styled27, { css as css23 } from "styled-components";
7494
+ import { useState as useState5, useRef as useRef4 } from "react";
7495
+
7496
+ // src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
7497
+ import styled24 from "styled-components";
7498
+ import { isNotNil as isNotNil8 } from "@wistia/type-guards";
7499
+ import { jsx as jsx181 } from "react/jsx-runtime";
7500
+ var VisuallyHidden = styled24.div({ ...visuallyHiddenStyle });
7501
+ var VisuallyHiddenButFocusable = styled24.div({
7502
+ "&:not(:focus-within)": visuallyHiddenStyle
7503
+ });
7504
+ var ScreenReaderOnly = ({
7505
+ text,
7506
+ children,
7507
+ focusable = false,
7508
+ ...otherProps
7509
+ }) => {
7510
+ const accessibleText = isNotNil8(text) ? text : children;
7511
+ if (focusable) {
7512
+ return /* @__PURE__ */ jsx181(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
7513
+ }
7514
+ return /* @__PURE__ */ jsx181(VisuallyHidden, { ...otherProps, children: accessibleText });
7515
+ };
7516
+ ScreenReaderOnly.displayName = "ScreenReaderOnly";
7517
+
7518
+ // src/components/Tooltip/Tooltip.tsx
7519
+ import {
7520
+ Root,
7521
+ Content,
7522
+ Trigger,
7523
+ Portal,
7524
+ Arrow
7525
+ } from "@radix-ui/react-tooltip";
7526
+ import styled25, { css as css21 } from "styled-components";
7527
+ import { jsx as jsx182, jsxs as jsxs14 } from "react/jsx-runtime";
7528
+ var CompactTooltipStyles = css21`
7529
+ --tooltip-font-size: var(--wui-typography-label-4-size);
7530
+ --tooltip-line-height: var(--wui-typography-label-4-line-height);
7531
+ --tooltip-font-weight: var(--wui-typography-label-4-weight);
7532
+ --tooltip-horizontal-padding: var(--wui-space-02);
7533
+ --tooltip-vertical-padding: var(--wui-space-03);
7534
+ `;
7535
+ var StyledContent = styled25(Content)`
7536
+ --tooltip-font-family: var(--wui-typography-family-default);
7537
+ --tooltip-border-radius: var(--wui-border-radius-05);
7538
+ --tooltip-bg: var(--wui-color-bg-tooltip);
7539
+ --tooltip-color: var(--wui-color-text-on-fill);
7540
+ --tooltip-font-size: var(--wui-typography-label-3-size);
7541
+ --tooltip-line-height: var(--wui-typography-label-3-line-height);
7542
+ --tooltip-font-weight: var(--wui-typography-label-3-weight);
7543
+ --tooltip-horizontal-padding: var(--wui-space-03);
7544
+ --tooltip-vertical-padding: var(--wui-space-03);
7545
+
7546
+ ${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
7547
+
7548
+ font-family: var(--tooltip-font-family);
7549
+ font-size: var(--tooltip-font-size);
7550
+ border-radius: var(--tooltip-border-radius);
7551
+ padding: var(--tooltip-horizontal-padding) var(--tooltip-vertical-padding);
7552
+ background-color: var(--tooltip-bg);
7553
+ color: var(--tooltip-color);
7554
+ user-select: none;
7555
+ animation-duration: 400ms;
7556
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
7557
+ will-change: transform, opacity;
7558
+ max-width: 30em;
7559
+
7560
+ &[data-state='delayed-open'][data-side='top'] {
7561
+ animation-name: slideDownAndFade;
7562
+ }
7563
+
7564
+ &[data-state='delayed-open'][data-side='right'] {
7565
+ animation-name: slideLeftAndFade;
7566
+ }
7567
+
7568
+ &[data-state='delayed-open'][data-side='bottom'] {
7569
+ animation-name: slideUpAndFade;
7570
+ }
7571
+
7572
+ &[data-state='delayed-open'][data-side='left'] {
7573
+ animation-name: slideRightAndFade;
7574
+ }
7575
+ `;
7576
+ var VISUAL_OFFSET = 6;
7577
+ var Tooltip = ({
7578
+ delay = 700,
7579
+ direction = "top",
7580
+ content,
7581
+ children,
7582
+ forceOpen,
7583
+ compact = false,
7584
+ hideArrow = false
7585
+ }) => {
7586
+ const rootProps = {};
7587
+ if (content === "" || content === null) {
7588
+ rootProps.open = false;
7589
+ }
7590
+ if (forceOpen === true) {
7591
+ rootProps.open = true;
7592
+ }
7593
+ return /* @__PURE__ */ jsxs14(
7594
+ Root,
7595
+ {
7596
+ delayDuration: delay,
7597
+ ...rootProps,
7598
+ children: [
7599
+ /* @__PURE__ */ jsx182(Trigger, { asChild: true, children }),
7600
+ /* @__PURE__ */ jsx182(Portal, { children: /* @__PURE__ */ jsxs14(
7601
+ StyledContent,
7602
+ {
7603
+ $compact: compact,
7604
+ side: direction,
7605
+ sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
7606
+ children: [
7607
+ content,
7608
+ !hideArrow ? /* @__PURE__ */ jsx182(Arrow, { asChild: true, children: /* @__PURE__ */ jsx182(
7609
+ "svg",
7610
+ {
7611
+ fill: "var(--tooltip-bg)",
7612
+ height: "8",
7613
+ style: { transform: "translateY(-2px)" },
7614
+ viewBox: "0 0 12 8",
7615
+ width: "12",
7616
+ xmlns: "http://www.w3.org/2000/svg",
7617
+ children: /* @__PURE__ */ jsx182("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
7618
+ }
7619
+ ) }) : null
7620
+ ]
7621
+ }
7622
+ ) })
7623
+ ]
7624
+ }
7625
+ );
7626
+ };
7627
+ Tooltip.displayName = "Tooltip";
7628
+
7629
+ // src/components/Input/Input.tsx
7630
+ import { forwardRef as forwardRef9, cloneElement as cloneElement3, useRef as useRef3 } from "react";
7631
+ import styled26, { css as css22 } from "styled-components";
7632
+ import { isNil as isNil12, isNotNil as isNotNil9 } from "@wistia/type-guards";
7633
+ import { jsx as jsx183, jsxs as jsxs15 } from "react/jsx-runtime";
7634
+ var inputStyles = css22`
7635
+ --wui-input-color-bg: var(--wui-color-bg-surface);
7636
+ --wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
7637
+ --wui-input-color-border: var(--wui-color-border);
7638
+ --wui-input-color-border-focus: var(--wui-color-border-active);
7639
+ --wui-input-color-border-error: var(--wui-color-border-error);
7640
+ --wui-input-color-border-disabled: var(--wui-color-border-disabled);
7641
+ --wui-input-border-radius: var(--wui-border-radius-rounded);
7642
+ --wui-input-multiline-border-radius: var(--wui-border-radius-02);
7643
+ --wui-input-vertical-padding: var(--wui-space-02);
7644
+ --wui-input-horizontal-padding: var(--wui-space-03);
7645
+ --wui-input-placeholder: var(--wui-gray-10);
7646
+ --wui-input-color-text-error: var(--wui-color-text-error);
7647
+
7648
+ input,
7649
+ textarea {
7650
+ padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
7651
+ background-color: var(--wui-input-color-bg);
7652
+ border: 1px solid var(--wui-input-color-border);
7653
+ border-radius: var(--wui-input-border-radius);
7654
+
7655
+ &::placeholder {
7656
+ color: var(--wui-input-placeholder);
7657
+ opacity: 1; /* Firefox */
7658
+ }
7659
+
7660
+ &:focus {
7661
+ border-color: var(--wui-input-color-border-focus);
7662
+ }
7663
+
7664
+ &[aria-invalid='true'] {
7665
+ border-color: var(--wui-input-color-border-error);
7666
+ color: var(--wui-input-color-text-error);
7667
+ }
7668
+
7669
+ &:disabled {
7670
+ border-color: var(--wui-color-bg-surface-disabled);
7671
+ background-color: var(--wui-color-bg-surface-disabled);
7672
+ }
7673
+ }
7674
+ `;
7675
+ var StyledInputContainer = styled26.div`
7676
+ display: inline-flex;
7677
+ position: relative;
7678
+ ${inputStyles};
7679
+ width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
7680
+
7681
+ input,
7682
+ textarea {
7683
+ width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
7684
+ ${({ $monospace }) => $monospace && "font-family: var(--wui-typography-family-mono);"}
7685
+ }
7686
+
7687
+ textarea {
7688
+ border-radius: var(--wui-input-multiline-border-radius);
7689
+ }
7690
+
7691
+ .wui-input-left-icon {
7692
+ display: flex;
7693
+ align-items: center;
7694
+ position: absolute;
7695
+ top: 50%;
7696
+ left: var(--wui-input-horizontal-padding);
7697
+ transform: translateY(-50%);
7698
+ }
7699
+
7700
+ :has(.wui-input-left-icon) input,
7701
+ :has(.wui-input-left-icon) textarea {
7702
+ padding-left: 32px;
7703
+ }
7704
+
7705
+ .wui-input-right-icon {
7706
+ display: flex;
7707
+ align-items: center;
7708
+ position: absolute;
7709
+ top: 50%;
7710
+ right: var(--wui-input-horizontal-padding);
7711
+ transform: translateY(-50%);
7712
+ }
7713
+
7714
+ :has(.wui-input-right-icon) input,
7715
+ :has(.wui-input-right-icon) textarea {
7716
+ padding-right: 32px;
7717
+ }
7091
7718
  `;
7092
- var DividerComponent = styled19.div`
7093
- ${({ $orientation }) => {
7094
- switch ($orientation) {
7095
- case "vertical":
7096
- return verticalBorderCss;
7097
- case "horizontal":
7098
- default:
7099
- return horizontalBorderCss;
7719
+ var isValidRef2 = (ref) => {
7720
+ return typeof ref === "object" && ref !== null && "current" in ref && isNotNil9(ref.current);
7721
+ };
7722
+ var Input = forwardRef9(
7723
+ ({
7724
+ fullWidth = false,
7725
+ monospace = false,
7726
+ type = "text",
7727
+ autoSelect = false,
7728
+ leftIcon,
7729
+ rightIcon,
7730
+ ...props
7731
+ }, externalRef) => {
7732
+ const internalRef = useRef3();
7733
+ const ref = isValidRef2(externalRef) ? externalRef : internalRef;
7734
+ let leftIconToDisplay = leftIcon;
7735
+ if (isNil12(leftIcon) && type === "search") {
7736
+ leftIconToDisplay = /* @__PURE__ */ jsx183(Icon, { type: "search" });
7737
+ }
7738
+ if (isNotNil9(leftIconToDisplay)) {
7739
+ leftIconToDisplay = cloneElement3(leftIconToDisplay, {
7740
+ size: "md",
7741
+ className: "wui-input-left-icon"
7742
+ });
7743
+ }
7744
+ let rightIconToDisplay = rightIcon;
7745
+ if (isNotNil9(rightIconToDisplay)) {
7746
+ rightIconToDisplay = cloneElement3(rightIconToDisplay, {
7747
+ size: "md",
7748
+ className: "wui-input-right-icon"
7749
+ });
7750
+ }
7751
+ const handleFocus = (event) => {
7752
+ if (isNotNil9(props.onFocus)) {
7753
+ props.onFocus(event);
7754
+ }
7755
+ if (autoSelect && ref && "current" in ref) {
7756
+ requestAnimationFrame(() => {
7757
+ ref.current?.select();
7758
+ });
7759
+ }
7760
+ };
7761
+ return /* @__PURE__ */ jsxs15(
7762
+ StyledInputContainer,
7763
+ {
7764
+ $fullWidth: fullWidth,
7765
+ $monospace: monospace,
7766
+ children: [
7767
+ leftIconToDisplay ?? null,
7768
+ type === "multiline" ? /* @__PURE__ */ jsx183(
7769
+ "textarea",
7770
+ {
7771
+ ...props,
7772
+ ref,
7773
+ onFocus: handleFocus
7774
+ }
7775
+ ) : /* @__PURE__ */ jsx183(
7776
+ "input",
7777
+ {
7778
+ ...props,
7779
+ ref,
7780
+ onFocus: handleFocus,
7781
+ type
7782
+ }
7783
+ ),
7784
+ rightIconToDisplay ?? null
7785
+ ]
7786
+ }
7787
+ );
7788
+ }
7789
+ );
7790
+ Input.displayName = "Input";
7791
+
7792
+ // src/components/EditableHeading/EditableHeading.tsx
7793
+ import { Fragment as Fragment4, jsx as jsx184, jsxs as jsxs16 } from "react/jsx-runtime";
7794
+ var StyledInput = styled27(Input)`
7795
+ :not([rows]) {
7796
+ min-height: unset;
7797
+ }
7798
+
7799
+ resize: vertical;
7800
+ font-size: var(--wui-typography-heading-1-size);
7801
+ font-weight: var(--wui-typography-heading-1-weight);
7802
+ line-height: var(--wui-typography-heading-1-line-height);
7803
+ font-family: var(--wui-typography-heading-1-family);
7804
+ outline: 2px solid var(--wui-color-focus-ring);
7805
+ outline-offset: -2px;
7806
+
7807
+ && {
7808
+ width: 100%;
7809
+ padding: var(--wui-space-02);
7810
+ border: none;
7811
+ height: ${({ $height }) => `${$height}px`};
7100
7812
  }
7101
- }}
7102
7813
  `;
7103
- var Divider = ({
7104
- orientation = "horizontal",
7105
- ...otherProps
7814
+ var editableStyles = css23`
7815
+ &:has(+ :focus-within) {
7816
+ background: var(--wui-color-bg-surface-hover);
7817
+ }
7818
+
7819
+ &:hover {
7820
+ background: var(--wui-color-bg-surface-hover);
7821
+ cursor: pointer;
7822
+ }
7823
+ `;
7824
+ var StyledHeading2 = styled27(Heading)`
7825
+ width: 100%;
7826
+ border-radius: var(--wui-border-radius-02);
7827
+ padding: var(--wui-space-02);
7828
+ overflow-wrap: anywhere;
7829
+ transition: all var(--wui-motion-duration-01) var(--wui-motion-ease);
7830
+ ${({ $editingDisabled }) => !$editingDisabled && editableStyles}
7831
+ `;
7832
+ var EditableHeading = ({
7833
+ children,
7834
+ onValueChange,
7835
+ onEditingChange,
7836
+ tooltipText = "Click to edit title",
7837
+ ariaLabel = "Edit title",
7838
+ forceEditing = false,
7839
+ editingDisabled = false
7106
7840
  }) => {
7107
- return /* @__PURE__ */ jsx176(
7108
- DividerComponent,
7841
+ const [isEditing, setIsEditing] = useState5(false);
7842
+ const [value, setValue] = useState5(children);
7843
+ const [previousValue, setPreviousValue] = useState5(children);
7844
+ const [headingHeight, setHeadingHeight] = useState5("60");
7845
+ const headingRef = useRef4(null);
7846
+ const handleSetEditing = (editing) => {
7847
+ if (editingDisabled) return;
7848
+ if (editing && headingRef.current) {
7849
+ setHeadingHeight(`${headingRef.current.offsetHeight}`);
7850
+ }
7851
+ if (editing) {
7852
+ setPreviousValue(value);
7853
+ }
7854
+ setIsEditing(editing);
7855
+ onEditingChange?.(editing);
7856
+ };
7857
+ const handleFinishEditing = () => {
7858
+ const trimmedValue = value.trim();
7859
+ if (trimmedValue === "") {
7860
+ setValue(previousValue);
7861
+ } else if (trimmedValue !== previousValue && onValueChange) {
7862
+ onValueChange(trimmedValue);
7863
+ } else {
7864
+ setValue(trimmedValue);
7865
+ }
7866
+ handleSetEditing(false);
7867
+ };
7868
+ const handleKeyDown = (event) => {
7869
+ if (event.key === "Enter" && !event.shiftKey) {
7870
+ event.preventDefault();
7871
+ handleFinishEditing();
7872
+ }
7873
+ if (event.key === "Escape") {
7874
+ setValue(previousValue);
7875
+ handleSetEditing(false);
7876
+ }
7877
+ };
7878
+ const HeadingComponent2 = /* @__PURE__ */ jsx184(
7879
+ StyledHeading2,
7109
7880
  {
7110
- $orientation: orientation,
7111
- "aria-orientation": orientation,
7112
- role: "separator",
7113
- ...otherProps
7881
+ ref: headingRef,
7882
+ $editingDisabled: editingDisabled,
7883
+ onClick: () => handleSetEditing(true),
7884
+ variant: "heading1",
7885
+ children: value
7114
7886
  }
7115
7887
  );
7888
+ if (editingDisabled) {
7889
+ return HeadingComponent2;
7890
+ }
7891
+ if (isEditing || forceEditing) {
7892
+ return /* @__PURE__ */ jsx184(
7893
+ StyledInput,
7894
+ {
7895
+ $height: headingHeight,
7896
+ autoFocus: true,
7897
+ fullWidth: true,
7898
+ onBlur: handleFinishEditing,
7899
+ onChange: (event) => setValue(event.target.value),
7900
+ onFocus: (event) => {
7901
+ const { length } = event.currentTarget.value;
7902
+ event.currentTarget.setSelectionRange(length, length);
7903
+ },
7904
+ onKeyDown: handleKeyDown,
7905
+ type: "multiline",
7906
+ value
7907
+ }
7908
+ );
7909
+ }
7910
+ return /* @__PURE__ */ jsxs16(Fragment4, { children: [
7911
+ /* @__PURE__ */ jsx184(
7912
+ Tooltip,
7913
+ {
7914
+ compact: true,
7915
+ content: tooltipText,
7916
+ children: HeadingComponent2
7917
+ }
7918
+ ),
7919
+ /* @__PURE__ */ jsx184(ScreenReaderOnly, { children: /* @__PURE__ */ jsx184(
7920
+ "button",
7921
+ {
7922
+ "aria-label": ariaLabel,
7923
+ onClick: () => handleSetEditing(true),
7924
+ type: "button"
7925
+ }
7926
+ ) })
7927
+ ] });
7116
7928
  };
7117
- Divider.displayName = "Divider";
7118
7929
 
7119
7930
  // src/components/Form/Form.tsx
7120
- import { forwardRef as forwardRef9, useRef as useRef3, useMemo as useMemo4, createContext as createContext2, useState as useState5, useId as useId2 } from "react";
7121
- import styled21 from "styled-components";
7931
+ import { forwardRef as forwardRef11, useRef as useRef5, useMemo as useMemo4, createContext as createContext2, useState as useState6, useId as useId2 } from "react";
7932
+ import styled29 from "styled-components";
7122
7933
  import { isNotUndefined as isNotUndefined4, isUndefined as isUndefined3 } from "@wistia/type-guards";
7123
7934
 
7124
7935
  // src/components/Stack/Stack.tsx
7125
- import { forwardRef as forwardRef8 } from "react";
7126
- import styled20 from "styled-components";
7127
- import { jsx as jsx177 } from "react/jsx-runtime";
7128
- var DEFAULT_ELEMENT3 = "div";
7129
- var StyledStack = styled20.div`
7936
+ import { forwardRef as forwardRef10 } from "react";
7937
+ import styled28 from "styled-components";
7938
+ import { jsx as jsx185 } from "react/jsx-runtime";
7939
+ var DEFAULT_ELEMENT4 = "div";
7940
+ var StyledStack = styled28.div`
7130
7941
  display: flex;
7131
7942
  flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
7132
7943
  gap: ${({ $gap }) => `var(--wui-${$gap})`};
7133
7944
  `;
7134
- var StackComponent = forwardRef8(
7945
+ var StackComponent = forwardRef10(
7135
7946
  ({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
7136
7947
  const responsiveGap = useResponsiveProp(gap);
7137
7948
  const responsiveDirection = useResponsiveProp(direction);
7138
- return /* @__PURE__ */ jsx177(
7949
+ return /* @__PURE__ */ jsx185(
7139
7950
  StyledStack,
7140
7951
  {
7141
7952
  ref,
7142
7953
  $direction: responsiveDirection,
7143
7954
  $gap: responsiveGap,
7144
- as: renderAs ?? DEFAULT_ELEMENT3,
7955
+ as: renderAs ?? DEFAULT_ELEMENT4,
7145
7956
  ...props
7146
7957
  }
7147
7958
  );
@@ -7151,8 +7962,8 @@ StackComponent.displayName = "Stack";
7151
7962
  var Stack = makePolymorphic(StackComponent);
7152
7963
 
7153
7964
  // src/components/Form/Form.tsx
7154
- import { jsx as jsx178 } from "react/jsx-runtime";
7155
- var StyledForm = styled21.form`
7965
+ import { jsx as jsx186 } from "react/jsx-runtime";
7966
+ var StyledForm = styled29.form`
7156
7967
  --form-default-width: 690px;
7157
7968
 
7158
7969
  max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
@@ -7165,9 +7976,9 @@ var FormContext = createContext2({
7165
7976
  formId: ""
7166
7977
  });
7167
7978
  var FormComponent = ({ children, action, values = {}, validate, fullWidth = false, ...props }, forwardedRef) => {
7168
- const [errors, setErrors] = useState5({});
7169
- const [hasSubmitted, setHasSubmitted] = useState5(false);
7170
- const innerRef = useRef3();
7979
+ const [errors, setErrors] = useState6({});
7980
+ const [hasSubmitted, setHasSubmitted] = useState6(false);
7981
+ const innerRef = useRef5();
7171
7982
  const ref = forwardedRef ?? innerRef;
7172
7983
  const autoId = useId2();
7173
7984
  const id = props.id ?? autoId;
@@ -7221,305 +8032,128 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
7221
8032
  }, [values, errors, id, hasSubmitted]);
7222
8033
  return (
7223
8034
  // @ts-expect-error - generic context providers are a giant pain
7224
- /* @__PURE__ */ jsx178(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx178(
8035
+ /* @__PURE__ */ jsx186(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx186(
7225
8036
  Stack,
7226
8037
  {
7227
8038
  gap: "space-05",
7228
- ...props,
7229
- ref,
7230
- $fullWidth: fullWidth,
7231
- as: StyledForm,
7232
- id,
7233
- onBlur: handleBlur,
7234
- onReset: handleReset,
7235
- onSubmit: handleSubmit,
7236
- children
7237
- }
7238
- ) })
7239
- );
7240
- };
7241
- FormComponent.displayName = "Form";
7242
- var Form = forwardRef9(FormComponent);
7243
-
7244
- // src/components/Form/useFormState.tsx
7245
- import { useCallback as useCallback5, useState as useState6 } from "react";
7246
- var useFormState = (action, initialData = {}) => {
7247
- const [data, setData] = useState6(initialData);
7248
- const [isPending, setIsPending] = useState6(false);
7249
- const [error, setError] = useState6(null);
7250
- const formAction = useCallback5(
7251
- async (nextFormData) => {
7252
- if (nextFormData === null) {
7253
- setData(initialData);
7254
- setError(null);
7255
- return;
7256
- }
7257
- const nextData = Object.fromEntries(nextFormData.entries());
7258
- setIsPending(true);
7259
- try {
7260
- const result = await action(data, nextData);
7261
- setData(result);
7262
- } catch (err) {
7263
- setError(err);
7264
- } finally {
7265
- setIsPending(false);
7266
- }
7267
- },
7268
- [action, initialData, data]
7269
- );
7270
- return [
7271
- {
7272
- data,
7273
- error
7274
- },
7275
- formAction,
7276
- isPending
7277
- ];
7278
- };
7279
-
7280
- // src/components/Form/FormErrorSummary.tsx
7281
- import { useContext as useContext2, useRef as useRef4 } from "react";
7282
- import { isArray, isNotUndefined as isNotUndefined5 } from "@wistia/type-guards";
7283
- import { jsx as jsx179, jsxs as jsxs12 } from "react/jsx-runtime";
7284
- var ErrorItem = ({ name, error, formId }) => {
7285
- return /* @__PURE__ */ jsx179("li", { children: /* @__PURE__ */ jsx179(Link, { href: `${formId}-${name}`, children: error }) }, name);
7286
- };
7287
- var FormErrorSummary = ({ description }) => {
7288
- const ref = useRef4(null);
7289
- const { formId, errors, hasSubmitted } = useContext2(FormContext);
7290
- const isValid = Object.keys(errors).length === 0;
7291
- if (isValid || !hasSubmitted) {
7292
- return null;
7293
- }
7294
- return /* @__PURE__ */ jsxs12("div", { ref, children: [
7295
- /* @__PURE__ */ jsx179("p", { children: description }),
7296
- /* @__PURE__ */ jsx179("ul", { children: Object.entries(errors).filter(([, error]) => isNotUndefined5(error)).map(
7297
- ([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */ jsx179(
7298
- ErrorItem,
7299
- {
7300
- error: err,
7301
- formId,
7302
- name
7303
- },
7304
- err
7305
- )) : /* @__PURE__ */ jsx179(
7306
- ErrorItem,
7307
- {
7308
- error: error ?? "",
7309
- formId,
7310
- name
7311
- },
7312
- error
7313
- )
7314
- ) })
7315
- ] });
7316
- };
7317
-
7318
- // src/components/FormField/FormField.tsx
7319
- import { Children as Children3, cloneElement as cloneElement3, useContext as useContext3 } from "react";
7320
- import styled24 from "styled-components";
7321
- import { isArray as isArray2, isNotNil as isNotNil8, isNotUndefined as isNotUndefined6, isUndefined as isUndefined4 } from "@wistia/type-guards";
7322
-
7323
- // src/components/Text/Text.tsx
7324
- import { forwardRef as forwardRef10 } from "react";
7325
- import styled22, { css as css20 } from "styled-components";
7326
- import { jsx as jsx180 } from "react/jsx-runtime";
7327
- var bodyBoldStyles = css20`
7328
- > strong,
7329
- b {
7330
- font-weight: var(--wui-typography-weight-body-bold);
7331
- }
7332
- `;
7333
- var labelBoldStyles = css20`
7334
- > strong,
7335
- b {
7336
- font-weight: var(--wui-typography-weight-label-bold);
7337
- }
7338
- `;
7339
- var body1TextStyle = css20`
7340
- --font-family: var(--wui-typography-body-1-family);
7341
- --font-size: var(--wui-typography-body-1-size);
7342
- --font-weight: var(--wui-typography-body-1-weight);
7343
- --line-height: var(--wui-typography-body-1-line-height);
7344
- ${bodyBoldStyles}
7345
- `;
7346
- var body2TextStyle = css20`
7347
- --font-family: var(--wui-typography-body-2-family);
7348
- --font-size: var(--wui-typography-body-2-size);
7349
- --font-weight: var(--wui-typography-body-2-weight);
7350
- --line-height: var(--wui-typography-body-2-line-height);
7351
- ${bodyBoldStyles}
7352
- `;
7353
- var body3TextStyle = css20`
7354
- --font-family: var(--wui-typography-body-3-family);
7355
- --font-size: var(--wui-typography-body-3-size);
7356
- --font-weight: var(--wui-typography-body-3-weight);
7357
- --line-height: var(--wui-typography-body-3-line-height);
7358
- ${bodyBoldStyles}
7359
- `;
7360
- var body4TextStyle = css20`
7361
- --font-family: var(--wui-typography-body-4-family);
7362
- --font-size: var(--wui-typography-body-4-size);
7363
- --font-weight: var(--wui-typography-body-4-weight);
7364
- --line-height: var(--wui-typography-body-4-line-height);
7365
- ${bodyBoldStyles}
7366
- `;
7367
- var label1TextStyle = css20`
7368
- --font-family: var(--wui-typography-label-1-family);
7369
- --font-size: var(--wui-typography-label-1-size);
7370
- --font-weight: var(--wui-typography-label-1-weight);
7371
- --line-height: var(--wui-typography-label-1-line-height);
7372
- ${labelBoldStyles}
7373
- `;
7374
- var label2TextStyle = css20`
7375
- --font-family: var(--wui-typography-label-2-family);
7376
- --font-size: var(--wui-typography-label-2-size);
7377
- --font-weight: var(--wui-typography-label-2-weight);
7378
- --line-height: var(--wui-typography-label-2-line-height);
7379
- ${labelBoldStyles}
7380
- `;
7381
- var label3TextStyle = css20`
7382
- --font-family: var(--wui-typography-label-3-family);
7383
- --font-size: var(--wui-typography-label-3-size);
7384
- --font-weight: var(--wui-typography-label-3-weight);
7385
- --line-height: var(--wui-typography-label-3-line-height);
7386
- ${labelBoldStyles}
7387
- `;
7388
- var label4TextStyle = css20`
7389
- --font-family: var(--wui-typography-label-4-family);
7390
- --font-size: var(--wui-typography-label-4-size);
7391
- --font-weight: var(--wui-typography-label-4-weight);
7392
- --line-height: var(--wui-typography-label-4-line-height);
7393
- ${labelBoldStyles}
7394
- `;
7395
- var body1MonoTextStyle = css20`
7396
- ${body1TextStyle};
7397
- --font-family: var(--wui-typography-family-mono);
7398
- `;
7399
- var body2MonoTextStyle = css20`
7400
- ${body2TextStyle};
7401
- --font-family: var(--wui-typography-family-mono);
7402
- `;
7403
- var body3MonoTextStyle = css20`
7404
- ${body3TextStyle};
7405
- --font-family: var(--wui-typography-family-mono);
7406
- `;
7407
- var body4MonoTextStyle = css20`
7408
- ${body4TextStyle};
7409
- --font-family: var(--wui-typography-family-mono);
7410
- `;
7411
- var variantStyleMap2 = {
7412
- body1: body1TextStyle,
7413
- body2: body2TextStyle,
7414
- body3: body3TextStyle,
7415
- body4: body4TextStyle,
7416
- body1Mono: body1MonoTextStyle,
7417
- body2Mono: body2MonoTextStyle,
7418
- body3Mono: body3MonoTextStyle,
7419
- body4Mono: body4MonoTextStyle,
7420
- label1: label1TextStyle,
7421
- label2: label2TextStyle,
7422
- label3: label3TextStyle,
7423
- label4: label4TextStyle
7424
- };
7425
- var StyledText = styled22.div`
7426
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
7427
- --text-color: ${({ $prominence, $disabled }) => {
7428
- if ($disabled) {
7429
- return "var(--wui-color-text-disabled)";
7430
- }
7431
- if ($prominence === "secondary") {
7432
- return "var(--wui-color-text-secondary)";
7433
- }
7434
- if ($prominence === "button") {
7435
- return "var(--wui-color-text-button)";
7436
- }
7437
- return "var(--wui-color-text)";
7438
- }};
7439
-
7440
- color: var(--text-color);
7441
- font-family: var(--font-family);
7442
- font-size: var(--font-size);
7443
- font-weight: var(--font-weight);
7444
- line-height: var(--line-height);
7445
- font-style: normal;
7446
- margin: 0;
7447
- ${({ $variant }) => variantStyleMap2[$variant]}
7448
- ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
7449
- ${({ $inline }) => $inline && css20`
7450
- display: inline-block;
7451
- `}
7452
- ${({ $disabled }) => $disabled && css20`
7453
- --text-color: var(--wui-color-text-disabled);
7454
- `}
7455
- ${({ $preventUserSelect }) => $preventUserSelect && css20`
7456
- user-select: none;
7457
- `}
7458
- ${({ $align }) => css20`
7459
- text-align: ${$align};
7460
- `}
7461
- ${({ as }) => as === "p" && css20`
7462
- display: block;
7463
- `}
7464
- `;
7465
- var DEFAULT_ELEMENT4 = "div";
7466
- var TextComponent = forwardRef10(
7467
- ({
7468
- align = "left",
7469
- colorScheme = "inherit",
7470
- disabled = false,
7471
- ellipsis = false,
7472
- inline = false,
7473
- preventUserSelect = false,
7474
- prominence = "primary",
7475
- variant = "body2",
7476
- renderAs,
7477
- ...otherProps
7478
- }, ref) => {
7479
- return /* @__PURE__ */ jsx180(
7480
- StyledText,
7481
- {
7482
- ref,
7483
- $align: align,
7484
- $colorScheme: colorScheme,
7485
- $disabled: disabled,
7486
- $ellipsis: ellipsis,
7487
- $inline: inline,
7488
- $preventUserSelect: preventUserSelect,
7489
- $prominence: prominence,
7490
- $variant: variant,
7491
- as: renderAs ?? DEFAULT_ELEMENT4,
7492
- ...otherProps
8039
+ ...props,
8040
+ ref,
8041
+ $fullWidth: fullWidth,
8042
+ as: StyledForm,
8043
+ id,
8044
+ onBlur: handleBlur,
8045
+ onReset: handleReset,
8046
+ onSubmit: handleSubmit,
8047
+ children
7493
8048
  }
7494
- );
8049
+ ) })
8050
+ );
8051
+ };
8052
+ FormComponent.displayName = "Form";
8053
+ var Form = forwardRef11(FormComponent);
8054
+
8055
+ // src/components/Form/useFormState.tsx
8056
+ import { useCallback as useCallback5, useState as useState7 } from "react";
8057
+ var useFormState = (action, initialData = {}) => {
8058
+ const [data, setData] = useState7(initialData);
8059
+ const [isPending, setIsPending] = useState7(false);
8060
+ const [error, setError] = useState7(null);
8061
+ const formAction = useCallback5(
8062
+ async (nextFormData) => {
8063
+ if (nextFormData === null) {
8064
+ setData(initialData);
8065
+ setError(null);
8066
+ return;
8067
+ }
8068
+ const nextData = Object.fromEntries(nextFormData.entries());
8069
+ setIsPending(true);
8070
+ try {
8071
+ const result = await action(data, nextData);
8072
+ setData(result);
8073
+ } catch (err) {
8074
+ setError(err);
8075
+ } finally {
8076
+ setIsPending(false);
8077
+ }
8078
+ },
8079
+ [action, initialData, data]
8080
+ );
8081
+ return [
8082
+ {
8083
+ data,
8084
+ error
8085
+ },
8086
+ formAction,
8087
+ isPending
8088
+ ];
8089
+ };
8090
+
8091
+ // src/components/Form/FormErrorSummary.tsx
8092
+ import { useContext as useContext2, useRef as useRef6 } from "react";
8093
+ import { isArray, isNotUndefined as isNotUndefined5 } from "@wistia/type-guards";
8094
+ import { jsx as jsx187, jsxs as jsxs17 } from "react/jsx-runtime";
8095
+ var ErrorItem = ({ name, error, formId }) => {
8096
+ return /* @__PURE__ */ jsx187("li", { children: /* @__PURE__ */ jsx187(Link, { href: `${formId}-${name}`, children: error }) }, name);
8097
+ };
8098
+ var FormErrorSummary = ({ description }) => {
8099
+ const ref = useRef6(null);
8100
+ const { formId, errors, hasSubmitted } = useContext2(FormContext);
8101
+ const isValid = Object.keys(errors).length === 0;
8102
+ if (isValid || !hasSubmitted) {
8103
+ return null;
7495
8104
  }
7496
- );
7497
- TextComponent.displayName = "Text";
7498
- var Text = makePolymorphic(TextComponent);
8105
+ return /* @__PURE__ */ jsxs17("div", { ref, children: [
8106
+ /* @__PURE__ */ jsx187("p", { children: description }),
8107
+ /* @__PURE__ */ jsx187("ul", { children: Object.entries(errors).filter(([, error]) => isNotUndefined5(error)).map(
8108
+ ([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */ jsx187(
8109
+ ErrorItem,
8110
+ {
8111
+ error: err,
8112
+ formId,
8113
+ name
8114
+ },
8115
+ err
8116
+ )) : /* @__PURE__ */ jsx187(
8117
+ ErrorItem,
8118
+ {
8119
+ error: error ?? "",
8120
+ formId,
8121
+ name
8122
+ },
8123
+ error
8124
+ )
8125
+ ) })
8126
+ ] });
8127
+ };
8128
+
8129
+ // src/components/FormField/FormField.tsx
8130
+ import { Children as Children3, cloneElement as cloneElement4, useContext as useContext3 } from "react";
8131
+ import styled31 from "styled-components";
8132
+ import { isArray as isArray2, isNotNil as isNotNil10, isNotUndefined as isNotUndefined6, isUndefined as isUndefined4 } from "@wistia/type-guards";
7499
8133
 
7500
8134
  // src/components/FormGroup/CheckboxGroup.tsx
7501
8135
  import { createContext as createContext3, useMemo as useMemo5 } from "react";
7502
8136
 
7503
8137
  // src/components/FormGroup/FormGroup.tsx
7504
- import styled23 from "styled-components";
7505
- import { useRef as useRef5 } from "react";
7506
- import { jsx as jsx181, jsxs as jsxs13 } from "react/jsx-runtime";
7507
- var StyledFieldset = styled23.fieldset`
8138
+ import styled30 from "styled-components";
8139
+ import { useRef as useRef7 } from "react";
8140
+ import { jsx as jsx188, jsxs as jsxs18 } from "react/jsx-runtime";
8141
+ var StyledFieldset = styled30.fieldset`
7508
8142
  border: 0;
7509
8143
  `;
7510
- var StyledLegend = styled23.legend`
8144
+ var StyledLegend = styled30.legend`
7511
8145
  margin-bottom: var(--space-01);
7512
8146
  `;
7513
8147
  var FormGroup = ({ children, label, ...props }) => {
7514
- const ref = useRef5();
7515
- return /* @__PURE__ */ jsxs13(
8148
+ const ref = useRef7();
8149
+ return /* @__PURE__ */ jsxs18(
7516
8150
  Stack,
7517
8151
  {
7518
8152
  ...props,
7519
8153
  ref,
7520
8154
  renderAs: StyledFieldset,
7521
8155
  children: [
7522
- /* @__PURE__ */ jsx181(
8156
+ /* @__PURE__ */ jsx188(
7523
8157
  Heading,
7524
8158
  {
7525
8159
  renderAs: StyledLegend,
@@ -7535,7 +8169,7 @@ var FormGroup = ({ children, label, ...props }) => {
7535
8169
  FormGroup.displayName = "FormGroup";
7536
8170
 
7537
8171
  // src/components/FormGroup/CheckboxGroup.tsx
7538
- import { jsx as jsx182 } from "react/jsx-runtime";
8172
+ import { jsx as jsx189 } from "react/jsx-runtime";
7539
8173
  var CheckboxGroupContext = createContext3(null);
7540
8174
  var CheckboxGroup = ({
7541
8175
  children,
@@ -7550,13 +8184,13 @@ var CheckboxGroup = ({
7550
8184
  onChange
7551
8185
  };
7552
8186
  }, [name, onChange]);
7553
- return /* @__PURE__ */ jsx182(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx182(FormGroup, { ...props, children }) });
8187
+ return /* @__PURE__ */ jsx189(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx189(FormGroup, { ...props, children }) });
7554
8188
  };
7555
8189
  CheckboxGroup.displayName = "CheckboxGroup";
7556
8190
 
7557
8191
  // src/components/FormField/FormField.tsx
7558
- import { jsx as jsx183, jsxs as jsxs14 } from "react/jsx-runtime";
7559
- var StyledFormField = styled24.div`
8192
+ import { jsx as jsx190, jsxs as jsxs19 } from "react/jsx-runtime";
8193
+ var StyledFormField = styled31.div`
7560
8194
  --form-field-spacing: var(--wui-space-01);
7561
8195
  --form-field-error-color: var(--wui-color-text-secondary-error);
7562
8196
 
@@ -7564,7 +8198,7 @@ var StyledFormField = styled24.div`
7564
8198
  flex-direction: column;
7565
8199
  gap: var(--form-field-spacing);
7566
8200
  `;
7567
- var StyledErrorList = styled24.ul`
8201
+ var StyledErrorList = styled31.ul`
7568
8202
  margin: 0;
7569
8203
  padding: 0;
7570
8204
  padding-left: var(--wui-space-04);
@@ -7574,7 +8208,7 @@ var StyledErrorList = styled24.ul`
7574
8208
  `;
7575
8209
  var ErrorMessages = ({ errors, id }) => {
7576
8210
  const isMultipleErrors = isArray2(errors);
7577
- return isMultipleErrors ? /* @__PURE__ */ jsx183(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ jsx183(
8211
+ return isMultipleErrors ? /* @__PURE__ */ jsx190(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ jsx190(
7578
8212
  Text,
7579
8213
  {
7580
8214
  colorScheme: "error",
@@ -7584,7 +8218,7 @@ var ErrorMessages = ({ errors, id }) => {
7584
8218
  children: error
7585
8219
  },
7586
8220
  `${id}-${index}`
7587
- )) }) : /* @__PURE__ */ jsx183(
8221
+ )) }) : /* @__PURE__ */ jsx190(
7588
8222
  Text,
7589
8223
  {
7590
8224
  colorScheme: "error",
@@ -7622,8 +8256,8 @@ var FormField = ({
7622
8256
  defaultValue
7623
8257
  };
7624
8258
  }
7625
- if (isNotNil8(checkboxGroup)) {
7626
- const computedName = isNotNil8(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
8259
+ if (isNotNil10(checkboxGroup)) {
8260
+ const computedName = isNotNil10(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
7627
8261
  const handleChange = (event) => {
7628
8262
  if (isNotUndefined6(props.onChange)) {
7629
8263
  props.onChange(event);
@@ -7636,15 +8270,15 @@ var FormField = ({
7636
8270
  ...childProps,
7637
8271
  name: computedName,
7638
8272
  onChange: handleChange,
7639
- "aria-invalid": isNotNil8(error),
7640
- "aria-describedby": isNotNil8(error) ? `${id}-error` : void 0
8273
+ "aria-invalid": isNotNil10(error),
8274
+ "aria-describedby": isNotNil10(error) ? `${id}-error` : void 0
7641
8275
  };
7642
8276
  }
7643
8277
  Children3.only(children);
7644
- return /* @__PURE__ */ jsxs14(StyledFormField, { ...props, children: [
7645
- !isInlineLabel && /* @__PURE__ */ jsx183(Label, { htmlFor: id, children: label }),
7646
- cloneElement3(children, childProps),
7647
- isNotNil8(computedError) ? /* @__PURE__ */ jsx183(
8278
+ return /* @__PURE__ */ jsxs19(StyledFormField, { ...props, children: [
8279
+ !isInlineLabel && /* @__PURE__ */ jsx190(Label, { htmlFor: id, children: label }),
8280
+ cloneElement4(children, childProps),
8281
+ isNotNil10(computedError) ? /* @__PURE__ */ jsx190(
7648
8282
  ErrorMessages,
7649
8283
  {
7650
8284
  errors: computedError,
@@ -7657,7 +8291,7 @@ FormField.displayName = "FormField";
7657
8291
 
7658
8292
  // src/components/FormGroup/RadioGroup.tsx
7659
8293
  import { createContext as createContext4, useMemo as useMemo6 } from "react";
7660
- import { jsx as jsx184 } from "react/jsx-runtime";
8294
+ import { jsx as jsx191 } from "react/jsx-runtime";
7661
8295
  var RadioGroupContext = createContext4(null);
7662
8296
  var RadioGroup = ({
7663
8297
  children,
@@ -7672,15 +8306,15 @@ var RadioGroup = ({
7672
8306
  onChange
7673
8307
  };
7674
8308
  }, [name, onChange]);
7675
- return /* @__PURE__ */ jsx184(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx184(FormGroup, { ...props, children }) });
8309
+ return /* @__PURE__ */ jsx191(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx191(FormGroup, { ...props, children }) });
7676
8310
  };
7677
8311
  RadioGroup.displayName = "RadioGroup";
7678
8312
 
7679
8313
  // src/components/IconButton/IconButton.tsx
7680
- import { Children as Children4, cloneElement as cloneElement4, forwardRef as forwardRef11 } from "react";
7681
- import styled25 from "styled-components";
7682
- import { jsx as jsx185 } from "react/jsx-runtime";
7683
- var StyledButton2 = styled25(Button)`
8314
+ import { Children as Children4, cloneElement as cloneElement5, forwardRef as forwardRef12 } from "react";
8315
+ import styled32 from "styled-components";
8316
+ import { jsx as jsx192 } from "react/jsx-runtime";
8317
+ var StyledButton2 = styled32(Button)`
7684
8318
  --icon-button-size-sm: 24px;
7685
8319
  --icon-button-size-md: 32px;
7686
8320
  --icon-button-size-lg: 40px;
@@ -7694,10 +8328,10 @@ var StyledButton2 = styled25(Button)`
7694
8328
  align-items: center;
7695
8329
  line-height: 1;
7696
8330
  `;
7697
- var IconButton = forwardRef11(
8331
+ var IconButton = forwardRef12(
7698
8332
  ({ children, label, size = "md", ...props }, ref) => {
7699
8333
  const responsiveSize = useResponsiveProp(size);
7700
- return /* @__PURE__ */ jsx185(
8334
+ return /* @__PURE__ */ jsx192(
7701
8335
  StyledButton2,
7702
8336
  {
7703
8337
  ...props,
@@ -7705,7 +8339,7 @@ var IconButton = forwardRef11(
7705
8339
  "aria-label": label,
7706
8340
  "data-wistia-ui-icon-button": true,
7707
8341
  size: responsiveSize,
7708
- children: cloneElement4(Children4.only(children), {
8342
+ children: cloneElement5(Children4.only(children), {
7709
8343
  size: responsiveSize
7710
8344
  })
7711
8345
  }
@@ -7714,178 +8348,15 @@ var IconButton = forwardRef11(
7714
8348
  );
7715
8349
  IconButton.displayName = "IconButton";
7716
8350
 
7717
- // src/components/Input/Input.tsx
7718
- import { forwardRef as forwardRef12, cloneElement as cloneElement5, useRef as useRef6 } from "react";
7719
- import styled26, { css as css21 } from "styled-components";
7720
- import { isNil as isNil12, isNotNil as isNotNil9 } from "@wistia/type-guards";
7721
- import { jsx as jsx186, jsxs as jsxs15 } from "react/jsx-runtime";
7722
- var inputStyles = css21`
7723
- --wui-input-color-bg: var(--wui-color-bg-surface);
7724
- --wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
7725
- --wui-input-color-border: var(--wui-color-border);
7726
- --wui-input-color-border-focus: var(--wui-color-border-active);
7727
- --wui-input-color-border-error: var(--wui-color-border-error);
7728
- --wui-input-color-border-disabled: var(--wui-color-border-disabled);
7729
- --wui-input-border-radius: var(--wui-border-radius-rounded);
7730
- --wui-input-multiline-border-radius: var(--wui-border-radius-02);
7731
- --wui-input-vertical-padding: var(--wui-space-02);
7732
- --wui-input-horizontal-padding: var(--wui-space-03);
7733
- --wui-input-placeholder: var(--wui-gray-10);
7734
- --wui-input-color-text-error: var(--wui-color-text-error);
7735
-
7736
- input,
7737
- textarea {
7738
- padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
7739
- background-color: var(--wui-input-color-bg);
7740
- border: 1px solid var(--wui-input-color-border);
7741
- border-radius: var(--wui-input-border-radius);
7742
-
7743
- &::placeholder {
7744
- color: var(--wui-input-placeholder);
7745
- opacity: 1; /* Firefox */
7746
- }
7747
-
7748
- &:focus {
7749
- border-color: var(--wui-input-color-border-focus);
7750
- }
7751
-
7752
- &[aria-invalid='true'] {
7753
- border-color: var(--wui-input-color-border-error);
7754
- color: var(--wui-input-color-text-error);
7755
- }
7756
-
7757
- &:disabled {
7758
- border-color: var(--wui-color-bg-surface-disabled);
7759
- background-color: var(--wui-color-bg-surface-disabled);
7760
- }
7761
- }
7762
- `;
7763
- var StyledInputContainer = styled26.div`
7764
- display: inline-flex;
7765
- position: relative;
7766
- ${inputStyles};
7767
- width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
7768
-
7769
- input,
7770
- textarea {
7771
- width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
7772
- ${({ $monospace }) => $monospace && "font-family: var(--wui-typography-family-mono);"}
7773
- }
7774
-
7775
- textarea {
7776
- border-radius: var(--wui-input-multiline-border-radius);
7777
- }
7778
-
7779
- .wui-input-left-icon {
7780
- display: flex;
7781
- align-items: center;
7782
- position: absolute;
7783
- top: 50%;
7784
- left: var(--wui-input-horizontal-padding);
7785
- transform: translateY(-50%);
7786
- }
7787
-
7788
- :has(.wui-input-left-icon) input,
7789
- :has(.wui-input-left-icon) textarea {
7790
- padding-left: 32px;
7791
- }
7792
-
7793
- .wui-input-right-icon {
7794
- display: flex;
7795
- align-items: center;
7796
- position: absolute;
7797
- top: 50%;
7798
- right: var(--wui-input-horizontal-padding);
7799
- transform: translateY(-50%);
7800
- }
7801
-
7802
- :has(.wui-input-right-icon) input,
7803
- :has(.wui-input-right-icon) textarea {
7804
- padding-right: 32px;
7805
- }
7806
- `;
7807
- var isValidRef2 = (ref) => {
7808
- return typeof ref === "object" && ref !== null && "current" in ref && isNotNil9(ref.current);
7809
- };
7810
- var Input = forwardRef12(
7811
- ({
7812
- fullWidth = false,
7813
- monospace = false,
7814
- type = "text",
7815
- autoSelect = false,
7816
- leftIcon,
7817
- rightIcon,
7818
- ...props
7819
- }, externalRef) => {
7820
- const internalRef = useRef6();
7821
- const ref = isValidRef2(externalRef) ? externalRef : internalRef;
7822
- let leftIconToDisplay = leftIcon;
7823
- if (isNil12(leftIcon) && type === "search") {
7824
- leftIconToDisplay = /* @__PURE__ */ jsx186(Icon, { type: "search" });
7825
- }
7826
- if (isNotNil9(leftIconToDisplay)) {
7827
- leftIconToDisplay = cloneElement5(leftIconToDisplay, {
7828
- size: "md",
7829
- className: "wui-input-left-icon"
7830
- });
7831
- }
7832
- let rightIconToDisplay = rightIcon;
7833
- if (isNotNil9(rightIconToDisplay)) {
7834
- rightIconToDisplay = cloneElement5(rightIconToDisplay, {
7835
- size: "md",
7836
- className: "wui-input-right-icon"
7837
- });
7838
- }
7839
- const handleFocus = (event) => {
7840
- if (isNotNil9(props.onFocus)) {
7841
- props.onFocus(event);
7842
- }
7843
- if (autoSelect && ref && "current" in ref) {
7844
- requestAnimationFrame(() => {
7845
- ref.current?.select();
7846
- });
7847
- }
7848
- };
7849
- return /* @__PURE__ */ jsxs15(
7850
- StyledInputContainer,
7851
- {
7852
- $fullWidth: fullWidth,
7853
- $monospace: monospace,
7854
- children: [
7855
- leftIconToDisplay ?? null,
7856
- type === "multiline" ? /* @__PURE__ */ jsx186(
7857
- "textarea",
7858
- {
7859
- ...props,
7860
- ref,
7861
- onFocus: handleFocus
7862
- }
7863
- ) : /* @__PURE__ */ jsx186(
7864
- "input",
7865
- {
7866
- ...props,
7867
- ref,
7868
- onFocus: handleFocus,
7869
- type
7870
- }
7871
- ),
7872
- rightIconToDisplay ?? null
7873
- ]
7874
- }
7875
- );
7876
- }
7877
- );
7878
- Input.displayName = "Input";
7879
-
7880
8351
  // src/components/Menu/Menu.tsx
7881
- import styled27, { css as css22, keyframes } from "styled-components";
8352
+ import styled33, { css as css24, keyframes as keyframes2 } from "styled-components";
7882
8353
  import {
7883
8354
  DropdownMenu,
7884
8355
  DropdownMenuTrigger,
7885
8356
  DropdownMenuPortal,
7886
8357
  DropdownMenuContent
7887
8358
  } from "@radix-ui/react-dropdown-menu";
7888
- import { isNotNil as isNotNil10, isNotUndefined as isNotUndefined7 } from "@wistia/type-guards";
8359
+ import { isNotNil as isNotNil11, isNotUndefined as isNotUndefined7 } from "@wistia/type-guards";
7889
8360
  import { useMemo as useMemo7 } from "react";
7890
8361
 
7891
8362
  // src/components/Menu/MenuContext.tsx
@@ -7894,8 +8365,8 @@ var MenuContext = createContext5({ compact: false });
7894
8365
  var useMenuContext = () => useContext4(MenuContext);
7895
8366
 
7896
8367
  // src/components/Menu/Menu.tsx
7897
- import { jsx as jsx187, jsxs as jsxs16 } from "react/jsx-runtime";
7898
- var open = keyframes`
8368
+ import { jsx as jsx193, jsxs as jsxs20 } from "react/jsx-runtime";
8369
+ var open = keyframes2`
7899
8370
  from {
7900
8371
  opacity: 0;
7901
8372
  transform: scale(.97) translateY(-8px);
@@ -7905,7 +8376,7 @@ var open = keyframes`
7905
8376
  transform: scale(1);
7906
8377
  }
7907
8378
  `;
7908
- var close = keyframes`
8379
+ var close = keyframes2`
7909
8380
  from {
7910
8381
  opacity: 1;
7911
8382
  transform: scale(1);
@@ -7915,7 +8386,7 @@ var close = keyframes`
7915
8386
  transform: scale(.97) translateY(-8px);
7916
8387
  }
7917
8388
  `;
7918
- var menuItemCss = css22`
8389
+ var menuItemCss = css24`
7919
8390
  --menu-label-description-gap: var(--wui-space-01);
7920
8391
  --menu-item-inner-gap: var(--wui-space-03);
7921
8392
  --menu-item-left-icon-size: 24px;
@@ -7926,7 +8397,7 @@ var menuItemCss = css22`
7926
8397
  --menu-label-line-height: var(--wui-typography-label-3-line-height);
7927
8398
  --menu-divider-margin: var(--wui-space-02);
7928
8399
  `;
7929
- var compactMenuItemCss = css22`
8400
+ var compactMenuItemCss = css24`
7930
8401
  --menu-label-description-gap: 0;
7931
8402
  --menu-item-inner-gap: var(--wui-space-02);
7932
8403
  --menu-item-left-icon-size: 16px;
@@ -7937,7 +8408,7 @@ var compactMenuItemCss = css22`
7937
8408
  --menu-label-line-height: var(--wui-typography-label-4-line-height);
7938
8409
  --menu-divider-margin: var(--wui-space-01);
7939
8410
  `;
7940
- var menuContentCss = css22`
8411
+ var menuContentCss = css24`
7941
8412
  --menu-font-family: var(--wui-typography-family-default);
7942
8413
  --menu-bg: var(--wui-color-bg-surface);
7943
8414
  --menu-shadow: var(--wui-elevation-01);
@@ -7979,7 +8450,7 @@ var menuContentCss = css22`
7979
8450
  margin: var(--menu-divider-margin) 0;
7980
8451
  }
7981
8452
  `;
7982
- var MenuContent = styled27(DropdownMenuContent)`
8453
+ var MenuContent = styled33(DropdownMenuContent)`
7983
8454
  ${menuContentCss}
7984
8455
  `;
7985
8456
  var Menu = ({
@@ -7997,7 +8468,7 @@ var Menu = ({
7997
8468
  }) => {
7998
8469
  const contextValue = useMemo7(() => ({ compact }), [compact]);
7999
8470
  let controlProps = {
8000
- ...isNotNil10(onOpenChange) && isNotNil10(isOpen) ? { open: isOpen, onOpenChange } : {}
8471
+ ...isNotNil11(onOpenChange) && isNotNil11(isOpen) ? { open: isOpen, onOpenChange } : {}
8001
8472
  };
8002
8473
  if (disabled) {
8003
8474
  controlProps = {
@@ -8005,24 +8476,24 @@ var Menu = ({
8005
8476
  onOpenChange: () => null
8006
8477
  };
8007
8478
  }
8008
- return /* @__PURE__ */ jsx187(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs16(
8479
+ return /* @__PURE__ */ jsx193(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs20(
8009
8480
  DropdownMenu,
8010
8481
  {
8011
8482
  modal: false,
8012
8483
  ...controlProps,
8013
8484
  children: [
8014
- /* @__PURE__ */ jsx187(DropdownMenuTrigger, { asChild: true, children: isNotUndefined7(trigger) ? trigger : /* @__PURE__ */ jsx187(
8485
+ /* @__PURE__ */ jsx193(DropdownMenuTrigger, { asChild: true, children: isNotUndefined7(trigger) ? trigger : /* @__PURE__ */ jsx193(
8015
8486
  Button,
8016
8487
  {
8017
8488
  "aria-expanded": isOpen,
8018
8489
  disabled,
8019
8490
  forceState: isOpen ? "active" : void 0,
8020
- rightIcon: /* @__PURE__ */ jsx187(Icon, { type: "caret-down" }),
8491
+ rightIcon: /* @__PURE__ */ jsx193(Icon, { type: "caret-down" }),
8021
8492
  ...triggerProps,
8022
8493
  children: label
8023
8494
  }
8024
8495
  ) }),
8025
- /* @__PURE__ */ jsx187(DropdownMenuPortal, { children: /* @__PURE__ */ jsx187(
8496
+ /* @__PURE__ */ jsx193(DropdownMenuPortal, { children: /* @__PURE__ */ jsx193(
8026
8497
  MenuContent,
8027
8498
  {
8028
8499
  ...props,
@@ -8042,19 +8513,19 @@ var Menu = ({
8042
8513
  Menu.displayName = "Menu";
8043
8514
 
8044
8515
  // src/components/Menu/MenuLabel.tsx
8045
- import styled28 from "styled-components";
8516
+ import styled34 from "styled-components";
8046
8517
  import { DropdownMenuLabel } from "@radix-ui/react-dropdown-menu";
8047
- import { jsx as jsx188 } from "react/jsx-runtime";
8048
- var StyledMenuLabel = styled28(DropdownMenuLabel)`
8518
+ import { jsx as jsx194 } from "react/jsx-runtime";
8519
+ var StyledMenuLabel = styled34(DropdownMenuLabel)`
8049
8520
  padding: var(--wui-space-02);
8050
8521
  `;
8051
8522
  var MenuLabel = ({ children, ...props }) => {
8052
- return /* @__PURE__ */ jsx188(
8523
+ return /* @__PURE__ */ jsx194(
8053
8524
  StyledMenuLabel,
8054
8525
  {
8055
8526
  asChild: true,
8056
8527
  ...props,
8057
- children: /* @__PURE__ */ jsx188(
8528
+ children: /* @__PURE__ */ jsx194(
8058
8529
  Heading,
8059
8530
  {
8060
8531
  renderAs: "span",
@@ -8069,8 +8540,8 @@ var MenuLabel = ({ children, ...props }) => {
8069
8540
  MenuLabel.displayName = "MenuLabel";
8070
8541
 
8071
8542
  // src/components/Menu/SubMenu.tsx
8072
- import { useState as useState7 } from "react";
8073
- import styled31 from "styled-components";
8543
+ import { useState as useState8 } from "react";
8544
+ import styled37 from "styled-components";
8074
8545
  import {
8075
8546
  DropdownMenuPortal as DropdownMenuPortal2,
8076
8547
  DropdownMenuSub,
@@ -8079,14 +8550,14 @@ import {
8079
8550
  DropdownMenuSubTrigger,
8080
8551
  DropdownMenuItem
8081
8552
  } from "@radix-ui/react-dropdown-menu";
8082
- import { isNotNil as isNotNil12 } from "@wistia/type-guards";
8553
+ import { isNotNil as isNotNil13 } from "@wistia/type-guards";
8083
8554
 
8084
8555
  // src/components/Menu/MenuItemButton.tsx
8085
8556
  import { forwardRef as forwardRef13 } from "react";
8086
- import styled29 from "styled-components";
8087
- import { isNotNil as isNotNil11, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
8088
- import { jsx as jsx189, jsxs as jsxs17 } from "react/jsx-runtime";
8089
- var StyledButton3 = styled29(Button)`
8557
+ import styled35 from "styled-components";
8558
+ import { isNotNil as isNotNil12, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
8559
+ import { jsx as jsx195, jsxs as jsxs21 } from "react/jsx-runtime";
8560
+ var StyledButton3 = styled35(Button)`
8090
8561
  ${({ colorScheme }) => getColorScheme(colorScheme)};
8091
8562
 
8092
8563
  display: flex;
@@ -8125,7 +8596,7 @@ var StyledButton3 = styled29(Button)`
8125
8596
  padding-left: var(--wui-space-04);
8126
8597
  }
8127
8598
  `;
8128
- var StyledLeftIconContainer = styled29.div`
8599
+ var StyledLeftIconContainer = styled35.div`
8129
8600
  height: var(--menu-item-left-icon-size);
8130
8601
  width: var(--menu-item-left-icon-size);
8131
8602
 
@@ -8134,7 +8605,7 @@ var StyledLeftIconContainer = styled29.div`
8134
8605
  width: var(--menu-item-left-icon-size);
8135
8606
  }
8136
8607
  `;
8137
- var StyledRightIconContainer = styled29.div`
8608
+ var StyledRightIconContainer = styled35.div`
8138
8609
  height: var(--menu-item-right-icon-size);
8139
8610
  width: var(--menu-item-right-icon-size);
8140
8611
 
@@ -8143,13 +8614,13 @@ var StyledRightIconContainer = styled29.div`
8143
8614
  width: var(--menu-item-right-icon-size);
8144
8615
  }
8145
8616
  `;
8146
- var StyledLabelAndDescriptionContainer = styled29.div`
8617
+ var StyledLabelAndDescriptionContainer = styled35.div`
8147
8618
  display: flex;
8148
8619
  flex-direction: column;
8149
8620
  gap: var(--menu-label-description-gap);
8150
8621
  flex-basis: 100%;
8151
8622
  `;
8152
- var StyledBadgeContainer = styled29.div`
8623
+ var StyledBadgeContainer = styled35.div`
8153
8624
  align-self: start;
8154
8625
  justify-self: end;
8155
8626
  font-size: var(--wui-typography-label-4-size);
@@ -8164,7 +8635,7 @@ var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...pro
8164
8635
  colorScheme = "error";
8165
8636
  }
8166
8637
  if (appearance === "gated") {
8167
- badge = /* @__PURE__ */ jsx189(
8638
+ badge = /* @__PURE__ */ jsx195(
8168
8639
  Icon,
8169
8640
  {
8170
8641
  colorScheme: "purple",
@@ -8176,7 +8647,7 @@ var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...pro
8176
8647
  }
8177
8648
  );
8178
8649
  }
8179
- return /* @__PURE__ */ jsxs17(
8650
+ return /* @__PURE__ */ jsxs21(
8180
8651
  StyledButton3,
8181
8652
  {
8182
8653
  ...props,
@@ -8186,10 +8657,10 @@ var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...pro
8186
8657
  fullWidth: true,
8187
8658
  unstyled: true,
8188
8659
  children: [
8189
- props.leftIcon ? /* @__PURE__ */ jsx189(StyledLeftIconContainer, { children: props.leftIcon }) : null,
8190
- /* @__PURE__ */ jsx189(StyledLabelAndDescriptionContainer, { children }),
8191
- isNotNil11(badge) || isNotNil11(command) ? /* @__PURE__ */ jsx189(StyledBadgeContainer, { children: badge ?? command }) : null,
8192
- props.rightIcon ? /* @__PURE__ */ jsx189(StyledRightIconContainer, { children: props.rightIcon }) : null
8660
+ props.leftIcon ? /* @__PURE__ */ jsx195(StyledLeftIconContainer, { children: props.leftIcon }) : null,
8661
+ /* @__PURE__ */ jsx195(StyledLabelAndDescriptionContainer, { children }),
8662
+ isNotNil12(badge) || isNotNil12(command) ? /* @__PURE__ */ jsx195(StyledBadgeContainer, { children: badge ?? command }) : null,
8663
+ props.rightIcon ? /* @__PURE__ */ jsx195(StyledRightIconContainer, { children: props.rightIcon }) : null
8193
8664
  ]
8194
8665
  }
8195
8666
  );
@@ -8197,33 +8668,33 @@ var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...pro
8197
8668
  MenuItemButton.displayName = "MenuItemButton";
8198
8669
 
8199
8670
  // src/components/Menu/MenuItemLabelDescription.tsx
8200
- import styled30 from "styled-components";
8201
- import { jsx as jsx190 } from "react/jsx-runtime";
8202
- var StyledMenuItemLabel = styled30.span``;
8203
- var StyledMenuItemDescription = styled30(Text).attrs({
8671
+ import styled36 from "styled-components";
8672
+ import { jsx as jsx196 } from "react/jsx-runtime";
8673
+ var StyledMenuItemLabel = styled36.span``;
8674
+ var StyledMenuItemDescription = styled36(Text).attrs({
8204
8675
  variant: "body4",
8205
8676
  prominence: "secondary"
8206
8677
  })``;
8207
8678
  var MenuItemLabel = ({ children }) => {
8208
- return /* @__PURE__ */ jsx190(StyledMenuItemLabel, { children });
8679
+ return /* @__PURE__ */ jsx196(StyledMenuItemLabel, { children });
8209
8680
  };
8210
8681
  var MenuItemDescription = ({ children }) => {
8211
- return /* @__PURE__ */ jsx190(StyledMenuItemDescription, { children });
8682
+ return /* @__PURE__ */ jsx196(StyledMenuItemDescription, { children });
8212
8683
  };
8213
8684
 
8214
8685
  // src/components/Menu/SubMenu.tsx
8215
- import { jsx as jsx191, jsxs as jsxs18 } from "react/jsx-runtime";
8216
- var SubMenuContent = styled31(DropdownMenuSubContent)`
8686
+ import { jsx as jsx197, jsxs as jsxs22 } from "react/jsx-runtime";
8687
+ var SubMenuContent = styled37(DropdownMenuSubContent)`
8217
8688
  ${menuContentCss}
8218
8689
 
8219
8690
  ${mq.smAndDown} {
8220
8691
  transform: translateX(-100%) !important;
8221
8692
  }
8222
8693
  `;
8223
- var StyledMobileSubMenuItems = styled31.div`
8694
+ var StyledMobileSubMenuItems = styled37.div`
8224
8695
  margin-left: var(--wui-space-04);
8225
8696
  `;
8226
- var StyledSubTrigger = styled31(DropdownMenuSubTrigger)`
8697
+ var StyledSubTrigger = styled37(DropdownMenuSubTrigger)`
8227
8698
  outline: none;
8228
8699
 
8229
8700
  &[data-state='open'],
@@ -8234,11 +8705,11 @@ var StyledSubTrigger = styled31(DropdownMenuSubTrigger)`
8234
8705
  var SubMenuTrigger = (props) => {
8235
8706
  const { isSmAndUp } = useMq();
8236
8707
  const Trigger3 = isSmAndUp ? StyledSubTrigger : DropdownMenuItem;
8237
- return /* @__PURE__ */ jsx191(Trigger3, { asChild: true, children: /* @__PURE__ */ jsx191(
8708
+ return /* @__PURE__ */ jsx197(Trigger3, { asChild: true, children: /* @__PURE__ */ jsx197(
8238
8709
  MenuItemButton,
8239
8710
  {
8240
8711
  ...props,
8241
- rightIcon: /* @__PURE__ */ jsx191(Icon, { type: "caret-right" })
8712
+ rightIcon: /* @__PURE__ */ jsx197(Icon, { type: "caret-right" })
8242
8713
  }
8243
8714
  ) });
8244
8715
  };
@@ -8250,16 +8721,16 @@ var SubMenu = ({
8250
8721
  ...props
8251
8722
  }) => {
8252
8723
  const { isSmAndUp } = useMq();
8253
- const [isExpanded, setIsExpanded] = useState7(false);
8724
+ const [isExpanded, setIsExpanded] = useState8(false);
8254
8725
  const { compact } = useMenuContext();
8255
- return isSmAndUp ? /* @__PURE__ */ jsxs18(DropdownMenuSub, { onOpenChange, children: [
8256
- /* @__PURE__ */ jsxs18(SubMenuTrigger, { ...props, children: [
8257
- /* @__PURE__ */ jsx191(MenuItemLabel, { children: label }),
8258
- isNotNil12(description) ? /* @__PURE__ */ jsx191(MenuItemDescription, { children: description }) : null
8726
+ return isSmAndUp ? /* @__PURE__ */ jsxs22(DropdownMenuSub, { onOpenChange, children: [
8727
+ /* @__PURE__ */ jsxs22(SubMenuTrigger, { ...props, children: [
8728
+ /* @__PURE__ */ jsx197(MenuItemLabel, { children: label }),
8729
+ isNotNil13(description) ? /* @__PURE__ */ jsx197(MenuItemDescription, { children: description }) : null
8259
8730
  ] }),
8260
- /* @__PURE__ */ jsx191(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx191(SubMenuContent, { $compact: compact, children }) })
8261
- ] }) : /* @__PURE__ */ jsxs18(DropdownMenuGroup, { children: [
8262
- /* @__PURE__ */ jsxs18(
8731
+ /* @__PURE__ */ jsx197(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx197(SubMenuContent, { $compact: compact, children }) })
8732
+ ] }) : /* @__PURE__ */ jsxs22(DropdownMenuGroup, { children: [
8733
+ /* @__PURE__ */ jsxs22(
8263
8734
  SubMenuTrigger,
8264
8735
  {
8265
8736
  ...props,
@@ -8268,12 +8739,12 @@ var SubMenu = ({
8268
8739
  setIsExpanded((prev) => !prev);
8269
8740
  },
8270
8741
  children: [
8271
- /* @__PURE__ */ jsx191(MenuItemLabel, { children: label }),
8272
- /* @__PURE__ */ jsx191(MenuItemDescription, { children: description })
8742
+ /* @__PURE__ */ jsx197(MenuItemLabel, { children: label }),
8743
+ /* @__PURE__ */ jsx197(MenuItemDescription, { children: description })
8273
8744
  ]
8274
8745
  }
8275
8746
  ),
8276
- /* @__PURE__ */ jsx191(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
8747
+ /* @__PURE__ */ jsx197(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
8277
8748
  ] });
8278
8749
  };
8279
8750
  SubMenu.displayName = "SubMenu";
@@ -8281,15 +8752,15 @@ SubMenu.displayName = "SubMenu";
8281
8752
  // src/components/Menu/MenuItem.tsx
8282
8753
  import { forwardRef as forwardRef14 } from "react";
8283
8754
  import { DropdownMenuItem as DropdownMenuItem2 } from "@radix-ui/react-dropdown-menu";
8284
- import { jsx as jsx192 } from "react/jsx-runtime";
8755
+ import { jsx as jsx198 } from "react/jsx-runtime";
8285
8756
  var MenuItem = forwardRef14(
8286
8757
  ({ onSelect = () => null, ...props }, ref) => {
8287
- return /* @__PURE__ */ jsx192(
8758
+ return /* @__PURE__ */ jsx198(
8288
8759
  DropdownMenuItem2,
8289
8760
  {
8290
8761
  asChild: true,
8291
8762
  onSelect,
8292
- children: /* @__PURE__ */ jsx192(
8763
+ children: /* @__PURE__ */ jsx198(
8293
8764
  MenuItemButton,
8294
8765
  {
8295
8766
  ...props,
@@ -8307,10 +8778,10 @@ MenuItem.displayName = "MenuItem";
8307
8778
  import {
8308
8779
  DropdownMenuRadioGroup
8309
8780
  } from "@radix-ui/react-dropdown-menu";
8310
- import { jsx as jsx193, jsxs as jsxs19 } from "react/jsx-runtime";
8781
+ import { jsx as jsx199, jsxs as jsxs23 } from "react/jsx-runtime";
8311
8782
  var MenuRadioGroup = ({ children, label, ...props }) => {
8312
- return /* @__PURE__ */ jsxs19(DropdownMenuRadioGroup, { ...props, children: [
8313
- /* @__PURE__ */ jsx193(MenuLabel, { children: label }),
8783
+ return /* @__PURE__ */ jsxs23(DropdownMenuRadioGroup, { ...props, children: [
8784
+ /* @__PURE__ */ jsx199(MenuLabel, { children: label }),
8314
8785
  children
8315
8786
  ] });
8316
8787
  };
@@ -8321,11 +8792,11 @@ import {
8321
8792
  DropdownMenuItemIndicator,
8322
8793
  DropdownMenuRadioItem
8323
8794
  } from "@radix-ui/react-dropdown-menu";
8324
- import { jsx as jsx194 } from "react/jsx-runtime";
8795
+ import { jsx as jsx200 } from "react/jsx-runtime";
8325
8796
  var RadioMenuItem = ({
8326
8797
  onSelect,
8327
8798
  value,
8328
- indicator = /* @__PURE__ */ jsx194(
8799
+ indicator = /* @__PURE__ */ jsx200(
8329
8800
  Icon,
8330
8801
  {
8331
8802
  size: "sm",
@@ -8335,17 +8806,17 @@ var RadioMenuItem = ({
8335
8806
  ...props
8336
8807
  }) => {
8337
8808
  const extraProps = onSelect ? { onSelect } : {};
8338
- return /* @__PURE__ */ jsx194(
8809
+ return /* @__PURE__ */ jsx200(
8339
8810
  DropdownMenuRadioItem,
8340
8811
  {
8341
8812
  ...extraProps,
8342
8813
  asChild: true,
8343
8814
  value,
8344
- children: /* @__PURE__ */ jsx194(
8815
+ children: /* @__PURE__ */ jsx200(
8345
8816
  MenuItemButton,
8346
8817
  {
8347
8818
  ...props,
8348
- rightIcon: /* @__PURE__ */ jsx194(DropdownMenuItemIndicator, { children: indicator })
8819
+ rightIcon: /* @__PURE__ */ jsx200(DropdownMenuItemIndicator, { children: indicator })
8349
8820
  }
8350
8821
  )
8351
8822
  }
@@ -8357,9 +8828,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
8357
8828
  import {
8358
8829
  DropdownMenuCheckboxItem
8359
8830
  } from "@radix-ui/react-dropdown-menu";
8360
- import { jsx as jsx195, jsxs as jsxs20 } from "react/jsx-runtime";
8831
+ import { jsx as jsx201, jsxs as jsxs24 } from "react/jsx-runtime";
8361
8832
  var CheckboxIndicator2 = ({ checked, ...props }) => {
8362
- return checked ? /* @__PURE__ */ jsxs20(
8833
+ return checked ? /* @__PURE__ */ jsxs24(
8363
8834
  "svg",
8364
8835
  {
8365
8836
  ...props,
@@ -8369,14 +8840,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
8369
8840
  width: "24",
8370
8841
  xmlns: "http://www.w3.org/2000/svg",
8371
8842
  children: [
8372
- /* @__PURE__ */ jsx195(
8843
+ /* @__PURE__ */ jsx201(
8373
8844
  "path",
8374
8845
  {
8375
8846
  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",
8376
8847
  fill: "#2949e5"
8377
8848
  }
8378
8849
  ),
8379
- /* @__PURE__ */ jsx195(
8850
+ /* @__PURE__ */ jsx201(
8380
8851
  "path",
8381
8852
  {
8382
8853
  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",
@@ -8385,7 +8856,7 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
8385
8856
  )
8386
8857
  ]
8387
8858
  }
8388
- ) : /* @__PURE__ */ jsxs20(
8859
+ ) : /* @__PURE__ */ jsxs24(
8389
8860
  "svg",
8390
8861
  {
8391
8862
  ...props,
@@ -8395,14 +8866,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
8395
8866
  width: "24",
8396
8867
  xmlns: "http://www.w3.org/2000/svg",
8397
8868
  children: [
8398
- /* @__PURE__ */ jsx195(
8869
+ /* @__PURE__ */ jsx201(
8399
8870
  "path",
8400
8871
  {
8401
8872
  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",
8402
8873
  fill: "#fcfcfd"
8403
8874
  }
8404
8875
  ),
8405
- /* @__PURE__ */ jsx195(
8876
+ /* @__PURE__ */ jsx201(
8406
8877
  "path",
8407
8878
  {
8408
8879
  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",
@@ -8419,18 +8890,18 @@ var CheckboxMenuItem = ({
8419
8890
  onCheckedChange,
8420
8891
  ...props
8421
8892
  }) => {
8422
- return /* @__PURE__ */ jsx195(
8893
+ return /* @__PURE__ */ jsx201(
8423
8894
  DropdownMenuCheckboxItem,
8424
8895
  {
8425
8896
  asChild: true,
8426
8897
  checked,
8427
8898
  onCheckedChange,
8428
8899
  onSelect,
8429
- children: /* @__PURE__ */ jsx195(
8900
+ children: /* @__PURE__ */ jsx201(
8430
8901
  MenuItemButton,
8431
8902
  {
8432
8903
  ...props,
8433
- leftIcon: /* @__PURE__ */ jsx195(CheckboxIndicator2, { checked })
8904
+ leftIcon: /* @__PURE__ */ jsx201(CheckboxIndicator2, { checked })
8434
8905
  }
8435
8906
  )
8436
8907
  }
@@ -8440,58 +8911,36 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
8440
8911
 
8441
8912
  // src/components/Modal/Modal.tsx
8442
8913
  import { forwardRef as forwardRef17 } from "react";
8443
- import styled37 from "styled-components";
8914
+ import styled42 from "styled-components";
8444
8915
  import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
8445
8916
  import { isNotNil as isNotNil15 } from "@wistia/type-guards";
8446
8917
 
8447
8918
  // src/components/Modal/ModalHeader.tsx
8448
- import styled34 from "styled-components";
8919
+ import styled39 from "styled-components";
8449
8920
  import { Title as DialogTitle } from "@radix-ui/react-dialog";
8450
8921
 
8451
8922
  // src/components/Modal/ModalCloseButton.tsx
8452
- import styled32 from "styled-components";
8923
+ import styled38 from "styled-components";
8453
8924
  import { Close as DialogClose } from "@radix-ui/react-dialog";
8454
- import { jsx as jsx196 } from "react/jsx-runtime";
8455
- var CloseButton = styled32(DialogClose)`
8925
+ import { jsx as jsx202 } from "react/jsx-runtime";
8926
+ var CloseButton = styled38(DialogClose)`
8456
8927
  align-self: start;
8457
8928
  `;
8458
8929
  var ModalCloseButton = () => {
8459
- return /* @__PURE__ */ jsx196(CloseButton, { asChild: true, children: /* @__PURE__ */ jsx196(
8930
+ return /* @__PURE__ */ jsx202(CloseButton, { asChild: true, children: /* @__PURE__ */ jsx202(
8460
8931
  IconButton,
8461
8932
  {
8462
8933
  label: "Dismiss modal",
8463
8934
  size: "sm",
8464
8935
  variant: "ghost",
8465
- children: /* @__PURE__ */ jsx196(Icon, { type: "close" })
8936
+ children: /* @__PURE__ */ jsx202(Icon, { type: "close" })
8466
8937
  }
8467
8938
  ) });
8468
8939
  };
8469
8940
 
8470
- // src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
8471
- import styled33 from "styled-components";
8472
- import { isNotNil as isNotNil13 } from "@wistia/type-guards";
8473
- import { jsx as jsx197 } from "react/jsx-runtime";
8474
- var VisuallyHidden = styled33.div({ ...visuallyHiddenStyle });
8475
- var VisuallyHiddenButFocusable = styled33.div({
8476
- "&:not(:focus-within)": visuallyHiddenStyle
8477
- });
8478
- var ScreenReaderOnly = ({
8479
- text,
8480
- children,
8481
- focusable = false,
8482
- ...otherProps
8483
- }) => {
8484
- const accessibleText = isNotNil13(text) ? text : children;
8485
- if (focusable) {
8486
- return /* @__PURE__ */ jsx197(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
8487
- }
8488
- return /* @__PURE__ */ jsx197(VisuallyHidden, { ...otherProps, children: accessibleText });
8489
- };
8490
- ScreenReaderOnly.displayName = "ScreenReaderOnly";
8491
-
8492
8941
  // src/components/Modal/ModalHeader.tsx
8493
- import { jsx as jsx198, jsxs as jsxs21 } from "react/jsx-runtime";
8494
- var Header = styled34.header`
8942
+ import { jsx as jsx203, jsxs as jsxs25 } from "react/jsx-runtime";
8943
+ var Header = styled39.header`
8495
8944
  display: flex;
8496
8945
  order: 1;
8497
8946
  gap: var(--wui-space-01);
@@ -8503,7 +8952,7 @@ var Header = styled34.header`
8503
8952
  margin-top: 0;
8504
8953
  }
8505
8954
  `;
8506
- var Title = styled34(DialogTitle)`
8955
+ var Title = styled39(DialogTitle)`
8507
8956
  font-family: var(--wui-typography-heading-2-family);
8508
8957
  line-height: var(--wui-typography-heading-2-line-height);
8509
8958
  font-size: var(--wui-typography-heading-2-size);
@@ -8515,22 +8964,22 @@ var ModalHeader = ({
8515
8964
  hideCloseButton
8516
8965
  }) => {
8517
8966
  const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
8518
- return /* @__PURE__ */ jsxs21(Header, { children: [
8519
- /* @__PURE__ */ jsx198(TitleWrapper, { children: title }),
8520
- hideCloseButton ? null : /* @__PURE__ */ jsx198(ModalCloseButton, {})
8967
+ return /* @__PURE__ */ jsxs25(Header, { children: [
8968
+ /* @__PURE__ */ jsx203(TitleWrapper, { children: title }),
8969
+ hideCloseButton ? null : /* @__PURE__ */ jsx203(ModalCloseButton, {})
8521
8970
  ] });
8522
8971
  };
8523
8972
 
8524
8973
  // src/components/Modal/ModalContent.tsx
8525
8974
  import { forwardRef as forwardRef15 } from "react";
8526
- import styled35 from "styled-components";
8975
+ import styled40 from "styled-components";
8527
8976
  import { Content as DialogContent } from "@radix-ui/react-dialog";
8528
8977
 
8529
8978
  // src/private/hooks/useFocusRestore/useFocusRestore.ts
8530
- import { useRef as useRef7, useEffect as useEffect4 } from "react";
8979
+ import { useRef as useRef8, useEffect as useEffect4 } from "react";
8531
8980
  import { isNotNil as isNotNil14 } from "@wistia/type-guards";
8532
8981
  var useFocusRestore = () => {
8533
- const previouslyFocusedRef = useRef7(null);
8982
+ const previouslyFocusedRef = useRef8(null);
8534
8983
  useEffect4(() => {
8535
8984
  previouslyFocusedRef.current = document.activeElement;
8536
8985
  }, []);
@@ -8546,8 +8995,8 @@ var useFocusRestore = () => {
8546
8995
  };
8547
8996
 
8548
8997
  // src/components/Modal/ModalContent.tsx
8549
- import { jsx as jsx199 } from "react/jsx-runtime";
8550
- var StyledModalContent = styled35(DialogContent)`
8998
+ import { jsx as jsx204 } from "react/jsx-runtime";
8999
+ var StyledModalContent = styled40(DialogContent)`
8551
9000
  background-color: var(--wui-color-bg-app);
8552
9001
  box-sizing: border-box;
8553
9002
  display: flex;
@@ -8591,7 +9040,7 @@ var StyledModalContent = styled35(DialogContent)`
8591
9040
  var ModalContent = forwardRef15(
8592
9041
  ({ fullHeight, width, children, ...otherProps }, ref) => {
8593
9042
  useFocusRestore();
8594
- return /* @__PURE__ */ jsx199(
9043
+ return /* @__PURE__ */ jsx204(
8595
9044
  StyledModalContent,
8596
9045
  {
8597
9046
  ref,
@@ -8607,8 +9056,8 @@ var ModalContent = forwardRef15(
8607
9056
 
8608
9057
  // src/private/components/Backdrop/Backdrop.tsx
8609
9058
  import { forwardRef as forwardRef16 } from "react";
8610
- import styled36 from "styled-components";
8611
- import { jsx as jsx200 } from "react/jsx-runtime";
9059
+ import styled41 from "styled-components";
9060
+ import { jsx as jsx205 } from "react/jsx-runtime";
8612
9061
  var backdropAnimationDuration = 150;
8613
9062
  var alignVerticalMap = {
8614
9063
  stretch: "normal",
@@ -8621,7 +9070,7 @@ var alignHorizontalMap = {
8621
9070
  center: "center",
8622
9071
  right: "end"
8623
9072
  };
8624
- var BackdropComponent = styled36.div`
9073
+ var BackdropComponent = styled41.div`
8625
9074
  align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
8626
9075
  animation-name: backdropShow;
8627
9076
  animation-duration: ${() => `${backdropAnimationDuration}ms`};
@@ -8645,7 +9094,7 @@ var BackdropComponent = styled36.div`
8645
9094
  }
8646
9095
  `;
8647
9096
  var Backdrop = forwardRef16(
8648
- ({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ jsx200(
9097
+ ({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ jsx205(
8649
9098
  BackdropComponent,
8650
9099
  {
8651
9100
  ref,
@@ -8659,9 +9108,9 @@ var Backdrop = forwardRef16(
8659
9108
  Backdrop.displayName = "Backdrop";
8660
9109
 
8661
9110
  // src/components/Modal/Modal.tsx
8662
- import { jsx as jsx201, jsxs as jsxs22 } from "react/jsx-runtime";
9111
+ import { jsx as jsx206, jsxs as jsxs26 } from "react/jsx-runtime";
8663
9112
  var DEFAULT_MODAL_WIDTH = "532px";
8664
- var ModalBody = styled37.div`
9113
+ var ModalBody = styled42.div`
8665
9114
  flex-direction: column;
8666
9115
  display: flex;
8667
9116
  order: 2;
@@ -8679,7 +9128,7 @@ var Modal = forwardRef17(
8679
9128
  width = DEFAULT_MODAL_WIDTH,
8680
9129
  ...props
8681
9130
  }, ref) => {
8682
- return /* @__PURE__ */ jsx201(
9131
+ return /* @__PURE__ */ jsx206(
8683
9132
  DialogRoot,
8684
9133
  {
8685
9134
  onOpenChange: (open2) => {
@@ -8688,9 +9137,9 @@ var Modal = forwardRef17(
8688
9137
  }
8689
9138
  },
8690
9139
  open: isOpen,
8691
- children: /* @__PURE__ */ jsxs22(DialogPortal, { children: [
8692
- /* @__PURE__ */ jsx201(Backdrop, {}),
8693
- /* @__PURE__ */ jsxs22(
9140
+ children: /* @__PURE__ */ jsxs26(DialogPortal, { children: [
9141
+ /* @__PURE__ */ jsx206(Backdrop, {}),
9142
+ /* @__PURE__ */ jsxs26(
8694
9143
  ModalContent,
8695
9144
  {
8696
9145
  ref,
@@ -8706,8 +9155,8 @@ var Modal = forwardRef17(
8706
9155
  width,
8707
9156
  ...props,
8708
9157
  children: [
8709
- /* @__PURE__ */ jsx201(ModalBody, { children }),
8710
- /* @__PURE__ */ jsx201(
9158
+ /* @__PURE__ */ jsx206(ModalBody, { children }),
9159
+ /* @__PURE__ */ jsx206(
8711
9160
  ModalHeader,
8712
9161
  {
8713
9162
  hideCloseButton,
@@ -8727,15 +9176,15 @@ Modal.displayName = "Modal";
8727
9176
 
8728
9177
  // src/components/Radio/Radio.tsx
8729
9178
  import { forwardRef as forwardRef18, useId as useId3 } from "react";
8730
- import styled38, { css as css23 } from "styled-components";
9179
+ import styled43, { css as css25 } from "styled-components";
8731
9180
  import { isNonEmptyString as isNonEmptyString3 } from "@wistia/type-guards";
8732
- import { jsx as jsx202, jsxs as jsxs23 } from "react/jsx-runtime";
8733
- var StyledLabelWrapper2 = styled38.div`
9181
+ import { jsx as jsx207, jsxs as jsxs27 } from "react/jsx-runtime";
9182
+ var StyledLabelWrapper2 = styled43.div`
8734
9183
  display: flex;
8735
9184
  flex-direction: column;
8736
9185
  padding-left: var(--wui-space-02);
8737
9186
  `;
8738
- var StyledRadio = styled38.input`
9187
+ var StyledRadio = styled43.input`
8739
9188
  box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
8740
9189
  appearance: none;
8741
9190
  margin: 0;
@@ -8761,11 +9210,11 @@ var StyledRadio = styled38.input`
8761
9210
  transform: scale(1);
8762
9211
  }
8763
9212
  `;
8764
- var disabledStyle2 = css23`
9213
+ var disabledStyle2 = css25`
8765
9214
  cursor: not-allowed;
8766
9215
  opacity: 0.5;
8767
9216
  `;
8768
- var errorStyle = css23`
9217
+ var errorStyle = css25`
8769
9218
  /* TODO Lamp to design error state */
8770
9219
  &:hover,
8771
9220
  &:focus,
@@ -8773,11 +9222,11 @@ var errorStyle = css23`
8773
9222
  border-color: transparent !important;
8774
9223
  }
8775
9224
  `;
8776
- var defaultHoverStyle = css23`
9225
+ var defaultHoverStyle = css25`
8777
9226
  /* TODO Lamp to design hover state */
8778
9227
  cursor: pointer;
8779
9228
  `;
8780
- var StyledRadioWrapper = styled38.div`
9229
+ var StyledRadioWrapper = styled43.div`
8781
9230
  align-items: baseline;
8782
9231
  border: 1px solid transparent;
8783
9232
  border-radius: 4px;
@@ -8815,13 +9264,13 @@ var Radio = forwardRef18(
8815
9264
  }, ref) => {
8816
9265
  const generatedId = useId3();
8817
9266
  const computedId = isNonEmptyString3(id) ? id : `ui-radio-${generatedId}`;
8818
- return /* @__PURE__ */ jsxs23(
9267
+ return /* @__PURE__ */ jsxs27(
8819
9268
  StyledRadioWrapper,
8820
9269
  {
8821
9270
  "aria-invalid": otherProps["aria-invalid"],
8822
9271
  disabled,
8823
9272
  children: [
8824
- /* @__PURE__ */ jsx202(
9273
+ /* @__PURE__ */ jsx207(
8825
9274
  StyledRadio,
8826
9275
  {
8827
9276
  ref,
@@ -8836,8 +9285,8 @@ var Radio = forwardRef18(
8836
9285
  ...otherProps
8837
9286
  }
8838
9287
  ),
8839
- /* @__PURE__ */ jsxs23(StyledLabelWrapper2, { children: [
8840
- /* @__PURE__ */ jsx202(
9288
+ /* @__PURE__ */ jsxs27(StyledLabelWrapper2, { children: [
9289
+ /* @__PURE__ */ jsx207(
8841
9290
  Label,
8842
9291
  {
8843
9292
  disabled,
@@ -8846,7 +9295,7 @@ var Radio = forwardRef18(
8846
9295
  children: label
8847
9296
  }
8848
9297
  ),
8849
- /* @__PURE__ */ jsx202(LabelDescription, { children: description })
9298
+ /* @__PURE__ */ jsx207(LabelDescription, { children: description })
8850
9299
  ] })
8851
9300
  ]
8852
9301
  }
@@ -8857,11 +9306,11 @@ Radio.displayName = "Radio";
8857
9306
 
8858
9307
  // src/components/SegmentedControl/SegmentedControl.tsx
8859
9308
  import { forwardRef as forwardRef19 } from "react";
8860
- import styled39 from "styled-components";
9309
+ import styled44, { css as css26 } from "styled-components";
8861
9310
  import { Root as ToggleGroupRoot } from "@radix-ui/react-toggle-group";
8862
9311
  import { isNil as isNil13 } from "@wistia/type-guards";
8863
- import { jsx as jsx203 } from "react/jsx-runtime";
8864
- var StyledSegmentedControl = styled39(ToggleGroupRoot)`
9312
+ import { jsx as jsx208 } from "react/jsx-runtime";
9313
+ var segmentedControlStyles = css26`
8865
9314
  display: inline-flex;
8866
9315
  background-color: var(--wui-color-bg-surface-secondary);
8867
9316
  border-radius: var(--wui-border-radius-rounded);
@@ -8869,483 +9318,131 @@ var StyledSegmentedControl = styled39(ToggleGroupRoot)`
8869
9318
  gap: var(--wui-space-01);
8870
9319
  width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
8871
9320
  `;
9321
+ var StyledSegmentedControl = styled44(ToggleGroupRoot)`
9322
+ ${segmentedControlStyles}
9323
+ `;
8872
9324
  var SegmentedControl = forwardRef19(
8873
9325
  ({
8874
9326
  children,
8875
9327
  disabled = false,
8876
- fullWidth = false,
8877
- selectedValue,
8878
- onSelectedValueChange,
8879
- ...props
8880
- }, ref) => {
8881
- if (isNil13(children)) {
8882
- return null;
8883
- }
8884
- return /* @__PURE__ */ jsx203(
8885
- StyledSegmentedControl,
8886
- {
8887
- ref,
8888
- $fullWidth: fullWidth,
8889
- disabled,
8890
- loop: true,
8891
- onValueChange: onSelectedValueChange,
8892
- rovingFocus: true,
8893
- type: "single",
8894
- value: selectedValue,
8895
- ...props,
8896
- children
8897
- }
8898
- );
8899
- }
8900
- );
8901
- SegmentedControl.displayName = "SegmentedControl";
8902
-
8903
- // src/components/SegmentedControl/SegmentedControlItem.tsx
8904
- import { forwardRef as forwardRef20 } from "react";
8905
- import styled40 from "styled-components";
8906
- import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
8907
- import { isNotNil as isNotNil16 } from "@wistia/type-guards";
8908
- import { jsxs as jsxs24 } from "react/jsx-runtime";
8909
- var StyledSegmentedControlItem = styled40(ToggleGroupItem)`
8910
- all: unset; /* ToggleGroupItem is a button element */
8911
- align-items: center;
8912
- border-radius: var(--wui-border-radius-rounded);
8913
- color: var(--wui-color-text-secondary);
8914
- cursor: pointer;
8915
- display: flex;
8916
- flex-grow: 1;
8917
- flex-shrink: 1;
8918
- font-size: var(--wui-typography-label-3-size);
8919
- justify-content: center;
8920
- padding: 6px 8px;
8921
- user-select: none;
8922
-
8923
- /* Icon component */
8924
- svg {
8925
- height: 16px;
8926
- width: 16px;
8927
-
8928
- /* add right margin if there's a label and an icon */
8929
- ${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
8930
- }
8931
-
8932
- &:hover {
8933
- background-color: var(--wui-color-bg-surface-secondary-hover);
8934
- }
8935
-
8936
- &:focus-visible {
8937
- outline: 2px solid var(--wui-color-focus-ring);
8938
- }
8939
-
8940
- &[data-state='on'] {
8941
- background-color: var(--wui-color-bg-fill-white);
8942
- color: var(--wui-color-text-selected);
8943
- cursor: default;
8944
- }
8945
-
8946
- &:focus-visible,
8947
- &[data-state='on'] {
8948
- svg path {
8949
- fill: var(--wui-color-focus-ring);
8950
- }
8951
- }
8952
-
8953
- &[data-disabled] {
8954
- cursor: not-allowed;
8955
-
8956
- &:hover {
8957
- background-color: inherit;
8958
- }
8959
- }
8960
- `;
8961
- var SegmentedControlItem = forwardRef20(
8962
- ({ disabled, icon, label, "aria-label": ariaLabel, value }, ref) => {
8963
- const handleClick = (event) => {
8964
- const target = event.target;
8965
- const { state } = target.dataset;
8966
- if (state === "on") {
8967
- event.preventDefault();
8968
- }
8969
- };
8970
- return /* @__PURE__ */ jsxs24(
8971
- StyledSegmentedControlItem,
8972
- {
8973
- ref,
8974
- $hasLabel: isNotNil16(label),
8975
- "aria-label": isNotNil16(label) ? void 0 : ariaLabel,
8976
- disabled,
8977
- onClick: handleClick,
8978
- value,
8979
- children: [
8980
- icon,
8981
- label
8982
- ]
8983
- }
8984
- );
8985
- }
8986
- );
8987
- SegmentedControlItem.displayName = "SegmentedControlItem";
8988
-
8989
- // src/components/Tag/Tag.tsx
8990
- import { forwardRef as forwardRef21 } from "react";
8991
- import styled41 from "styled-components";
8992
- import { isNil as isNil14, isNotNil as isNotNil17, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
8993
- import { Fragment as Fragment4, jsx as jsx204, jsxs as jsxs25 } from "react/jsx-runtime";
8994
- var TagLabel = styled41.a`
8995
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
8996
- font-size: var(--wui-typography-label-4-size);
8997
- font-weight: var(--wui-typography-label-4-weight);
8998
- line-height: var(--wui-typography-label-4-line-height);
8999
- border-radius: var(--wui-border-radius-01);
9000
- align-items: center;
9001
- color: var(--wui-color-text);
9002
- text-decoration: none;
9003
- padding: var(--wui-space-01);
9004
-
9005
- :not(:only-child) {
9006
- padding-right: var(--wui-space-01);
9007
- }
9008
-
9009
- :is(a):hover {
9010
- background: var(--wui-color-bg-surface-secondary-hover);
9011
- }
9012
-
9013
- :is(a):active {
9014
- background: var(--wui-color-bg-surface-secondary-active);
9015
- }
9016
-
9017
- :focus-visible {
9018
- outline: unset;
9019
- box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
9020
- }
9021
- `;
9022
- var TagDivider = styled41.div`
9023
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
9024
- border-left: 1px solid var(--wui-color-border);
9025
- display: flex;
9026
- height: 14px;
9027
- width: 1px;
9028
- `;
9029
- var StyledRemoveButton = styled41.button`
9030
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
9031
- all: unset;
9032
- cursor: pointer;
9033
- display: flex;
9034
- height: 22px;
9035
- width: 12px;
9036
- align-items: center;
9037
- padding: 0 var(--wui-space-01);
9038
- border-radius: var(--wui-border-radius-01);
9039
-
9040
- svg path {
9041
- fill: var(--wui-color-icon);
9042
- }
9043
-
9044
- :hover {
9045
- background: var(--wui-color-bg-surface-secondary-hover);
9046
- }
9047
-
9048
- :active {
9049
- background: var(--wui-color-bg-surface-secondary-active);
9050
- }
9051
-
9052
- :focus-visible {
9053
- outline: unset;
9054
- box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
9055
- }
9056
- `;
9057
- var StyledTag = styled41.div`
9058
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
9059
- align-items: center;
9060
- background-color: var(--wui-color-bg-surface-secondary);
9061
- border-radius: var(--wui-border-radius-01);
9062
- display: inline-flex;
9063
- overflow: hidden;
9064
-
9065
- > * {
9066
- transition: background var(--wui-duration-01) var(--wui-motion-ease);
9067
- }
9068
- `;
9069
- var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
9070
- if (isNil14(onClickRemove)) {
9071
- return null;
9072
- }
9073
- if (isNil14(onClickRemoveLabel)) {
9074
- throw new Error(
9075
- "for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
9076
- );
9077
- }
9078
- return /* @__PURE__ */ jsxs25(Fragment4, { children: [
9079
- /* @__PURE__ */ jsx204(TagDivider, { $colorScheme: colorScheme }),
9080
- /* @__PURE__ */ jsxs25(
9081
- StyledRemoveButton,
9082
- {
9083
- $colorScheme: colorScheme,
9084
- onClick: onClickRemove,
9085
- type: "button",
9086
- children: [
9087
- /* @__PURE__ */ jsx204(
9088
- Icon,
9089
- {
9090
- size: "sm",
9091
- type: "close"
9092
- }
9093
- ),
9094
- /* @__PURE__ */ jsx204(ScreenReaderOnly, { children: onClickRemoveLabel })
9095
- ]
9096
- }
9097
- )
9098
- ] });
9099
- };
9100
- var Tag = forwardRef21(
9101
- ({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
9102
- const labelProps = isNotNil17(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
9103
- return /* @__PURE__ */ jsxs25(
9104
- StyledTag,
9105
- {
9106
- ref,
9107
- $colorScheme: colorScheme,
9108
- ...otherProps,
9109
- children: [
9110
- /* @__PURE__ */ jsx204(
9111
- TagLabel,
9112
- {
9113
- ...labelProps,
9114
- $colorScheme: colorScheme,
9115
- children: label
9116
- }
9117
- ),
9118
- /* @__PURE__ */ jsx204(
9119
- RemoveButton,
9120
- {
9121
- colorScheme,
9122
- onClickRemove,
9123
- onClickRemoveLabel
9124
- }
9125
- )
9126
- ]
9328
+ fullWidth = false,
9329
+ selectedValue,
9330
+ onSelectedValueChange,
9331
+ ...props
9332
+ }, ref) => {
9333
+ if (isNil13(children)) {
9334
+ return null;
9335
+ }
9336
+ return /* @__PURE__ */ jsx208(
9337
+ StyledSegmentedControl,
9338
+ {
9339
+ ref,
9340
+ $fullWidth: fullWidth,
9341
+ disabled,
9342
+ loop: true,
9343
+ onValueChange: onSelectedValueChange,
9344
+ rovingFocus: true,
9345
+ type: "single",
9346
+ value: selectedValue,
9347
+ ...props,
9348
+ children
9127
9349
  }
9128
9350
  );
9129
9351
  }
9130
9352
  );
9131
- Tag.displayName = "Tag";
9132
-
9133
- // src/components/Tooltip/Tooltip.tsx
9134
- import {
9135
- Root,
9136
- Content,
9137
- Trigger,
9138
- Portal,
9139
- Arrow
9140
- } from "@radix-ui/react-tooltip";
9141
- import styled42, { css as css24 } from "styled-components";
9142
- import { jsx as jsx205, jsxs as jsxs26 } from "react/jsx-runtime";
9143
- var CompactTooltipStyles = css24`
9144
- --tooltip-font-size: var(--wui-typography-label-4-size);
9145
- --tooltip-line-height: var(--wui-typography-label-4-line-height);
9146
- --tooltip-font-weight: var(--wui-typography-label-4-weight);
9147
- --tooltip-horizontal-padding: var(--wui-space-02);
9148
- --tooltip-vertical-padding: var(--wui-space-03);
9149
- `;
9150
- var StyledContent = styled42(Content)`
9151
- --tooltip-font-family: var(--wui-typography-family-default);
9152
- --tooltip-border-radius: var(--wui-border-radius-05);
9153
- --tooltip-bg: var(--wui-color-bg-tooltip);
9154
- --tooltip-color: var(--wui-color-text-on-fill);
9155
- --tooltip-font-size: var(--wui-typography-label-3-size);
9156
- --tooltip-line-height: var(--wui-typography-label-3-line-height);
9157
- --tooltip-font-weight: var(--wui-typography-label-3-weight);
9158
- --tooltip-horizontal-padding: var(--wui-space-03);
9159
- --tooltip-vertical-padding: var(--wui-space-03);
9160
-
9161
- ${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
9353
+ SegmentedControl.displayName = "SegmentedControl";
9162
9354
 
9163
- font-family: var(--tooltip-font-family);
9164
- font-size: var(--tooltip-font-size);
9165
- border-radius: var(--tooltip-border-radius);
9166
- padding: var(--tooltip-horizontal-padding) var(--tooltip-vertical-padding);
9167
- background-color: var(--tooltip-bg);
9168
- color: var(--tooltip-color);
9355
+ // src/components/SegmentedControl/SegmentedControlItem.tsx
9356
+ import { forwardRef as forwardRef20 } from "react";
9357
+ import styled45, { css as css27 } from "styled-components";
9358
+ import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
9359
+ import { isNotNil as isNotNil16 } from "@wistia/type-guards";
9360
+ import { jsxs as jsxs28 } from "react/jsx-runtime";
9361
+ var segmentedControlItemStyles = css27`
9362
+ all: unset; /* ToggleGroupItem is a button element */
9363
+ align-items: center;
9364
+ border-radius: var(--wui-border-radius-rounded);
9365
+ color: var(--wui-color-text-secondary);
9366
+ cursor: pointer;
9367
+ display: flex;
9368
+ flex-grow: 1;
9369
+ flex-shrink: 1;
9370
+ font-size: var(--wui-typography-label-3-size);
9371
+ justify-content: center;
9372
+ padding: 6px 8px;
9169
9373
  user-select: none;
9170
- animation-duration: 400ms;
9171
- animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
9172
- will-change: transform, opacity;
9173
- max-width: 30em;
9174
9374
 
9175
- &[data-state='delayed-open'][data-side='top'] {
9176
- animation-name: slideDownAndFade;
9177
- }
9375
+ /* Icon component */
9376
+ svg {
9377
+ height: 16px;
9378
+ width: 16px;
9178
9379
 
9179
- &[data-state='delayed-open'][data-side='right'] {
9180
- animation-name: slideLeftAndFade;
9380
+ /* add right margin if there's a label and an icon */
9381
+ ${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
9181
9382
  }
9182
9383
 
9183
- &[data-state='delayed-open'][data-side='bottom'] {
9184
- animation-name: slideUpAndFade;
9384
+ &:hover {
9385
+ background-color: var(--wui-color-bg-surface-secondary-hover);
9185
9386
  }
9186
9387
 
9187
- &[data-state='delayed-open'][data-side='left'] {
9188
- animation-name: slideRightAndFade;
9189
- }
9190
- `;
9191
- var VISUAL_OFFSET = 6;
9192
- var Tooltip = ({
9193
- delay = 700,
9194
- direction = "top",
9195
- content,
9196
- children,
9197
- forceOpen,
9198
- compact = false,
9199
- hideArrow = false
9200
- }) => {
9201
- const rootProps = {};
9202
- if (content === "" || content === null) {
9203
- rootProps.open = false;
9204
- }
9205
- if (forceOpen === true) {
9206
- rootProps.open = true;
9388
+ &:focus-visible {
9389
+ outline: 2px solid var(--wui-color-focus-ring);
9207
9390
  }
9208
- return /* @__PURE__ */ jsxs26(
9209
- Root,
9210
- {
9211
- delayDuration: delay,
9212
- ...rootProps,
9213
- children: [
9214
- /* @__PURE__ */ jsx205(Trigger, { asChild: true, children }),
9215
- /* @__PURE__ */ jsx205(Portal, { children: /* @__PURE__ */ jsxs26(
9216
- StyledContent,
9217
- {
9218
- $compact: compact,
9219
- side: direction,
9220
- sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
9221
- children: [
9222
- content,
9223
- !hideArrow ? /* @__PURE__ */ jsx205(Arrow, { asChild: true, children: /* @__PURE__ */ jsx205(
9224
- "svg",
9225
- {
9226
- fill: "var(--tooltip-bg)",
9227
- height: "8",
9228
- style: { transform: "translateY(-2px)" },
9229
- viewBox: "0 0 12 8",
9230
- width: "12",
9231
- xmlns: "http://www.w3.org/2000/svg",
9232
- children: /* @__PURE__ */ jsx205("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
9233
- }
9234
- ) }) : null
9235
- ]
9236
- }
9237
- ) })
9238
- ]
9239
- }
9240
- );
9241
- };
9242
- Tooltip.displayName = "Tooltip";
9243
9391
 
9244
- // src/components/WistiaLogo/WistiaLogo.tsx
9245
- import styled43 from "styled-components";
9246
- import { isNotNil as isNotNil18 } from "@wistia/type-guards";
9247
- import { jsx as jsx206, jsxs as jsxs27 } from "react/jsx-runtime";
9248
- var renderBrandmark = (brandmarkColor, iconOnly) => {
9249
- if (iconOnly) {
9250
- return /* @__PURE__ */ jsx206(
9251
- "g",
9252
- {
9253
- "data-testid": "ui-wistia-logo-brandmark",
9254
- fill: brandmarkColor,
9255
- children: /* @__PURE__ */ jsx206("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
9256
- }
9257
- );
9258
- }
9259
- return /* @__PURE__ */ jsx206(
9260
- "g",
9261
- {
9262
- "data-testid": "ui-wistia-logo-brandmark",
9263
- fill: brandmarkColor,
9264
- children: /* @__PURE__ */ jsx206("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
9265
- }
9266
- );
9267
- };
9268
- var renderLogotype = (logotypeColor, iconOnly) => {
9269
- if (iconOnly) {
9270
- return null;
9392
+ /* note: react-toggle-group uses "on" and react-tabs uses "active" */
9393
+ &[data-state='on'],
9394
+ &[data-state='active'] {
9395
+ background-color: var(--wui-color-bg-fill-white);
9396
+ color: var(--wui-color-text-selected);
9397
+ cursor: default;
9271
9398
  }
9272
- return /* @__PURE__ */ jsx206(
9273
- "g",
9274
- {
9275
- "data-testid": "ui-wistia-logo-logotype",
9276
- fill: logotypeColor,
9277
- children: /* @__PURE__ */ jsx206("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
9399
+
9400
+ &:focus-visible,
9401
+ &[data-state='on'],
9402
+ &[data-state='active'] {
9403
+ svg path {
9404
+ fill: var(--wui-color-focus-ring);
9278
9405
  }
9279
- );
9280
- };
9281
- var computedViewBox = (iconOnly) => {
9282
- if (iconOnly) {
9283
- return "0 0 34.4 26.78";
9284
9406
  }
9285
- return "0 0 144 31.47";
9286
- };
9287
- var WistiaLogoComponent = styled43.svg`
9288
- height: ${({ height }) => `${height}px`};
9289
9407
 
9290
- /* ensure it will always fit on mobile */
9291
- max-height: 22vw;
9292
- max-width: 100%;
9408
+ &[data-disabled] {
9409
+ cursor: not-allowed;
9293
9410
 
9294
- &:hover {
9295
- path {
9296
- ${({ $hoverColor }) => $hoverColor !== void 0 ? `fill: ${$hoverColor}` : null};
9411
+ &:hover {
9412
+ background-color: inherit;
9297
9413
  }
9298
9414
  }
9299
9415
  `;
9300
- var WistiaLogo = ({
9301
- description = void 0,
9302
- height = 100,
9303
- hoverColor = void 0,
9304
- href = void 0,
9305
- iconOnly = false,
9306
- title = "Wistia Logo",
9307
- variant = "standard",
9308
- ...otherProps
9309
- }) => {
9310
- const primaryColor = "#2949e5";
9311
- const darkColor = "#000934";
9312
- const lightColor = "#ffffff";
9313
- const VARIANT_COLORS = {
9314
- standard: {
9315
- brandmark: primaryColor,
9316
- logotype: darkColor
9317
- },
9318
- dark: {
9319
- brandmark: darkColor,
9320
- logotype: darkColor
9321
- },
9322
- light: {
9323
- brandmark: lightColor,
9324
- logotype: lightColor
9325
- }
9326
- };
9327
- const brandmarkColor = VARIANT_COLORS[variant].brandmark;
9328
- const logotypeColor = VARIANT_COLORS[variant].logotype;
9329
- const Logo = /* @__PURE__ */ jsxs27(
9330
- WistiaLogoComponent,
9331
- {
9332
- $hoverColor: hoverColor,
9333
- height,
9334
- role: "img",
9335
- viewBox: computedViewBox(iconOnly),
9336
- xmlns: "http://www.w3.org/2000/svg",
9337
- ...otherProps,
9338
- children: [
9339
- /* @__PURE__ */ jsx206("title", { children: title }),
9340
- isNotNil18(description) ? /* @__PURE__ */ jsx206("desc", { children: description }) : null,
9341
- renderBrandmark(brandmarkColor, iconOnly),
9342
- renderLogotype(logotypeColor, iconOnly)
9343
- ]
9344
- }
9345
- );
9346
- return href !== void 0 ? /* @__PURE__ */ jsx206("a", { href, children: Logo }) : Logo;
9347
- };
9348
- WistiaLogo.displayName = "WistiaLogo";
9416
+ var StyledSegmentedControlItem = styled45(ToggleGroupItem)`
9417
+ ${segmentedControlItemStyles}
9418
+ `;
9419
+ var SegmentedControlItem = forwardRef20(
9420
+ ({ disabled, icon, label, "aria-label": ariaLabel, value }, ref) => {
9421
+ const handleClick = (event) => {
9422
+ const target = event.target;
9423
+ const { state } = target.dataset;
9424
+ if (state === "on") {
9425
+ event.preventDefault();
9426
+ }
9427
+ };
9428
+ return /* @__PURE__ */ jsxs28(
9429
+ StyledSegmentedControlItem,
9430
+ {
9431
+ ref,
9432
+ $hasLabel: isNotNil16(label),
9433
+ "aria-label": isNotNil16(label) ? void 0 : ariaLabel,
9434
+ disabled,
9435
+ onClick: handleClick,
9436
+ value,
9437
+ children: [
9438
+ icon,
9439
+ label
9440
+ ]
9441
+ }
9442
+ );
9443
+ }
9444
+ );
9445
+ SegmentedControlItem.displayName = "SegmentedControlItem";
9349
9446
 
9350
9447
  // src/components/Select/Select.tsx
9351
9448
  import {
@@ -9358,10 +9455,10 @@ import {
9358
9455
  Value,
9359
9456
  ScrollDownButton
9360
9457
  } from "@radix-ui/react-select";
9361
- import { forwardRef as forwardRef22 } from "react";
9362
- import styled44 from "styled-components";
9363
- import { jsx as jsx207, jsxs as jsxs28 } from "react/jsx-runtime";
9364
- var StyledTrigger = styled44(Trigger2)`
9458
+ import { forwardRef as forwardRef21 } from "react";
9459
+ import styled46 from "styled-components";
9460
+ import { jsx as jsx209, jsxs as jsxs29 } from "react/jsx-runtime";
9461
+ var StyledTrigger = styled46(Trigger2)`
9365
9462
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
9366
9463
  --wui-select-color-bg: var(--wui-color-bg-surface);
9367
9464
  --wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
@@ -9402,7 +9499,7 @@ var StyledTrigger = styled44(Trigger2)`
9402
9499
  background-color: var(--wui-color-bg-surface-disabled);
9403
9500
  }
9404
9501
  `;
9405
- var StyledContent2 = styled44(Content2)`
9502
+ var StyledContent2 = styled46(Content2)`
9406
9503
  --wui-select-content-border: var(--wui-color-border);
9407
9504
  --wui-select-content-bg: var(--wui-color-bg-surface);
9408
9505
  --wui-select-content-border-radius: var(--wui-border-radius-02);
@@ -9418,7 +9515,7 @@ var StyledContent2 = styled44(Content2)`
9418
9515
  padding: var(--wui-select-option-padding);
9419
9516
  min-width: 200px;
9420
9517
  `;
9421
- var Select = forwardRef22(
9518
+ var Select = forwardRef21(
9422
9519
  ({
9423
9520
  colorScheme = "inherit",
9424
9521
  children,
@@ -9428,13 +9525,13 @@ var Select = forwardRef22(
9428
9525
  ...props
9429
9526
  }, forwardedRef) => {
9430
9527
  const responsiveFullWidth = useResponsiveProp(fullWidth);
9431
- return /* @__PURE__ */ jsxs28(
9528
+ return /* @__PURE__ */ jsxs29(
9432
9529
  Root2,
9433
9530
  {
9434
9531
  ...props,
9435
9532
  onValueChange: onChange,
9436
9533
  children: [
9437
- /* @__PURE__ */ jsxs28(
9534
+ /* @__PURE__ */ jsxs29(
9438
9535
  StyledTrigger,
9439
9536
  {
9440
9537
  ref: forwardedRef,
@@ -9442,8 +9539,8 @@ var Select = forwardRef22(
9442
9539
  $fullWidth: responsiveFullWidth,
9443
9540
  ...props,
9444
9541
  children: [
9445
- /* @__PURE__ */ jsx207(Value, { placeholder }),
9446
- /* @__PURE__ */ jsx207(
9542
+ /* @__PURE__ */ jsx209(Value, { placeholder }),
9543
+ /* @__PURE__ */ jsx209(
9447
9544
  Icon,
9448
9545
  {
9449
9546
  size: "md",
@@ -9453,10 +9550,10 @@ var Select = forwardRef22(
9453
9550
  ]
9454
9551
  }
9455
9552
  ),
9456
- /* @__PURE__ */ jsx207(Portal2, { children: /* @__PURE__ */ jsxs28(StyledContent2, { position: "popper", children: [
9457
- /* @__PURE__ */ jsx207(ScrollUpButton, { children: /* @__PURE__ */ jsx207(Icon, { type: "caret-up" }) }),
9458
- /* @__PURE__ */ jsx207(Viewport, { children }),
9459
- /* @__PURE__ */ jsx207(ScrollDownButton, { children: /* @__PURE__ */ jsx207(Icon, { type: "caret-down" }) })
9553
+ /* @__PURE__ */ jsx209(Portal2, { children: /* @__PURE__ */ jsxs29(StyledContent2, { position: "popper", children: [
9554
+ /* @__PURE__ */ jsx209(ScrollUpButton, { children: /* @__PURE__ */ jsx209(Icon, { type: "caret-up" }) }),
9555
+ /* @__PURE__ */ jsx209(Viewport, { children }),
9556
+ /* @__PURE__ */ jsx209(ScrollDownButton, { children: /* @__PURE__ */ jsx209(Icon, { type: "caret-down" }) })
9460
9557
  ] }) })
9461
9558
  ]
9462
9559
  }
@@ -9467,10 +9564,10 @@ Select.displayName = "Select";
9467
9564
 
9468
9565
  // src/components/Select/SelectOption.tsx
9469
9566
  import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
9470
- import { forwardRef as forwardRef23 } from "react";
9471
- import styled45 from "styled-components";
9472
- import { jsx as jsx208, jsxs as jsxs29 } from "react/jsx-runtime";
9473
- var StyledItem = styled45(Item)`
9567
+ import { forwardRef as forwardRef22 } from "react";
9568
+ import styled47 from "styled-components";
9569
+ import { jsx as jsx210, jsxs as jsxs30 } from "react/jsx-runtime";
9570
+ var StyledItem = styled47(Item)`
9474
9571
  ${variantStyleMap2.body3};
9475
9572
  display: flex;
9476
9573
  padding: var(--wui-select-option-padding);
@@ -9493,25 +9590,25 @@ var StyledItem = styled45(Item)`
9493
9590
  background-color: transparent;
9494
9591
  }
9495
9592
  `;
9496
- var StyledIconContainer = styled45.span`
9593
+ var StyledIconContainer = styled47.span`
9497
9594
  width: 12px;
9498
9595
  `;
9499
- var SelectOption = forwardRef23(
9596
+ var SelectOption = forwardRef22(
9500
9597
  ({ children, ...props }, forwardedRef) => {
9501
- return /* @__PURE__ */ jsxs29(
9598
+ return /* @__PURE__ */ jsxs30(
9502
9599
  StyledItem,
9503
9600
  {
9504
9601
  ...props,
9505
9602
  ref: forwardedRef,
9506
9603
  children: [
9507
- /* @__PURE__ */ jsx208(StyledIconContainer, { children: /* @__PURE__ */ jsx208(ItemIndicator, { children: /* @__PURE__ */ jsx208(
9604
+ /* @__PURE__ */ jsx210(StyledIconContainer, { children: /* @__PURE__ */ jsx210(ItemIndicator, { children: /* @__PURE__ */ jsx210(
9508
9605
  Icon,
9509
9606
  {
9510
9607
  size: "sm",
9511
9608
  type: "checkmark"
9512
9609
  }
9513
9610
  ) }) }),
9514
- /* @__PURE__ */ jsx208(ItemText, { children })
9611
+ /* @__PURE__ */ jsx210(ItemText, { children })
9515
9612
  ]
9516
9613
  }
9517
9614
  );
@@ -9521,14 +9618,14 @@ SelectOption.displayName = "Option";
9521
9618
 
9522
9619
  // src/components/Select/SelectOptionGroup.tsx
9523
9620
  import { Group, Label as Label2 } from "@radix-ui/react-select";
9524
- import styled46 from "styled-components";
9525
- import { jsx as jsx209, jsxs as jsxs30 } from "react/jsx-runtime";
9526
- var StyledLabel3 = styled46(Label2)`
9621
+ import styled48 from "styled-components";
9622
+ import { jsx as jsx211, jsxs as jsxs31 } from "react/jsx-runtime";
9623
+ var StyledLabel4 = styled48(Label2)`
9527
9624
  padding: var(--wui-select-option-padding);
9528
9625
  `;
9529
9626
  var SelectOptionGroup = ({ children, label, ...props }) => {
9530
- return /* @__PURE__ */ jsxs30(Group, { ...props, children: [
9531
- /* @__PURE__ */ jsx209(StyledLabel3, { children: /* @__PURE__ */ jsx209(
9627
+ return /* @__PURE__ */ jsxs31(Group, { ...props, children: [
9628
+ /* @__PURE__ */ jsx211(StyledLabel4, { children: /* @__PURE__ */ jsx211(
9532
9629
  Text,
9533
9630
  {
9534
9631
  prominence: "secondary",
@@ -9540,315 +9637,459 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
9540
9637
  ] });
9541
9638
  };
9542
9639
 
9543
- // src/components/DataCards/DataCard.tsx
9544
- import styled47, { keyframes as keyframes2 } from "styled-components";
9545
- import { isNotNull } from "@wistia/type-guards";
9546
- import { jsx as jsx210, jsxs as jsxs31 } from "react/jsx-runtime";
9547
- var StyledDataCard = styled47.div`
9548
- ${({ $colorScheme }) => getColorScheme($colorScheme)}
9549
- display: grid;
9550
- grid-template-areas: 'label slot' 'value value';
9551
- grid-template-rows: auto auto;
9552
- grid-template-columns: auto auto;
9553
- gap: var(--wui-space-01);
9554
- padding: var(--wui-space-03);
9555
- background: var(--wui-color-bg-surface-secondary);
9556
- flex: 1;
9557
- border-radius: var(--wui-border-radius-02);
9558
- position: relative;
9559
- `;
9560
- var shimmer = keyframes2`
9561
- 0% {
9562
- background-position: 200% 0;
9563
- }
9564
- 100% {
9565
- background-position: -200% 0;
9566
- }
9640
+ // src/components/Tabs/Tabs.tsx
9641
+ import { forwardRef as forwardRef24 } from "react";
9642
+ import { Root as TabsRoot } from "@radix-ui/react-tabs";
9643
+ import { isNotNil as isNotNil18, isNil as isNil14 } from "@wistia/type-guards";
9644
+
9645
+ // src/components/Tabs/TabPanel.tsx
9646
+ import styled49 from "styled-components";
9647
+ import { Content as TabsContent } from "@radix-ui/react-tabs";
9648
+ import { jsx as jsx212 } from "react/jsx-runtime";
9649
+ var StyledTabPanel = styled49(TabsContent)`
9650
+ display: flex;
9651
+ flex-direction: column;
9567
9652
  `;
9568
- var LoadingBackground = styled47.div`
9569
- background: linear-gradient(
9570
- 90deg,
9571
- var(--wui-color-bg-surface-tertiary) 25%,
9572
- var(--wui-color-bg-surface-secondary) 37%,
9573
- var(--wui-color-bg-surface-tertiary) 63%
9653
+ var TabPanel = ({ children, value, ...props }) => {
9654
+ return /* @__PURE__ */ jsx212(
9655
+ StyledTabPanel,
9656
+ {
9657
+ value,
9658
+ ...props,
9659
+ children
9660
+ }
9574
9661
  );
9575
- background-size: 200% 100%;
9576
- animation: ${shimmer} 1.5s infinite;
9577
- border-radius: var(--wui-border-radius-01);
9578
- `;
9579
- var StyledLoadingLabel = styled47(LoadingBackground)`
9580
- width: 80px;
9581
- height: var(--wui-typography-heading-6-line-height);
9662
+ };
9663
+ TabPanel.displayName = "TabPanel";
9664
+
9665
+ // src/components/Tabs/TabList.tsx
9666
+ import styled50 from "styled-components";
9667
+ import { List as RadixTabList } from "@radix-ui/react-tabs";
9668
+ import { jsx as jsx213 } from "react/jsx-runtime";
9669
+ var StyledTabList = styled50(RadixTabList)`
9670
+ ${segmentedControlStyles}
9671
+
9672
+ margin-bottom: var(--wui-space-04);
9582
9673
  `;
9583
- var StyledLoadingValue = styled47(LoadingBackground)`
9584
- width: 90%;
9585
- height: var(--wui-typography-heading-3-line-height);
9674
+ var TabList = ({
9675
+ children,
9676
+ fullWidth,
9677
+ ariaLabel,
9678
+ ...props
9679
+ }) => {
9680
+ return /* @__PURE__ */ jsx213(
9681
+ StyledTabList,
9682
+ {
9683
+ $fullWidth: fullWidth,
9684
+ "aria-label": ariaLabel,
9685
+ ...props,
9686
+ children
9687
+ }
9688
+ );
9689
+ };
9690
+ TabList.displayName = "TabList";
9691
+
9692
+ // src/components/Tabs/TabItem.tsx
9693
+ import { forwardRef as forwardRef23 } from "react";
9694
+ import styled51 from "styled-components";
9695
+ import { Trigger as RadixTab } from "@radix-ui/react-tabs";
9696
+ import { isNotNil as isNotNil17 } from "@wistia/type-guards";
9697
+ import { jsxs as jsxs32 } from "react/jsx-runtime";
9698
+ var StyledTabItem = styled51(RadixTab)`
9699
+ ${segmentedControlItemStyles}
9700
+
9701
+ &[data-state='active'] {
9702
+ background-color: white;
9703
+ }
9586
9704
  `;
9587
- var StyledLabel4 = styled47(Heading)`
9588
- grid-area: label;
9705
+ var TabItem = forwardRef23(
9706
+ ({ disabled = false, icon, label, "aria-label": ariaLabel, value }, ref) => {
9707
+ return /* @__PURE__ */ jsxs32(
9708
+ StyledTabItem,
9709
+ {
9710
+ ref,
9711
+ $hasLabel: isNotNil17(label),
9712
+ "aria-label": isNotNil17(label) ? void 0 : ariaLabel,
9713
+ disabled,
9714
+ value,
9715
+ children: [
9716
+ icon,
9717
+ label
9718
+ ]
9719
+ }
9720
+ );
9721
+ }
9722
+ );
9723
+ TabItem.displayName = "TabItem";
9724
+
9725
+ // src/components/Tabs/extractTabItems.ts
9726
+ import { Children as Children5, Fragment as Fragment5, isValidElement as isValidElement2 } from "react";
9727
+ var extractTabItems = (children) => {
9728
+ const tabItems = [];
9729
+ Children5.forEach(children, (child) => {
9730
+ if (!isValidElement2(child)) {
9731
+ return;
9732
+ }
9733
+ if (typeof child.type !== "string" && child.type.displayName === "Tab") {
9734
+ tabItems.push(child);
9735
+ } else if (child.type === Fragment5) {
9736
+ const fragmentElement = child;
9737
+ tabItems.push(...extractTabItems(fragmentElement.props.children));
9738
+ } else if ((child.props.children ?? null) != null) {
9739
+ const childChildren = child.props.children;
9740
+ tabItems.push(...extractTabItems(childChildren));
9741
+ } else {
9742
+ }
9743
+ });
9744
+ return tabItems;
9745
+ };
9746
+
9747
+ // src/components/Tabs/Tabs.tsx
9748
+ import { jsx as jsx214, jsxs as jsxs33 } from "react/jsx-runtime";
9749
+ var Tabs = forwardRef24(
9750
+ ({
9751
+ children,
9752
+ fullWidth = true,
9753
+ "aria-label": ariaLabel,
9754
+ defaultSelectedValue,
9755
+ selectedValue,
9756
+ onSelectedValueChange,
9757
+ ...otherProps
9758
+ }, ref) => {
9759
+ const tabItems = extractTabItems(children);
9760
+ const modeProps = defaultSelectedValue !== void 0 ? { defaultValue: defaultSelectedValue } : { value: selectedValue, onValueChange: onSelectedValueChange };
9761
+ return /* @__PURE__ */ jsxs33(
9762
+ TabsRoot,
9763
+ {
9764
+ ref,
9765
+ activationMode: "automatic",
9766
+ ...otherProps,
9767
+ ...modeProps,
9768
+ children: [
9769
+ /* @__PURE__ */ jsx214(
9770
+ TabList,
9771
+ {
9772
+ ariaLabel,
9773
+ fullWidth,
9774
+ children: tabItems.map((tab) => {
9775
+ const {
9776
+ value,
9777
+ disabled = false,
9778
+ icon,
9779
+ label,
9780
+ "aria-label": ariaLabelForTab
9781
+ } = tab.props;
9782
+ if (isNil14(icon)) {
9783
+ return /* @__PURE__ */ jsx214(
9784
+ TabItem,
9785
+ {
9786
+ disabled,
9787
+ label,
9788
+ value
9789
+ },
9790
+ value
9791
+ );
9792
+ }
9793
+ if (isNotNil18(label)) {
9794
+ return /* @__PURE__ */ jsx214(
9795
+ TabItem,
9796
+ {
9797
+ disabled,
9798
+ icon,
9799
+ label,
9800
+ value
9801
+ },
9802
+ value
9803
+ );
9804
+ }
9805
+ if (isNotNil18(ariaLabelForTab)) {
9806
+ return /* @__PURE__ */ jsx214(
9807
+ TabItem,
9808
+ {
9809
+ "aria-label": ariaLabelForTab,
9810
+ disabled,
9811
+ icon,
9812
+ value
9813
+ },
9814
+ value
9815
+ );
9816
+ }
9817
+ throw new Error("A `Tab` with an icon must have either label or aria-label");
9818
+ })
9819
+ }
9820
+ ),
9821
+ tabItems.map((tab) => /* @__PURE__ */ jsx214(
9822
+ TabPanel,
9823
+ {
9824
+ value: tab.props.value,
9825
+ children: tab.props.children
9826
+ },
9827
+ tab.props.value
9828
+ ))
9829
+ ]
9830
+ }
9831
+ );
9832
+ }
9833
+ );
9834
+ Tabs.displayName = "Tabs";
9835
+
9836
+ // src/components/Tabs/Tab.tsx
9837
+ import { forwardRef as forwardRef25 } from "react";
9838
+ import { jsx as jsx215 } from "react/jsx-runtime";
9839
+ var Tab = forwardRef25(({ children }, ref) => {
9840
+ return /* @__PURE__ */ jsx215("div", { ref, children });
9841
+ });
9842
+ Tab.displayName = "Tab";
9843
+
9844
+ // src/components/Tag/Tag.tsx
9845
+ import { forwardRef as forwardRef26 } from "react";
9846
+ import styled52 from "styled-components";
9847
+ import { isNil as isNil15, isNotNil as isNotNil19, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
9848
+ import { Fragment as Fragment6, jsx as jsx216, jsxs as jsxs34 } from "react/jsx-runtime";
9849
+ var TagLabel = styled52.a`
9850
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
9851
+ font-size: var(--wui-typography-label-4-size);
9852
+ font-weight: var(--wui-typography-label-4-weight);
9853
+ line-height: var(--wui-typography-label-4-line-height);
9854
+ border-radius: var(--wui-border-radius-01);
9855
+ align-items: center;
9856
+ color: var(--wui-color-text);
9857
+ text-decoration: none;
9858
+ padding: var(--wui-space-01);
9859
+
9860
+ :not(:only-child) {
9861
+ padding-right: var(--wui-space-01);
9862
+ }
9863
+
9864
+ :is(a):hover {
9865
+ background: var(--wui-color-bg-surface-secondary-hover);
9866
+ }
9867
+
9868
+ :is(a):active {
9869
+ background: var(--wui-color-bg-surface-secondary-active);
9870
+ }
9871
+
9872
+ :focus-visible {
9873
+ outline: unset;
9874
+ box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
9875
+ }
9589
9876
  `;
9590
- var StyledValue = styled47(Heading)`
9591
- grid-area: value;
9877
+ var TagDivider = styled52.div`
9878
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
9879
+ border-left: 1px solid var(--wui-color-border);
9880
+ display: flex;
9881
+ height: 14px;
9882
+ width: 1px;
9592
9883
  `;
9593
- var StyledSlot = styled47.div`
9884
+ var StyledRemoveButton = styled52.button`
9885
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
9886
+ all: unset;
9887
+ cursor: pointer;
9594
9888
  display: flex;
9595
- justify-content: flex-end;
9596
- grid-area: slot;
9597
- align-self: center;
9889
+ height: 22px;
9890
+ width: 12px;
9891
+ align-items: center;
9892
+ padding: 0 var(--wui-space-01);
9893
+ border-radius: var(--wui-border-radius-01);
9894
+
9895
+ svg path {
9896
+ fill: var(--wui-color-icon);
9897
+ }
9898
+
9899
+ :hover {
9900
+ background: var(--wui-color-bg-surface-secondary-hover);
9901
+ }
9902
+
9903
+ :active {
9904
+ background: var(--wui-color-bg-surface-secondary-active);
9905
+ }
9906
+
9907
+ :focus-visible {
9908
+ outline: unset;
9909
+ box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
9910
+ }
9598
9911
  `;
9599
- var StyledDataCardTrendContainer = styled47.div`
9600
- position: absolute;
9601
- bottom: var(--wui-space-01);
9602
- right: var(--wui-space-01);
9912
+ var StyledTag = styled52.div`
9913
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
9914
+ align-items: center;
9915
+ background-color: var(--wui-color-bg-surface-secondary);
9916
+ border-radius: var(--wui-border-radius-01);
9917
+ display: inline-flex;
9918
+ overflow: hidden;
9919
+
9920
+ > * {
9921
+ transition: background var(--wui-duration-01) var(--wui-motion-ease);
9922
+ }
9603
9923
  `;
9604
- var DataCard = ({
9605
- label,
9606
- value,
9607
- upperRightSlot,
9608
- colorScheme = "inherit",
9609
- isLoading = false,
9610
- trend,
9611
- ...props
9612
- }) => /* @__PURE__ */ jsxs31(
9613
- StyledDataCard,
9614
- {
9615
- $colorScheme: colorScheme,
9616
- ...props,
9617
- children: [
9618
- /* @__PURE__ */ jsx210(
9619
- StyledLabel4,
9620
- {
9621
- renderAs: "dt",
9622
- variant: "heading6",
9623
- children: isLoading ? /* @__PURE__ */ jsx210(StyledLoadingLabel, {}) : label
9624
- }
9625
- ),
9626
- /* @__PURE__ */ jsx210(
9627
- StyledValue,
9628
- {
9629
- renderAs: "dd",
9630
- variant: "heading3",
9631
- children: isLoading ? /* @__PURE__ */ jsx210(StyledLoadingValue, {}) : value
9632
- }
9633
- ),
9634
- isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */ jsx210(StyledSlot, { children: upperRightSlot }),
9635
- isNotNull(trend) && !isLoading && /* @__PURE__ */ jsx210(StyledDataCardTrendContainer, { children: trend })
9636
- ]
9924
+ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
9925
+ if (isNil15(onClickRemove)) {
9926
+ return null;
9927
+ }
9928
+ if (isNil15(onClickRemoveLabel)) {
9929
+ throw new Error(
9930
+ "for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
9931
+ );
9932
+ }
9933
+ return /* @__PURE__ */ jsxs34(Fragment6, { children: [
9934
+ /* @__PURE__ */ jsx216(TagDivider, { $colorScheme: colorScheme }),
9935
+ /* @__PURE__ */ jsxs34(
9936
+ StyledRemoveButton,
9937
+ {
9938
+ $colorScheme: colorScheme,
9939
+ onClick: onClickRemove,
9940
+ type: "button",
9941
+ children: [
9942
+ /* @__PURE__ */ jsx216(
9943
+ Icon,
9944
+ {
9945
+ size: "sm",
9946
+ type: "close"
9947
+ }
9948
+ ),
9949
+ /* @__PURE__ */ jsx216(ScreenReaderOnly, { children: onClickRemoveLabel })
9950
+ ]
9951
+ }
9952
+ )
9953
+ ] });
9954
+ };
9955
+ var Tag = forwardRef26(
9956
+ ({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
9957
+ const labelProps = isNotNil19(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
9958
+ return /* @__PURE__ */ jsxs34(
9959
+ StyledTag,
9960
+ {
9961
+ ref,
9962
+ $colorScheme: colorScheme,
9963
+ ...otherProps,
9964
+ children: [
9965
+ /* @__PURE__ */ jsx216(
9966
+ TagLabel,
9967
+ {
9968
+ ...labelProps,
9969
+ $colorScheme: colorScheme,
9970
+ children: label
9971
+ }
9972
+ ),
9973
+ /* @__PURE__ */ jsx216(
9974
+ RemoveButton,
9975
+ {
9976
+ colorScheme,
9977
+ onClickRemove,
9978
+ onClickRemoveLabel
9979
+ }
9980
+ )
9981
+ ]
9982
+ }
9983
+ );
9637
9984
  }
9638
9985
  );
9639
- DataCard.displayName = "DataCard";
9986
+ Tag.displayName = "Tag";
9640
9987
 
9641
- // src/components/DataCards/DataCards.tsx
9642
- import styled48 from "styled-components";
9643
- import { jsx as jsx211 } from "react/jsx-runtime";
9644
- var StyledDataCards = styled48(Box)`
9645
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
9646
- margin-top: 0; /* Remove default <dl> style */
9647
- > * {
9648
- min-width: 120px;
9649
- max-width: ${({ $cardMaxWidth }) => $cardMaxWidth};
9988
+ // src/components/WistiaLogo/WistiaLogo.tsx
9989
+ import styled53 from "styled-components";
9990
+ import { isNotNil as isNotNil20 } from "@wistia/type-guards";
9991
+ import { jsx as jsx217, jsxs as jsxs35 } from "react/jsx-runtime";
9992
+ var renderBrandmark = (brandmarkColor, iconOnly) => {
9993
+ if (iconOnly) {
9994
+ return /* @__PURE__ */ jsx217(
9995
+ "g",
9996
+ {
9997
+ "data-testid": "ui-wistia-logo-brandmark",
9998
+ fill: brandmarkColor,
9999
+ children: /* @__PURE__ */ jsx217("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
10000
+ }
10001
+ );
9650
10002
  }
9651
- `;
9652
- var DataCards = ({
9653
- children,
9654
- cardMaxWidth = "none",
9655
- colorScheme = "inherit",
9656
- ...props
9657
- }) => {
9658
- return /* @__PURE__ */ jsx211(
9659
- StyledDataCards,
10003
+ return /* @__PURE__ */ jsx217(
10004
+ "g",
9660
10005
  {
9661
- ...props,
9662
- $cardMaxWidth: cardMaxWidth,
9663
- $colorScheme: colorScheme,
9664
- direction: "row",
9665
- fill: "horizontal",
9666
- gap: "space-02",
9667
- renderAs: "dl",
9668
- wrapItems: true,
9669
- children
10006
+ "data-testid": "ui-wistia-logo-brandmark",
10007
+ fill: brandmarkColor,
10008
+ children: /* @__PURE__ */ jsx217("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
9670
10009
  }
9671
10010
  );
9672
10011
  };
9673
- DataCards.displayName = "DataCards";
9674
-
9675
- // src/components/DataCards/DataCardTrend.tsx
9676
- import styled49 from "styled-components";
9677
- import { jsx as jsx212, jsxs as jsxs32 } from "react/jsx-runtime";
9678
- var StyledDataCardTrend = styled49.div`
9679
- ${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
9680
- background: var(--wui-color-bg-app);
9681
- border-radius: var(--wui-border-radius-rounded);
9682
- padding: var(--wui-space-01);
9683
- display: flex;
9684
- align-items: center;
9685
- gap: 2px;
9686
- `;
9687
- var DataCardTrend = ({
9688
- direction = "up",
9689
- outlook = "positive",
9690
- children,
9691
- ...props
9692
- }) => {
9693
- return /* @__PURE__ */ jsxs32(StyledDataCardTrend, { $outlook: outlook, children: [
9694
- /* @__PURE__ */ jsx212(
9695
- Icon,
9696
- {
9697
- size: "md",
9698
- type: direction === "up" ? "arrow-up" : "arrow-down",
9699
- ...props
9700
- }
9701
- ),
9702
- /* @__PURE__ */ jsx212(
9703
- Text,
9704
- {
9705
- prominence: "secondary",
9706
- variant: "label4",
9707
- children
9708
- }
9709
- )
9710
- ] });
10012
+ var renderLogotype = (logotypeColor, iconOnly) => {
10013
+ if (iconOnly) {
10014
+ return null;
10015
+ }
10016
+ return /* @__PURE__ */ jsx217(
10017
+ "g",
10018
+ {
10019
+ "data-testid": "ui-wistia-logo-logotype",
10020
+ fill: logotypeColor,
10021
+ children: /* @__PURE__ */ jsx217("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
10022
+ }
10023
+ );
9711
10024
  };
9712
-
9713
- // src/components/EditableHeading/EditableHeading.tsx
9714
- import styled50, { css as css25 } from "styled-components";
9715
- import { useState as useState8, useRef as useRef8 } from "react";
9716
- import { Fragment as Fragment5, jsx as jsx213, jsxs as jsxs33 } from "react/jsx-runtime";
9717
- var StyledInput = styled50(Input)`
9718
- :not([rows]) {
9719
- min-height: unset;
10025
+ var computedViewBox = (iconOnly) => {
10026
+ if (iconOnly) {
10027
+ return "0 0 34.4 26.78";
9720
10028
  }
10029
+ return "0 0 144 31.47";
10030
+ };
10031
+ var WistiaLogoComponent = styled53.svg`
10032
+ height: ${({ height }) => `${height}px`};
9721
10033
 
9722
- resize: vertical;
9723
- font-size: var(--wui-typography-heading-1-size);
9724
- font-weight: var(--wui-typography-heading-1-weight);
9725
- line-height: var(--wui-typography-heading-1-line-height);
9726
- font-family: var(--wui-typography-heading-1-family);
9727
- outline: 2px solid var(--wui-color-focus-ring);
9728
- outline-offset: -2px;
9729
-
9730
- && {
9731
- width: 100%;
9732
- padding: var(--wui-space-02);
9733
- border: none;
9734
- height: ${({ $height }) => `${$height}px`};
9735
- }
9736
- `;
9737
- var editableStyles = css25`
9738
- &:has(+ :focus-within) {
9739
- background: var(--wui-color-bg-surface-hover);
9740
- }
10034
+ /* ensure it will always fit on mobile */
10035
+ max-height: 22vw;
10036
+ max-width: 100%;
9741
10037
 
9742
10038
  &:hover {
9743
- background: var(--wui-color-bg-surface-hover);
9744
- cursor: pointer;
10039
+ path {
10040
+ ${({ $hoverColor }) => $hoverColor !== void 0 ? `fill: ${$hoverColor}` : null};
10041
+ }
9745
10042
  }
9746
10043
  `;
9747
- var StyledHeading2 = styled50(Heading)`
9748
- width: 100%;
9749
- border-radius: var(--wui-border-radius-02);
9750
- padding: var(--wui-space-02);
9751
- overflow-wrap: anywhere;
9752
- transition: all var(--wui-motion-duration-01) var(--wui-motion-ease);
9753
- ${({ $editingDisabled }) => !$editingDisabled && editableStyles}
9754
- `;
9755
- var EditableHeading = ({
9756
- children,
9757
- onValueChange,
9758
- onEditingChange,
9759
- tooltipText = "Click to edit title",
9760
- ariaLabel = "Edit title",
9761
- forceEditing = false,
9762
- editingDisabled = false
10044
+ var WistiaLogo = ({
10045
+ description = void 0,
10046
+ height = 100,
10047
+ hoverColor = void 0,
10048
+ href = void 0,
10049
+ iconOnly = false,
10050
+ title = "Wistia Logo",
10051
+ variant = "standard",
10052
+ ...otherProps
9763
10053
  }) => {
9764
- const [isEditing, setIsEditing] = useState8(false);
9765
- const [value, setValue] = useState8(children);
9766
- const [previousValue, setPreviousValue] = useState8(children);
9767
- const [headingHeight, setHeadingHeight] = useState8("60");
9768
- const headingRef = useRef8(null);
9769
- const handleSetEditing = (editing) => {
9770
- if (editingDisabled) return;
9771
- if (editing && headingRef.current) {
9772
- setHeadingHeight(`${headingRef.current.offsetHeight}`);
9773
- }
9774
- if (editing) {
9775
- setPreviousValue(value);
9776
- }
9777
- setIsEditing(editing);
9778
- onEditingChange?.(editing);
9779
- };
9780
- const handleFinishEditing = () => {
9781
- const trimmedValue = value.trim();
9782
- if (trimmedValue === "") {
9783
- setValue(previousValue);
9784
- } else if (trimmedValue !== previousValue && onValueChange) {
9785
- onValueChange(trimmedValue);
9786
- } else {
9787
- setValue(trimmedValue);
9788
- }
9789
- handleSetEditing(false);
9790
- };
9791
- const handleKeyDown = (event) => {
9792
- if (event.key === "Enter" && !event.shiftKey) {
9793
- event.preventDefault();
9794
- handleFinishEditing();
9795
- }
9796
- if (event.key === "Escape") {
9797
- setValue(previousValue);
9798
- handleSetEditing(false);
10054
+ const primaryColor = "#2949e5";
10055
+ const darkColor = "#000934";
10056
+ const lightColor = "#ffffff";
10057
+ const VARIANT_COLORS = {
10058
+ standard: {
10059
+ brandmark: primaryColor,
10060
+ logotype: darkColor
10061
+ },
10062
+ dark: {
10063
+ brandmark: darkColor,
10064
+ logotype: darkColor
10065
+ },
10066
+ light: {
10067
+ brandmark: lightColor,
10068
+ logotype: lightColor
9799
10069
  }
9800
10070
  };
9801
- const HeadingComponent2 = /* @__PURE__ */ jsx213(
9802
- StyledHeading2,
10071
+ const brandmarkColor = VARIANT_COLORS[variant].brandmark;
10072
+ const logotypeColor = VARIANT_COLORS[variant].logotype;
10073
+ const Logo = /* @__PURE__ */ jsxs35(
10074
+ WistiaLogoComponent,
9803
10075
  {
9804
- ref: headingRef,
9805
- $editingDisabled: editingDisabled,
9806
- onClick: () => handleSetEditing(true),
9807
- variant: "heading1",
9808
- children: value
10076
+ $hoverColor: hoverColor,
10077
+ height,
10078
+ role: "img",
10079
+ viewBox: computedViewBox(iconOnly),
10080
+ xmlns: "http://www.w3.org/2000/svg",
10081
+ ...otherProps,
10082
+ children: [
10083
+ /* @__PURE__ */ jsx217("title", { children: title }),
10084
+ isNotNil20(description) ? /* @__PURE__ */ jsx217("desc", { children: description }) : null,
10085
+ renderBrandmark(brandmarkColor, iconOnly),
10086
+ renderLogotype(logotypeColor, iconOnly)
10087
+ ]
9809
10088
  }
9810
10089
  );
9811
- if (editingDisabled) {
9812
- return HeadingComponent2;
9813
- }
9814
- if (isEditing || forceEditing) {
9815
- return /* @__PURE__ */ jsx213(
9816
- StyledInput,
9817
- {
9818
- $height: headingHeight,
9819
- autoFocus: true,
9820
- fullWidth: true,
9821
- onBlur: handleFinishEditing,
9822
- onChange: (event) => setValue(event.target.value),
9823
- onFocus: (event) => {
9824
- const { length } = event.currentTarget.value;
9825
- event.currentTarget.setSelectionRange(length, length);
9826
- },
9827
- onKeyDown: handleKeyDown,
9828
- type: "multiline",
9829
- value
9830
- }
9831
- );
9832
- }
9833
- return /* @__PURE__ */ jsxs33(Fragment5, { children: [
9834
- /* @__PURE__ */ jsx213(
9835
- Tooltip,
9836
- {
9837
- compact: true,
9838
- content: tooltipText,
9839
- children: HeadingComponent2
9840
- }
9841
- ),
9842
- /* @__PURE__ */ jsx213(ScreenReaderOnly, { children: /* @__PURE__ */ jsx213(
9843
- "button",
9844
- {
9845
- "aria-label": ariaLabel,
9846
- onClick: () => handleSetEditing(true),
9847
- type: "button"
9848
- }
9849
- ) })
9850
- ] });
10090
+ return href !== void 0 ? /* @__PURE__ */ jsx217("a", { href, children: Logo }) : Logo;
9851
10091
  };
10092
+ WistiaLogo.displayName = "WistiaLogo";
9852
10093
  export {
9853
10094
  ActionButton,
9854
10095
  Avatar,
@@ -9897,6 +10138,8 @@ export {
9897
10138
  SelectOptionGroup,
9898
10139
  Stack,
9899
10140
  SubMenu,
10141
+ Tab,
10142
+ Tabs,
9900
10143
  Tag,
9901
10144
  Text,
9902
10145
  Tooltip,