@wistia/ui 0.5.3 → 0.5.4-beta.1a9b4c68.aeef579
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1875 -1511
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +287 -196
- package/dist/index.d.ts +287 -196
- package/dist/index.mjs +1756 -1394
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.5.
|
|
3
|
+
* @license @wistia/ui v0.5.4-beta.1a9b4c68.aeef579
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -86,6 +86,8 @@ __export(index_exports, {
|
|
|
86
86
|
SelectOptionGroup: () => SelectOptionGroup,
|
|
87
87
|
Stack: () => Stack,
|
|
88
88
|
SubMenu: () => SubMenu,
|
|
89
|
+
Tab: () => Tab,
|
|
90
|
+
Tabs: () => Tabs,
|
|
89
91
|
Tag: () => Tag,
|
|
90
92
|
Text: () => Text,
|
|
91
93
|
Tooltip: () => Tooltip,
|
|
@@ -7174,75 +7176,856 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
7174
7176
|
);
|
|
7175
7177
|
Checkbox.displayName = "Checkbox";
|
|
7176
7178
|
|
|
7177
|
-
// src/components/
|
|
7179
|
+
// src/components/DataCards/DataCard.tsx
|
|
7178
7180
|
var import_styled_components34 = __toESM(require("styled-components"));
|
|
7181
|
+
var import_type_guards21 = require("@wistia/type-guards");
|
|
7179
7182
|
var import_jsx_runtime176 = require("react/jsx-runtime");
|
|
7180
|
-
var
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7183
|
+
var StyledDataCard = import_styled_components34.default.div`
|
|
7184
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
7185
|
+
display: grid;
|
|
7186
|
+
grid-template-areas: 'label slot' 'value value';
|
|
7187
|
+
grid-template-rows: auto auto;
|
|
7188
|
+
grid-template-columns: auto auto;
|
|
7189
|
+
gap: var(--wui-space-01);
|
|
7190
|
+
padding: var(--wui-space-03);
|
|
7191
|
+
background: var(--wui-color-bg-surface-secondary);
|
|
7192
|
+
flex: 1;
|
|
7193
|
+
border-radius: var(--wui-border-radius-02);
|
|
7194
|
+
position: relative;
|
|
7186
7195
|
`;
|
|
7187
|
-
var
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7196
|
+
var shimmer = import_styled_components34.keyframes`
|
|
7197
|
+
0% {
|
|
7198
|
+
background-position: 200% 0;
|
|
7199
|
+
}
|
|
7200
|
+
100% {
|
|
7201
|
+
background-position: -200% 0;
|
|
7202
|
+
}
|
|
7192
7203
|
`;
|
|
7193
|
-
var
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7204
|
+
var LoadingBackground = import_styled_components34.default.div`
|
|
7205
|
+
background: linear-gradient(
|
|
7206
|
+
90deg,
|
|
7207
|
+
var(--wui-color-bg-surface-tertiary) 25%,
|
|
7208
|
+
var(--wui-color-bg-surface-secondary) 37%,
|
|
7209
|
+
var(--wui-color-bg-surface-tertiary) 63%
|
|
7210
|
+
);
|
|
7211
|
+
background-size: 200% 100%;
|
|
7212
|
+
animation: ${shimmer} 1.5s infinite;
|
|
7213
|
+
border-radius: var(--wui-border-radius-01);
|
|
7214
|
+
`;
|
|
7215
|
+
var StyledLoadingLabel = (0, import_styled_components34.default)(LoadingBackground)`
|
|
7216
|
+
width: 80px;
|
|
7217
|
+
height: var(--wui-typography-heading-6-line-height);
|
|
7218
|
+
`;
|
|
7219
|
+
var StyledLoadingValue = (0, import_styled_components34.default)(LoadingBackground)`
|
|
7220
|
+
width: 90%;
|
|
7221
|
+
height: var(--wui-typography-heading-3-line-height);
|
|
7222
|
+
`;
|
|
7223
|
+
var StyledLabel3 = (0, import_styled_components34.default)(Heading)`
|
|
7224
|
+
grid-area: label;
|
|
7225
|
+
`;
|
|
7226
|
+
var StyledValue = (0, import_styled_components34.default)(Heading)`
|
|
7227
|
+
grid-area: value;
|
|
7228
|
+
`;
|
|
7229
|
+
var StyledSlot = import_styled_components34.default.div`
|
|
7230
|
+
display: flex;
|
|
7231
|
+
justify-content: flex-end;
|
|
7232
|
+
grid-area: slot;
|
|
7233
|
+
align-self: center;
|
|
7234
|
+
`;
|
|
7235
|
+
var StyledDataCardTrendContainer = import_styled_components34.default.div`
|
|
7236
|
+
position: absolute;
|
|
7237
|
+
bottom: var(--wui-space-01);
|
|
7238
|
+
right: var(--wui-space-01);
|
|
7239
|
+
`;
|
|
7240
|
+
var DataCard = ({
|
|
7241
|
+
label,
|
|
7242
|
+
value,
|
|
7243
|
+
upperRightSlot,
|
|
7244
|
+
colorScheme = "inherit",
|
|
7245
|
+
isLoading = false,
|
|
7246
|
+
trend,
|
|
7247
|
+
...props
|
|
7248
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(
|
|
7249
|
+
StyledDataCard,
|
|
7250
|
+
{
|
|
7251
|
+
$colorScheme: colorScheme,
|
|
7252
|
+
...props,
|
|
7253
|
+
children: [
|
|
7254
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
7255
|
+
StyledLabel3,
|
|
7256
|
+
{
|
|
7257
|
+
renderAs: "dt",
|
|
7258
|
+
variant: "heading6",
|
|
7259
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledLoadingLabel, {}) : label
|
|
7260
|
+
}
|
|
7261
|
+
),
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
7263
|
+
StyledValue,
|
|
7264
|
+
{
|
|
7265
|
+
renderAs: "dd",
|
|
7266
|
+
variant: "heading3",
|
|
7267
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledLoadingValue, {}) : value
|
|
7268
|
+
}
|
|
7269
|
+
),
|
|
7270
|
+
(0, import_type_guards21.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
7271
|
+
(0, import_type_guards21.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
7272
|
+
]
|
|
7273
|
+
}
|
|
7274
|
+
);
|
|
7275
|
+
DataCard.displayName = "DataCard";
|
|
7276
|
+
|
|
7277
|
+
// src/components/DataCards/DataCards.tsx
|
|
7278
|
+
var import_styled_components35 = __toESM(require("styled-components"));
|
|
7279
|
+
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
7280
|
+
var StyledDataCards = (0, import_styled_components35.default)(Box)`
|
|
7281
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7282
|
+
margin-top: 0; /* Remove default <dl> style */
|
|
7283
|
+
> * {
|
|
7284
|
+
min-width: 120px;
|
|
7285
|
+
max-width: ${({ $cardMaxWidth }) => $cardMaxWidth};
|
|
7286
|
+
}
|
|
7287
|
+
`;
|
|
7288
|
+
var DataCards = ({
|
|
7289
|
+
children,
|
|
7290
|
+
cardMaxWidth = "none",
|
|
7291
|
+
colorScheme = "inherit",
|
|
7292
|
+
...props
|
|
7293
|
+
}) => {
|
|
7294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
|
|
7295
|
+
StyledDataCards,
|
|
7296
|
+
{
|
|
7297
|
+
...props,
|
|
7298
|
+
$cardMaxWidth: cardMaxWidth,
|
|
7299
|
+
$colorScheme: colorScheme,
|
|
7300
|
+
direction: "row",
|
|
7301
|
+
fill: "horizontal",
|
|
7302
|
+
gap: "space-02",
|
|
7303
|
+
renderAs: "dl",
|
|
7304
|
+
wrapItems: true,
|
|
7305
|
+
children
|
|
7306
|
+
}
|
|
7307
|
+
);
|
|
7308
|
+
};
|
|
7309
|
+
DataCards.displayName = "DataCards";
|
|
7310
|
+
|
|
7311
|
+
// src/components/DataCards/DataCardTrend.tsx
|
|
7312
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
7313
|
+
|
|
7314
|
+
// src/components/Text/Text.tsx
|
|
7315
|
+
var import_react20 = require("react");
|
|
7316
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
7317
|
+
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
7318
|
+
var bodyBoldStyles = import_styled_components36.css`
|
|
7319
|
+
> strong,
|
|
7320
|
+
b {
|
|
7321
|
+
font-weight: var(--wui-typography-weight-body-bold);
|
|
7322
|
+
}
|
|
7323
|
+
`;
|
|
7324
|
+
var labelBoldStyles = import_styled_components36.css`
|
|
7325
|
+
> strong,
|
|
7326
|
+
b {
|
|
7327
|
+
font-weight: var(--wui-typography-weight-label-bold);
|
|
7328
|
+
}
|
|
7329
|
+
`;
|
|
7330
|
+
var body1TextStyle = import_styled_components36.css`
|
|
7331
|
+
--font-family: var(--wui-typography-body-1-family);
|
|
7332
|
+
--font-size: var(--wui-typography-body-1-size);
|
|
7333
|
+
--font-weight: var(--wui-typography-body-1-weight);
|
|
7334
|
+
--line-height: var(--wui-typography-body-1-line-height);
|
|
7335
|
+
${bodyBoldStyles}
|
|
7336
|
+
`;
|
|
7337
|
+
var body2TextStyle = import_styled_components36.css`
|
|
7338
|
+
--font-family: var(--wui-typography-body-2-family);
|
|
7339
|
+
--font-size: var(--wui-typography-body-2-size);
|
|
7340
|
+
--font-weight: var(--wui-typography-body-2-weight);
|
|
7341
|
+
--line-height: var(--wui-typography-body-2-line-height);
|
|
7342
|
+
${bodyBoldStyles}
|
|
7343
|
+
`;
|
|
7344
|
+
var body3TextStyle = import_styled_components36.css`
|
|
7345
|
+
--font-family: var(--wui-typography-body-3-family);
|
|
7346
|
+
--font-size: var(--wui-typography-body-3-size);
|
|
7347
|
+
--font-weight: var(--wui-typography-body-3-weight);
|
|
7348
|
+
--line-height: var(--wui-typography-body-3-line-height);
|
|
7349
|
+
${bodyBoldStyles}
|
|
7350
|
+
`;
|
|
7351
|
+
var body4TextStyle = import_styled_components36.css`
|
|
7352
|
+
--font-family: var(--wui-typography-body-4-family);
|
|
7353
|
+
--font-size: var(--wui-typography-body-4-size);
|
|
7354
|
+
--font-weight: var(--wui-typography-body-4-weight);
|
|
7355
|
+
--line-height: var(--wui-typography-body-4-line-height);
|
|
7356
|
+
${bodyBoldStyles}
|
|
7357
|
+
`;
|
|
7358
|
+
var label1TextStyle = import_styled_components36.css`
|
|
7359
|
+
--font-family: var(--wui-typography-label-1-family);
|
|
7360
|
+
--font-size: var(--wui-typography-label-1-size);
|
|
7361
|
+
--font-weight: var(--wui-typography-label-1-weight);
|
|
7362
|
+
--line-height: var(--wui-typography-label-1-line-height);
|
|
7363
|
+
${labelBoldStyles}
|
|
7364
|
+
`;
|
|
7365
|
+
var label2TextStyle = import_styled_components36.css`
|
|
7366
|
+
--font-family: var(--wui-typography-label-2-family);
|
|
7367
|
+
--font-size: var(--wui-typography-label-2-size);
|
|
7368
|
+
--font-weight: var(--wui-typography-label-2-weight);
|
|
7369
|
+
--line-height: var(--wui-typography-label-2-line-height);
|
|
7370
|
+
${labelBoldStyles}
|
|
7371
|
+
`;
|
|
7372
|
+
var label3TextStyle = import_styled_components36.css`
|
|
7373
|
+
--font-family: var(--wui-typography-label-3-family);
|
|
7374
|
+
--font-size: var(--wui-typography-label-3-size);
|
|
7375
|
+
--font-weight: var(--wui-typography-label-3-weight);
|
|
7376
|
+
--line-height: var(--wui-typography-label-3-line-height);
|
|
7377
|
+
${labelBoldStyles}
|
|
7378
|
+
`;
|
|
7379
|
+
var label4TextStyle = import_styled_components36.css`
|
|
7380
|
+
--font-family: var(--wui-typography-label-4-family);
|
|
7381
|
+
--font-size: var(--wui-typography-label-4-size);
|
|
7382
|
+
--font-weight: var(--wui-typography-label-4-weight);
|
|
7383
|
+
--line-height: var(--wui-typography-label-4-line-height);
|
|
7384
|
+
${labelBoldStyles}
|
|
7385
|
+
`;
|
|
7386
|
+
var body1MonoTextStyle = import_styled_components36.css`
|
|
7387
|
+
${body1TextStyle};
|
|
7388
|
+
--font-family: var(--wui-typography-family-mono);
|
|
7389
|
+
`;
|
|
7390
|
+
var body2MonoTextStyle = import_styled_components36.css`
|
|
7391
|
+
${body2TextStyle};
|
|
7392
|
+
--font-family: var(--wui-typography-family-mono);
|
|
7393
|
+
`;
|
|
7394
|
+
var body3MonoTextStyle = import_styled_components36.css`
|
|
7395
|
+
${body3TextStyle};
|
|
7396
|
+
--font-family: var(--wui-typography-family-mono);
|
|
7397
|
+
`;
|
|
7398
|
+
var body4MonoTextStyle = import_styled_components36.css`
|
|
7399
|
+
${body4TextStyle};
|
|
7400
|
+
--font-family: var(--wui-typography-family-mono);
|
|
7401
|
+
`;
|
|
7402
|
+
var variantStyleMap2 = {
|
|
7403
|
+
body1: body1TextStyle,
|
|
7404
|
+
body2: body2TextStyle,
|
|
7405
|
+
body3: body3TextStyle,
|
|
7406
|
+
body4: body4TextStyle,
|
|
7407
|
+
body1Mono: body1MonoTextStyle,
|
|
7408
|
+
body2Mono: body2MonoTextStyle,
|
|
7409
|
+
body3Mono: body3MonoTextStyle,
|
|
7410
|
+
body4Mono: body4MonoTextStyle,
|
|
7411
|
+
label1: label1TextStyle,
|
|
7412
|
+
label2: label2TextStyle,
|
|
7413
|
+
label3: label3TextStyle,
|
|
7414
|
+
label4: label4TextStyle
|
|
7415
|
+
};
|
|
7416
|
+
var StyledText = import_styled_components36.default.div`
|
|
7417
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7418
|
+
--text-color: ${({ $prominence, $disabled }) => {
|
|
7419
|
+
if ($disabled) {
|
|
7420
|
+
return "var(--wui-color-text-disabled)";
|
|
7421
|
+
}
|
|
7422
|
+
if ($prominence === "secondary") {
|
|
7423
|
+
return "var(--wui-color-text-secondary)";
|
|
7424
|
+
}
|
|
7425
|
+
if ($prominence === "button") {
|
|
7426
|
+
return "var(--wui-color-text-button)";
|
|
7427
|
+
}
|
|
7428
|
+
return "var(--wui-color-text)";
|
|
7429
|
+
}};
|
|
7430
|
+
|
|
7431
|
+
color: var(--text-color);
|
|
7432
|
+
font-family: var(--font-family);
|
|
7433
|
+
font-size: var(--font-size);
|
|
7434
|
+
font-weight: var(--font-weight);
|
|
7435
|
+
line-height: var(--line-height);
|
|
7436
|
+
font-style: normal;
|
|
7437
|
+
margin: 0;
|
|
7438
|
+
${({ $variant }) => variantStyleMap2[$variant]}
|
|
7439
|
+
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
7440
|
+
${({ $inline }) => $inline && import_styled_components36.css`
|
|
7441
|
+
display: inline-block;
|
|
7442
|
+
`}
|
|
7443
|
+
${({ $disabled }) => $disabled && import_styled_components36.css`
|
|
7444
|
+
--text-color: var(--wui-color-text-disabled);
|
|
7445
|
+
`}
|
|
7446
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components36.css`
|
|
7447
|
+
user-select: none;
|
|
7448
|
+
`}
|
|
7449
|
+
${({ $align }) => import_styled_components36.css`
|
|
7450
|
+
text-align: ${$align};
|
|
7451
|
+
`}
|
|
7452
|
+
${({ as }) => as === "p" && import_styled_components36.css`
|
|
7453
|
+
display: block;
|
|
7454
|
+
`}
|
|
7455
|
+
`;
|
|
7456
|
+
var DEFAULT_ELEMENT3 = "div";
|
|
7457
|
+
var TextComponent = (0, import_react20.forwardRef)(
|
|
7458
|
+
({
|
|
7459
|
+
align = "left",
|
|
7460
|
+
colorScheme = "inherit",
|
|
7461
|
+
disabled = false,
|
|
7462
|
+
ellipsis = false,
|
|
7463
|
+
inline = false,
|
|
7464
|
+
preventUserSelect = false,
|
|
7465
|
+
prominence = "primary",
|
|
7466
|
+
variant = "body2",
|
|
7467
|
+
renderAs,
|
|
7468
|
+
...otherProps
|
|
7469
|
+
}, ref) => {
|
|
7470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
|
|
7471
|
+
StyledText,
|
|
7472
|
+
{
|
|
7473
|
+
ref,
|
|
7474
|
+
$align: align,
|
|
7475
|
+
$colorScheme: colorScheme,
|
|
7476
|
+
$disabled: disabled,
|
|
7477
|
+
$ellipsis: ellipsis,
|
|
7478
|
+
$inline: inline,
|
|
7479
|
+
$preventUserSelect: preventUserSelect,
|
|
7480
|
+
$prominence: prominence,
|
|
7481
|
+
$variant: variant,
|
|
7482
|
+
as: renderAs ?? DEFAULT_ELEMENT3,
|
|
7483
|
+
...otherProps
|
|
7484
|
+
}
|
|
7485
|
+
);
|
|
7486
|
+
}
|
|
7487
|
+
);
|
|
7488
|
+
TextComponent.displayName = "Text";
|
|
7489
|
+
var Text = makePolymorphic(TextComponent);
|
|
7490
|
+
|
|
7491
|
+
// src/components/DataCards/DataCardTrend.tsx
|
|
7492
|
+
var import_jsx_runtime179 = require("react/jsx-runtime");
|
|
7493
|
+
var StyledDataCardTrend = import_styled_components37.default.div`
|
|
7494
|
+
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
7495
|
+
background: var(--wui-color-bg-app);
|
|
7496
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
7497
|
+
padding: var(--wui-space-01);
|
|
7498
|
+
display: flex;
|
|
7499
|
+
align-items: center;
|
|
7500
|
+
gap: 2px;
|
|
7501
|
+
`;
|
|
7502
|
+
var DataCardTrend = ({
|
|
7503
|
+
direction = "up",
|
|
7504
|
+
outlook = "positive",
|
|
7505
|
+
children,
|
|
7506
|
+
...props
|
|
7507
|
+
}) => {
|
|
7508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
7509
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
7510
|
+
Icon,
|
|
7511
|
+
{
|
|
7512
|
+
size: "md",
|
|
7513
|
+
type: direction === "up" ? "arrow-up" : "arrow-down",
|
|
7514
|
+
...props
|
|
7515
|
+
}
|
|
7516
|
+
),
|
|
7517
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
7518
|
+
Text,
|
|
7519
|
+
{
|
|
7520
|
+
prominence: "secondary",
|
|
7521
|
+
variant: "label4",
|
|
7522
|
+
children
|
|
7523
|
+
}
|
|
7524
|
+
)
|
|
7525
|
+
] });
|
|
7526
|
+
};
|
|
7527
|
+
|
|
7528
|
+
// src/components/Divider/Divider.tsx
|
|
7529
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
7530
|
+
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
7531
|
+
var horizontalBorderCss = import_styled_components38.css`
|
|
7532
|
+
border-top-color: var(--wui-color-border);
|
|
7533
|
+
border-top-style: solid;
|
|
7534
|
+
border-top-width: 1px;
|
|
7535
|
+
clear: both; /* for horizontal dividers, ensure it clears any floats */
|
|
7536
|
+
height: 0;
|
|
7537
|
+
`;
|
|
7538
|
+
var verticalBorderCss = import_styled_components38.css`
|
|
7539
|
+
background-color: var(--wui-color-border);
|
|
7540
|
+
max-width: 1px;
|
|
7541
|
+
min-height: 100%;
|
|
7542
|
+
width: 1px;
|
|
7543
|
+
`;
|
|
7544
|
+
var DividerComponent = import_styled_components38.default.div`
|
|
7545
|
+
${({ $orientation }) => {
|
|
7546
|
+
switch ($orientation) {
|
|
7547
|
+
case "vertical":
|
|
7548
|
+
return verticalBorderCss;
|
|
7549
|
+
case "horizontal":
|
|
7550
|
+
default:
|
|
7551
|
+
return horizontalBorderCss;
|
|
7552
|
+
}
|
|
7553
|
+
}}
|
|
7554
|
+
`;
|
|
7555
|
+
var Divider = ({
|
|
7556
|
+
orientation = "horizontal",
|
|
7557
|
+
...otherProps
|
|
7558
|
+
}) => {
|
|
7559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
|
|
7560
|
+
DividerComponent,
|
|
7561
|
+
{
|
|
7562
|
+
$orientation: orientation,
|
|
7563
|
+
"aria-orientation": orientation,
|
|
7564
|
+
role: "separator",
|
|
7565
|
+
...otherProps
|
|
7566
|
+
}
|
|
7567
|
+
);
|
|
7568
|
+
};
|
|
7569
|
+
Divider.displayName = "Divider";
|
|
7570
|
+
|
|
7571
|
+
// src/components/EditableHeading/EditableHeading.tsx
|
|
7572
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
7573
|
+
var import_react22 = require("react");
|
|
7574
|
+
|
|
7575
|
+
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7576
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7577
|
+
var import_type_guards22 = require("@wistia/type-guards");
|
|
7578
|
+
var import_jsx_runtime181 = require("react/jsx-runtime");
|
|
7579
|
+
var VisuallyHidden = import_styled_components39.default.div({ ...visuallyHiddenStyle });
|
|
7580
|
+
var VisuallyHiddenButFocusable = import_styled_components39.default.div({
|
|
7581
|
+
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7582
|
+
});
|
|
7583
|
+
var ScreenReaderOnly = ({
|
|
7584
|
+
text,
|
|
7585
|
+
children,
|
|
7586
|
+
focusable = false,
|
|
7587
|
+
...otherProps
|
|
7588
|
+
}) => {
|
|
7589
|
+
const accessibleText = (0, import_type_guards22.isNotNil)(text) ? text : children;
|
|
7590
|
+
if (focusable) {
|
|
7591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7592
|
+
}
|
|
7593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7594
|
+
};
|
|
7595
|
+
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7596
|
+
|
|
7597
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
7598
|
+
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
7599
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
7600
|
+
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
7601
|
+
var CompactTooltipStyles = import_styled_components40.css`
|
|
7602
|
+
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
7603
|
+
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
7604
|
+
--tooltip-font-weight: var(--wui-typography-label-4-weight);
|
|
7605
|
+
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
7606
|
+
--tooltip-vertical-padding: var(--wui-space-03);
|
|
7607
|
+
`;
|
|
7608
|
+
var StyledContent = (0, import_styled_components40.default)(import_react_tooltip2.Content)`
|
|
7609
|
+
--tooltip-font-family: var(--wui-typography-family-default);
|
|
7610
|
+
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
7611
|
+
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
7612
|
+
--tooltip-color: var(--wui-color-text-on-fill);
|
|
7613
|
+
--tooltip-font-size: var(--wui-typography-label-3-size);
|
|
7614
|
+
--tooltip-line-height: var(--wui-typography-label-3-line-height);
|
|
7615
|
+
--tooltip-font-weight: var(--wui-typography-label-3-weight);
|
|
7616
|
+
--tooltip-horizontal-padding: var(--wui-space-03);
|
|
7617
|
+
--tooltip-vertical-padding: var(--wui-space-03);
|
|
7618
|
+
|
|
7619
|
+
${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
|
|
7620
|
+
|
|
7621
|
+
font-family: var(--tooltip-font-family);
|
|
7622
|
+
font-size: var(--tooltip-font-size);
|
|
7623
|
+
border-radius: var(--tooltip-border-radius);
|
|
7624
|
+
padding: var(--tooltip-horizontal-padding) var(--tooltip-vertical-padding);
|
|
7625
|
+
background-color: var(--tooltip-bg);
|
|
7626
|
+
color: var(--tooltip-color);
|
|
7627
|
+
user-select: none;
|
|
7628
|
+
animation-duration: 400ms;
|
|
7629
|
+
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
7630
|
+
will-change: transform, opacity;
|
|
7631
|
+
max-width: 30em;
|
|
7632
|
+
|
|
7633
|
+
&[data-state='delayed-open'][data-side='top'] {
|
|
7634
|
+
animation-name: slideDownAndFade;
|
|
7635
|
+
}
|
|
7636
|
+
|
|
7637
|
+
&[data-state='delayed-open'][data-side='right'] {
|
|
7638
|
+
animation-name: slideLeftAndFade;
|
|
7639
|
+
}
|
|
7640
|
+
|
|
7641
|
+
&[data-state='delayed-open'][data-side='bottom'] {
|
|
7642
|
+
animation-name: slideUpAndFade;
|
|
7643
|
+
}
|
|
7644
|
+
|
|
7645
|
+
&[data-state='delayed-open'][data-side='left'] {
|
|
7646
|
+
animation-name: slideRightAndFade;
|
|
7647
|
+
}
|
|
7648
|
+
`;
|
|
7649
|
+
var VISUAL_OFFSET = 6;
|
|
7650
|
+
var Tooltip = ({
|
|
7651
|
+
delay = 700,
|
|
7652
|
+
direction = "top",
|
|
7653
|
+
content,
|
|
7654
|
+
children,
|
|
7655
|
+
forceOpen,
|
|
7656
|
+
compact = false,
|
|
7657
|
+
hideArrow = false
|
|
7658
|
+
}) => {
|
|
7659
|
+
const rootProps = {};
|
|
7660
|
+
if (content === "" || content === null) {
|
|
7661
|
+
rootProps.open = false;
|
|
7662
|
+
}
|
|
7663
|
+
if (forceOpen === true) {
|
|
7664
|
+
rootProps.open = true;
|
|
7665
|
+
}
|
|
7666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(
|
|
7667
|
+
import_react_tooltip2.Root,
|
|
7668
|
+
{
|
|
7669
|
+
delayDuration: delay,
|
|
7670
|
+
...rootProps,
|
|
7671
|
+
children: [
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(
|
|
7674
|
+
StyledContent,
|
|
7675
|
+
{
|
|
7676
|
+
$compact: compact,
|
|
7677
|
+
side: direction,
|
|
7678
|
+
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
7679
|
+
children: [
|
|
7680
|
+
content,
|
|
7681
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
7682
|
+
"svg",
|
|
7683
|
+
{
|
|
7684
|
+
fill: "var(--tooltip-bg)",
|
|
7685
|
+
height: "8",
|
|
7686
|
+
style: { transform: "translateY(-2px)" },
|
|
7687
|
+
viewBox: "0 0 12 8",
|
|
7688
|
+
width: "12",
|
|
7689
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7690
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("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" })
|
|
7691
|
+
}
|
|
7692
|
+
) }) : null
|
|
7693
|
+
]
|
|
7694
|
+
}
|
|
7695
|
+
) })
|
|
7696
|
+
]
|
|
7697
|
+
}
|
|
7698
|
+
);
|
|
7699
|
+
};
|
|
7700
|
+
Tooltip.displayName = "Tooltip";
|
|
7701
|
+
|
|
7702
|
+
// src/components/Input/Input.tsx
|
|
7703
|
+
var import_react21 = require("react");
|
|
7704
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7705
|
+
var import_type_guards23 = require("@wistia/type-guards");
|
|
7706
|
+
var import_jsx_runtime183 = require("react/jsx-runtime");
|
|
7707
|
+
var inputStyles = import_styled_components41.css`
|
|
7708
|
+
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7709
|
+
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
7710
|
+
--wui-input-color-border: var(--wui-color-border);
|
|
7711
|
+
--wui-input-color-border-focus: var(--wui-color-border-active);
|
|
7712
|
+
--wui-input-color-border-error: var(--wui-color-border-error);
|
|
7713
|
+
--wui-input-color-border-disabled: var(--wui-color-border-disabled);
|
|
7714
|
+
--wui-input-border-radius: var(--wui-border-radius-rounded);
|
|
7715
|
+
--wui-input-multiline-border-radius: var(--wui-border-radius-02);
|
|
7716
|
+
--wui-input-vertical-padding: var(--wui-space-02);
|
|
7717
|
+
--wui-input-horizontal-padding: var(--wui-space-03);
|
|
7718
|
+
--wui-input-placeholder: var(--wui-gray-10);
|
|
7719
|
+
--wui-input-color-text-error: var(--wui-color-text-error);
|
|
7720
|
+
|
|
7721
|
+
input,
|
|
7722
|
+
textarea {
|
|
7723
|
+
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
7724
|
+
background-color: var(--wui-input-color-bg);
|
|
7725
|
+
border: 1px solid var(--wui-input-color-border);
|
|
7726
|
+
border-radius: var(--wui-input-border-radius);
|
|
7727
|
+
|
|
7728
|
+
&::placeholder {
|
|
7729
|
+
color: var(--wui-input-placeholder);
|
|
7730
|
+
opacity: 1; /* Firefox */
|
|
7731
|
+
}
|
|
7732
|
+
|
|
7733
|
+
&:focus {
|
|
7734
|
+
border-color: var(--wui-input-color-border-focus);
|
|
7735
|
+
}
|
|
7736
|
+
|
|
7737
|
+
&[aria-invalid='true'] {
|
|
7738
|
+
border-color: var(--wui-input-color-border-error);
|
|
7739
|
+
color: var(--wui-input-color-text-error);
|
|
7740
|
+
}
|
|
7741
|
+
|
|
7742
|
+
&:disabled {
|
|
7743
|
+
border-color: var(--wui-color-bg-surface-disabled);
|
|
7744
|
+
background-color: var(--wui-color-bg-surface-disabled);
|
|
7745
|
+
}
|
|
7746
|
+
}
|
|
7747
|
+
`;
|
|
7748
|
+
var StyledInputContainer = import_styled_components41.default.div`
|
|
7749
|
+
display: inline-flex;
|
|
7750
|
+
position: relative;
|
|
7751
|
+
${inputStyles};
|
|
7752
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7753
|
+
|
|
7754
|
+
input,
|
|
7755
|
+
textarea {
|
|
7756
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7757
|
+
${({ $monospace }) => $monospace && "font-family: var(--wui-typography-family-mono);"}
|
|
7758
|
+
}
|
|
7759
|
+
|
|
7760
|
+
textarea {
|
|
7761
|
+
border-radius: var(--wui-input-multiline-border-radius);
|
|
7762
|
+
}
|
|
7763
|
+
|
|
7764
|
+
.wui-input-left-icon {
|
|
7765
|
+
display: flex;
|
|
7766
|
+
align-items: center;
|
|
7767
|
+
position: absolute;
|
|
7768
|
+
top: 50%;
|
|
7769
|
+
left: var(--wui-input-horizontal-padding);
|
|
7770
|
+
transform: translateY(-50%);
|
|
7771
|
+
}
|
|
7772
|
+
|
|
7773
|
+
:has(.wui-input-left-icon) input,
|
|
7774
|
+
:has(.wui-input-left-icon) textarea {
|
|
7775
|
+
padding-left: 32px;
|
|
7776
|
+
}
|
|
7777
|
+
|
|
7778
|
+
.wui-input-right-icon {
|
|
7779
|
+
display: flex;
|
|
7780
|
+
align-items: center;
|
|
7781
|
+
position: absolute;
|
|
7782
|
+
top: 50%;
|
|
7783
|
+
right: var(--wui-input-horizontal-padding);
|
|
7784
|
+
transform: translateY(-50%);
|
|
7785
|
+
}
|
|
7786
|
+
|
|
7787
|
+
:has(.wui-input-right-icon) input,
|
|
7788
|
+
:has(.wui-input-right-icon) textarea {
|
|
7789
|
+
padding-right: 32px;
|
|
7790
|
+
}
|
|
7791
|
+
`;
|
|
7792
|
+
var isValidRef2 = (ref) => {
|
|
7793
|
+
return typeof ref === "object" && ref !== null && "current" in ref && (0, import_type_guards23.isNotNil)(ref.current);
|
|
7794
|
+
};
|
|
7795
|
+
var Input = (0, import_react21.forwardRef)(
|
|
7796
|
+
({
|
|
7797
|
+
fullWidth = false,
|
|
7798
|
+
monospace = false,
|
|
7799
|
+
type = "text",
|
|
7800
|
+
autoSelect = false,
|
|
7801
|
+
leftIcon,
|
|
7802
|
+
rightIcon,
|
|
7803
|
+
...props
|
|
7804
|
+
}, externalRef) => {
|
|
7805
|
+
const internalRef = (0, import_react21.useRef)();
|
|
7806
|
+
const ref = isValidRef2(externalRef) ? externalRef : internalRef;
|
|
7807
|
+
let leftIconToDisplay = leftIcon;
|
|
7808
|
+
if ((0, import_type_guards23.isNil)(leftIcon) && type === "search") {
|
|
7809
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(Icon, { type: "search" });
|
|
7810
|
+
}
|
|
7811
|
+
if ((0, import_type_guards23.isNotNil)(leftIconToDisplay)) {
|
|
7812
|
+
leftIconToDisplay = (0, import_react21.cloneElement)(leftIconToDisplay, {
|
|
7813
|
+
size: "md",
|
|
7814
|
+
className: "wui-input-left-icon"
|
|
7815
|
+
});
|
|
7816
|
+
}
|
|
7817
|
+
let rightIconToDisplay = rightIcon;
|
|
7818
|
+
if ((0, import_type_guards23.isNotNil)(rightIconToDisplay)) {
|
|
7819
|
+
rightIconToDisplay = (0, import_react21.cloneElement)(rightIconToDisplay, {
|
|
7820
|
+
size: "md",
|
|
7821
|
+
className: "wui-input-right-icon"
|
|
7822
|
+
});
|
|
7823
|
+
}
|
|
7824
|
+
const handleFocus = (event) => {
|
|
7825
|
+
if ((0, import_type_guards23.isNotNil)(props.onFocus)) {
|
|
7826
|
+
props.onFocus(event);
|
|
7827
|
+
}
|
|
7828
|
+
if (autoSelect && ref && "current" in ref) {
|
|
7829
|
+
requestAnimationFrame(() => {
|
|
7830
|
+
ref.current?.select();
|
|
7831
|
+
});
|
|
7832
|
+
}
|
|
7833
|
+
};
|
|
7834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(
|
|
7835
|
+
StyledInputContainer,
|
|
7836
|
+
{
|
|
7837
|
+
$fullWidth: fullWidth,
|
|
7838
|
+
$monospace: monospace,
|
|
7839
|
+
children: [
|
|
7840
|
+
leftIconToDisplay ?? null,
|
|
7841
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7842
|
+
"textarea",
|
|
7843
|
+
{
|
|
7844
|
+
...props,
|
|
7845
|
+
ref,
|
|
7846
|
+
onFocus: handleFocus
|
|
7847
|
+
}
|
|
7848
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7849
|
+
"input",
|
|
7850
|
+
{
|
|
7851
|
+
...props,
|
|
7852
|
+
ref,
|
|
7853
|
+
onFocus: handleFocus,
|
|
7854
|
+
type
|
|
7855
|
+
}
|
|
7856
|
+
),
|
|
7857
|
+
rightIconToDisplay ?? null
|
|
7858
|
+
]
|
|
7859
|
+
}
|
|
7860
|
+
);
|
|
7861
|
+
}
|
|
7862
|
+
);
|
|
7863
|
+
Input.displayName = "Input";
|
|
7864
|
+
|
|
7865
|
+
// src/components/EditableHeading/EditableHeading.tsx
|
|
7866
|
+
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
7867
|
+
var StyledInput = (0, import_styled_components42.default)(Input)`
|
|
7868
|
+
:not([rows]) {
|
|
7869
|
+
min-height: unset;
|
|
7870
|
+
}
|
|
7871
|
+
|
|
7872
|
+
resize: vertical;
|
|
7873
|
+
font-size: var(--wui-typography-heading-1-size);
|
|
7874
|
+
font-weight: var(--wui-typography-heading-1-weight);
|
|
7875
|
+
line-height: var(--wui-typography-heading-1-line-height);
|
|
7876
|
+
font-family: var(--wui-typography-heading-1-family);
|
|
7877
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
7878
|
+
outline-offset: -2px;
|
|
7879
|
+
|
|
7880
|
+
&& {
|
|
7881
|
+
width: 100%;
|
|
7882
|
+
padding: var(--wui-space-02);
|
|
7883
|
+
border: none;
|
|
7884
|
+
height: ${({ $height }) => `${$height}px`};
|
|
7885
|
+
}
|
|
7886
|
+
`;
|
|
7887
|
+
var editableStyles = import_styled_components42.css`
|
|
7888
|
+
&:has(+ :focus-within) {
|
|
7889
|
+
background: var(--wui-color-bg-surface-hover);
|
|
7890
|
+
}
|
|
7891
|
+
|
|
7892
|
+
&:hover {
|
|
7893
|
+
background: var(--wui-color-bg-surface-hover);
|
|
7894
|
+
cursor: pointer;
|
|
7895
|
+
}
|
|
7896
|
+
`;
|
|
7897
|
+
var StyledHeading2 = (0, import_styled_components42.default)(Heading)`
|
|
7898
|
+
width: 100%;
|
|
7899
|
+
border-radius: var(--wui-border-radius-02);
|
|
7900
|
+
padding: var(--wui-space-02);
|
|
7901
|
+
overflow-wrap: anywhere;
|
|
7902
|
+
transition: all var(--wui-motion-duration-01) var(--wui-motion-ease);
|
|
7903
|
+
${({ $editingDisabled }) => !$editingDisabled && editableStyles}
|
|
7904
|
+
`;
|
|
7905
|
+
var EditableHeading = ({
|
|
7906
|
+
children,
|
|
7907
|
+
onValueChange,
|
|
7908
|
+
onEditingChange,
|
|
7909
|
+
tooltipText = "Click to edit title",
|
|
7910
|
+
ariaLabel = "Edit title",
|
|
7911
|
+
forceEditing = false,
|
|
7912
|
+
editingDisabled = false
|
|
7913
|
+
}) => {
|
|
7914
|
+
const [isEditing, setIsEditing] = (0, import_react22.useState)(false);
|
|
7915
|
+
const [value, setValue] = (0, import_react22.useState)(children);
|
|
7916
|
+
const [previousValue, setPreviousValue] = (0, import_react22.useState)(children);
|
|
7917
|
+
const [headingHeight, setHeadingHeight] = (0, import_react22.useState)("60");
|
|
7918
|
+
const headingRef = (0, import_react22.useRef)(null);
|
|
7919
|
+
const handleSetEditing = (editing) => {
|
|
7920
|
+
if (editingDisabled) return;
|
|
7921
|
+
if (editing && headingRef.current) {
|
|
7922
|
+
setHeadingHeight(`${headingRef.current.offsetHeight}`);
|
|
7923
|
+
}
|
|
7924
|
+
if (editing) {
|
|
7925
|
+
setPreviousValue(value);
|
|
7926
|
+
}
|
|
7927
|
+
setIsEditing(editing);
|
|
7928
|
+
onEditingChange?.(editing);
|
|
7929
|
+
};
|
|
7930
|
+
const handleFinishEditing = () => {
|
|
7931
|
+
const trimmedValue = value.trim();
|
|
7932
|
+
if (trimmedValue === "") {
|
|
7933
|
+
setValue(previousValue);
|
|
7934
|
+
} else if (trimmedValue !== previousValue && onValueChange) {
|
|
7935
|
+
onValueChange(trimmedValue);
|
|
7936
|
+
} else {
|
|
7937
|
+
setValue(trimmedValue);
|
|
7938
|
+
}
|
|
7939
|
+
handleSetEditing(false);
|
|
7940
|
+
};
|
|
7941
|
+
const handleKeyDown = (event) => {
|
|
7942
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
7943
|
+
event.preventDefault();
|
|
7944
|
+
handleFinishEditing();
|
|
7945
|
+
}
|
|
7946
|
+
if (event.key === "Escape") {
|
|
7947
|
+
setValue(previousValue);
|
|
7948
|
+
handleSetEditing(false);
|
|
7949
|
+
}
|
|
7950
|
+
};
|
|
7951
|
+
const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7952
|
+
StyledHeading2,
|
|
7953
|
+
{
|
|
7954
|
+
ref: headingRef,
|
|
7955
|
+
$editingDisabled: editingDisabled,
|
|
7956
|
+
onClick: () => handleSetEditing(true),
|
|
7957
|
+
variant: "heading1",
|
|
7958
|
+
children: value
|
|
7959
|
+
}
|
|
7960
|
+
);
|
|
7961
|
+
if (editingDisabled) {
|
|
7962
|
+
return HeadingComponent2;
|
|
7963
|
+
}
|
|
7964
|
+
if (isEditing || forceEditing) {
|
|
7965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7966
|
+
StyledInput,
|
|
7967
|
+
{
|
|
7968
|
+
$height: headingHeight,
|
|
7969
|
+
autoFocus: true,
|
|
7970
|
+
fullWidth: true,
|
|
7971
|
+
onBlur: handleFinishEditing,
|
|
7972
|
+
onChange: (event) => setValue(event.target.value),
|
|
7973
|
+
onFocus: (event) => {
|
|
7974
|
+
const { length } = event.currentTarget.value;
|
|
7975
|
+
event.currentTarget.setSelectionRange(length, length);
|
|
7976
|
+
},
|
|
7977
|
+
onKeyDown: handleKeyDown,
|
|
7978
|
+
type: "multiline",
|
|
7979
|
+
value
|
|
7980
|
+
}
|
|
7981
|
+
);
|
|
7201
7982
|
}
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
"
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(import_jsx_runtime184.Fragment, { children: [
|
|
7984
|
+
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7985
|
+
Tooltip,
|
|
7986
|
+
{
|
|
7987
|
+
compact: true,
|
|
7988
|
+
content: tooltipText,
|
|
7989
|
+
children: HeadingComponent2
|
|
7990
|
+
}
|
|
7991
|
+
),
|
|
7992
|
+
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7993
|
+
"button",
|
|
7994
|
+
{
|
|
7995
|
+
"aria-label": ariaLabel,
|
|
7996
|
+
onClick: () => handleSetEditing(true),
|
|
7997
|
+
type: "button"
|
|
7998
|
+
}
|
|
7999
|
+
) })
|
|
8000
|
+
] });
|
|
7217
8001
|
};
|
|
7218
|
-
Divider.displayName = "Divider";
|
|
7219
8002
|
|
|
7220
8003
|
// src/components/Form/Form.tsx
|
|
7221
|
-
var
|
|
7222
|
-
var
|
|
7223
|
-
var
|
|
8004
|
+
var import_react24 = require("react");
|
|
8005
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
8006
|
+
var import_type_guards24 = require("@wistia/type-guards");
|
|
7224
8007
|
|
|
7225
8008
|
// src/components/Stack/Stack.tsx
|
|
7226
|
-
var
|
|
7227
|
-
var
|
|
7228
|
-
var
|
|
7229
|
-
var
|
|
7230
|
-
var StyledStack =
|
|
8009
|
+
var import_react23 = require("react");
|
|
8010
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8011
|
+
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
8012
|
+
var DEFAULT_ELEMENT4 = "div";
|
|
8013
|
+
var StyledStack = import_styled_components43.default.div`
|
|
7231
8014
|
display: flex;
|
|
7232
8015
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
7233
8016
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
7234
8017
|
`;
|
|
7235
|
-
var StackComponent = (0,
|
|
8018
|
+
var StackComponent = (0, import_react23.forwardRef)(
|
|
7236
8019
|
({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
|
|
7237
8020
|
const responsiveGap = useResponsiveProp(gap);
|
|
7238
8021
|
const responsiveDirection = useResponsiveProp(direction);
|
|
7239
|
-
return /* @__PURE__ */ (0,
|
|
8022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7240
8023
|
StyledStack,
|
|
7241
8024
|
{
|
|
7242
8025
|
ref,
|
|
7243
8026
|
$direction: responsiveDirection,
|
|
7244
8027
|
$gap: responsiveGap,
|
|
7245
|
-
as: renderAs ??
|
|
8028
|
+
as: renderAs ?? DEFAULT_ELEMENT4,
|
|
7246
8029
|
...props
|
|
7247
8030
|
}
|
|
7248
8031
|
);
|
|
@@ -7252,29 +8035,29 @@ StackComponent.displayName = "Stack";
|
|
|
7252
8035
|
var Stack = makePolymorphic(StackComponent);
|
|
7253
8036
|
|
|
7254
8037
|
// src/components/Form/Form.tsx
|
|
7255
|
-
var
|
|
7256
|
-
var StyledForm =
|
|
8038
|
+
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
8039
|
+
var StyledForm = import_styled_components44.default.form`
|
|
7257
8040
|
--form-default-width: 690px;
|
|
7258
8041
|
|
|
7259
8042
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
7260
8043
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
7261
8044
|
`;
|
|
7262
|
-
var FormContext = (0,
|
|
8045
|
+
var FormContext = (0, import_react24.createContext)({
|
|
7263
8046
|
values: {},
|
|
7264
8047
|
errors: {},
|
|
7265
8048
|
hasSubmitted: false,
|
|
7266
8049
|
formId: ""
|
|
7267
8050
|
});
|
|
7268
8051
|
var FormComponent = ({ children, action, values = {}, validate, fullWidth = false, ...props }, forwardedRef) => {
|
|
7269
|
-
const [errors, setErrors] = (0,
|
|
7270
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
7271
|
-
const innerRef = (0,
|
|
8052
|
+
const [errors, setErrors] = (0, import_react24.useState)({});
|
|
8053
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react24.useState)(false);
|
|
8054
|
+
const innerRef = (0, import_react24.useRef)();
|
|
7272
8055
|
const ref = forwardedRef ?? innerRef;
|
|
7273
|
-
const autoId = (0,
|
|
8056
|
+
const autoId = (0, import_react24.useId)();
|
|
7274
8057
|
const id = props.id ?? autoId;
|
|
7275
8058
|
const handleValidate = (nextFormData) => {
|
|
7276
8059
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
7277
|
-
if ((0,
|
|
8060
|
+
if ((0, import_type_guards24.isUndefined)(validate)) {
|
|
7278
8061
|
return {};
|
|
7279
8062
|
}
|
|
7280
8063
|
return validate(nextData);
|
|
@@ -7284,7 +8067,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7284
8067
|
props.onBlur(event);
|
|
7285
8068
|
}
|
|
7286
8069
|
const formData = new FormData(event.currentTarget);
|
|
7287
|
-
if ((0,
|
|
8070
|
+
if ((0, import_type_guards24.isNotUndefined)(validate)) {
|
|
7288
8071
|
handleValidate(formData);
|
|
7289
8072
|
}
|
|
7290
8073
|
};
|
|
@@ -7312,7 +8095,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7312
8095
|
void action(null);
|
|
7313
8096
|
}
|
|
7314
8097
|
};
|
|
7315
|
-
const context = (0,
|
|
8098
|
+
const context = (0, import_react24.useMemo)(() => {
|
|
7316
8099
|
return {
|
|
7317
8100
|
values,
|
|
7318
8101
|
errors,
|
|
@@ -7322,7 +8105,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7322
8105
|
}, [values, errors, id, hasSubmitted]);
|
|
7323
8106
|
return (
|
|
7324
8107
|
// @ts-expect-error - generic context providers are a giant pain
|
|
7325
|
-
/* @__PURE__ */ (0,
|
|
8108
|
+
/* @__PURE__ */ (0, import_jsx_runtime186.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7326
8109
|
Stack,
|
|
7327
8110
|
{
|
|
7328
8111
|
gap: "space-05",
|
|
@@ -7340,15 +8123,15 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7340
8123
|
);
|
|
7341
8124
|
};
|
|
7342
8125
|
FormComponent.displayName = "Form";
|
|
7343
|
-
var Form = (0,
|
|
8126
|
+
var Form = (0, import_react24.forwardRef)(FormComponent);
|
|
7344
8127
|
|
|
7345
8128
|
// src/components/Form/useFormState.tsx
|
|
7346
|
-
var
|
|
8129
|
+
var import_react25 = require("react");
|
|
7347
8130
|
var useFormState = (action, initialData = {}) => {
|
|
7348
|
-
const [data, setData] = (0,
|
|
7349
|
-
const [isPending, setIsPending] = (0,
|
|
7350
|
-
const [error, setError] = (0,
|
|
7351
|
-
const formAction = (0,
|
|
8131
|
+
const [data, setData] = (0, import_react25.useState)(initialData);
|
|
8132
|
+
const [isPending, setIsPending] = (0, import_react25.useState)(false);
|
|
8133
|
+
const [error, setError] = (0, import_react25.useState)(null);
|
|
8134
|
+
const formAction = (0, import_react25.useCallback)(
|
|
7352
8135
|
async (nextFormData) => {
|
|
7353
8136
|
if (nextFormData === null) {
|
|
7354
8137
|
setData(initialData);
|
|
@@ -7356,271 +8139,94 @@ var useFormState = (action, initialData = {}) => {
|
|
|
7356
8139
|
return;
|
|
7357
8140
|
}
|
|
7358
8141
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
7359
|
-
setIsPending(true);
|
|
7360
|
-
try {
|
|
7361
|
-
const result = await action(data, nextData);
|
|
7362
|
-
setData(result);
|
|
7363
|
-
} catch (err) {
|
|
7364
|
-
setError(err);
|
|
7365
|
-
} finally {
|
|
7366
|
-
setIsPending(false);
|
|
7367
|
-
}
|
|
7368
|
-
},
|
|
7369
|
-
[action, initialData, data]
|
|
7370
|
-
);
|
|
7371
|
-
return [
|
|
7372
|
-
{
|
|
7373
|
-
data,
|
|
7374
|
-
error
|
|
7375
|
-
},
|
|
7376
|
-
formAction,
|
|
7377
|
-
isPending
|
|
7378
|
-
];
|
|
7379
|
-
};
|
|
7380
|
-
|
|
7381
|
-
// src/components/Form/FormErrorSummary.tsx
|
|
7382
|
-
var import_react23 = require("react");
|
|
7383
|
-
var import_type_guards22 = require("@wistia/type-guards");
|
|
7384
|
-
var import_jsx_runtime179 = require("react/jsx-runtime");
|
|
7385
|
-
var ErrorItem = ({ name, error, formId }) => {
|
|
7386
|
-
return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(Link, { href: `${formId}-${name}`, children: error }) }, name);
|
|
7387
|
-
};
|
|
7388
|
-
var FormErrorSummary = ({ description }) => {
|
|
7389
|
-
const ref = (0, import_react23.useRef)(null);
|
|
7390
|
-
const { formId, errors, hasSubmitted } = (0, import_react23.useContext)(FormContext);
|
|
7391
|
-
const isValid = Object.keys(errors).length === 0;
|
|
7392
|
-
if (isValid || !hasSubmitted) {
|
|
7393
|
-
return null;
|
|
7394
|
-
}
|
|
7395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)("div", { ref, children: [
|
|
7396
|
-
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)("p", { children: description }),
|
|
7397
|
-
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards22.isNotUndefined)(error)).map(
|
|
7398
|
-
([name, error]) => (0, import_type_guards22.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
7399
|
-
ErrorItem,
|
|
7400
|
-
{
|
|
7401
|
-
error: err,
|
|
7402
|
-
formId,
|
|
7403
|
-
name
|
|
7404
|
-
},
|
|
7405
|
-
err
|
|
7406
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
7407
|
-
ErrorItem,
|
|
7408
|
-
{
|
|
7409
|
-
error: error ?? "",
|
|
7410
|
-
formId,
|
|
7411
|
-
name
|
|
7412
|
-
},
|
|
7413
|
-
error
|
|
7414
|
-
)
|
|
7415
|
-
) })
|
|
7416
|
-
] });
|
|
7417
|
-
};
|
|
7418
|
-
|
|
7419
|
-
// src/components/FormField/FormField.tsx
|
|
7420
|
-
var import_react27 = require("react");
|
|
7421
|
-
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7422
|
-
var import_type_guards23 = require("@wistia/type-guards");
|
|
7423
|
-
|
|
7424
|
-
// src/components/Text/Text.tsx
|
|
7425
|
-
var import_react24 = require("react");
|
|
7426
|
-
var import_styled_components37 = __toESM(require("styled-components"));
|
|
7427
|
-
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
7428
|
-
var bodyBoldStyles = import_styled_components37.css`
|
|
7429
|
-
> strong,
|
|
7430
|
-
b {
|
|
7431
|
-
font-weight: var(--wui-typography-weight-body-bold);
|
|
7432
|
-
}
|
|
7433
|
-
`;
|
|
7434
|
-
var labelBoldStyles = import_styled_components37.css`
|
|
7435
|
-
> strong,
|
|
7436
|
-
b {
|
|
7437
|
-
font-weight: var(--wui-typography-weight-label-bold);
|
|
7438
|
-
}
|
|
7439
|
-
`;
|
|
7440
|
-
var body1TextStyle = import_styled_components37.css`
|
|
7441
|
-
--font-family: var(--wui-typography-body-1-family);
|
|
7442
|
-
--font-size: var(--wui-typography-body-1-size);
|
|
7443
|
-
--font-weight: var(--wui-typography-body-1-weight);
|
|
7444
|
-
--line-height: var(--wui-typography-body-1-line-height);
|
|
7445
|
-
${bodyBoldStyles}
|
|
7446
|
-
`;
|
|
7447
|
-
var body2TextStyle = import_styled_components37.css`
|
|
7448
|
-
--font-family: var(--wui-typography-body-2-family);
|
|
7449
|
-
--font-size: var(--wui-typography-body-2-size);
|
|
7450
|
-
--font-weight: var(--wui-typography-body-2-weight);
|
|
7451
|
-
--line-height: var(--wui-typography-body-2-line-height);
|
|
7452
|
-
${bodyBoldStyles}
|
|
7453
|
-
`;
|
|
7454
|
-
var body3TextStyle = import_styled_components37.css`
|
|
7455
|
-
--font-family: var(--wui-typography-body-3-family);
|
|
7456
|
-
--font-size: var(--wui-typography-body-3-size);
|
|
7457
|
-
--font-weight: var(--wui-typography-body-3-weight);
|
|
7458
|
-
--line-height: var(--wui-typography-body-3-line-height);
|
|
7459
|
-
${bodyBoldStyles}
|
|
7460
|
-
`;
|
|
7461
|
-
var body4TextStyle = import_styled_components37.css`
|
|
7462
|
-
--font-family: var(--wui-typography-body-4-family);
|
|
7463
|
-
--font-size: var(--wui-typography-body-4-size);
|
|
7464
|
-
--font-weight: var(--wui-typography-body-4-weight);
|
|
7465
|
-
--line-height: var(--wui-typography-body-4-line-height);
|
|
7466
|
-
${bodyBoldStyles}
|
|
7467
|
-
`;
|
|
7468
|
-
var label1TextStyle = import_styled_components37.css`
|
|
7469
|
-
--font-family: var(--wui-typography-label-1-family);
|
|
7470
|
-
--font-size: var(--wui-typography-label-1-size);
|
|
7471
|
-
--font-weight: var(--wui-typography-label-1-weight);
|
|
7472
|
-
--line-height: var(--wui-typography-label-1-line-height);
|
|
7473
|
-
${labelBoldStyles}
|
|
7474
|
-
`;
|
|
7475
|
-
var label2TextStyle = import_styled_components37.css`
|
|
7476
|
-
--font-family: var(--wui-typography-label-2-family);
|
|
7477
|
-
--font-size: var(--wui-typography-label-2-size);
|
|
7478
|
-
--font-weight: var(--wui-typography-label-2-weight);
|
|
7479
|
-
--line-height: var(--wui-typography-label-2-line-height);
|
|
7480
|
-
${labelBoldStyles}
|
|
7481
|
-
`;
|
|
7482
|
-
var label3TextStyle = import_styled_components37.css`
|
|
7483
|
-
--font-family: var(--wui-typography-label-3-family);
|
|
7484
|
-
--font-size: var(--wui-typography-label-3-size);
|
|
7485
|
-
--font-weight: var(--wui-typography-label-3-weight);
|
|
7486
|
-
--line-height: var(--wui-typography-label-3-line-height);
|
|
7487
|
-
${labelBoldStyles}
|
|
7488
|
-
`;
|
|
7489
|
-
var label4TextStyle = import_styled_components37.css`
|
|
7490
|
-
--font-family: var(--wui-typography-label-4-family);
|
|
7491
|
-
--font-size: var(--wui-typography-label-4-size);
|
|
7492
|
-
--font-weight: var(--wui-typography-label-4-weight);
|
|
7493
|
-
--line-height: var(--wui-typography-label-4-line-height);
|
|
7494
|
-
${labelBoldStyles}
|
|
7495
|
-
`;
|
|
7496
|
-
var body1MonoTextStyle = import_styled_components37.css`
|
|
7497
|
-
${body1TextStyle};
|
|
7498
|
-
--font-family: var(--wui-typography-family-mono);
|
|
7499
|
-
`;
|
|
7500
|
-
var body2MonoTextStyle = import_styled_components37.css`
|
|
7501
|
-
${body2TextStyle};
|
|
7502
|
-
--font-family: var(--wui-typography-family-mono);
|
|
7503
|
-
`;
|
|
7504
|
-
var body3MonoTextStyle = import_styled_components37.css`
|
|
7505
|
-
${body3TextStyle};
|
|
7506
|
-
--font-family: var(--wui-typography-family-mono);
|
|
7507
|
-
`;
|
|
7508
|
-
var body4MonoTextStyle = import_styled_components37.css`
|
|
7509
|
-
${body4TextStyle};
|
|
7510
|
-
--font-family: var(--wui-typography-family-mono);
|
|
7511
|
-
`;
|
|
7512
|
-
var variantStyleMap2 = {
|
|
7513
|
-
body1: body1TextStyle,
|
|
7514
|
-
body2: body2TextStyle,
|
|
7515
|
-
body3: body3TextStyle,
|
|
7516
|
-
body4: body4TextStyle,
|
|
7517
|
-
body1Mono: body1MonoTextStyle,
|
|
7518
|
-
body2Mono: body2MonoTextStyle,
|
|
7519
|
-
body3Mono: body3MonoTextStyle,
|
|
7520
|
-
body4Mono: body4MonoTextStyle,
|
|
7521
|
-
label1: label1TextStyle,
|
|
7522
|
-
label2: label2TextStyle,
|
|
7523
|
-
label3: label3TextStyle,
|
|
7524
|
-
label4: label4TextStyle
|
|
7525
|
-
};
|
|
7526
|
-
var StyledText = import_styled_components37.default.div`
|
|
7527
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7528
|
-
--text-color: ${({ $prominence, $disabled }) => {
|
|
7529
|
-
if ($disabled) {
|
|
7530
|
-
return "var(--wui-color-text-disabled)";
|
|
7531
|
-
}
|
|
7532
|
-
if ($prominence === "secondary") {
|
|
7533
|
-
return "var(--wui-color-text-secondary)";
|
|
7534
|
-
}
|
|
7535
|
-
if ($prominence === "button") {
|
|
7536
|
-
return "var(--wui-color-text-button)";
|
|
7537
|
-
}
|
|
7538
|
-
return "var(--wui-color-text)";
|
|
7539
|
-
}};
|
|
7540
|
-
|
|
7541
|
-
color: var(--text-color);
|
|
7542
|
-
font-family: var(--font-family);
|
|
7543
|
-
font-size: var(--font-size);
|
|
7544
|
-
font-weight: var(--font-weight);
|
|
7545
|
-
line-height: var(--line-height);
|
|
7546
|
-
font-style: normal;
|
|
7547
|
-
margin: 0;
|
|
7548
|
-
${({ $variant }) => variantStyleMap2[$variant]}
|
|
7549
|
-
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
7550
|
-
${({ $inline }) => $inline && import_styled_components37.css`
|
|
7551
|
-
display: inline-block;
|
|
7552
|
-
`}
|
|
7553
|
-
${({ $disabled }) => $disabled && import_styled_components37.css`
|
|
7554
|
-
--text-color: var(--wui-color-text-disabled);
|
|
7555
|
-
`}
|
|
7556
|
-
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components37.css`
|
|
7557
|
-
user-select: none;
|
|
7558
|
-
`}
|
|
7559
|
-
${({ $align }) => import_styled_components37.css`
|
|
7560
|
-
text-align: ${$align};
|
|
7561
|
-
`}
|
|
7562
|
-
${({ as }) => as === "p" && import_styled_components37.css`
|
|
7563
|
-
display: block;
|
|
7564
|
-
`}
|
|
7565
|
-
`;
|
|
7566
|
-
var DEFAULT_ELEMENT4 = "div";
|
|
7567
|
-
var TextComponent = (0, import_react24.forwardRef)(
|
|
7568
|
-
({
|
|
7569
|
-
align = "left",
|
|
7570
|
-
colorScheme = "inherit",
|
|
7571
|
-
disabled = false,
|
|
7572
|
-
ellipsis = false,
|
|
7573
|
-
inline = false,
|
|
7574
|
-
preventUserSelect = false,
|
|
7575
|
-
prominence = "primary",
|
|
7576
|
-
variant = "body2",
|
|
7577
|
-
renderAs,
|
|
7578
|
-
...otherProps
|
|
7579
|
-
}, ref) => {
|
|
7580
|
-
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
|
|
7581
|
-
StyledText,
|
|
7582
|
-
{
|
|
7583
|
-
ref,
|
|
7584
|
-
$align: align,
|
|
7585
|
-
$colorScheme: colorScheme,
|
|
7586
|
-
$disabled: disabled,
|
|
7587
|
-
$ellipsis: ellipsis,
|
|
7588
|
-
$inline: inline,
|
|
7589
|
-
$preventUserSelect: preventUserSelect,
|
|
7590
|
-
$prominence: prominence,
|
|
7591
|
-
$variant: variant,
|
|
7592
|
-
as: renderAs ?? DEFAULT_ELEMENT4,
|
|
7593
|
-
...otherProps
|
|
8142
|
+
setIsPending(true);
|
|
8143
|
+
try {
|
|
8144
|
+
const result = await action(data, nextData);
|
|
8145
|
+
setData(result);
|
|
8146
|
+
} catch (err) {
|
|
8147
|
+
setError(err);
|
|
8148
|
+
} finally {
|
|
8149
|
+
setIsPending(false);
|
|
7594
8150
|
}
|
|
7595
|
-
|
|
8151
|
+
},
|
|
8152
|
+
[action, initialData, data]
|
|
8153
|
+
);
|
|
8154
|
+
return [
|
|
8155
|
+
{
|
|
8156
|
+
data,
|
|
8157
|
+
error
|
|
8158
|
+
},
|
|
8159
|
+
formAction,
|
|
8160
|
+
isPending
|
|
8161
|
+
];
|
|
8162
|
+
};
|
|
8163
|
+
|
|
8164
|
+
// src/components/Form/FormErrorSummary.tsx
|
|
8165
|
+
var import_react26 = require("react");
|
|
8166
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
8167
|
+
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
8168
|
+
var ErrorItem = ({ name, error, formId }) => {
|
|
8169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Link, { href: `${formId}-${name}`, children: error }) }, name);
|
|
8170
|
+
};
|
|
8171
|
+
var FormErrorSummary = ({ description }) => {
|
|
8172
|
+
const ref = (0, import_react26.useRef)(null);
|
|
8173
|
+
const { formId, errors, hasSubmitted } = (0, import_react26.useContext)(FormContext);
|
|
8174
|
+
const isValid = Object.keys(errors).length === 0;
|
|
8175
|
+
if (isValid || !hasSubmitted) {
|
|
8176
|
+
return null;
|
|
7596
8177
|
}
|
|
7597
|
-
)
|
|
7598
|
-
|
|
7599
|
-
|
|
8178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)("div", { ref, children: [
|
|
8179
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)("p", { children: description }),
|
|
8180
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards25.isNotUndefined)(error)).map(
|
|
8181
|
+
([name, error]) => (0, import_type_guards25.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
8182
|
+
ErrorItem,
|
|
8183
|
+
{
|
|
8184
|
+
error: err,
|
|
8185
|
+
formId,
|
|
8186
|
+
name
|
|
8187
|
+
},
|
|
8188
|
+
err
|
|
8189
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
8190
|
+
ErrorItem,
|
|
8191
|
+
{
|
|
8192
|
+
error: error ?? "",
|
|
8193
|
+
formId,
|
|
8194
|
+
name
|
|
8195
|
+
},
|
|
8196
|
+
error
|
|
8197
|
+
)
|
|
8198
|
+
) })
|
|
8199
|
+
] });
|
|
8200
|
+
};
|
|
8201
|
+
|
|
8202
|
+
// src/components/FormField/FormField.tsx
|
|
8203
|
+
var import_react29 = require("react");
|
|
8204
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
8205
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
7600
8206
|
|
|
7601
8207
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
7602
|
-
var
|
|
8208
|
+
var import_react28 = require("react");
|
|
7603
8209
|
|
|
7604
8210
|
// src/components/FormGroup/FormGroup.tsx
|
|
7605
|
-
var
|
|
7606
|
-
var
|
|
7607
|
-
var
|
|
7608
|
-
var StyledFieldset =
|
|
8211
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
8212
|
+
var import_react27 = require("react");
|
|
8213
|
+
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
8214
|
+
var StyledFieldset = import_styled_components45.default.fieldset`
|
|
7609
8215
|
border: 0;
|
|
7610
8216
|
`;
|
|
7611
|
-
var StyledLegend =
|
|
8217
|
+
var StyledLegend = import_styled_components45.default.legend`
|
|
7612
8218
|
margin-bottom: var(--space-01);
|
|
7613
8219
|
`;
|
|
7614
8220
|
var FormGroup = ({ children, label, ...props }) => {
|
|
7615
|
-
const ref = (0,
|
|
7616
|
-
return /* @__PURE__ */ (0,
|
|
8221
|
+
const ref = (0, import_react27.useRef)();
|
|
8222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(
|
|
7617
8223
|
Stack,
|
|
7618
8224
|
{
|
|
7619
8225
|
...props,
|
|
7620
8226
|
ref,
|
|
7621
8227
|
renderAs: StyledFieldset,
|
|
7622
8228
|
children: [
|
|
7623
|
-
/* @__PURE__ */ (0,
|
|
8229
|
+
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
7624
8230
|
Heading,
|
|
7625
8231
|
{
|
|
7626
8232
|
renderAs: StyledLegend,
|
|
@@ -7636,8 +8242,8 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
7636
8242
|
FormGroup.displayName = "FormGroup";
|
|
7637
8243
|
|
|
7638
8244
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
7639
|
-
var
|
|
7640
|
-
var CheckboxGroupContext = (0,
|
|
8245
|
+
var import_jsx_runtime189 = require("react/jsx-runtime");
|
|
8246
|
+
var CheckboxGroupContext = (0, import_react28.createContext)(null);
|
|
7641
8247
|
var CheckboxGroup = ({
|
|
7642
8248
|
children,
|
|
7643
8249
|
name,
|
|
@@ -7645,19 +8251,19 @@ var CheckboxGroup = ({
|
|
|
7645
8251
|
value,
|
|
7646
8252
|
...props
|
|
7647
8253
|
}) => {
|
|
7648
|
-
const context = (0,
|
|
8254
|
+
const context = (0, import_react28.useMemo)(() => {
|
|
7649
8255
|
return {
|
|
7650
8256
|
name,
|
|
7651
8257
|
onChange
|
|
7652
8258
|
};
|
|
7653
8259
|
}, [name, onChange]);
|
|
7654
|
-
return /* @__PURE__ */ (0,
|
|
8260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(FormGroup, { ...props, children }) });
|
|
7655
8261
|
};
|
|
7656
8262
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
7657
8263
|
|
|
7658
8264
|
// src/components/FormField/FormField.tsx
|
|
7659
|
-
var
|
|
7660
|
-
var StyledFormField =
|
|
8265
|
+
var import_jsx_runtime190 = require("react/jsx-runtime");
|
|
8266
|
+
var StyledFormField = import_styled_components46.default.div`
|
|
7661
8267
|
--form-field-spacing: var(--wui-space-01);
|
|
7662
8268
|
--form-field-error-color: var(--wui-color-text-secondary-error);
|
|
7663
8269
|
|
|
@@ -7665,7 +8271,7 @@ var StyledFormField = import_styled_components39.default.div`
|
|
|
7665
8271
|
flex-direction: column;
|
|
7666
8272
|
gap: var(--form-field-spacing);
|
|
7667
8273
|
`;
|
|
7668
|
-
var StyledErrorList =
|
|
8274
|
+
var StyledErrorList = import_styled_components46.default.ul`
|
|
7669
8275
|
margin: 0;
|
|
7670
8276
|
padding: 0;
|
|
7671
8277
|
padding-left: var(--wui-space-04);
|
|
@@ -7674,8 +8280,8 @@ var StyledErrorList = import_styled_components39.default.ul`
|
|
|
7674
8280
|
gap: var(--wui-space-01);
|
|
7675
8281
|
`;
|
|
7676
8282
|
var ErrorMessages = ({ errors, id }) => {
|
|
7677
|
-
const isMultipleErrors = (0,
|
|
7678
|
-
return isMultipleErrors ? /* @__PURE__ */ (0,
|
|
8283
|
+
const isMultipleErrors = (0, import_type_guards26.isArray)(errors);
|
|
8284
|
+
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
7679
8285
|
Text,
|
|
7680
8286
|
{
|
|
7681
8287
|
colorScheme: "error",
|
|
@@ -7685,7 +8291,7 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
7685
8291
|
children: error
|
|
7686
8292
|
},
|
|
7687
8293
|
`${id}-${index}`
|
|
7688
|
-
)) }) : /* @__PURE__ */ (0,
|
|
8294
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
7689
8295
|
Text,
|
|
7690
8296
|
{
|
|
7691
8297
|
colorScheme: "error",
|
|
@@ -7705,8 +8311,8 @@ var FormField = ({
|
|
|
7705
8311
|
value,
|
|
7706
8312
|
...props
|
|
7707
8313
|
}) => {
|
|
7708
|
-
const formState = (0,
|
|
7709
|
-
const checkboxGroup = (0,
|
|
8314
|
+
const formState = (0, import_react29.useContext)(FormContext);
|
|
8315
|
+
const checkboxGroup = (0, import_react29.useContext)(CheckboxGroupContext);
|
|
7710
8316
|
const id = props.id ?? `${formState.formId}-${name}`;
|
|
7711
8317
|
const isInlineLabel = children.type === Checkbox;
|
|
7712
8318
|
const computedError = error ?? formState.errors[name];
|
|
@@ -7717,19 +8323,19 @@ var FormField = ({
|
|
|
7717
8323
|
label: isInlineLabel ? label : void 0,
|
|
7718
8324
|
...props
|
|
7719
8325
|
};
|
|
7720
|
-
if ((0,
|
|
8326
|
+
if ((0, import_type_guards26.isUndefined)(value) && (0, import_type_guards26.isNotUndefined)(defaultValue)) {
|
|
7721
8327
|
childProps = {
|
|
7722
8328
|
...childProps,
|
|
7723
8329
|
defaultValue
|
|
7724
8330
|
};
|
|
7725
8331
|
}
|
|
7726
|
-
if ((0,
|
|
7727
|
-
const computedName = (0,
|
|
8332
|
+
if ((0, import_type_guards26.isNotNil)(checkboxGroup)) {
|
|
8333
|
+
const computedName = (0, import_type_guards26.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
7728
8334
|
const handleChange = (event) => {
|
|
7729
|
-
if ((0,
|
|
8335
|
+
if ((0, import_type_guards26.isNotUndefined)(props.onChange)) {
|
|
7730
8336
|
props.onChange(event);
|
|
7731
8337
|
}
|
|
7732
|
-
if ((0,
|
|
8338
|
+
if ((0, import_type_guards26.isNotUndefined)(checkboxGroup.onChange)) {
|
|
7733
8339
|
checkboxGroup.onChange(event);
|
|
7734
8340
|
}
|
|
7735
8341
|
};
|
|
@@ -7737,15 +8343,15 @@ var FormField = ({
|
|
|
7737
8343
|
...childProps,
|
|
7738
8344
|
name: computedName,
|
|
7739
8345
|
onChange: handleChange,
|
|
7740
|
-
"aria-invalid": (0,
|
|
7741
|
-
"aria-describedby": (0,
|
|
8346
|
+
"aria-invalid": (0, import_type_guards26.isNotNil)(error),
|
|
8347
|
+
"aria-describedby": (0, import_type_guards26.isNotNil)(error) ? `${id}-error` : void 0
|
|
7742
8348
|
};
|
|
7743
8349
|
}
|
|
7744
|
-
|
|
7745
|
-
return /* @__PURE__ */ (0,
|
|
7746
|
-
!isInlineLabel && /* @__PURE__ */ (0,
|
|
7747
|
-
(0,
|
|
7748
|
-
(0,
|
|
8350
|
+
import_react29.Children.only(children);
|
|
8351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(StyledFormField, { ...props, children: [
|
|
8352
|
+
!isInlineLabel && /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(Label, { htmlFor: id, children: label }),
|
|
8353
|
+
(0, import_react29.cloneElement)(children, childProps),
|
|
8354
|
+
(0, import_type_guards26.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
7749
8355
|
ErrorMessages,
|
|
7750
8356
|
{
|
|
7751
8357
|
errors: computedError,
|
|
@@ -7757,9 +8363,9 @@ var FormField = ({
|
|
|
7757
8363
|
FormField.displayName = "FormField";
|
|
7758
8364
|
|
|
7759
8365
|
// src/components/FormGroup/RadioGroup.tsx
|
|
7760
|
-
var
|
|
7761
|
-
var
|
|
7762
|
-
var RadioGroupContext = (0,
|
|
8366
|
+
var import_react30 = require("react");
|
|
8367
|
+
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
8368
|
+
var RadioGroupContext = (0, import_react30.createContext)(null);
|
|
7763
8369
|
var RadioGroup = ({
|
|
7764
8370
|
children,
|
|
7765
8371
|
name,
|
|
@@ -7767,21 +8373,21 @@ var RadioGroup = ({
|
|
|
7767
8373
|
value,
|
|
7768
8374
|
...props
|
|
7769
8375
|
}) => {
|
|
7770
|
-
const context = (0,
|
|
8376
|
+
const context = (0, import_react30.useMemo)(() => {
|
|
7771
8377
|
return {
|
|
7772
8378
|
name,
|
|
7773
8379
|
onChange
|
|
7774
8380
|
};
|
|
7775
8381
|
}, [name, onChange]);
|
|
7776
|
-
return /* @__PURE__ */ (0,
|
|
8382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(FormGroup, { ...props, children }) });
|
|
7777
8383
|
};
|
|
7778
8384
|
RadioGroup.displayName = "RadioGroup";
|
|
7779
8385
|
|
|
7780
8386
|
// src/components/IconButton/IconButton.tsx
|
|
7781
|
-
var
|
|
7782
|
-
var
|
|
7783
|
-
var
|
|
7784
|
-
var StyledButton2 = (0,
|
|
8387
|
+
var import_react31 = require("react");
|
|
8388
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
8389
|
+
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
8390
|
+
var StyledButton2 = (0, import_styled_components47.default)(Button)`
|
|
7785
8391
|
--icon-button-size-sm: 24px;
|
|
7786
8392
|
--icon-button-size-md: 32px;
|
|
7787
8393
|
--icon-button-size-lg: 40px;
|
|
@@ -7795,10 +8401,10 @@ var StyledButton2 = (0, import_styled_components40.default)(Button)`
|
|
|
7795
8401
|
align-items: center;
|
|
7796
8402
|
line-height: 1;
|
|
7797
8403
|
`;
|
|
7798
|
-
var IconButton = (0,
|
|
8404
|
+
var IconButton = (0, import_react31.forwardRef)(
|
|
7799
8405
|
({ children, label, size = "md", ...props }, ref) => {
|
|
7800
8406
|
const responsiveSize = useResponsiveProp(size);
|
|
7801
|
-
return /* @__PURE__ */ (0,
|
|
8407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7802
8408
|
StyledButton2,
|
|
7803
8409
|
{
|
|
7804
8410
|
...props,
|
|
@@ -7806,7 +8412,7 @@ var IconButton = (0, import_react29.forwardRef)(
|
|
|
7806
8412
|
"aria-label": label,
|
|
7807
8413
|
"data-wistia-ui-icon-button": true,
|
|
7808
8414
|
size: responsiveSize,
|
|
7809
|
-
children: (0,
|
|
8415
|
+
children: (0, import_react31.cloneElement)(import_react31.Children.only(children), {
|
|
7810
8416
|
size: responsiveSize
|
|
7811
8417
|
})
|
|
7812
8418
|
}
|
|
@@ -7815,183 +8421,20 @@ var IconButton = (0, import_react29.forwardRef)(
|
|
|
7815
8421
|
);
|
|
7816
8422
|
IconButton.displayName = "IconButton";
|
|
7817
8423
|
|
|
7818
|
-
// src/components/Input/Input.tsx
|
|
7819
|
-
var import_react30 = require("react");
|
|
7820
|
-
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7821
|
-
var import_type_guards24 = require("@wistia/type-guards");
|
|
7822
|
-
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
7823
|
-
var inputStyles = import_styled_components41.css`
|
|
7824
|
-
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7825
|
-
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
7826
|
-
--wui-input-color-border: var(--wui-color-border);
|
|
7827
|
-
--wui-input-color-border-focus: var(--wui-color-border-active);
|
|
7828
|
-
--wui-input-color-border-error: var(--wui-color-border-error);
|
|
7829
|
-
--wui-input-color-border-disabled: var(--wui-color-border-disabled);
|
|
7830
|
-
--wui-input-border-radius: var(--wui-border-radius-rounded);
|
|
7831
|
-
--wui-input-multiline-border-radius: var(--wui-border-radius-02);
|
|
7832
|
-
--wui-input-vertical-padding: var(--wui-space-02);
|
|
7833
|
-
--wui-input-horizontal-padding: var(--wui-space-03);
|
|
7834
|
-
--wui-input-placeholder: var(--wui-gray-10);
|
|
7835
|
-
--wui-input-color-text-error: var(--wui-color-text-error);
|
|
7836
|
-
|
|
7837
|
-
input,
|
|
7838
|
-
textarea {
|
|
7839
|
-
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
7840
|
-
background-color: var(--wui-input-color-bg);
|
|
7841
|
-
border: 1px solid var(--wui-input-color-border);
|
|
7842
|
-
border-radius: var(--wui-input-border-radius);
|
|
7843
|
-
|
|
7844
|
-
&::placeholder {
|
|
7845
|
-
color: var(--wui-input-placeholder);
|
|
7846
|
-
opacity: 1; /* Firefox */
|
|
7847
|
-
}
|
|
7848
|
-
|
|
7849
|
-
&:focus {
|
|
7850
|
-
border-color: var(--wui-input-color-border-focus);
|
|
7851
|
-
}
|
|
7852
|
-
|
|
7853
|
-
&[aria-invalid='true'] {
|
|
7854
|
-
border-color: var(--wui-input-color-border-error);
|
|
7855
|
-
color: var(--wui-input-color-text-error);
|
|
7856
|
-
}
|
|
7857
|
-
|
|
7858
|
-
&:disabled {
|
|
7859
|
-
border-color: var(--wui-color-bg-surface-disabled);
|
|
7860
|
-
background-color: var(--wui-color-bg-surface-disabled);
|
|
7861
|
-
}
|
|
7862
|
-
}
|
|
7863
|
-
`;
|
|
7864
|
-
var StyledInputContainer = import_styled_components41.default.div`
|
|
7865
|
-
display: inline-flex;
|
|
7866
|
-
position: relative;
|
|
7867
|
-
${inputStyles};
|
|
7868
|
-
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7869
|
-
|
|
7870
|
-
input,
|
|
7871
|
-
textarea {
|
|
7872
|
-
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7873
|
-
${({ $monospace }) => $monospace && "font-family: var(--wui-typography-family-mono);"}
|
|
7874
|
-
}
|
|
7875
|
-
|
|
7876
|
-
textarea {
|
|
7877
|
-
border-radius: var(--wui-input-multiline-border-radius);
|
|
7878
|
-
}
|
|
7879
|
-
|
|
7880
|
-
.wui-input-left-icon {
|
|
7881
|
-
display: flex;
|
|
7882
|
-
align-items: center;
|
|
7883
|
-
position: absolute;
|
|
7884
|
-
top: 50%;
|
|
7885
|
-
left: var(--wui-input-horizontal-padding);
|
|
7886
|
-
transform: translateY(-50%);
|
|
7887
|
-
}
|
|
7888
|
-
|
|
7889
|
-
:has(.wui-input-left-icon) input,
|
|
7890
|
-
:has(.wui-input-left-icon) textarea {
|
|
7891
|
-
padding-left: 32px;
|
|
7892
|
-
}
|
|
7893
|
-
|
|
7894
|
-
.wui-input-right-icon {
|
|
7895
|
-
display: flex;
|
|
7896
|
-
align-items: center;
|
|
7897
|
-
position: absolute;
|
|
7898
|
-
top: 50%;
|
|
7899
|
-
right: var(--wui-input-horizontal-padding);
|
|
7900
|
-
transform: translateY(-50%);
|
|
7901
|
-
}
|
|
7902
|
-
|
|
7903
|
-
:has(.wui-input-right-icon) input,
|
|
7904
|
-
:has(.wui-input-right-icon) textarea {
|
|
7905
|
-
padding-right: 32px;
|
|
7906
|
-
}
|
|
7907
|
-
`;
|
|
7908
|
-
var isValidRef2 = (ref) => {
|
|
7909
|
-
return typeof ref === "object" && ref !== null && "current" in ref && (0, import_type_guards24.isNotNil)(ref.current);
|
|
7910
|
-
};
|
|
7911
|
-
var Input = (0, import_react30.forwardRef)(
|
|
7912
|
-
({
|
|
7913
|
-
fullWidth = false,
|
|
7914
|
-
monospace = false,
|
|
7915
|
-
type = "text",
|
|
7916
|
-
autoSelect = false,
|
|
7917
|
-
leftIcon,
|
|
7918
|
-
rightIcon,
|
|
7919
|
-
...props
|
|
7920
|
-
}, externalRef) => {
|
|
7921
|
-
const internalRef = (0, import_react30.useRef)();
|
|
7922
|
-
const ref = isValidRef2(externalRef) ? externalRef : internalRef;
|
|
7923
|
-
let leftIconToDisplay = leftIcon;
|
|
7924
|
-
if ((0, import_type_guards24.isNil)(leftIcon) && type === "search") {
|
|
7925
|
-
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(Icon, { type: "search" });
|
|
7926
|
-
}
|
|
7927
|
-
if ((0, import_type_guards24.isNotNil)(leftIconToDisplay)) {
|
|
7928
|
-
leftIconToDisplay = (0, import_react30.cloneElement)(leftIconToDisplay, {
|
|
7929
|
-
size: "md",
|
|
7930
|
-
className: "wui-input-left-icon"
|
|
7931
|
-
});
|
|
7932
|
-
}
|
|
7933
|
-
let rightIconToDisplay = rightIcon;
|
|
7934
|
-
if ((0, import_type_guards24.isNotNil)(rightIconToDisplay)) {
|
|
7935
|
-
rightIconToDisplay = (0, import_react30.cloneElement)(rightIconToDisplay, {
|
|
7936
|
-
size: "md",
|
|
7937
|
-
className: "wui-input-right-icon"
|
|
7938
|
-
});
|
|
7939
|
-
}
|
|
7940
|
-
const handleFocus = (event) => {
|
|
7941
|
-
if ((0, import_type_guards24.isNotNil)(props.onFocus)) {
|
|
7942
|
-
props.onFocus(event);
|
|
7943
|
-
}
|
|
7944
|
-
if (autoSelect && ref && "current" in ref) {
|
|
7945
|
-
requestAnimationFrame(() => {
|
|
7946
|
-
ref.current?.select();
|
|
7947
|
-
});
|
|
7948
|
-
}
|
|
7949
|
-
};
|
|
7950
|
-
return /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(
|
|
7951
|
-
StyledInputContainer,
|
|
7952
|
-
{
|
|
7953
|
-
$fullWidth: fullWidth,
|
|
7954
|
-
$monospace: monospace,
|
|
7955
|
-
children: [
|
|
7956
|
-
leftIconToDisplay ?? null,
|
|
7957
|
-
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7958
|
-
"textarea",
|
|
7959
|
-
{
|
|
7960
|
-
...props,
|
|
7961
|
-
ref,
|
|
7962
|
-
onFocus: handleFocus
|
|
7963
|
-
}
|
|
7964
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7965
|
-
"input",
|
|
7966
|
-
{
|
|
7967
|
-
...props,
|
|
7968
|
-
ref,
|
|
7969
|
-
onFocus: handleFocus,
|
|
7970
|
-
type
|
|
7971
|
-
}
|
|
7972
|
-
),
|
|
7973
|
-
rightIconToDisplay ?? null
|
|
7974
|
-
]
|
|
7975
|
-
}
|
|
7976
|
-
);
|
|
7977
|
-
}
|
|
7978
|
-
);
|
|
7979
|
-
Input.displayName = "Input";
|
|
7980
|
-
|
|
7981
8424
|
// src/components/Menu/Menu.tsx
|
|
7982
|
-
var
|
|
8425
|
+
var import_styled_components48 = __toESM(require("styled-components"));
|
|
7983
8426
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
7984
|
-
var
|
|
7985
|
-
var
|
|
8427
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
8428
|
+
var import_react33 = require("react");
|
|
7986
8429
|
|
|
7987
8430
|
// src/components/Menu/MenuContext.tsx
|
|
7988
|
-
var
|
|
7989
|
-
var MenuContext = (0,
|
|
7990
|
-
var useMenuContext = () => (0,
|
|
8431
|
+
var import_react32 = require("react");
|
|
8432
|
+
var MenuContext = (0, import_react32.createContext)({ compact: false });
|
|
8433
|
+
var useMenuContext = () => (0, import_react32.useContext)(MenuContext);
|
|
7991
8434
|
|
|
7992
8435
|
// src/components/Menu/Menu.tsx
|
|
7993
|
-
var
|
|
7994
|
-
var open =
|
|
8436
|
+
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
8437
|
+
var open = import_styled_components48.keyframes`
|
|
7995
8438
|
from {
|
|
7996
8439
|
opacity: 0;
|
|
7997
8440
|
transform: scale(.97) translateY(-8px);
|
|
@@ -8001,7 +8444,7 @@ var open = import_styled_components42.keyframes`
|
|
|
8001
8444
|
transform: scale(1);
|
|
8002
8445
|
}
|
|
8003
8446
|
`;
|
|
8004
|
-
var close =
|
|
8447
|
+
var close = import_styled_components48.keyframes`
|
|
8005
8448
|
from {
|
|
8006
8449
|
opacity: 1;
|
|
8007
8450
|
transform: scale(1);
|
|
@@ -8011,7 +8454,7 @@ var close = import_styled_components42.keyframes`
|
|
|
8011
8454
|
transform: scale(.97) translateY(-8px);
|
|
8012
8455
|
}
|
|
8013
8456
|
`;
|
|
8014
|
-
var menuItemCss =
|
|
8457
|
+
var menuItemCss = import_styled_components48.css`
|
|
8015
8458
|
--menu-label-description-gap: var(--wui-space-01);
|
|
8016
8459
|
--menu-item-inner-gap: var(--wui-space-03);
|
|
8017
8460
|
--menu-item-left-icon-size: 24px;
|
|
@@ -8022,7 +8465,7 @@ var menuItemCss = import_styled_components42.css`
|
|
|
8022
8465
|
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
8023
8466
|
--menu-divider-margin: var(--wui-space-02);
|
|
8024
8467
|
`;
|
|
8025
|
-
var compactMenuItemCss =
|
|
8468
|
+
var compactMenuItemCss = import_styled_components48.css`
|
|
8026
8469
|
--menu-label-description-gap: 0;
|
|
8027
8470
|
--menu-item-inner-gap: var(--wui-space-02);
|
|
8028
8471
|
--menu-item-left-icon-size: 16px;
|
|
@@ -8033,7 +8476,7 @@ var compactMenuItemCss = import_styled_components42.css`
|
|
|
8033
8476
|
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
8034
8477
|
--menu-divider-margin: var(--wui-space-01);
|
|
8035
8478
|
`;
|
|
8036
|
-
var menuContentCss =
|
|
8479
|
+
var menuContentCss = import_styled_components48.css`
|
|
8037
8480
|
--menu-font-family: var(--wui-typography-family-default);
|
|
8038
8481
|
--menu-bg: var(--wui-color-bg-surface);
|
|
8039
8482
|
--menu-shadow: var(--wui-elevation-01);
|
|
@@ -8075,7 +8518,7 @@ var menuContentCss = import_styled_components42.css`
|
|
|
8075
8518
|
margin: var(--menu-divider-margin) 0;
|
|
8076
8519
|
}
|
|
8077
8520
|
`;
|
|
8078
|
-
var MenuContent = (0,
|
|
8521
|
+
var MenuContent = (0, import_styled_components48.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
8079
8522
|
${menuContentCss}
|
|
8080
8523
|
`;
|
|
8081
8524
|
var Menu = ({
|
|
@@ -8091,9 +8534,9 @@ var Menu = ({
|
|
|
8091
8534
|
onInteractOutside,
|
|
8092
8535
|
...props
|
|
8093
8536
|
}) => {
|
|
8094
|
-
const contextValue = (0,
|
|
8537
|
+
const contextValue = (0, import_react33.useMemo)(() => ({ compact }), [compact]);
|
|
8095
8538
|
let controlProps = {
|
|
8096
|
-
...(0,
|
|
8539
|
+
...(0, import_type_guards27.isNotNil)(onOpenChange) && (0, import_type_guards27.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8097
8540
|
};
|
|
8098
8541
|
if (disabled) {
|
|
8099
8542
|
controlProps = {
|
|
@@ -8101,24 +8544,24 @@ var Menu = ({
|
|
|
8101
8544
|
onOpenChange: () => null
|
|
8102
8545
|
};
|
|
8103
8546
|
}
|
|
8104
|
-
return /* @__PURE__ */ (0,
|
|
8547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(
|
|
8105
8548
|
import_react_dropdown_menu.DropdownMenu,
|
|
8106
8549
|
{
|
|
8107
8550
|
modal: false,
|
|
8108
8551
|
...controlProps,
|
|
8109
8552
|
children: [
|
|
8110
|
-
/* @__PURE__ */ (0,
|
|
8553
|
+
/* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards27.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
8111
8554
|
Button,
|
|
8112
8555
|
{
|
|
8113
8556
|
"aria-expanded": isOpen,
|
|
8114
8557
|
disabled,
|
|
8115
8558
|
forceState: isOpen ? "active" : void 0,
|
|
8116
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8559
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(Icon, { type: "caret-down" }),
|
|
8117
8560
|
...triggerProps,
|
|
8118
8561
|
children: label
|
|
8119
8562
|
}
|
|
8120
8563
|
) }),
|
|
8121
|
-
/* @__PURE__ */ (0,
|
|
8564
|
+
/* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
8122
8565
|
MenuContent,
|
|
8123
8566
|
{
|
|
8124
8567
|
...props,
|
|
@@ -8138,19 +8581,19 @@ var Menu = ({
|
|
|
8138
8581
|
Menu.displayName = "Menu";
|
|
8139
8582
|
|
|
8140
8583
|
// src/components/Menu/MenuLabel.tsx
|
|
8141
|
-
var
|
|
8584
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
8142
8585
|
var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
|
|
8143
|
-
var
|
|
8144
|
-
var StyledMenuLabel = (0,
|
|
8586
|
+
var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
8587
|
+
var StyledMenuLabel = (0, import_styled_components49.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
|
|
8145
8588
|
padding: var(--wui-space-02);
|
|
8146
8589
|
`;
|
|
8147
8590
|
var MenuLabel = ({ children, ...props }) => {
|
|
8148
|
-
return /* @__PURE__ */ (0,
|
|
8591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
8149
8592
|
StyledMenuLabel,
|
|
8150
8593
|
{
|
|
8151
8594
|
asChild: true,
|
|
8152
8595
|
...props,
|
|
8153
|
-
children: /* @__PURE__ */ (0,
|
|
8596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
8154
8597
|
Heading,
|
|
8155
8598
|
{
|
|
8156
8599
|
renderAs: "span",
|
|
@@ -8165,17 +8608,17 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
8165
8608
|
MenuLabel.displayName = "MenuLabel";
|
|
8166
8609
|
|
|
8167
8610
|
// src/components/Menu/SubMenu.tsx
|
|
8168
|
-
var
|
|
8169
|
-
var
|
|
8611
|
+
var import_react35 = require("react");
|
|
8612
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
8170
8613
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
8171
|
-
var
|
|
8614
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
8172
8615
|
|
|
8173
8616
|
// src/components/Menu/MenuItemButton.tsx
|
|
8174
|
-
var
|
|
8175
|
-
var
|
|
8176
|
-
var
|
|
8177
|
-
var
|
|
8178
|
-
var StyledButton3 = (0,
|
|
8617
|
+
var import_react34 = require("react");
|
|
8618
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
8619
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8620
|
+
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
8621
|
+
var StyledButton3 = (0, import_styled_components50.default)(Button)`
|
|
8179
8622
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
8180
8623
|
|
|
8181
8624
|
display: flex;
|
|
@@ -8214,7 +8657,7 @@ var StyledButton3 = (0, import_styled_components44.default)(Button)`
|
|
|
8214
8657
|
padding-left: var(--wui-space-04);
|
|
8215
8658
|
}
|
|
8216
8659
|
`;
|
|
8217
|
-
var StyledLeftIconContainer =
|
|
8660
|
+
var StyledLeftIconContainer = import_styled_components50.default.div`
|
|
8218
8661
|
height: var(--menu-item-left-icon-size);
|
|
8219
8662
|
width: var(--menu-item-left-icon-size);
|
|
8220
8663
|
|
|
@@ -8223,7 +8666,7 @@ var StyledLeftIconContainer = import_styled_components44.default.div`
|
|
|
8223
8666
|
width: var(--menu-item-left-icon-size);
|
|
8224
8667
|
}
|
|
8225
8668
|
`;
|
|
8226
|
-
var StyledRightIconContainer =
|
|
8669
|
+
var StyledRightIconContainer = import_styled_components50.default.div`
|
|
8227
8670
|
height: var(--menu-item-right-icon-size);
|
|
8228
8671
|
width: var(--menu-item-right-icon-size);
|
|
8229
8672
|
|
|
@@ -8232,28 +8675,28 @@ var StyledRightIconContainer = import_styled_components44.default.div`
|
|
|
8232
8675
|
width: var(--menu-item-right-icon-size);
|
|
8233
8676
|
}
|
|
8234
8677
|
`;
|
|
8235
|
-
var StyledLabelAndDescriptionContainer =
|
|
8678
|
+
var StyledLabelAndDescriptionContainer = import_styled_components50.default.div`
|
|
8236
8679
|
display: flex;
|
|
8237
8680
|
flex-direction: column;
|
|
8238
8681
|
gap: var(--menu-label-description-gap);
|
|
8239
8682
|
flex-basis: 100%;
|
|
8240
8683
|
`;
|
|
8241
|
-
var StyledBadgeContainer =
|
|
8684
|
+
var StyledBadgeContainer = import_styled_components50.default.div`
|
|
8242
8685
|
align-self: start;
|
|
8243
8686
|
justify-self: end;
|
|
8244
8687
|
font-size: var(--wui-typography-label-4-size);
|
|
8245
8688
|
color: var(--wui-color-text-secondary);
|
|
8246
8689
|
`;
|
|
8247
|
-
var MenuItemButton = (0,
|
|
8690
|
+
var MenuItemButton = (0, import_react34.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
8248
8691
|
let { colorScheme, badge } = props;
|
|
8249
8692
|
if (appearance === "dangerous") {
|
|
8250
|
-
if ((0,
|
|
8693
|
+
if ((0, import_type_guards28.isNotUndefined)(colorScheme)) {
|
|
8251
8694
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
8252
8695
|
}
|
|
8253
8696
|
colorScheme = "error";
|
|
8254
8697
|
}
|
|
8255
8698
|
if (appearance === "gated") {
|
|
8256
|
-
badge = /* @__PURE__ */ (0,
|
|
8699
|
+
badge = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
8257
8700
|
Icon,
|
|
8258
8701
|
{
|
|
8259
8702
|
colorScheme: "purple",
|
|
@@ -8265,7 +8708,7 @@ var MenuItemButton = (0, import_react33.forwardRef)(({ children, appearance, com
|
|
|
8265
8708
|
}
|
|
8266
8709
|
);
|
|
8267
8710
|
}
|
|
8268
|
-
return /* @__PURE__ */ (0,
|
|
8711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(
|
|
8269
8712
|
StyledButton3,
|
|
8270
8713
|
{
|
|
8271
8714
|
...props,
|
|
@@ -8275,10 +8718,10 @@ var MenuItemButton = (0, import_react33.forwardRef)(({ children, appearance, com
|
|
|
8275
8718
|
fullWidth: true,
|
|
8276
8719
|
unstyled: true,
|
|
8277
8720
|
children: [
|
|
8278
|
-
props.leftIcon ? /* @__PURE__ */ (0,
|
|
8279
|
-
/* @__PURE__ */ (0,
|
|
8280
|
-
(0,
|
|
8281
|
-
props.rightIcon ? /* @__PURE__ */ (0,
|
|
8721
|
+
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
8722
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
8723
|
+
(0, import_type_guards28.isNotNil)(badge) || (0, import_type_guards28.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
8724
|
+
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
8282
8725
|
]
|
|
8283
8726
|
}
|
|
8284
8727
|
);
|
|
@@ -8286,33 +8729,33 @@ var MenuItemButton = (0, import_react33.forwardRef)(({ children, appearance, com
|
|
|
8286
8729
|
MenuItemButton.displayName = "MenuItemButton";
|
|
8287
8730
|
|
|
8288
8731
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
8289
|
-
var
|
|
8290
|
-
var
|
|
8291
|
-
var StyledMenuItemLabel =
|
|
8292
|
-
var StyledMenuItemDescription = (0,
|
|
8732
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
8733
|
+
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
8734
|
+
var StyledMenuItemLabel = import_styled_components51.default.span``;
|
|
8735
|
+
var StyledMenuItemDescription = (0, import_styled_components51.default)(Text).attrs({
|
|
8293
8736
|
variant: "body4",
|
|
8294
8737
|
prominence: "secondary"
|
|
8295
8738
|
})``;
|
|
8296
8739
|
var MenuItemLabel = ({ children }) => {
|
|
8297
|
-
return /* @__PURE__ */ (0,
|
|
8740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(StyledMenuItemLabel, { children });
|
|
8298
8741
|
};
|
|
8299
8742
|
var MenuItemDescription = ({ children }) => {
|
|
8300
|
-
return /* @__PURE__ */ (0,
|
|
8743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(StyledMenuItemDescription, { children });
|
|
8301
8744
|
};
|
|
8302
8745
|
|
|
8303
8746
|
// src/components/Menu/SubMenu.tsx
|
|
8304
|
-
var
|
|
8305
|
-
var SubMenuContent = (0,
|
|
8747
|
+
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
8748
|
+
var SubMenuContent = (0, import_styled_components52.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
|
|
8306
8749
|
${menuContentCss}
|
|
8307
8750
|
|
|
8308
8751
|
${mq.smAndDown} {
|
|
8309
8752
|
transform: translateX(-100%) !important;
|
|
8310
8753
|
}
|
|
8311
8754
|
`;
|
|
8312
|
-
var StyledMobileSubMenuItems =
|
|
8755
|
+
var StyledMobileSubMenuItems = import_styled_components52.default.div`
|
|
8313
8756
|
margin-left: var(--wui-space-04);
|
|
8314
8757
|
`;
|
|
8315
|
-
var StyledSubTrigger = (0,
|
|
8758
|
+
var StyledSubTrigger = (0, import_styled_components52.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
|
|
8316
8759
|
outline: none;
|
|
8317
8760
|
|
|
8318
8761
|
&[data-state='open'],
|
|
@@ -8323,11 +8766,11 @@ var StyledSubTrigger = (0, import_styled_components46.default)(import_react_drop
|
|
|
8323
8766
|
var SubMenuTrigger = (props) => {
|
|
8324
8767
|
const { isSmAndUp } = useMq();
|
|
8325
8768
|
const Trigger3 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
|
|
8326
|
-
return /* @__PURE__ */ (0,
|
|
8769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Trigger3, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
|
|
8327
8770
|
MenuItemButton,
|
|
8328
8771
|
{
|
|
8329
8772
|
...props,
|
|
8330
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8773
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Icon, { type: "caret-right" })
|
|
8331
8774
|
}
|
|
8332
8775
|
) });
|
|
8333
8776
|
};
|
|
@@ -8339,16 +8782,16 @@ var SubMenu = ({
|
|
|
8339
8782
|
...props
|
|
8340
8783
|
}) => {
|
|
8341
8784
|
const { isSmAndUp } = useMq();
|
|
8342
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
8785
|
+
const [isExpanded, setIsExpanded] = (0, import_react35.useState)(false);
|
|
8343
8786
|
const { compact } = useMenuContext();
|
|
8344
|
-
return isSmAndUp ? /* @__PURE__ */ (0,
|
|
8345
|
-
/* @__PURE__ */ (0,
|
|
8346
|
-
/* @__PURE__ */ (0,
|
|
8347
|
-
(0,
|
|
8787
|
+
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
8788
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
8789
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemLabel, { children: label }),
|
|
8790
|
+
(0, import_type_guards29.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemDescription, { children: description }) : null
|
|
8348
8791
|
] }),
|
|
8349
|
-
/* @__PURE__ */ (0,
|
|
8350
|
-
] }) : /* @__PURE__ */ (0,
|
|
8351
|
-
/* @__PURE__ */ (0,
|
|
8792
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
8793
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
8794
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
8352
8795
|
SubMenuTrigger,
|
|
8353
8796
|
{
|
|
8354
8797
|
...props,
|
|
@@ -8357,28 +8800,28 @@ var SubMenu = ({
|
|
|
8357
8800
|
setIsExpanded((prev) => !prev);
|
|
8358
8801
|
},
|
|
8359
8802
|
children: [
|
|
8360
|
-
/* @__PURE__ */ (0,
|
|
8361
|
-
/* @__PURE__ */ (0,
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemLabel, { children: label }),
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemDescription, { children: description })
|
|
8362
8805
|
]
|
|
8363
8806
|
}
|
|
8364
8807
|
),
|
|
8365
|
-
/* @__PURE__ */ (0,
|
|
8808
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
|
|
8366
8809
|
] });
|
|
8367
8810
|
};
|
|
8368
8811
|
SubMenu.displayName = "SubMenu";
|
|
8369
8812
|
|
|
8370
8813
|
// src/components/Menu/MenuItem.tsx
|
|
8371
|
-
var
|
|
8814
|
+
var import_react36 = require("react");
|
|
8372
8815
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
8373
|
-
var
|
|
8374
|
-
var MenuItem = (0,
|
|
8816
|
+
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
8817
|
+
var MenuItem = (0, import_react36.forwardRef)(
|
|
8375
8818
|
({ onSelect = () => null, ...props }, ref) => {
|
|
8376
|
-
return /* @__PURE__ */ (0,
|
|
8819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
8377
8820
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
8378
8821
|
{
|
|
8379
8822
|
asChild: true,
|
|
8380
8823
|
onSelect,
|
|
8381
|
-
children: /* @__PURE__ */ (0,
|
|
8824
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
8382
8825
|
MenuItemButton,
|
|
8383
8826
|
{
|
|
8384
8827
|
...props,
|
|
@@ -8394,10 +8837,10 @@ MenuItem.displayName = "MenuItem";
|
|
|
8394
8837
|
|
|
8395
8838
|
// src/components/Menu/MenuRadioGroup.tsx
|
|
8396
8839
|
var import_react_dropdown_menu5 = require("@radix-ui/react-dropdown-menu");
|
|
8397
|
-
var
|
|
8840
|
+
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
8398
8841
|
var MenuRadioGroup = ({ children, label, ...props }) => {
|
|
8399
|
-
return /* @__PURE__ */ (0,
|
|
8400
|
-
/* @__PURE__ */ (0,
|
|
8842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
|
|
8843
|
+
/* @__PURE__ */ (0, import_jsx_runtime199.jsx)(MenuLabel, { children: label }),
|
|
8401
8844
|
children
|
|
8402
8845
|
] });
|
|
8403
8846
|
};
|
|
@@ -8405,11 +8848,11 @@ MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
|
8405
8848
|
|
|
8406
8849
|
// src/components/Menu/RadioMenuItem.tsx
|
|
8407
8850
|
var import_react_dropdown_menu6 = require("@radix-ui/react-dropdown-menu");
|
|
8408
|
-
var
|
|
8851
|
+
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
8409
8852
|
var RadioMenuItem = ({
|
|
8410
8853
|
onSelect,
|
|
8411
8854
|
value,
|
|
8412
|
-
indicator = /* @__PURE__ */ (0,
|
|
8855
|
+
indicator = /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8413
8856
|
Icon,
|
|
8414
8857
|
{
|
|
8415
8858
|
size: "sm",
|
|
@@ -8419,17 +8862,17 @@ var RadioMenuItem = ({
|
|
|
8419
8862
|
...props
|
|
8420
8863
|
}) => {
|
|
8421
8864
|
const extraProps = onSelect ? { onSelect } : {};
|
|
8422
|
-
return /* @__PURE__ */ (0,
|
|
8865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8423
8866
|
import_react_dropdown_menu6.DropdownMenuRadioItem,
|
|
8424
8867
|
{
|
|
8425
8868
|
...extraProps,
|
|
8426
8869
|
asChild: true,
|
|
8427
8870
|
value,
|
|
8428
|
-
children: /* @__PURE__ */ (0,
|
|
8871
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8429
8872
|
MenuItemButton,
|
|
8430
8873
|
{
|
|
8431
8874
|
...props,
|
|
8432
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8875
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
|
|
8433
8876
|
}
|
|
8434
8877
|
)
|
|
8435
8878
|
}
|
|
@@ -8439,9 +8882,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
8439
8882
|
|
|
8440
8883
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
8441
8884
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
8442
|
-
var
|
|
8885
|
+
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
8443
8886
|
var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
8444
|
-
return checked ? /* @__PURE__ */ (0,
|
|
8887
|
+
return checked ? /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
8445
8888
|
"svg",
|
|
8446
8889
|
{
|
|
8447
8890
|
...props,
|
|
@@ -8451,14 +8894,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8451
8894
|
width: "24",
|
|
8452
8895
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8453
8896
|
children: [
|
|
8454
|
-
/* @__PURE__ */ (0,
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8455
8898
|
"path",
|
|
8456
8899
|
{
|
|
8457
8900
|
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",
|
|
8458
8901
|
fill: "#2949e5"
|
|
8459
8902
|
}
|
|
8460
8903
|
),
|
|
8461
|
-
/* @__PURE__ */ (0,
|
|
8904
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8462
8905
|
"path",
|
|
8463
8906
|
{
|
|
8464
8907
|
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",
|
|
@@ -8467,7 +8910,7 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8467
8910
|
)
|
|
8468
8911
|
]
|
|
8469
8912
|
}
|
|
8470
|
-
) : /* @__PURE__ */ (0,
|
|
8913
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
8471
8914
|
"svg",
|
|
8472
8915
|
{
|
|
8473
8916
|
...props,
|
|
@@ -8477,14 +8920,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8477
8920
|
width: "24",
|
|
8478
8921
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8479
8922
|
children: [
|
|
8480
|
-
/* @__PURE__ */ (0,
|
|
8923
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8481
8924
|
"path",
|
|
8482
8925
|
{
|
|
8483
8926
|
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",
|
|
8484
8927
|
fill: "#fcfcfd"
|
|
8485
8928
|
}
|
|
8486
8929
|
),
|
|
8487
|
-
/* @__PURE__ */ (0,
|
|
8930
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8488
8931
|
"path",
|
|
8489
8932
|
{
|
|
8490
8933
|
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",
|
|
@@ -8501,18 +8944,18 @@ var CheckboxMenuItem = ({
|
|
|
8501
8944
|
onCheckedChange,
|
|
8502
8945
|
...props
|
|
8503
8946
|
}) => {
|
|
8504
|
-
return /* @__PURE__ */ (0,
|
|
8947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8505
8948
|
import_react_dropdown_menu7.DropdownMenuCheckboxItem,
|
|
8506
8949
|
{
|
|
8507
8950
|
asChild: true,
|
|
8508
8951
|
checked,
|
|
8509
8952
|
onCheckedChange,
|
|
8510
8953
|
onSelect,
|
|
8511
|
-
children: /* @__PURE__ */ (0,
|
|
8954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8512
8955
|
MenuItemButton,
|
|
8513
8956
|
{
|
|
8514
8957
|
...props,
|
|
8515
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8958
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(CheckboxIndicator2, { checked })
|
|
8516
8959
|
}
|
|
8517
8960
|
)
|
|
8518
8961
|
}
|
|
@@ -8521,59 +8964,37 @@ var CheckboxMenuItem = ({
|
|
|
8521
8964
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
8522
8965
|
|
|
8523
8966
|
// src/components/Modal/Modal.tsx
|
|
8524
|
-
var
|
|
8525
|
-
var
|
|
8967
|
+
var import_react40 = require("react");
|
|
8968
|
+
var import_styled_components57 = __toESM(require("styled-components"));
|
|
8526
8969
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
8527
|
-
var
|
|
8970
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
8528
8971
|
|
|
8529
8972
|
// src/components/Modal/ModalHeader.tsx
|
|
8530
|
-
var
|
|
8973
|
+
var import_styled_components54 = __toESM(require("styled-components"));
|
|
8531
8974
|
var import_react_dialog2 = require("@radix-ui/react-dialog");
|
|
8532
8975
|
|
|
8533
8976
|
// src/components/Modal/ModalCloseButton.tsx
|
|
8534
|
-
var
|
|
8977
|
+
var import_styled_components53 = __toESM(require("styled-components"));
|
|
8535
8978
|
var import_react_dialog = require("@radix-ui/react-dialog");
|
|
8536
|
-
var
|
|
8537
|
-
var CloseButton = (0,
|
|
8979
|
+
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
8980
|
+
var CloseButton = (0, import_styled_components53.default)(import_react_dialog.Close)`
|
|
8538
8981
|
align-self: start;
|
|
8539
8982
|
`;
|
|
8540
8983
|
var ModalCloseButton = () => {
|
|
8541
|
-
return /* @__PURE__ */ (0,
|
|
8984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(CloseButton, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8542
8985
|
IconButton,
|
|
8543
8986
|
{
|
|
8544
8987
|
label: "Dismiss modal",
|
|
8545
8988
|
size: "sm",
|
|
8546
8989
|
variant: "ghost",
|
|
8547
|
-
children: /* @__PURE__ */ (0,
|
|
8990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(Icon, { type: "close" })
|
|
8548
8991
|
}
|
|
8549
8992
|
) });
|
|
8550
8993
|
};
|
|
8551
8994
|
|
|
8552
|
-
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
8553
|
-
var import_styled_components48 = __toESM(require("styled-components"));
|
|
8554
|
-
var import_type_guards28 = require("@wistia/type-guards");
|
|
8555
|
-
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
8556
|
-
var VisuallyHidden = import_styled_components48.default.div({ ...visuallyHiddenStyle });
|
|
8557
|
-
var VisuallyHiddenButFocusable = import_styled_components48.default.div({
|
|
8558
|
-
"&:not(:focus-within)": visuallyHiddenStyle
|
|
8559
|
-
});
|
|
8560
|
-
var ScreenReaderOnly = ({
|
|
8561
|
-
text,
|
|
8562
|
-
children,
|
|
8563
|
-
focusable = false,
|
|
8564
|
-
...otherProps
|
|
8565
|
-
}) => {
|
|
8566
|
-
const accessibleText = (0, import_type_guards28.isNotNil)(text) ? text : children;
|
|
8567
|
-
if (focusable) {
|
|
8568
|
-
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
8569
|
-
}
|
|
8570
|
-
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
8571
|
-
};
|
|
8572
|
-
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
8573
|
-
|
|
8574
8995
|
// src/components/Modal/ModalHeader.tsx
|
|
8575
|
-
var
|
|
8576
|
-
var Header =
|
|
8996
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
8997
|
+
var Header = import_styled_components54.default.header`
|
|
8577
8998
|
display: flex;
|
|
8578
8999
|
order: 1;
|
|
8579
9000
|
gap: var(--wui-space-01);
|
|
@@ -8585,7 +9006,7 @@ var Header = import_styled_components49.default.header`
|
|
|
8585
9006
|
margin-top: 0;
|
|
8586
9007
|
}
|
|
8587
9008
|
`;
|
|
8588
|
-
var Title = (0,
|
|
9009
|
+
var Title = (0, import_styled_components54.default)(import_react_dialog2.Title)`
|
|
8589
9010
|
font-family: var(--wui-typography-heading-2-family);
|
|
8590
9011
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
8591
9012
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -8597,28 +9018,28 @@ var ModalHeader = ({
|
|
|
8597
9018
|
hideCloseButton
|
|
8598
9019
|
}) => {
|
|
8599
9020
|
const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
|
|
8600
|
-
return /* @__PURE__ */ (0,
|
|
8601
|
-
/* @__PURE__ */ (0,
|
|
8602
|
-
hideCloseButton ? null : /* @__PURE__ */ (0,
|
|
9021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(Header, { children: [
|
|
9022
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(TitleWrapper, { children: title }),
|
|
9023
|
+
hideCloseButton ? null : /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(ModalCloseButton, {})
|
|
8603
9024
|
] });
|
|
8604
9025
|
};
|
|
8605
9026
|
|
|
8606
9027
|
// src/components/Modal/ModalContent.tsx
|
|
8607
|
-
var
|
|
8608
|
-
var
|
|
9028
|
+
var import_react38 = require("react");
|
|
9029
|
+
var import_styled_components55 = __toESM(require("styled-components"));
|
|
8609
9030
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
8610
9031
|
|
|
8611
9032
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
8612
|
-
var
|
|
8613
|
-
var
|
|
9033
|
+
var import_react37 = require("react");
|
|
9034
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
8614
9035
|
var useFocusRestore = () => {
|
|
8615
|
-
const previouslyFocusedRef = (0,
|
|
8616
|
-
(0,
|
|
9036
|
+
const previouslyFocusedRef = (0, import_react37.useRef)(null);
|
|
9037
|
+
(0, import_react37.useEffect)(() => {
|
|
8617
9038
|
previouslyFocusedRef.current = document.activeElement;
|
|
8618
9039
|
}, []);
|
|
8619
|
-
(0,
|
|
9040
|
+
(0, import_react37.useEffect)(() => {
|
|
8620
9041
|
return () => {
|
|
8621
|
-
if ((0,
|
|
9042
|
+
if ((0, import_type_guards30.isNotNil)(previouslyFocusedRef.current)) {
|
|
8622
9043
|
setTimeout(() => {
|
|
8623
9044
|
previouslyFocusedRef.current?.focus();
|
|
8624
9045
|
}, 0);
|
|
@@ -8628,8 +9049,8 @@ var useFocusRestore = () => {
|
|
|
8628
9049
|
};
|
|
8629
9050
|
|
|
8630
9051
|
// src/components/Modal/ModalContent.tsx
|
|
8631
|
-
var
|
|
8632
|
-
var StyledModalContent = (0,
|
|
9052
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
9053
|
+
var StyledModalContent = (0, import_styled_components55.default)(import_react_dialog3.Content)`
|
|
8633
9054
|
background-color: var(--wui-color-bg-app);
|
|
8634
9055
|
box-sizing: border-box;
|
|
8635
9056
|
display: flex;
|
|
@@ -8670,10 +9091,10 @@ var StyledModalContent = (0, import_styled_components50.default)(import_react_di
|
|
|
8670
9091
|
}
|
|
8671
9092
|
}
|
|
8672
9093
|
`;
|
|
8673
|
-
var ModalContent = (0,
|
|
9094
|
+
var ModalContent = (0, import_react38.forwardRef)(
|
|
8674
9095
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
8675
9096
|
useFocusRestore();
|
|
8676
|
-
return /* @__PURE__ */ (0,
|
|
9097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8677
9098
|
StyledModalContent,
|
|
8678
9099
|
{
|
|
8679
9100
|
ref,
|
|
@@ -8688,9 +9109,9 @@ var ModalContent = (0, import_react37.forwardRef)(
|
|
|
8688
9109
|
);
|
|
8689
9110
|
|
|
8690
9111
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
8691
|
-
var
|
|
8692
|
-
var
|
|
8693
|
-
var
|
|
9112
|
+
var import_react39 = require("react");
|
|
9113
|
+
var import_styled_components56 = __toESM(require("styled-components"));
|
|
9114
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8694
9115
|
var backdropAnimationDuration = 150;
|
|
8695
9116
|
var alignVerticalMap = {
|
|
8696
9117
|
stretch: "normal",
|
|
@@ -8703,7 +9124,7 @@ var alignHorizontalMap = {
|
|
|
8703
9124
|
center: "center",
|
|
8704
9125
|
right: "end"
|
|
8705
9126
|
};
|
|
8706
|
-
var BackdropComponent =
|
|
9127
|
+
var BackdropComponent = import_styled_components56.default.div`
|
|
8707
9128
|
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
8708
9129
|
animation-name: backdropShow;
|
|
8709
9130
|
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
@@ -8726,8 +9147,8 @@ var BackdropComponent = import_styled_components51.default.div`
|
|
|
8726
9147
|
}
|
|
8727
9148
|
}
|
|
8728
9149
|
`;
|
|
8729
|
-
var Backdrop = (0,
|
|
8730
|
-
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
9150
|
+
var Backdrop = (0, import_react39.forwardRef)(
|
|
9151
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8731
9152
|
BackdropComponent,
|
|
8732
9153
|
{
|
|
8733
9154
|
ref,
|
|
@@ -8741,14 +9162,14 @@ var Backdrop = (0, import_react38.forwardRef)(
|
|
|
8741
9162
|
Backdrop.displayName = "Backdrop";
|
|
8742
9163
|
|
|
8743
9164
|
// src/components/Modal/Modal.tsx
|
|
8744
|
-
var
|
|
9165
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
8745
9166
|
var DEFAULT_MODAL_WIDTH = "532px";
|
|
8746
|
-
var ModalBody =
|
|
9167
|
+
var ModalBody = import_styled_components57.default.div`
|
|
8747
9168
|
flex-direction: column;
|
|
8748
9169
|
display: flex;
|
|
8749
9170
|
order: 2;
|
|
8750
9171
|
`;
|
|
8751
|
-
var Modal = (0,
|
|
9172
|
+
var Modal = (0, import_react40.forwardRef)(
|
|
8752
9173
|
({
|
|
8753
9174
|
children,
|
|
8754
9175
|
fullHeight = false,
|
|
@@ -8761,24 +9182,24 @@ var Modal = (0, import_react39.forwardRef)(
|
|
|
8761
9182
|
width = DEFAULT_MODAL_WIDTH,
|
|
8762
9183
|
...props
|
|
8763
9184
|
}, ref) => {
|
|
8764
|
-
return /* @__PURE__ */ (0,
|
|
9185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
8765
9186
|
import_react_dialog4.Root,
|
|
8766
9187
|
{
|
|
8767
9188
|
onOpenChange: (open2) => {
|
|
8768
|
-
if (!open2 && (0,
|
|
9189
|
+
if (!open2 && (0, import_type_guards31.isNotNil)(onRequestClose)) {
|
|
8769
9190
|
onRequestClose();
|
|
8770
9191
|
}
|
|
8771
9192
|
},
|
|
8772
9193
|
open: isOpen,
|
|
8773
|
-
children: /* @__PURE__ */ (0,
|
|
8774
|
-
/* @__PURE__ */ (0,
|
|
8775
|
-
/* @__PURE__ */ (0,
|
|
9194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(import_react_dialog4.Portal, { children: [
|
|
9195
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Backdrop, {}),
|
|
9196
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
8776
9197
|
ModalContent,
|
|
8777
9198
|
{
|
|
8778
9199
|
ref,
|
|
8779
9200
|
fullHeight,
|
|
8780
9201
|
onOpenAutoFocus: (event) => {
|
|
8781
|
-
if ((0,
|
|
9202
|
+
if ((0, import_type_guards31.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
8782
9203
|
event.preventDefault();
|
|
8783
9204
|
requestAnimationFrame(() => {
|
|
8784
9205
|
initialFocusRef.current?.focus();
|
|
@@ -8788,8 +9209,8 @@ var Modal = (0, import_react39.forwardRef)(
|
|
|
8788
9209
|
width,
|
|
8789
9210
|
...props,
|
|
8790
9211
|
children: [
|
|
8791
|
-
/* @__PURE__ */ (0,
|
|
8792
|
-
/* @__PURE__ */ (0,
|
|
9212
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(ModalBody, { children }),
|
|
9213
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
8793
9214
|
ModalHeader,
|
|
8794
9215
|
{
|
|
8795
9216
|
hideCloseButton,
|
|
@@ -8808,16 +9229,16 @@ var Modal = (0, import_react39.forwardRef)(
|
|
|
8808
9229
|
Modal.displayName = "Modal";
|
|
8809
9230
|
|
|
8810
9231
|
// src/components/Radio/Radio.tsx
|
|
8811
|
-
var
|
|
8812
|
-
var
|
|
8813
|
-
var
|
|
8814
|
-
var
|
|
8815
|
-
var StyledLabelWrapper2 =
|
|
9232
|
+
var import_react41 = require("react");
|
|
9233
|
+
var import_styled_components58 = __toESM(require("styled-components"));
|
|
9234
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9235
|
+
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
9236
|
+
var StyledLabelWrapper2 = import_styled_components58.default.div`
|
|
8816
9237
|
display: flex;
|
|
8817
9238
|
flex-direction: column;
|
|
8818
9239
|
padding-left: var(--wui-space-02);
|
|
8819
9240
|
`;
|
|
8820
|
-
var StyledRadio =
|
|
9241
|
+
var StyledRadio = import_styled_components58.default.input`
|
|
8821
9242
|
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
8822
9243
|
appearance: none;
|
|
8823
9244
|
margin: 0;
|
|
@@ -8843,11 +9264,11 @@ var StyledRadio = import_styled_components53.default.input`
|
|
|
8843
9264
|
transform: scale(1);
|
|
8844
9265
|
}
|
|
8845
9266
|
`;
|
|
8846
|
-
var disabledStyle2 =
|
|
9267
|
+
var disabledStyle2 = import_styled_components58.css`
|
|
8847
9268
|
cursor: not-allowed;
|
|
8848
9269
|
opacity: 0.5;
|
|
8849
9270
|
`;
|
|
8850
|
-
var errorStyle =
|
|
9271
|
+
var errorStyle = import_styled_components58.css`
|
|
8851
9272
|
/* TODO Lamp to design error state */
|
|
8852
9273
|
&:hover,
|
|
8853
9274
|
&:focus,
|
|
@@ -8855,11 +9276,11 @@ var errorStyle = import_styled_components53.css`
|
|
|
8855
9276
|
border-color: transparent !important;
|
|
8856
9277
|
}
|
|
8857
9278
|
`;
|
|
8858
|
-
var defaultHoverStyle =
|
|
9279
|
+
var defaultHoverStyle = import_styled_components58.css`
|
|
8859
9280
|
/* TODO Lamp to design hover state */
|
|
8860
9281
|
cursor: pointer;
|
|
8861
9282
|
`;
|
|
8862
|
-
var StyledRadioWrapper =
|
|
9283
|
+
var StyledRadioWrapper = import_styled_components58.default.div`
|
|
8863
9284
|
align-items: baseline;
|
|
8864
9285
|
border: 1px solid transparent;
|
|
8865
9286
|
border-radius: 4px;
|
|
@@ -8882,7 +9303,7 @@ var StyledRadioWrapper = import_styled_components53.default.div`
|
|
|
8882
9303
|
|
|
8883
9304
|
${({ disabled }) => disabled && disabledStyle2};
|
|
8884
9305
|
`;
|
|
8885
|
-
var Radio = (0,
|
|
9306
|
+
var Radio = (0, import_react41.forwardRef)(
|
|
8886
9307
|
({
|
|
8887
9308
|
checked,
|
|
8888
9309
|
disabled = false,
|
|
@@ -8895,15 +9316,15 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8895
9316
|
value = "false",
|
|
8896
9317
|
...otherProps
|
|
8897
9318
|
}, ref) => {
|
|
8898
|
-
const generatedId = (0,
|
|
8899
|
-
const computedId = (0,
|
|
8900
|
-
return /* @__PURE__ */ (0,
|
|
9319
|
+
const generatedId = (0, import_react41.useId)();
|
|
9320
|
+
const computedId = (0, import_type_guards32.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
|
|
9321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(
|
|
8901
9322
|
StyledRadioWrapper,
|
|
8902
9323
|
{
|
|
8903
9324
|
"aria-invalid": otherProps["aria-invalid"],
|
|
8904
9325
|
disabled,
|
|
8905
9326
|
children: [
|
|
8906
|
-
/* @__PURE__ */ (0,
|
|
9327
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
8907
9328
|
StyledRadio,
|
|
8908
9329
|
{
|
|
8909
9330
|
ref,
|
|
@@ -8918,8 +9339,8 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8918
9339
|
...otherProps
|
|
8919
9340
|
}
|
|
8920
9341
|
),
|
|
8921
|
-
/* @__PURE__ */ (0,
|
|
8922
|
-
/* @__PURE__ */ (0,
|
|
9342
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(StyledLabelWrapper2, { children: [
|
|
9343
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
8923
9344
|
Label,
|
|
8924
9345
|
{
|
|
8925
9346
|
disabled,
|
|
@@ -8928,7 +9349,7 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8928
9349
|
children: label
|
|
8929
9350
|
}
|
|
8930
9351
|
),
|
|
8931
|
-
/* @__PURE__ */ (0,
|
|
9352
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(LabelDescription, { children: description })
|
|
8932
9353
|
] })
|
|
8933
9354
|
]
|
|
8934
9355
|
}
|
|
@@ -8938,497 +9359,234 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8938
9359
|
Radio.displayName = "Radio";
|
|
8939
9360
|
|
|
8940
9361
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
8941
|
-
var import_react41 = require("react");
|
|
8942
|
-
var import_styled_components54 = __toESM(require("styled-components"));
|
|
8943
|
-
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
8944
|
-
var import_type_guards32 = require("@wistia/type-guards");
|
|
8945
|
-
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
8946
|
-
var StyledSegmentedControl = (0, import_styled_components54.default)(import_react_toggle_group.Root)`
|
|
8947
|
-
display: inline-flex;
|
|
8948
|
-
background-color: var(--wui-color-bg-surface-secondary);
|
|
8949
|
-
border-radius: var(--wui-border-radius-rounded);
|
|
8950
|
-
border: 2px solid var(--wui-color-bg-surface-secondary);
|
|
8951
|
-
gap: var(--wui-space-01);
|
|
8952
|
-
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
8953
|
-
`;
|
|
8954
|
-
var SegmentedControl = (0, import_react41.forwardRef)(
|
|
8955
|
-
({
|
|
8956
|
-
children,
|
|
8957
|
-
disabled = false,
|
|
8958
|
-
fullWidth = false,
|
|
8959
|
-
selectedValue,
|
|
8960
|
-
onSelectedValueChange,
|
|
8961
|
-
...props
|
|
8962
|
-
}, ref) => {
|
|
8963
|
-
if ((0, import_type_guards32.isNil)(children)) {
|
|
8964
|
-
return null;
|
|
8965
|
-
}
|
|
8966
|
-
return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8967
|
-
StyledSegmentedControl,
|
|
8968
|
-
{
|
|
8969
|
-
ref,
|
|
8970
|
-
$fullWidth: fullWidth,
|
|
8971
|
-
disabled,
|
|
8972
|
-
loop: true,
|
|
8973
|
-
onValueChange: onSelectedValueChange,
|
|
8974
|
-
rovingFocus: true,
|
|
8975
|
-
type: "single",
|
|
8976
|
-
value: selectedValue,
|
|
8977
|
-
...props,
|
|
8978
|
-
children
|
|
8979
|
-
}
|
|
8980
|
-
);
|
|
8981
|
-
}
|
|
8982
|
-
);
|
|
8983
|
-
SegmentedControl.displayName = "SegmentedControl";
|
|
8984
|
-
|
|
8985
|
-
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
8986
9362
|
var import_react42 = require("react");
|
|
8987
|
-
var
|
|
8988
|
-
var
|
|
8989
|
-
var import_type_guards33 = require("@wistia/type-guards");
|
|
8990
|
-
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8991
|
-
var StyledSegmentedControlItem = (0, import_styled_components55.default)(import_react_toggle_group2.Item)`
|
|
8992
|
-
all: unset; /* ToggleGroupItem is a button element */
|
|
8993
|
-
align-items: center;
|
|
8994
|
-
border-radius: var(--wui-border-radius-rounded);
|
|
8995
|
-
color: var(--wui-color-text-secondary);
|
|
8996
|
-
cursor: pointer;
|
|
8997
|
-
display: flex;
|
|
8998
|
-
flex-grow: 1;
|
|
8999
|
-
flex-shrink: 1;
|
|
9000
|
-
font-size: var(--wui-typography-label-3-size);
|
|
9001
|
-
justify-content: center;
|
|
9002
|
-
padding: 6px 8px;
|
|
9003
|
-
user-select: none;
|
|
9004
|
-
|
|
9005
|
-
/* Icon component */
|
|
9006
|
-
svg {
|
|
9007
|
-
height: 16px;
|
|
9008
|
-
width: 16px;
|
|
9009
|
-
|
|
9010
|
-
/* add right margin if there's a label and an icon */
|
|
9011
|
-
${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
|
|
9012
|
-
}
|
|
9013
|
-
|
|
9014
|
-
&:hover {
|
|
9015
|
-
background-color: var(--wui-color-bg-surface-secondary-hover);
|
|
9016
|
-
}
|
|
9017
|
-
|
|
9018
|
-
&:focus-visible {
|
|
9019
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
9020
|
-
}
|
|
9021
|
-
|
|
9022
|
-
&[data-state='on'] {
|
|
9023
|
-
background-color: var(--wui-color-bg-fill-white);
|
|
9024
|
-
color: var(--wui-color-text-selected);
|
|
9025
|
-
cursor: default;
|
|
9026
|
-
}
|
|
9027
|
-
|
|
9028
|
-
&:focus-visible,
|
|
9029
|
-
&[data-state='on'] {
|
|
9030
|
-
svg path {
|
|
9031
|
-
fill: var(--wui-color-focus-ring);
|
|
9032
|
-
}
|
|
9033
|
-
}
|
|
9034
|
-
|
|
9035
|
-
&[data-disabled] {
|
|
9036
|
-
cursor: not-allowed;
|
|
9037
|
-
|
|
9038
|
-
&:hover {
|
|
9039
|
-
background-color: inherit;
|
|
9040
|
-
}
|
|
9041
|
-
}
|
|
9042
|
-
`;
|
|
9043
|
-
var SegmentedControlItem = (0, import_react42.forwardRef)(
|
|
9044
|
-
({ disabled, icon, label, "aria-label": ariaLabel, value }, ref) => {
|
|
9045
|
-
const handleClick = (event) => {
|
|
9046
|
-
const target = event.target;
|
|
9047
|
-
const { state } = target.dataset;
|
|
9048
|
-
if (state === "on") {
|
|
9049
|
-
event.preventDefault();
|
|
9050
|
-
}
|
|
9051
|
-
};
|
|
9052
|
-
return /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
|
|
9053
|
-
StyledSegmentedControlItem,
|
|
9054
|
-
{
|
|
9055
|
-
ref,
|
|
9056
|
-
$hasLabel: (0, import_type_guards33.isNotNil)(label),
|
|
9057
|
-
"aria-label": (0, import_type_guards33.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9058
|
-
disabled,
|
|
9059
|
-
onClick: handleClick,
|
|
9060
|
-
value,
|
|
9061
|
-
children: [
|
|
9062
|
-
icon,
|
|
9063
|
-
label
|
|
9064
|
-
]
|
|
9065
|
-
}
|
|
9066
|
-
);
|
|
9067
|
-
}
|
|
9068
|
-
);
|
|
9069
|
-
SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
9070
|
-
|
|
9071
|
-
// src/components/Tag/Tag.tsx
|
|
9072
|
-
var import_react43 = require("react");
|
|
9073
|
-
var import_styled_components56 = __toESM(require("styled-components"));
|
|
9363
|
+
var import_styled_components59 = __toESM(require("styled-components"));
|
|
9364
|
+
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
9074
9365
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9075
|
-
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
9076
|
-
var TagLabel = import_styled_components56.default.a`
|
|
9077
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9078
|
-
font-size: var(--wui-typography-label-4-size);
|
|
9079
|
-
font-weight: var(--wui-typography-label-4-weight);
|
|
9080
|
-
line-height: var(--wui-typography-label-4-line-height);
|
|
9081
|
-
border-radius: var(--wui-border-radius-01);
|
|
9082
|
-
align-items: center;
|
|
9083
|
-
color: var(--wui-color-text);
|
|
9084
|
-
text-decoration: none;
|
|
9085
|
-
padding: var(--wui-space-01);
|
|
9086
|
-
|
|
9087
|
-
:not(:only-child) {
|
|
9088
|
-
padding-right: var(--wui-space-01);
|
|
9089
|
-
}
|
|
9090
|
-
|
|
9091
|
-
:is(a):hover {
|
|
9092
|
-
background: var(--wui-color-bg-surface-secondary-hover);
|
|
9093
|
-
}
|
|
9094
|
-
|
|
9095
|
-
:is(a):active {
|
|
9096
|
-
background: var(--wui-color-bg-surface-secondary-active);
|
|
9097
|
-
}
|
|
9098
|
-
|
|
9099
|
-
:focus-visible {
|
|
9100
|
-
outline: unset;
|
|
9101
|
-
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9102
|
-
}
|
|
9103
|
-
`;
|
|
9104
|
-
var TagDivider = import_styled_components56.default.div`
|
|
9105
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9106
|
-
border-left: 1px solid var(--wui-color-border);
|
|
9107
|
-
display: flex;
|
|
9108
|
-
height: 14px;
|
|
9109
|
-
width: 1px;
|
|
9110
|
-
`;
|
|
9111
|
-
var StyledRemoveButton = import_styled_components56.default.button`
|
|
9112
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9113
|
-
all: unset;
|
|
9114
|
-
cursor: pointer;
|
|
9115
|
-
display: flex;
|
|
9116
|
-
height: 22px;
|
|
9117
|
-
width: 12px;
|
|
9118
|
-
align-items: center;
|
|
9119
|
-
padding: 0 var(--wui-space-01);
|
|
9120
|
-
border-radius: var(--wui-border-radius-01);
|
|
9121
9366
|
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9367
|
+
// src/private/helpers/mergeRefs/mergeRefs.ts
|
|
9368
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
9369
|
+
var mergeRefs = (refs) => (value) => {
|
|
9370
|
+
refs.forEach((ref) => {
|
|
9371
|
+
if ((0, import_type_guards33.isFunction)(ref)) {
|
|
9372
|
+
ref(value);
|
|
9373
|
+
return;
|
|
9374
|
+
}
|
|
9375
|
+
if ((0, import_type_guards33.isNotNil)(ref)) {
|
|
9376
|
+
ref.current = value;
|
|
9377
|
+
}
|
|
9378
|
+
});
|
|
9379
|
+
};
|
|
9129
9380
|
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9381
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
9382
|
+
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
9383
|
+
var segmentedControlStyles = import_styled_components59.css`
|
|
9384
|
+
--wui-segmented-border-width: 2px;
|
|
9133
9385
|
|
|
9134
|
-
:focus-visible {
|
|
9135
|
-
outline: unset;
|
|
9136
|
-
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9137
|
-
}
|
|
9138
|
-
`;
|
|
9139
|
-
var StyledTag = import_styled_components56.default.div`
|
|
9140
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9141
|
-
align-items: center;
|
|
9142
|
-
background-color: var(--wui-color-bg-surface-secondary);
|
|
9143
|
-
border-radius: var(--wui-border-radius-01);
|
|
9144
9386
|
display: inline-flex;
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
}
|
|
9387
|
+
background-color: var(--wui-color-bg-surface-secondary);
|
|
9388
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
9389
|
+
border: var(--wui-segmented-border-width) solid var(--wui-color-bg-surface-secondary);
|
|
9390
|
+
gap: var(--wui-space-01);
|
|
9391
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
9392
|
+
position: relative;
|
|
9150
9393
|
`;
|
|
9151
|
-
var
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9394
|
+
var StyledSegmentedControl = (0, import_styled_components59.default)(import_react_toggle_group.Root)`
|
|
9395
|
+
${segmentedControlStyles}
|
|
9396
|
+
`;
|
|
9397
|
+
var StyledSegmentedControlActiveBackground = import_styled_components59.default.div`
|
|
9398
|
+
background: var(--wui-color-bg-fill-white);
|
|
9399
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
9400
|
+
width: ${({ $width }) => $width}px;
|
|
9401
|
+
transform: translateX(${({ $xPosition }) => $xPosition}px);
|
|
9402
|
+
height: ${({ $height }) => $height}px;
|
|
9403
|
+
position: absolute;
|
|
9404
|
+
top: 0;
|
|
9405
|
+
left: 0;
|
|
9406
|
+
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease-out);
|
|
9407
|
+
pointer-events: none;
|
|
9408
|
+
z-index: 0;
|
|
9409
|
+
box-shadow: var(--wui-elevation-01);
|
|
9410
|
+
outline: var(--wui-segmented-control-active-background-focus-ring-color) solid 2px;
|
|
9411
|
+
`;
|
|
9412
|
+
var SegmentedControlContext = (0, import_react42.createContext)(null);
|
|
9413
|
+
var useSegmentedControlContext = () => {
|
|
9414
|
+
const context = (0, import_react42.useContext)(SegmentedControlContext);
|
|
9415
|
+
if (!context) {
|
|
9416
|
+
throw new Error("useSegmentedControl must be used within a SegmentedControl");
|
|
9159
9417
|
}
|
|
9160
|
-
return
|
|
9161
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
9162
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
|
|
9163
|
-
StyledRemoveButton,
|
|
9164
|
-
{
|
|
9165
|
-
$colorScheme: colorScheme,
|
|
9166
|
-
onClick: onClickRemove,
|
|
9167
|
-
type: "button",
|
|
9168
|
-
children: [
|
|
9169
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
9170
|
-
Icon,
|
|
9171
|
-
{
|
|
9172
|
-
size: "sm",
|
|
9173
|
-
type: "close"
|
|
9174
|
-
}
|
|
9175
|
-
),
|
|
9176
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
9177
|
-
]
|
|
9178
|
-
}
|
|
9179
|
-
)
|
|
9180
|
-
] });
|
|
9418
|
+
return context;
|
|
9181
9419
|
};
|
|
9182
|
-
var
|
|
9183
|
-
({
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9420
|
+
var SegmentedControl = (0, import_react42.forwardRef)(
|
|
9421
|
+
({
|
|
9422
|
+
children,
|
|
9423
|
+
disabled = false,
|
|
9424
|
+
fullWidth = false,
|
|
9425
|
+
selectedValue,
|
|
9426
|
+
onSelectedValueChange,
|
|
9427
|
+
...props
|
|
9428
|
+
}, ref) => {
|
|
9429
|
+
const containerRef = (0, import_react42.useRef)(null);
|
|
9430
|
+
const combinedRef = mergeRefs([ref, containerRef]);
|
|
9431
|
+
const [selectedItemMetrics, setSelectedItemMetrics] = (0, import_react42.useState)({
|
|
9432
|
+
width: 0,
|
|
9433
|
+
xOffset: 0,
|
|
9434
|
+
height: 0
|
|
9435
|
+
});
|
|
9436
|
+
const contextValue = (0, import_react42.useMemo)(
|
|
9437
|
+
() => ({
|
|
9438
|
+
selectedValue,
|
|
9439
|
+
setSelectedItemMetrics
|
|
9440
|
+
}),
|
|
9441
|
+
[selectedValue]
|
|
9442
|
+
);
|
|
9443
|
+
if ((0, import_type_guards34.isNil)(children)) {
|
|
9444
|
+
return null;
|
|
9445
|
+
}
|
|
9446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(SegmentedControlContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
|
|
9447
|
+
StyledSegmentedControl,
|
|
9187
9448
|
{
|
|
9188
|
-
ref,
|
|
9189
|
-
$
|
|
9190
|
-
|
|
9449
|
+
ref: combinedRef,
|
|
9450
|
+
$fullWidth: fullWidth,
|
|
9451
|
+
disabled,
|
|
9452
|
+
loop: true,
|
|
9453
|
+
onValueChange: onSelectedValueChange,
|
|
9454
|
+
rovingFocus: true,
|
|
9455
|
+
type: "single",
|
|
9456
|
+
value: selectedValue,
|
|
9457
|
+
...props,
|
|
9191
9458
|
children: [
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
...labelProps,
|
|
9196
|
-
$colorScheme: colorScheme,
|
|
9197
|
-
children: label
|
|
9198
|
-
}
|
|
9199
|
-
),
|
|
9200
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
9201
|
-
RemoveButton,
|
|
9459
|
+
children,
|
|
9460
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
9461
|
+
StyledSegmentedControlActiveBackground,
|
|
9202
9462
|
{
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9463
|
+
$height: selectedItemMetrics.height,
|
|
9464
|
+
$width: selectedItemMetrics.width,
|
|
9465
|
+
$xPosition: selectedItemMetrics.xOffset
|
|
9206
9466
|
}
|
|
9207
9467
|
)
|
|
9208
9468
|
]
|
|
9209
9469
|
}
|
|
9210
|
-
);
|
|
9470
|
+
) });
|
|
9211
9471
|
}
|
|
9212
9472
|
);
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
// src/components/Tooltip/Tooltip.tsx
|
|
9216
|
-
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
9217
|
-
var import_styled_components57 = __toESM(require("styled-components"));
|
|
9218
|
-
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
9219
|
-
var CompactTooltipStyles = import_styled_components57.css`
|
|
9220
|
-
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
9221
|
-
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
9222
|
-
--tooltip-font-weight: var(--wui-typography-label-4-weight);
|
|
9223
|
-
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
9224
|
-
--tooltip-vertical-padding: var(--wui-space-03);
|
|
9225
|
-
`;
|
|
9226
|
-
var StyledContent = (0, import_styled_components57.default)(import_react_tooltip2.Content)`
|
|
9227
|
-
--tooltip-font-family: var(--wui-typography-family-default);
|
|
9228
|
-
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
9229
|
-
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
9230
|
-
--tooltip-color: var(--wui-color-text-on-fill);
|
|
9231
|
-
--tooltip-font-size: var(--wui-typography-label-3-size);
|
|
9232
|
-
--tooltip-line-height: var(--wui-typography-label-3-line-height);
|
|
9233
|
-
--tooltip-font-weight: var(--wui-typography-label-3-weight);
|
|
9234
|
-
--tooltip-horizontal-padding: var(--wui-space-03);
|
|
9235
|
-
--tooltip-vertical-padding: var(--wui-space-03);
|
|
9236
|
-
|
|
9237
|
-
${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
|
|
9473
|
+
SegmentedControl.displayName = "SegmentedControl";
|
|
9238
9474
|
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9475
|
+
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
9476
|
+
var import_react43 = require("react");
|
|
9477
|
+
var import_styled_components60 = __toESM(require("styled-components"));
|
|
9478
|
+
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
9479
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
9480
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
9481
|
+
var segmentedControlItemStyles = import_styled_components60.css`
|
|
9482
|
+
all: unset; /* ToggleGroupItem is a button element */
|
|
9483
|
+
align-items: center;
|
|
9484
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
9485
|
+
color: var(--wui-color-text-secondary);
|
|
9486
|
+
cursor: pointer;
|
|
9487
|
+
display: flex;
|
|
9488
|
+
flex-grow: 1;
|
|
9489
|
+
flex-shrink: 1;
|
|
9490
|
+
font-size: var(--wui-typography-label-3-size);
|
|
9491
|
+
font-weight: var(--wui-typography-label-3-weight);
|
|
9492
|
+
justify-content: center;
|
|
9493
|
+
padding: 6px 8px;
|
|
9245
9494
|
user-select: none;
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
will-change: transform, opacity;
|
|
9249
|
-
max-width: 30em;
|
|
9495
|
+
position: relative;
|
|
9496
|
+
z-index: 1;
|
|
9250
9497
|
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9498
|
+
/* Icon component */
|
|
9499
|
+
svg {
|
|
9500
|
+
height: 16px;
|
|
9501
|
+
width: 16px;
|
|
9254
9502
|
|
|
9255
|
-
|
|
9256
|
-
|
|
9503
|
+
/* add right margin if there's a label and an icon */
|
|
9504
|
+
${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
|
|
9257
9505
|
}
|
|
9258
9506
|
|
|
9259
|
-
|
|
9260
|
-
|
|
9507
|
+
&:hover {
|
|
9508
|
+
background-color: var(--wui-color-bg-surface-secondary-hover);
|
|
9261
9509
|
}
|
|
9262
9510
|
|
|
9263
|
-
&[
|
|
9264
|
-
|
|
9265
|
-
}
|
|
9266
|
-
`;
|
|
9267
|
-
var VISUAL_OFFSET = 6;
|
|
9268
|
-
var Tooltip = ({
|
|
9269
|
-
delay = 700,
|
|
9270
|
-
direction = "top",
|
|
9271
|
-
content,
|
|
9272
|
-
children,
|
|
9273
|
-
forceOpen,
|
|
9274
|
-
compact = false,
|
|
9275
|
-
hideArrow = false
|
|
9276
|
-
}) => {
|
|
9277
|
-
const rootProps = {};
|
|
9278
|
-
if (content === "" || content === null) {
|
|
9279
|
-
rootProps.open = false;
|
|
9280
|
-
}
|
|
9281
|
-
if (forceOpen === true) {
|
|
9282
|
-
rootProps.open = true;
|
|
9511
|
+
&[role='radio']:focus-visible {
|
|
9512
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
9283
9513
|
}
|
|
9284
|
-
return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
9285
|
-
import_react_tooltip2.Root,
|
|
9286
|
-
{
|
|
9287
|
-
delayDuration: delay,
|
|
9288
|
-
...rootProps,
|
|
9289
|
-
children: [
|
|
9290
|
-
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
9291
|
-
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
9292
|
-
StyledContent,
|
|
9293
|
-
{
|
|
9294
|
-
$compact: compact,
|
|
9295
|
-
side: direction,
|
|
9296
|
-
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
9297
|
-
children: [
|
|
9298
|
-
content,
|
|
9299
|
-
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
9300
|
-
"svg",
|
|
9301
|
-
{
|
|
9302
|
-
fill: "var(--tooltip-bg)",
|
|
9303
|
-
height: "8",
|
|
9304
|
-
style: { transform: "translateY(-2px)" },
|
|
9305
|
-
viewBox: "0 0 12 8",
|
|
9306
|
-
width: "12",
|
|
9307
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9308
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime206.jsx)("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" })
|
|
9309
|
-
}
|
|
9310
|
-
) }) : null
|
|
9311
|
-
]
|
|
9312
|
-
}
|
|
9313
|
-
) })
|
|
9314
|
-
]
|
|
9315
|
-
}
|
|
9316
|
-
);
|
|
9317
|
-
};
|
|
9318
|
-
Tooltip.displayName = "Tooltip";
|
|
9319
9514
|
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
var
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
fill: brandmarkColor,
|
|
9331
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("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" })
|
|
9332
|
-
}
|
|
9333
|
-
);
|
|
9334
|
-
}
|
|
9335
|
-
return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
9336
|
-
"g",
|
|
9337
|
-
{
|
|
9338
|
-
"data-testid": "ui-wistia-logo-brandmark",
|
|
9339
|
-
fill: brandmarkColor,
|
|
9340
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("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" })
|
|
9341
|
-
}
|
|
9342
|
-
);
|
|
9343
|
-
};
|
|
9344
|
-
var renderLogotype = (logotypeColor, iconOnly) => {
|
|
9345
|
-
if (iconOnly) {
|
|
9346
|
-
return null;
|
|
9347
|
-
}
|
|
9348
|
-
return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
9349
|
-
"g",
|
|
9350
|
-
{
|
|
9351
|
-
"data-testid": "ui-wistia-logo-logotype",
|
|
9352
|
-
fill: logotypeColor,
|
|
9353
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("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" })
|
|
9354
|
-
}
|
|
9355
|
-
);
|
|
9356
|
-
};
|
|
9357
|
-
var computedViewBox = (iconOnly) => {
|
|
9358
|
-
if (iconOnly) {
|
|
9359
|
-
return "0 0 34.4 26.78";
|
|
9515
|
+
/* note: react-toggle-group uses "on" and react-tabs uses "active" */
|
|
9516
|
+
&[data-state='on'],
|
|
9517
|
+
&[data-state='active'] {
|
|
9518
|
+
background-color: transparent;
|
|
9519
|
+
color: var(--wui-color-text-selected);
|
|
9520
|
+
cursor: default;
|
|
9521
|
+
|
|
9522
|
+
svg path {
|
|
9523
|
+
fill: var(--wui-color-focus-ring);
|
|
9524
|
+
}
|
|
9360
9525
|
}
|
|
9361
|
-
return "0 0 144 31.47";
|
|
9362
|
-
};
|
|
9363
|
-
var WistiaLogoComponent = import_styled_components58.default.svg`
|
|
9364
|
-
height: ${({ height }) => `${height}px`};
|
|
9365
9526
|
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9527
|
+
&[data-disabled] {
|
|
9528
|
+
cursor: not-allowed;
|
|
9529
|
+
color: var(--wui-color-text-disabled);
|
|
9369
9530
|
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9531
|
+
svg path {
|
|
9532
|
+
fill: var(--wui-color-icon-disabled);
|
|
9533
|
+
}
|
|
9534
|
+
|
|
9535
|
+
&:hover {
|
|
9536
|
+
background-color: inherit;
|
|
9373
9537
|
}
|
|
9374
9538
|
}
|
|
9375
9539
|
`;
|
|
9376
|
-
var
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
]
|
|
9420
|
-
}
|
|
9421
|
-
);
|
|
9422
|
-
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("a", { href, children: Logo }) : Logo;
|
|
9423
|
-
};
|
|
9424
|
-
WistiaLogo.displayName = "WistiaLogo";
|
|
9540
|
+
var StyledSegmentedControlItem = (0, import_styled_components60.default)(import_react_toggle_group2.Item)`
|
|
9541
|
+
${segmentedControlItemStyles}
|
|
9542
|
+
`;
|
|
9543
|
+
var SegmentedControlItem = (0, import_react43.forwardRef)(
|
|
9544
|
+
({ disabled, icon, label, "aria-label": ariaLabel, value }, ref) => {
|
|
9545
|
+
const itemRef = (0, import_react43.useRef)(null);
|
|
9546
|
+
const combinedRef = mergeRefs([ref, itemRef]);
|
|
9547
|
+
const { selectedValue, setSelectedItemMetrics } = useSegmentedControlContext();
|
|
9548
|
+
(0, import_react43.useEffect)(() => {
|
|
9549
|
+
if (value === selectedValue && itemRef.current) {
|
|
9550
|
+
setSelectedItemMetrics({
|
|
9551
|
+
width: itemRef.current.offsetWidth,
|
|
9552
|
+
xOffset: itemRef.current.offsetLeft,
|
|
9553
|
+
height: itemRef.current.offsetHeight
|
|
9554
|
+
});
|
|
9555
|
+
}
|
|
9556
|
+
}, [selectedValue, value, setSelectedItemMetrics]);
|
|
9557
|
+
const handleClick = (event) => {
|
|
9558
|
+
const target = event.target;
|
|
9559
|
+
const { state } = target.dataset;
|
|
9560
|
+
if (state === "on") {
|
|
9561
|
+
event.preventDefault();
|
|
9562
|
+
}
|
|
9563
|
+
};
|
|
9564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
|
|
9565
|
+
StyledSegmentedControlItem,
|
|
9566
|
+
{
|
|
9567
|
+
ref: combinedRef,
|
|
9568
|
+
$hasLabel: (0, import_type_guards35.isNotNil)(label),
|
|
9569
|
+
"aria-label": (0, import_type_guards35.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9570
|
+
"data-value": value,
|
|
9571
|
+
disabled,
|
|
9572
|
+
onClick: handleClick,
|
|
9573
|
+
value,
|
|
9574
|
+
children: [
|
|
9575
|
+
icon,
|
|
9576
|
+
label
|
|
9577
|
+
]
|
|
9578
|
+
}
|
|
9579
|
+
);
|
|
9580
|
+
}
|
|
9581
|
+
);
|
|
9582
|
+
SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
9425
9583
|
|
|
9426
9584
|
// src/components/Select/Select.tsx
|
|
9427
9585
|
var import_react_select = require("@radix-ui/react-select");
|
|
9428
9586
|
var import_react44 = require("react");
|
|
9429
|
-
var
|
|
9430
|
-
var
|
|
9431
|
-
var StyledTrigger = (0,
|
|
9587
|
+
var import_styled_components61 = __toESM(require("styled-components"));
|
|
9588
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
9589
|
+
var StyledTrigger = (0, import_styled_components61.default)(import_react_select.Trigger)`
|
|
9432
9590
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9433
9591
|
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
9434
9592
|
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -9469,7 +9627,7 @@ var StyledTrigger = (0, import_styled_components59.default)(import_react_select.
|
|
|
9469
9627
|
background-color: var(--wui-color-bg-surface-disabled);
|
|
9470
9628
|
}
|
|
9471
9629
|
`;
|
|
9472
|
-
var StyledContent2 = (0,
|
|
9630
|
+
var StyledContent2 = (0, import_styled_components61.default)(import_react_select.Content)`
|
|
9473
9631
|
--wui-select-content-border: var(--wui-color-border);
|
|
9474
9632
|
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
9475
9633
|
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -9487,435 +9645,639 @@ var StyledContent2 = (0, import_styled_components59.default)(import_react_select
|
|
|
9487
9645
|
`;
|
|
9488
9646
|
var Select = (0, import_react44.forwardRef)(
|
|
9489
9647
|
({
|
|
9490
|
-
colorScheme = "inherit",
|
|
9648
|
+
colorScheme = "inherit",
|
|
9649
|
+
children,
|
|
9650
|
+
onChange = () => null,
|
|
9651
|
+
placeholder = "Select...",
|
|
9652
|
+
fullWidth = false,
|
|
9653
|
+
...props
|
|
9654
|
+
}, forwardedRef) => {
|
|
9655
|
+
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
9656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
9657
|
+
import_react_select.Root,
|
|
9658
|
+
{
|
|
9659
|
+
...props,
|
|
9660
|
+
onValueChange: onChange,
|
|
9661
|
+
children: [
|
|
9662
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
9663
|
+
StyledTrigger,
|
|
9664
|
+
{
|
|
9665
|
+
ref: forwardedRef,
|
|
9666
|
+
$colorScheme: colorScheme,
|
|
9667
|
+
$fullWidth: responsiveFullWidth,
|
|
9668
|
+
...props,
|
|
9669
|
+
children: [
|
|
9670
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.Value, { placeholder }),
|
|
9671
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
9672
|
+
Icon,
|
|
9673
|
+
{
|
|
9674
|
+
size: "md",
|
|
9675
|
+
type: "caret-down"
|
|
9676
|
+
}
|
|
9677
|
+
)
|
|
9678
|
+
]
|
|
9679
|
+
}
|
|
9680
|
+
),
|
|
9681
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(StyledContent2, { position: "popper", children: [
|
|
9682
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(Icon, { type: "caret-up" }) }),
|
|
9683
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.Viewport, { children }),
|
|
9684
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(Icon, { type: "caret-down" }) })
|
|
9685
|
+
] }) })
|
|
9686
|
+
]
|
|
9687
|
+
}
|
|
9688
|
+
);
|
|
9689
|
+
}
|
|
9690
|
+
);
|
|
9691
|
+
Select.displayName = "Select";
|
|
9692
|
+
|
|
9693
|
+
// src/components/Select/SelectOption.tsx
|
|
9694
|
+
var import_react_select2 = require("@radix-ui/react-select");
|
|
9695
|
+
var import_react45 = require("react");
|
|
9696
|
+
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9697
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
9698
|
+
var StyledItem = (0, import_styled_components62.default)(import_react_select2.Item)`
|
|
9699
|
+
${variantStyleMap2.body3};
|
|
9700
|
+
display: flex;
|
|
9701
|
+
padding: var(--wui-select-option-padding);
|
|
9702
|
+
gap: var(--wui-select-option-inner-gap);
|
|
9703
|
+
font-size: var(--font-size);
|
|
9704
|
+
font-weight: var(--font-weight);
|
|
9705
|
+
border-radius: var(--wui-border-radius-01);
|
|
9706
|
+
|
|
9707
|
+
&:hover,
|
|
9708
|
+
&:focus-visible {
|
|
9709
|
+
background-color: var(--wui-select-option-bg-hover);
|
|
9710
|
+
outline: none;
|
|
9711
|
+
}
|
|
9712
|
+
|
|
9713
|
+
&[aria-disabled='true'] {
|
|
9714
|
+
color: var(--wui-color-text-disabled);
|
|
9715
|
+
}
|
|
9716
|
+
|
|
9717
|
+
&[aria-disabled='true']:hover {
|
|
9718
|
+
background-color: transparent;
|
|
9719
|
+
}
|
|
9720
|
+
`;
|
|
9721
|
+
var StyledIconContainer = import_styled_components62.default.span`
|
|
9722
|
+
width: 12px;
|
|
9723
|
+
`;
|
|
9724
|
+
var SelectOption = (0, import_react45.forwardRef)(
|
|
9725
|
+
({ children, ...props }, forwardedRef) => {
|
|
9726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
|
|
9727
|
+
StyledItem,
|
|
9728
|
+
{
|
|
9729
|
+
...props,
|
|
9730
|
+
ref: forwardedRef,
|
|
9731
|
+
children: [
|
|
9732
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledIconContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(import_react_select2.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9733
|
+
Icon,
|
|
9734
|
+
{
|
|
9735
|
+
size: "sm",
|
|
9736
|
+
type: "checkmark"
|
|
9737
|
+
}
|
|
9738
|
+
) }) }),
|
|
9739
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(import_react_select2.ItemText, { children })
|
|
9740
|
+
]
|
|
9741
|
+
}
|
|
9742
|
+
);
|
|
9743
|
+
}
|
|
9744
|
+
);
|
|
9745
|
+
SelectOption.displayName = "Option";
|
|
9746
|
+
|
|
9747
|
+
// src/components/Select/SelectOptionGroup.tsx
|
|
9748
|
+
var import_react_select3 = require("@radix-ui/react-select");
|
|
9749
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9750
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
9751
|
+
var StyledLabel4 = (0, import_styled_components63.default)(import_react_select3.Label)`
|
|
9752
|
+
padding: var(--wui-select-option-padding);
|
|
9753
|
+
`;
|
|
9754
|
+
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
9755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(import_react_select3.Group, { ...props, children: [
|
|
9756
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledLabel4, { children: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
9757
|
+
Text,
|
|
9758
|
+
{
|
|
9759
|
+
prominence: "secondary",
|
|
9760
|
+
variant: "body3",
|
|
9761
|
+
children: label
|
|
9762
|
+
}
|
|
9763
|
+
) }),
|
|
9764
|
+
children
|
|
9765
|
+
] });
|
|
9766
|
+
};
|
|
9767
|
+
|
|
9768
|
+
// src/components/Tabs/Tabs.tsx
|
|
9769
|
+
var import_react48 = require("react");
|
|
9770
|
+
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
9771
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
9772
|
+
|
|
9773
|
+
// src/components/Tabs/TabPanel.tsx
|
|
9774
|
+
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9775
|
+
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
9776
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
9777
|
+
var StyledTabPanel = (0, import_styled_components64.default)(import_react_tabs.Content)`
|
|
9778
|
+
display: flex;
|
|
9779
|
+
flex-direction: column;
|
|
9780
|
+
`;
|
|
9781
|
+
var TabPanel = ({ children, value, ...props }) => {
|
|
9782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
9783
|
+
StyledTabPanel,
|
|
9784
|
+
{
|
|
9785
|
+
value,
|
|
9786
|
+
...props,
|
|
9787
|
+
children
|
|
9788
|
+
}
|
|
9789
|
+
);
|
|
9790
|
+
};
|
|
9791
|
+
TabPanel.displayName = "TabPanel";
|
|
9792
|
+
|
|
9793
|
+
// src/components/Tabs/TabList.tsx
|
|
9794
|
+
var import_styled_components65 = __toESM(require("styled-components"));
|
|
9795
|
+
var import_react_tabs2 = require("@radix-ui/react-tabs");
|
|
9796
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
9797
|
+
var StyledTabList = (0, import_styled_components65.default)(import_react_tabs2.List)`
|
|
9798
|
+
${segmentedControlStyles}
|
|
9799
|
+
|
|
9800
|
+
&:has(:focus-visible) {
|
|
9801
|
+
--wui-segmented-control-active-background-focus-ring-color: var(--wui-color-focus-ring);
|
|
9802
|
+
}
|
|
9803
|
+
|
|
9804
|
+
margin-bottom: var(--wui-space-04);
|
|
9805
|
+
`;
|
|
9806
|
+
var TabList = ({
|
|
9807
|
+
children,
|
|
9808
|
+
fullWidth,
|
|
9809
|
+
ariaLabel,
|
|
9810
|
+
...props
|
|
9811
|
+
}) => {
|
|
9812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
9813
|
+
StyledTabList,
|
|
9814
|
+
{
|
|
9815
|
+
$fullWidth: fullWidth,
|
|
9816
|
+
"aria-label": ariaLabel,
|
|
9817
|
+
...props,
|
|
9818
|
+
children
|
|
9819
|
+
}
|
|
9820
|
+
);
|
|
9821
|
+
};
|
|
9822
|
+
TabList.displayName = "TabList";
|
|
9823
|
+
|
|
9824
|
+
// src/components/Tabs/TabItem.tsx
|
|
9825
|
+
var import_react46 = require("react");
|
|
9826
|
+
var import_styled_components66 = __toESM(require("styled-components"));
|
|
9827
|
+
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
9828
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
9829
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
9830
|
+
var StyledTabItem = (0, import_styled_components66.default)(import_react_tabs3.Trigger)`
|
|
9831
|
+
${segmentedControlItemStyles}
|
|
9832
|
+
`;
|
|
9833
|
+
var TabItem = (0, import_react46.forwardRef)(
|
|
9834
|
+
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, ref) => {
|
|
9835
|
+
const itemRef = (0, import_react46.useRef)(null);
|
|
9836
|
+
const combinedRef = mergeRefs([ref, itemRef]);
|
|
9837
|
+
const { selectedValue, setSelectedItemMetrics } = useTabsContext();
|
|
9838
|
+
const updateMetrics = (0, import_react46.useCallback)(() => {
|
|
9839
|
+
if (value === selectedValue && itemRef.current) {
|
|
9840
|
+
setSelectedItemMetrics({
|
|
9841
|
+
width: itemRef.current.offsetWidth,
|
|
9842
|
+
xOffset: itemRef.current.offsetLeft,
|
|
9843
|
+
height: itemRef.current.offsetHeight
|
|
9844
|
+
});
|
|
9845
|
+
}
|
|
9846
|
+
}, [selectedValue, value, setSelectedItemMetrics]);
|
|
9847
|
+
(0, import_react46.useLayoutEffect)(() => {
|
|
9848
|
+
updateMetrics();
|
|
9849
|
+
}, [selectedValue, value, updateMetrics]);
|
|
9850
|
+
(0, import_react46.useEffect)(() => {
|
|
9851
|
+
const resizeObserver = new ResizeObserver(updateMetrics);
|
|
9852
|
+
if (itemRef.current) {
|
|
9853
|
+
resizeObserver.observe(itemRef.current);
|
|
9854
|
+
}
|
|
9855
|
+
return () => {
|
|
9856
|
+
resizeObserver.disconnect();
|
|
9857
|
+
};
|
|
9858
|
+
}, [updateMetrics]);
|
|
9859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(
|
|
9860
|
+
StyledTabItem,
|
|
9861
|
+
{
|
|
9862
|
+
ref: combinedRef,
|
|
9863
|
+
$hasLabel: (0, import_type_guards36.isNotNil)(label),
|
|
9864
|
+
"aria-label": (0, import_type_guards36.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9865
|
+
disabled,
|
|
9866
|
+
value,
|
|
9867
|
+
children: [
|
|
9868
|
+
icon,
|
|
9869
|
+
label
|
|
9870
|
+
]
|
|
9871
|
+
}
|
|
9872
|
+
);
|
|
9873
|
+
}
|
|
9874
|
+
);
|
|
9875
|
+
TabItem.displayName = "TabItem";
|
|
9876
|
+
|
|
9877
|
+
// src/components/Tabs/extractTabItems.ts
|
|
9878
|
+
var import_react47 = require("react");
|
|
9879
|
+
var extractTabItems = (children) => {
|
|
9880
|
+
const tabItems = [];
|
|
9881
|
+
import_react47.Children.forEach(children, (child) => {
|
|
9882
|
+
if (!(0, import_react47.isValidElement)(child)) {
|
|
9883
|
+
return;
|
|
9884
|
+
}
|
|
9885
|
+
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
9886
|
+
tabItems.push(child);
|
|
9887
|
+
} else if (child.type === import_react47.Fragment) {
|
|
9888
|
+
const fragmentElement = child;
|
|
9889
|
+
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
9890
|
+
} else if ((child.props.children ?? null) != null) {
|
|
9891
|
+
const childChildren = child.props.children;
|
|
9892
|
+
tabItems.push(...extractTabItems(childChildren));
|
|
9893
|
+
} else {
|
|
9894
|
+
}
|
|
9895
|
+
});
|
|
9896
|
+
return tabItems;
|
|
9897
|
+
};
|
|
9898
|
+
|
|
9899
|
+
// src/components/Tabs/Tabs.tsx
|
|
9900
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
9901
|
+
var TabsContext = (0, import_react48.createContext)(null);
|
|
9902
|
+
var useTabsContext = () => {
|
|
9903
|
+
const context = (0, import_react48.useContext)(TabsContext);
|
|
9904
|
+
if (!context) {
|
|
9905
|
+
throw new Error("useTabsContext must be used within a Tabs component");
|
|
9906
|
+
}
|
|
9907
|
+
return context;
|
|
9908
|
+
};
|
|
9909
|
+
var Tabs = (0, import_react48.forwardRef)(
|
|
9910
|
+
({
|
|
9491
9911
|
children,
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9912
|
+
fullWidth = true,
|
|
9913
|
+
"aria-label": ariaLabel,
|
|
9914
|
+
defaultSelectedValue,
|
|
9915
|
+
selectedValue,
|
|
9916
|
+
onSelectedValueChange,
|
|
9917
|
+
...otherProps
|
|
9918
|
+
}, ref) => {
|
|
9919
|
+
const [selectedItem, setSelectedItem] = (0, import_react48.useState)(selectedValue ?? defaultSelectedValue);
|
|
9920
|
+
const [selectedItemMetrics, setSelectedItemMetrics] = (0, import_react48.useState)({
|
|
9921
|
+
width: 0,
|
|
9922
|
+
xOffset: 0,
|
|
9923
|
+
height: 0
|
|
9924
|
+
});
|
|
9925
|
+
const tabItems = extractTabItems(children);
|
|
9926
|
+
const modeProps = defaultSelectedValue !== void 0 ? { defaultValue: defaultSelectedValue } : { value: selectedValue };
|
|
9927
|
+
const contextValue = (0, import_react48.useMemo)(
|
|
9928
|
+
() => ({
|
|
9929
|
+
selectedValue: selectedItem,
|
|
9930
|
+
setSelectedItemMetrics
|
|
9931
|
+
}),
|
|
9932
|
+
[selectedItem]
|
|
9933
|
+
);
|
|
9934
|
+
const handleSelectedValueChange = (value) => {
|
|
9935
|
+
setSelectedItem(value);
|
|
9936
|
+
onSelectedValueChange?.(value);
|
|
9937
|
+
};
|
|
9938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(
|
|
9939
|
+
import_react_tabs4.Root,
|
|
9500
9940
|
{
|
|
9501
|
-
|
|
9502
|
-
|
|
9941
|
+
ref,
|
|
9942
|
+
activationMode: "automatic",
|
|
9943
|
+
onValueChange: handleSelectedValueChange,
|
|
9944
|
+
...otherProps,
|
|
9945
|
+
...modeProps,
|
|
9503
9946
|
children: [
|
|
9504
|
-
/* @__PURE__ */ (0,
|
|
9505
|
-
|
|
9947
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(
|
|
9948
|
+
TabList,
|
|
9506
9949
|
{
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
$fullWidth: responsiveFullWidth,
|
|
9510
|
-
...props,
|
|
9950
|
+
ariaLabel,
|
|
9951
|
+
fullWidth,
|
|
9511
9952
|
children: [
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9953
|
+
tabItems.map((tab) => {
|
|
9954
|
+
const {
|
|
9955
|
+
value,
|
|
9956
|
+
disabled = false,
|
|
9957
|
+
icon,
|
|
9958
|
+
label,
|
|
9959
|
+
"aria-label": ariaLabelForTab
|
|
9960
|
+
} = tab.props;
|
|
9961
|
+
if ((0, import_type_guards37.isNil)(icon)) {
|
|
9962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9963
|
+
TabItem,
|
|
9964
|
+
{
|
|
9965
|
+
disabled,
|
|
9966
|
+
label,
|
|
9967
|
+
value
|
|
9968
|
+
},
|
|
9969
|
+
value
|
|
9970
|
+
);
|
|
9971
|
+
}
|
|
9972
|
+
if ((0, import_type_guards37.isNotNil)(label)) {
|
|
9973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9974
|
+
TabItem,
|
|
9975
|
+
{
|
|
9976
|
+
disabled,
|
|
9977
|
+
icon,
|
|
9978
|
+
label,
|
|
9979
|
+
value
|
|
9980
|
+
},
|
|
9981
|
+
value
|
|
9982
|
+
);
|
|
9983
|
+
}
|
|
9984
|
+
if ((0, import_type_guards37.isNotNil)(ariaLabelForTab)) {
|
|
9985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9986
|
+
TabItem,
|
|
9987
|
+
{
|
|
9988
|
+
"aria-label": ariaLabelForTab,
|
|
9989
|
+
disabled,
|
|
9990
|
+
icon,
|
|
9991
|
+
value
|
|
9992
|
+
},
|
|
9993
|
+
value
|
|
9994
|
+
);
|
|
9995
|
+
}
|
|
9996
|
+
throw new Error("A `Tab` with an icon must have either label or aria-label");
|
|
9997
|
+
}),
|
|
9998
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9999
|
+
StyledSegmentedControlActiveBackground,
|
|
9515
10000
|
{
|
|
9516
|
-
|
|
9517
|
-
|
|
10001
|
+
$height: selectedItemMetrics.height,
|
|
10002
|
+
$width: selectedItemMetrics.width,
|
|
10003
|
+
$xPosition: selectedItemMetrics.xOffset
|
|
9518
10004
|
}
|
|
9519
10005
|
)
|
|
9520
10006
|
]
|
|
9521
10007
|
}
|
|
9522
10008
|
),
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
10009
|
+
tabItems.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
10010
|
+
TabPanel,
|
|
10011
|
+
{
|
|
10012
|
+
value: tab.props.value,
|
|
10013
|
+
children: tab.props.children
|
|
10014
|
+
},
|
|
10015
|
+
tab.props.value
|
|
10016
|
+
))
|
|
9528
10017
|
]
|
|
9529
10018
|
}
|
|
9530
|
-
);
|
|
10019
|
+
) });
|
|
9531
10020
|
}
|
|
9532
10021
|
);
|
|
9533
|
-
|
|
10022
|
+
Tabs.displayName = "Tabs";
|
|
9534
10023
|
|
|
9535
|
-
// src/components/
|
|
9536
|
-
var
|
|
9537
|
-
var
|
|
9538
|
-
var
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
10024
|
+
// src/components/Tabs/Tab.tsx
|
|
10025
|
+
var import_react49 = require("react");
|
|
10026
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
10027
|
+
var Tab = (0, import_react49.forwardRef)(({ children }, ref) => {
|
|
10028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { ref, children });
|
|
10029
|
+
});
|
|
10030
|
+
Tab.displayName = "Tab";
|
|
10031
|
+
|
|
10032
|
+
// src/components/Tag/Tag.tsx
|
|
10033
|
+
var import_react50 = require("react");
|
|
10034
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
10035
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10036
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
10037
|
+
var TagLabel = import_styled_components67.default.a`
|
|
10038
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
10039
|
+
font-size: var(--wui-typography-label-4-size);
|
|
10040
|
+
font-weight: var(--wui-typography-label-4-weight);
|
|
10041
|
+
line-height: var(--wui-typography-label-4-line-height);
|
|
9547
10042
|
border-radius: var(--wui-border-radius-01);
|
|
10043
|
+
align-items: center;
|
|
10044
|
+
color: var(--wui-color-text);
|
|
10045
|
+
text-decoration: none;
|
|
10046
|
+
padding: var(--wui-space-01);
|
|
9548
10047
|
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
background-color: var(--wui-select-option-bg-hover);
|
|
9552
|
-
outline: none;
|
|
10048
|
+
:not(:only-child) {
|
|
10049
|
+
padding-right: var(--wui-space-01);
|
|
9553
10050
|
}
|
|
9554
10051
|
|
|
9555
|
-
|
|
9556
|
-
|
|
10052
|
+
:is(a):hover {
|
|
10053
|
+
background: var(--wui-color-bg-surface-secondary-hover);
|
|
9557
10054
|
}
|
|
9558
10055
|
|
|
9559
|
-
|
|
9560
|
-
background-color
|
|
10056
|
+
:is(a):active {
|
|
10057
|
+
background: var(--wui-color-bg-surface-secondary-active);
|
|
10058
|
+
}
|
|
10059
|
+
|
|
10060
|
+
:focus-visible {
|
|
10061
|
+
outline: unset;
|
|
10062
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9561
10063
|
}
|
|
9562
10064
|
`;
|
|
9563
|
-
var
|
|
10065
|
+
var TagDivider = import_styled_components67.default.div`
|
|
10066
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
10067
|
+
border-left: 1px solid var(--wui-color-border);
|
|
10068
|
+
display: flex;
|
|
10069
|
+
height: 14px;
|
|
10070
|
+
width: 1px;
|
|
10071
|
+
`;
|
|
10072
|
+
var StyledRemoveButton = import_styled_components67.default.button`
|
|
10073
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
10074
|
+
all: unset;
|
|
10075
|
+
cursor: pointer;
|
|
10076
|
+
display: flex;
|
|
10077
|
+
height: 22px;
|
|
9564
10078
|
width: 12px;
|
|
10079
|
+
align-items: center;
|
|
10080
|
+
padding: 0 var(--wui-space-01);
|
|
10081
|
+
border-radius: var(--wui-border-radius-01);
|
|
10082
|
+
|
|
10083
|
+
svg path {
|
|
10084
|
+
fill: var(--wui-color-icon);
|
|
10085
|
+
}
|
|
10086
|
+
|
|
10087
|
+
:hover {
|
|
10088
|
+
background: var(--wui-color-bg-surface-secondary-hover);
|
|
10089
|
+
}
|
|
10090
|
+
|
|
10091
|
+
:active {
|
|
10092
|
+
background: var(--wui-color-bg-surface-secondary-active);
|
|
10093
|
+
}
|
|
10094
|
+
|
|
10095
|
+
:focus-visible {
|
|
10096
|
+
outline: unset;
|
|
10097
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
10098
|
+
}
|
|
9565
10099
|
`;
|
|
9566
|
-
var
|
|
9567
|
-
({
|
|
9568
|
-
|
|
9569
|
-
|
|
10100
|
+
var StyledTag = import_styled_components67.default.div`
|
|
10101
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
10102
|
+
align-items: center;
|
|
10103
|
+
background-color: var(--wui-color-bg-surface-secondary);
|
|
10104
|
+
border-radius: var(--wui-border-radius-01);
|
|
10105
|
+
display: inline-flex;
|
|
10106
|
+
overflow: hidden;
|
|
10107
|
+
|
|
10108
|
+
> * {
|
|
10109
|
+
transition: background var(--wui-duration-01) var(--wui-motion-ease);
|
|
10110
|
+
}
|
|
10111
|
+
`;
|
|
10112
|
+
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
10113
|
+
if ((0, import_type_guards38.isNil)(onClickRemove)) {
|
|
10114
|
+
return null;
|
|
10115
|
+
}
|
|
10116
|
+
if ((0, import_type_guards38.isNil)(onClickRemoveLabel)) {
|
|
10117
|
+
throw new Error(
|
|
10118
|
+
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
10119
|
+
);
|
|
10120
|
+
}
|
|
10121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(import_jsx_runtime218.Fragment, { children: [
|
|
10122
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
10123
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
10124
|
+
StyledRemoveButton,
|
|
9570
10125
|
{
|
|
9571
|
-
|
|
9572
|
-
|
|
10126
|
+
$colorScheme: colorScheme,
|
|
10127
|
+
onClick: onClickRemove,
|
|
10128
|
+
type: "button",
|
|
9573
10129
|
children: [
|
|
9574
|
-
/* @__PURE__ */ (0,
|
|
10130
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
9575
10131
|
Icon,
|
|
9576
10132
|
{
|
|
9577
10133
|
size: "sm",
|
|
9578
|
-
type: "
|
|
10134
|
+
type: "close"
|
|
9579
10135
|
}
|
|
9580
|
-
)
|
|
9581
|
-
/* @__PURE__ */ (0,
|
|
10136
|
+
),
|
|
10137
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
9582
10138
|
]
|
|
9583
10139
|
}
|
|
9584
|
-
)
|
|
9585
|
-
}
|
|
9586
|
-
);
|
|
9587
|
-
SelectOption.displayName = "Option";
|
|
9588
|
-
|
|
9589
|
-
// src/components/Select/SelectOptionGroup.tsx
|
|
9590
|
-
var import_react_select3 = require("@radix-ui/react-select");
|
|
9591
|
-
var import_styled_components61 = __toESM(require("styled-components"));
|
|
9592
|
-
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
9593
|
-
var StyledLabel3 = (0, import_styled_components61.default)(import_react_select3.Label)`
|
|
9594
|
-
padding: var(--wui-select-option-padding);
|
|
9595
|
-
`;
|
|
9596
|
-
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
9597
|
-
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(import_react_select3.Group, { ...props, children: [
|
|
9598
|
-
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(StyledLabel3, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
9599
|
-
Text,
|
|
9600
|
-
{
|
|
9601
|
-
prominence: "secondary",
|
|
9602
|
-
variant: "body3",
|
|
9603
|
-
children: label
|
|
9604
|
-
}
|
|
9605
|
-
) }),
|
|
9606
|
-
children
|
|
10140
|
+
)
|
|
9607
10141
|
] });
|
|
9608
10142
|
};
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
var(--wui-color-bg-surface-tertiary) 25%,
|
|
9639
|
-
var(--wui-color-bg-surface-secondary) 37%,
|
|
9640
|
-
var(--wui-color-bg-surface-tertiary) 63%
|
|
9641
|
-
);
|
|
9642
|
-
background-size: 200% 100%;
|
|
9643
|
-
animation: ${shimmer} 1.5s infinite;
|
|
9644
|
-
border-radius: var(--wui-border-radius-01);
|
|
9645
|
-
`;
|
|
9646
|
-
var StyledLoadingLabel = (0, import_styled_components62.default)(LoadingBackground)`
|
|
9647
|
-
width: 80px;
|
|
9648
|
-
height: var(--wui-typography-heading-6-line-height);
|
|
9649
|
-
`;
|
|
9650
|
-
var StyledLoadingValue = (0, import_styled_components62.default)(LoadingBackground)`
|
|
9651
|
-
width: 90%;
|
|
9652
|
-
height: var(--wui-typography-heading-3-line-height);
|
|
9653
|
-
`;
|
|
9654
|
-
var StyledLabel4 = (0, import_styled_components62.default)(Heading)`
|
|
9655
|
-
grid-area: label;
|
|
9656
|
-
`;
|
|
9657
|
-
var StyledValue = (0, import_styled_components62.default)(Heading)`
|
|
9658
|
-
grid-area: value;
|
|
9659
|
-
`;
|
|
9660
|
-
var StyledSlot = import_styled_components62.default.div`
|
|
9661
|
-
display: flex;
|
|
9662
|
-
justify-content: flex-end;
|
|
9663
|
-
grid-area: slot;
|
|
9664
|
-
align-self: center;
|
|
9665
|
-
`;
|
|
9666
|
-
var StyledDataCardTrendContainer = import_styled_components62.default.div`
|
|
9667
|
-
position: absolute;
|
|
9668
|
-
bottom: var(--wui-space-01);
|
|
9669
|
-
right: var(--wui-space-01);
|
|
9670
|
-
`;
|
|
9671
|
-
var DataCard = ({
|
|
9672
|
-
label,
|
|
9673
|
-
value,
|
|
9674
|
-
upperRightSlot,
|
|
9675
|
-
colorScheme = "inherit",
|
|
9676
|
-
isLoading = false,
|
|
9677
|
-
trend,
|
|
9678
|
-
...props
|
|
9679
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
|
|
9680
|
-
StyledDataCard,
|
|
9681
|
-
{
|
|
9682
|
-
$colorScheme: colorScheme,
|
|
9683
|
-
...props,
|
|
9684
|
-
children: [
|
|
9685
|
-
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9686
|
-
StyledLabel4,
|
|
9687
|
-
{
|
|
9688
|
-
renderAs: "dt",
|
|
9689
|
-
variant: "heading6",
|
|
9690
|
-
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledLoadingLabel, {}) : label
|
|
9691
|
-
}
|
|
9692
|
-
),
|
|
9693
|
-
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9694
|
-
StyledValue,
|
|
9695
|
-
{
|
|
9696
|
-
renderAs: "dd",
|
|
9697
|
-
variant: "heading3",
|
|
9698
|
-
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledLoadingValue, {}) : value
|
|
9699
|
-
}
|
|
9700
|
-
),
|
|
9701
|
-
(0, import_type_guards36.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
9702
|
-
(0, import_type_guards36.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
9703
|
-
]
|
|
10143
|
+
var Tag = (0, import_react50.forwardRef)(
|
|
10144
|
+
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
10145
|
+
const labelProps = (0, import_type_guards38.isNotNil)(href) && (0, import_type_guards38.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
10146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
10147
|
+
StyledTag,
|
|
10148
|
+
{
|
|
10149
|
+
ref,
|
|
10150
|
+
$colorScheme: colorScheme,
|
|
10151
|
+
...otherProps,
|
|
10152
|
+
children: [
|
|
10153
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
10154
|
+
TagLabel,
|
|
10155
|
+
{
|
|
10156
|
+
...labelProps,
|
|
10157
|
+
$colorScheme: colorScheme,
|
|
10158
|
+
children: label
|
|
10159
|
+
}
|
|
10160
|
+
),
|
|
10161
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
10162
|
+
RemoveButton,
|
|
10163
|
+
{
|
|
10164
|
+
colorScheme,
|
|
10165
|
+
onClickRemove,
|
|
10166
|
+
onClickRemoveLabel
|
|
10167
|
+
}
|
|
10168
|
+
)
|
|
10169
|
+
]
|
|
10170
|
+
}
|
|
10171
|
+
);
|
|
9704
10172
|
}
|
|
9705
10173
|
);
|
|
9706
|
-
|
|
10174
|
+
Tag.displayName = "Tag";
|
|
9707
10175
|
|
|
9708
|
-
// src/components/
|
|
9709
|
-
var
|
|
9710
|
-
var
|
|
9711
|
-
var
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
10176
|
+
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
10177
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10178
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
10179
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
10180
|
+
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
10181
|
+
if (iconOnly) {
|
|
10182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
10183
|
+
"g",
|
|
10184
|
+
{
|
|
10185
|
+
"data-testid": "ui-wistia-logo-brandmark",
|
|
10186
|
+
fill: brandmarkColor,
|
|
10187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("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" })
|
|
10188
|
+
}
|
|
10189
|
+
);
|
|
9717
10190
|
}
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
children,
|
|
9721
|
-
cardMaxWidth = "none",
|
|
9722
|
-
colorScheme = "inherit",
|
|
9723
|
-
...props
|
|
9724
|
-
}) => {
|
|
9725
|
-
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
9726
|
-
StyledDataCards,
|
|
10191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
10192
|
+
"g",
|
|
9727
10193
|
{
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
direction: "row",
|
|
9732
|
-
fill: "horizontal",
|
|
9733
|
-
gap: "space-02",
|
|
9734
|
-
renderAs: "dl",
|
|
9735
|
-
wrapItems: true,
|
|
9736
|
-
children
|
|
10194
|
+
"data-testid": "ui-wistia-logo-brandmark",
|
|
10195
|
+
fill: brandmarkColor,
|
|
10196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("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" })
|
|
9737
10197
|
}
|
|
9738
10198
|
);
|
|
9739
10199
|
};
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
gap: 2px;
|
|
9753
|
-
`;
|
|
9754
|
-
var DataCardTrend = ({
|
|
9755
|
-
direction = "up",
|
|
9756
|
-
outlook = "positive",
|
|
9757
|
-
children,
|
|
9758
|
-
...props
|
|
9759
|
-
}) => {
|
|
9760
|
-
return /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
9761
|
-
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
9762
|
-
Icon,
|
|
9763
|
-
{
|
|
9764
|
-
size: "md",
|
|
9765
|
-
type: direction === "up" ? "arrow-up" : "arrow-down",
|
|
9766
|
-
...props
|
|
9767
|
-
}
|
|
9768
|
-
),
|
|
9769
|
-
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
9770
|
-
Text,
|
|
9771
|
-
{
|
|
9772
|
-
prominence: "secondary",
|
|
9773
|
-
variant: "label4",
|
|
9774
|
-
children
|
|
9775
|
-
}
|
|
9776
|
-
)
|
|
9777
|
-
] });
|
|
10200
|
+
var renderLogotype = (logotypeColor, iconOnly) => {
|
|
10201
|
+
if (iconOnly) {
|
|
10202
|
+
return null;
|
|
10203
|
+
}
|
|
10204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
10205
|
+
"g",
|
|
10206
|
+
{
|
|
10207
|
+
"data-testid": "ui-wistia-logo-logotype",
|
|
10208
|
+
fill: logotypeColor,
|
|
10209
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("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" })
|
|
10210
|
+
}
|
|
10211
|
+
);
|
|
9778
10212
|
};
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
var import_react46 = require("react");
|
|
9783
|
-
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
9784
|
-
var StyledInput = (0, import_styled_components65.default)(Input)`
|
|
9785
|
-
:not([rows]) {
|
|
9786
|
-
min-height: unset;
|
|
10213
|
+
var computedViewBox = (iconOnly) => {
|
|
10214
|
+
if (iconOnly) {
|
|
10215
|
+
return "0 0 34.4 26.78";
|
|
9787
10216
|
}
|
|
10217
|
+
return "0 0 144 31.47";
|
|
10218
|
+
};
|
|
10219
|
+
var WistiaLogoComponent = import_styled_components68.default.svg`
|
|
10220
|
+
height: ${({ height }) => `${height}px`};
|
|
9788
10221
|
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
line-height: var(--wui-typography-heading-1-line-height);
|
|
9793
|
-
font-family: var(--wui-typography-heading-1-family);
|
|
9794
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
9795
|
-
outline-offset: -2px;
|
|
9796
|
-
|
|
9797
|
-
&& {
|
|
9798
|
-
width: 100%;
|
|
9799
|
-
padding: var(--wui-space-02);
|
|
9800
|
-
border: none;
|
|
9801
|
-
height: ${({ $height }) => `${$height}px`};
|
|
9802
|
-
}
|
|
9803
|
-
`;
|
|
9804
|
-
var editableStyles = import_styled_components65.css`
|
|
9805
|
-
&:has(+ :focus-within) {
|
|
9806
|
-
background: var(--wui-color-bg-surface-hover);
|
|
9807
|
-
}
|
|
10222
|
+
/* ensure it will always fit on mobile */
|
|
10223
|
+
max-height: 22vw;
|
|
10224
|
+
max-width: 100%;
|
|
9808
10225
|
|
|
9809
10226
|
&:hover {
|
|
9810
|
-
|
|
9811
|
-
|
|
10227
|
+
path {
|
|
10228
|
+
${({ $hoverColor }) => $hoverColor !== void 0 ? `fill: ${$hoverColor}` : null};
|
|
10229
|
+
}
|
|
9812
10230
|
}
|
|
9813
10231
|
`;
|
|
9814
|
-
var
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
children,
|
|
9824
|
-
onValueChange,
|
|
9825
|
-
onEditingChange,
|
|
9826
|
-
tooltipText = "Click to edit title",
|
|
9827
|
-
ariaLabel = "Edit title",
|
|
9828
|
-
forceEditing = false,
|
|
9829
|
-
editingDisabled = false
|
|
10232
|
+
var WistiaLogo = ({
|
|
10233
|
+
description = void 0,
|
|
10234
|
+
height = 100,
|
|
10235
|
+
hoverColor = void 0,
|
|
10236
|
+
href = void 0,
|
|
10237
|
+
iconOnly = false,
|
|
10238
|
+
title = "Wistia Logo",
|
|
10239
|
+
variant = "standard",
|
|
10240
|
+
...otherProps
|
|
9830
10241
|
}) => {
|
|
9831
|
-
const
|
|
9832
|
-
const
|
|
9833
|
-
const
|
|
9834
|
-
const
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
};
|
|
9847
|
-
const handleFinishEditing = () => {
|
|
9848
|
-
const trimmedValue = value.trim();
|
|
9849
|
-
if (trimmedValue === "") {
|
|
9850
|
-
setValue(previousValue);
|
|
9851
|
-
} else if (trimmedValue !== previousValue && onValueChange) {
|
|
9852
|
-
onValueChange(trimmedValue);
|
|
9853
|
-
} else {
|
|
9854
|
-
setValue(trimmedValue);
|
|
9855
|
-
}
|
|
9856
|
-
handleSetEditing(false);
|
|
9857
|
-
};
|
|
9858
|
-
const handleKeyDown = (event) => {
|
|
9859
|
-
if (event.key === "Enter" && !event.shiftKey) {
|
|
9860
|
-
event.preventDefault();
|
|
9861
|
-
handleFinishEditing();
|
|
9862
|
-
}
|
|
9863
|
-
if (event.key === "Escape") {
|
|
9864
|
-
setValue(previousValue);
|
|
9865
|
-
handleSetEditing(false);
|
|
10242
|
+
const primaryColor = "#2949e5";
|
|
10243
|
+
const darkColor = "#000934";
|
|
10244
|
+
const lightColor = "#ffffff";
|
|
10245
|
+
const VARIANT_COLORS = {
|
|
10246
|
+
standard: {
|
|
10247
|
+
brandmark: primaryColor,
|
|
10248
|
+
logotype: darkColor
|
|
10249
|
+
},
|
|
10250
|
+
dark: {
|
|
10251
|
+
brandmark: darkColor,
|
|
10252
|
+
logotype: darkColor
|
|
10253
|
+
},
|
|
10254
|
+
light: {
|
|
10255
|
+
brandmark: lightColor,
|
|
10256
|
+
logotype: lightColor
|
|
9866
10257
|
}
|
|
9867
10258
|
};
|
|
9868
|
-
const
|
|
9869
|
-
|
|
10259
|
+
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
10260
|
+
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
10261
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(
|
|
10262
|
+
WistiaLogoComponent,
|
|
9870
10263
|
{
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
10264
|
+
$hoverColor: hoverColor,
|
|
10265
|
+
height,
|
|
10266
|
+
role: "img",
|
|
10267
|
+
viewBox: computedViewBox(iconOnly),
|
|
10268
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10269
|
+
...otherProps,
|
|
10270
|
+
children: [
|
|
10271
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)("title", { children: title }),
|
|
10272
|
+
(0, import_type_guards39.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("desc", { children: description }) : null,
|
|
10273
|
+
renderBrandmark(brandmarkColor, iconOnly),
|
|
10274
|
+
renderLogotype(logotypeColor, iconOnly)
|
|
10275
|
+
]
|
|
9876
10276
|
}
|
|
9877
10277
|
);
|
|
9878
|
-
|
|
9879
|
-
return HeadingComponent2;
|
|
9880
|
-
}
|
|
9881
|
-
if (isEditing || forceEditing) {
|
|
9882
|
-
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
9883
|
-
StyledInput,
|
|
9884
|
-
{
|
|
9885
|
-
$height: headingHeight,
|
|
9886
|
-
autoFocus: true,
|
|
9887
|
-
fullWidth: true,
|
|
9888
|
-
onBlur: handleFinishEditing,
|
|
9889
|
-
onChange: (event) => setValue(event.target.value),
|
|
9890
|
-
onFocus: (event) => {
|
|
9891
|
-
const { length } = event.currentTarget.value;
|
|
9892
|
-
event.currentTarget.setSelectionRange(length, length);
|
|
9893
|
-
},
|
|
9894
|
-
onKeyDown: handleKeyDown,
|
|
9895
|
-
type: "multiline",
|
|
9896
|
-
value
|
|
9897
|
-
}
|
|
9898
|
-
);
|
|
9899
|
-
}
|
|
9900
|
-
return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(import_jsx_runtime214.Fragment, { children: [
|
|
9901
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
9902
|
-
Tooltip,
|
|
9903
|
-
{
|
|
9904
|
-
compact: true,
|
|
9905
|
-
content: tooltipText,
|
|
9906
|
-
children: HeadingComponent2
|
|
9907
|
-
}
|
|
9908
|
-
),
|
|
9909
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
9910
|
-
"button",
|
|
9911
|
-
{
|
|
9912
|
-
"aria-label": ariaLabel,
|
|
9913
|
-
onClick: () => handleSetEditing(true),
|
|
9914
|
-
type: "button"
|
|
9915
|
-
}
|
|
9916
|
-
) })
|
|
9917
|
-
] });
|
|
10278
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("a", { href, children: Logo }) : Logo;
|
|
9918
10279
|
};
|
|
10280
|
+
WistiaLogo.displayName = "WistiaLogo";
|
|
9919
10281
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9920
10282
|
0 && (module.exports = {
|
|
9921
10283
|
ActionButton,
|
|
@@ -9965,6 +10327,8 @@ var EditableHeading = ({
|
|
|
9965
10327
|
SelectOptionGroup,
|
|
9966
10328
|
Stack,
|
|
9967
10329
|
SubMenu,
|
|
10330
|
+
Tab,
|
|
10331
|
+
Tabs,
|
|
9968
10332
|
Tag,
|
|
9969
10333
|
Text,
|
|
9970
10334
|
Tooltip,
|