@wistia/ui 0.5.3 → 0.5.4-beta.0ae5a6d3.5e3a5c3
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 +1597 -1379
- 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 +1635 -1419
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -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.0ae5a6d3.5e3a5c3
|
|
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,853 @@ 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};
|
|
7201
7286
|
}
|
|
7202
|
-
}}
|
|
7203
7287
|
`;
|
|
7204
|
-
var
|
|
7205
|
-
|
|
7206
|
-
|
|
7288
|
+
var DataCards = ({
|
|
7289
|
+
children,
|
|
7290
|
+
cardMaxWidth = "none",
|
|
7291
|
+
colorScheme = "inherit",
|
|
7292
|
+
...props
|
|
7207
7293
|
}) => {
|
|
7208
|
-
return /* @__PURE__ */ (0,
|
|
7209
|
-
|
|
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 Input = (0, import_react21.forwardRef)(
|
|
7793
|
+
({
|
|
7794
|
+
fullWidth = false,
|
|
7795
|
+
monospace = false,
|
|
7796
|
+
type = "text",
|
|
7797
|
+
autoSelect = false,
|
|
7798
|
+
leftIcon,
|
|
7799
|
+
rightIcon,
|
|
7800
|
+
...props
|
|
7801
|
+
}, externalRef) => {
|
|
7802
|
+
const internalRef = (0, import_react21.useRef)();
|
|
7803
|
+
const ref = (0, import_type_guards23.isNotNil)(externalRef) && (0, import_type_guards23.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
7804
|
+
let leftIconToDisplay = leftIcon;
|
|
7805
|
+
if ((0, import_type_guards23.isNil)(leftIcon) && type === "search") {
|
|
7806
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(Icon, { type: "search" });
|
|
7807
|
+
}
|
|
7808
|
+
if ((0, import_type_guards23.isNotNil)(leftIconToDisplay)) {
|
|
7809
|
+
leftIconToDisplay = (0, import_react21.cloneElement)(leftIconToDisplay, {
|
|
7810
|
+
size: "md",
|
|
7811
|
+
className: "wui-input-left-icon"
|
|
7812
|
+
});
|
|
7813
|
+
}
|
|
7814
|
+
let rightIconToDisplay = rightIcon;
|
|
7815
|
+
if ((0, import_type_guards23.isNotNil)(rightIconToDisplay)) {
|
|
7816
|
+
rightIconToDisplay = (0, import_react21.cloneElement)(rightIconToDisplay, {
|
|
7817
|
+
size: "md",
|
|
7818
|
+
className: "wui-input-right-icon"
|
|
7819
|
+
});
|
|
7820
|
+
}
|
|
7821
|
+
const handleFocus = (event) => {
|
|
7822
|
+
if ((0, import_type_guards23.isNotNil)(props.onFocus)) {
|
|
7823
|
+
props.onFocus(event);
|
|
7824
|
+
}
|
|
7825
|
+
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
7826
|
+
requestAnimationFrame(() => {
|
|
7827
|
+
ref.current?.select();
|
|
7828
|
+
});
|
|
7829
|
+
}
|
|
7830
|
+
};
|
|
7831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(
|
|
7832
|
+
StyledInputContainer,
|
|
7833
|
+
{
|
|
7834
|
+
$fullWidth: fullWidth,
|
|
7835
|
+
$monospace: monospace,
|
|
7836
|
+
children: [
|
|
7837
|
+
leftIconToDisplay ?? null,
|
|
7838
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7839
|
+
"textarea",
|
|
7840
|
+
{
|
|
7841
|
+
...props,
|
|
7842
|
+
ref,
|
|
7843
|
+
onFocus: handleFocus
|
|
7844
|
+
}
|
|
7845
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7846
|
+
"input",
|
|
7847
|
+
{
|
|
7848
|
+
...props,
|
|
7849
|
+
ref,
|
|
7850
|
+
onFocus: handleFocus,
|
|
7851
|
+
type
|
|
7852
|
+
}
|
|
7853
|
+
),
|
|
7854
|
+
rightIconToDisplay ?? null
|
|
7855
|
+
]
|
|
7856
|
+
}
|
|
7857
|
+
);
|
|
7858
|
+
}
|
|
7859
|
+
);
|
|
7860
|
+
Input.displayName = "Input";
|
|
7861
|
+
|
|
7862
|
+
// src/components/EditableHeading/EditableHeading.tsx
|
|
7863
|
+
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
7864
|
+
var StyledInput = (0, import_styled_components42.default)(Input)`
|
|
7865
|
+
:not([rows]) {
|
|
7866
|
+
min-height: unset;
|
|
7867
|
+
}
|
|
7868
|
+
|
|
7869
|
+
resize: vertical;
|
|
7870
|
+
font-size: var(--wui-typography-heading-1-size);
|
|
7871
|
+
font-weight: var(--wui-typography-heading-1-weight);
|
|
7872
|
+
line-height: var(--wui-typography-heading-1-line-height);
|
|
7873
|
+
font-family: var(--wui-typography-heading-1-family);
|
|
7874
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
7875
|
+
outline-offset: -2px;
|
|
7876
|
+
|
|
7877
|
+
&& {
|
|
7878
|
+
width: 100%;
|
|
7879
|
+
padding: var(--wui-space-02);
|
|
7880
|
+
border: none;
|
|
7881
|
+
height: ${({ $height }) => `${$height}px`};
|
|
7882
|
+
}
|
|
7883
|
+
`;
|
|
7884
|
+
var editableStyles = import_styled_components42.css`
|
|
7885
|
+
&:has(+ :focus-within) {
|
|
7886
|
+
background: var(--wui-color-bg-surface-hover);
|
|
7887
|
+
}
|
|
7888
|
+
|
|
7889
|
+
&:hover {
|
|
7890
|
+
background: var(--wui-color-bg-surface-hover);
|
|
7891
|
+
cursor: pointer;
|
|
7892
|
+
}
|
|
7893
|
+
`;
|
|
7894
|
+
var StyledHeading2 = (0, import_styled_components42.default)(Heading)`
|
|
7895
|
+
width: 100%;
|
|
7896
|
+
border-radius: var(--wui-border-radius-02);
|
|
7897
|
+
padding: var(--wui-space-02);
|
|
7898
|
+
overflow-wrap: anywhere;
|
|
7899
|
+
transition: all var(--wui-motion-duration-01) var(--wui-motion-ease);
|
|
7900
|
+
${({ $editingDisabled }) => !$editingDisabled && editableStyles}
|
|
7901
|
+
`;
|
|
7902
|
+
var EditableHeading = ({
|
|
7903
|
+
children,
|
|
7904
|
+
onValueChange,
|
|
7905
|
+
onEditingChange,
|
|
7906
|
+
tooltipText = "Click to edit title",
|
|
7907
|
+
ariaLabel = "Edit title",
|
|
7908
|
+
forceEditing = false,
|
|
7909
|
+
editingDisabled = false
|
|
7910
|
+
}) => {
|
|
7911
|
+
const [isEditing, setIsEditing] = (0, import_react22.useState)(false);
|
|
7912
|
+
const [value, setValue] = (0, import_react22.useState)(children);
|
|
7913
|
+
const [previousValue, setPreviousValue] = (0, import_react22.useState)(children);
|
|
7914
|
+
const [headingHeight, setHeadingHeight] = (0, import_react22.useState)("60");
|
|
7915
|
+
const headingRef = (0, import_react22.useRef)(null);
|
|
7916
|
+
const handleSetEditing = (editing) => {
|
|
7917
|
+
if (editingDisabled) return;
|
|
7918
|
+
if (editing && headingRef.current) {
|
|
7919
|
+
setHeadingHeight(`${headingRef.current.offsetHeight}`);
|
|
7920
|
+
}
|
|
7921
|
+
if (editing) {
|
|
7922
|
+
setPreviousValue(value);
|
|
7923
|
+
}
|
|
7924
|
+
setIsEditing(editing);
|
|
7925
|
+
onEditingChange?.(editing);
|
|
7926
|
+
};
|
|
7927
|
+
const handleFinishEditing = () => {
|
|
7928
|
+
const trimmedValue = value.trim();
|
|
7929
|
+
if (trimmedValue === "") {
|
|
7930
|
+
setValue(previousValue);
|
|
7931
|
+
} else if (trimmedValue !== previousValue && onValueChange) {
|
|
7932
|
+
onValueChange(trimmedValue);
|
|
7933
|
+
} else {
|
|
7934
|
+
setValue(trimmedValue);
|
|
7935
|
+
}
|
|
7936
|
+
handleSetEditing(false);
|
|
7937
|
+
};
|
|
7938
|
+
const handleKeyDown = (event) => {
|
|
7939
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
7940
|
+
event.preventDefault();
|
|
7941
|
+
handleFinishEditing();
|
|
7942
|
+
}
|
|
7943
|
+
if (event.key === "Escape") {
|
|
7944
|
+
setValue(previousValue);
|
|
7945
|
+
handleSetEditing(false);
|
|
7946
|
+
}
|
|
7947
|
+
};
|
|
7948
|
+
const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7949
|
+
StyledHeading2,
|
|
7210
7950
|
{
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7951
|
+
ref: headingRef,
|
|
7952
|
+
$editingDisabled: editingDisabled,
|
|
7953
|
+
onClick: () => handleSetEditing(true),
|
|
7954
|
+
variant: "heading1",
|
|
7955
|
+
children: value
|
|
7215
7956
|
}
|
|
7216
7957
|
);
|
|
7958
|
+
if (editingDisabled) {
|
|
7959
|
+
return HeadingComponent2;
|
|
7960
|
+
}
|
|
7961
|
+
if (isEditing || forceEditing) {
|
|
7962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7963
|
+
StyledInput,
|
|
7964
|
+
{
|
|
7965
|
+
$height: headingHeight,
|
|
7966
|
+
autoFocus: true,
|
|
7967
|
+
fullWidth: true,
|
|
7968
|
+
onBlur: handleFinishEditing,
|
|
7969
|
+
onChange: (event) => setValue(event.target.value),
|
|
7970
|
+
onFocus: (event) => {
|
|
7971
|
+
const { length } = event.currentTarget.value;
|
|
7972
|
+
event.currentTarget.setSelectionRange(length, length);
|
|
7973
|
+
},
|
|
7974
|
+
onKeyDown: handleKeyDown,
|
|
7975
|
+
type: "multiline",
|
|
7976
|
+
value
|
|
7977
|
+
}
|
|
7978
|
+
);
|
|
7979
|
+
}
|
|
7980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(import_jsx_runtime184.Fragment, { children: [
|
|
7981
|
+
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7982
|
+
Tooltip,
|
|
7983
|
+
{
|
|
7984
|
+
compact: true,
|
|
7985
|
+
content: tooltipText,
|
|
7986
|
+
children: HeadingComponent2
|
|
7987
|
+
}
|
|
7988
|
+
),
|
|
7989
|
+
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
7990
|
+
"button",
|
|
7991
|
+
{
|
|
7992
|
+
"aria-label": ariaLabel,
|
|
7993
|
+
onClick: () => handleSetEditing(true),
|
|
7994
|
+
type: "button"
|
|
7995
|
+
}
|
|
7996
|
+
) })
|
|
7997
|
+
] });
|
|
7217
7998
|
};
|
|
7218
|
-
Divider.displayName = "Divider";
|
|
7219
7999
|
|
|
7220
8000
|
// src/components/Form/Form.tsx
|
|
7221
|
-
var
|
|
7222
|
-
var
|
|
7223
|
-
var
|
|
8001
|
+
var import_react24 = require("react");
|
|
8002
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
8003
|
+
var import_type_guards24 = require("@wistia/type-guards");
|
|
7224
8004
|
|
|
7225
8005
|
// src/components/Stack/Stack.tsx
|
|
7226
|
-
var
|
|
7227
|
-
var
|
|
7228
|
-
var
|
|
7229
|
-
var
|
|
7230
|
-
var StyledStack =
|
|
8006
|
+
var import_react23 = require("react");
|
|
8007
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8008
|
+
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
8009
|
+
var DEFAULT_ELEMENT4 = "div";
|
|
8010
|
+
var StyledStack = import_styled_components43.default.div`
|
|
7231
8011
|
display: flex;
|
|
7232
8012
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
7233
8013
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
7234
8014
|
`;
|
|
7235
|
-
var StackComponent = (0,
|
|
8015
|
+
var StackComponent = (0, import_react23.forwardRef)(
|
|
7236
8016
|
({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
|
|
7237
8017
|
const responsiveGap = useResponsiveProp(gap);
|
|
7238
8018
|
const responsiveDirection = useResponsiveProp(direction);
|
|
7239
|
-
return /* @__PURE__ */ (0,
|
|
8019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7240
8020
|
StyledStack,
|
|
7241
8021
|
{
|
|
7242
8022
|
ref,
|
|
7243
8023
|
$direction: responsiveDirection,
|
|
7244
8024
|
$gap: responsiveGap,
|
|
7245
|
-
as: renderAs ??
|
|
8025
|
+
as: renderAs ?? DEFAULT_ELEMENT4,
|
|
7246
8026
|
...props
|
|
7247
8027
|
}
|
|
7248
8028
|
);
|
|
@@ -7252,29 +8032,29 @@ StackComponent.displayName = "Stack";
|
|
|
7252
8032
|
var Stack = makePolymorphic(StackComponent);
|
|
7253
8033
|
|
|
7254
8034
|
// src/components/Form/Form.tsx
|
|
7255
|
-
var
|
|
7256
|
-
var StyledForm =
|
|
8035
|
+
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
8036
|
+
var StyledForm = import_styled_components44.default.form`
|
|
7257
8037
|
--form-default-width: 690px;
|
|
7258
8038
|
|
|
7259
8039
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
7260
8040
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
7261
8041
|
`;
|
|
7262
|
-
var FormContext = (0,
|
|
8042
|
+
var FormContext = (0, import_react24.createContext)({
|
|
7263
8043
|
values: {},
|
|
7264
8044
|
errors: {},
|
|
7265
8045
|
hasSubmitted: false,
|
|
7266
8046
|
formId: ""
|
|
7267
8047
|
});
|
|
7268
8048
|
var FormComponent = ({ children, action, values = {}, validate, fullWidth = false, ...props }, forwardedRef) => {
|
|
7269
|
-
const [errors, setErrors] = (0,
|
|
7270
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
7271
|
-
const innerRef = (0,
|
|
8049
|
+
const [errors, setErrors] = (0, import_react24.useState)({});
|
|
8050
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react24.useState)(false);
|
|
8051
|
+
const innerRef = (0, import_react24.useRef)();
|
|
7272
8052
|
const ref = forwardedRef ?? innerRef;
|
|
7273
|
-
const autoId = (0,
|
|
8053
|
+
const autoId = (0, import_react24.useId)();
|
|
7274
8054
|
const id = props.id ?? autoId;
|
|
7275
8055
|
const handleValidate = (nextFormData) => {
|
|
7276
8056
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
7277
|
-
if ((0,
|
|
8057
|
+
if ((0, import_type_guards24.isUndefined)(validate)) {
|
|
7278
8058
|
return {};
|
|
7279
8059
|
}
|
|
7280
8060
|
return validate(nextData);
|
|
@@ -7284,7 +8064,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7284
8064
|
props.onBlur(event);
|
|
7285
8065
|
}
|
|
7286
8066
|
const formData = new FormData(event.currentTarget);
|
|
7287
|
-
if ((0,
|
|
8067
|
+
if ((0, import_type_guards24.isNotUndefined)(validate)) {
|
|
7288
8068
|
handleValidate(formData);
|
|
7289
8069
|
}
|
|
7290
8070
|
};
|
|
@@ -7312,7 +8092,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7312
8092
|
void action(null);
|
|
7313
8093
|
}
|
|
7314
8094
|
};
|
|
7315
|
-
const context = (0,
|
|
8095
|
+
const context = (0, import_react24.useMemo)(() => {
|
|
7316
8096
|
return {
|
|
7317
8097
|
values,
|
|
7318
8098
|
errors,
|
|
@@ -7322,7 +8102,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7322
8102
|
}, [values, errors, id, hasSubmitted]);
|
|
7323
8103
|
return (
|
|
7324
8104
|
// @ts-expect-error - generic context providers are a giant pain
|
|
7325
|
-
/* @__PURE__ */ (0,
|
|
8105
|
+
/* @__PURE__ */ (0, import_jsx_runtime186.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7326
8106
|
Stack,
|
|
7327
8107
|
{
|
|
7328
8108
|
gap: "space-05",
|
|
@@ -7340,15 +8120,15 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7340
8120
|
);
|
|
7341
8121
|
};
|
|
7342
8122
|
FormComponent.displayName = "Form";
|
|
7343
|
-
var Form = (0,
|
|
8123
|
+
var Form = (0, import_react24.forwardRef)(FormComponent);
|
|
7344
8124
|
|
|
7345
8125
|
// src/components/Form/useFormState.tsx
|
|
7346
|
-
var
|
|
8126
|
+
var import_react25 = require("react");
|
|
7347
8127
|
var useFormState = (action, initialData = {}) => {
|
|
7348
|
-
const [data, setData] = (0,
|
|
7349
|
-
const [isPending, setIsPending] = (0,
|
|
7350
|
-
const [error, setError] = (0,
|
|
7351
|
-
const formAction = (0,
|
|
8128
|
+
const [data, setData] = (0, import_react25.useState)(initialData);
|
|
8129
|
+
const [isPending, setIsPending] = (0, import_react25.useState)(false);
|
|
8130
|
+
const [error, setError] = (0, import_react25.useState)(null);
|
|
8131
|
+
const formAction = (0, import_react25.useCallback)(
|
|
7352
8132
|
async (nextFormData) => {
|
|
7353
8133
|
if (nextFormData === null) {
|
|
7354
8134
|
setData(initialData);
|
|
@@ -7379,23 +8159,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
7379
8159
|
};
|
|
7380
8160
|
|
|
7381
8161
|
// src/components/Form/FormErrorSummary.tsx
|
|
7382
|
-
var
|
|
7383
|
-
var
|
|
7384
|
-
var
|
|
8162
|
+
var import_react26 = require("react");
|
|
8163
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
8164
|
+
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
7385
8165
|
var ErrorItem = ({ name, error, formId }) => {
|
|
7386
|
-
return /* @__PURE__ */ (0,
|
|
8166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Link, { href: `${formId}-${name}`, children: error }) }, name);
|
|
7387
8167
|
};
|
|
7388
8168
|
var FormErrorSummary = ({ description }) => {
|
|
7389
|
-
const ref = (0,
|
|
7390
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
8169
|
+
const ref = (0, import_react26.useRef)(null);
|
|
8170
|
+
const { formId, errors, hasSubmitted } = (0, import_react26.useContext)(FormContext);
|
|
7391
8171
|
const isValid = Object.keys(errors).length === 0;
|
|
7392
8172
|
if (isValid || !hasSubmitted) {
|
|
7393
8173
|
return null;
|
|
7394
8174
|
}
|
|
7395
|
-
return /* @__PURE__ */ (0,
|
|
7396
|
-
/* @__PURE__ */ (0,
|
|
7397
|
-
/* @__PURE__ */ (0,
|
|
7398
|
-
([name, error]) => (0,
|
|
8175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)("div", { ref, children: [
|
|
8176
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)("p", { children: description }),
|
|
8177
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards25.isNotUndefined)(error)).map(
|
|
8178
|
+
([name, error]) => (0, import_type_guards25.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
7399
8179
|
ErrorItem,
|
|
7400
8180
|
{
|
|
7401
8181
|
error: err,
|
|
@@ -7403,7 +8183,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
7403
8183
|
name
|
|
7404
8184
|
},
|
|
7405
8185
|
err
|
|
7406
|
-
)) : /* @__PURE__ */ (0,
|
|
8186
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
7407
8187
|
ErrorItem,
|
|
7408
8188
|
{
|
|
7409
8189
|
error: error ?? "",
|
|
@@ -7416,211 +8196,34 @@ var FormErrorSummary = ({ description }) => {
|
|
|
7416
8196
|
] });
|
|
7417
8197
|
};
|
|
7418
8198
|
|
|
7419
|
-
// src/components/FormField/FormField.tsx
|
|
7420
|
-
var
|
|
7421
|
-
var
|
|
7422
|
-
var
|
|
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
|
|
7594
|
-
}
|
|
7595
|
-
);
|
|
7596
|
-
}
|
|
7597
|
-
);
|
|
7598
|
-
TextComponent.displayName = "Text";
|
|
7599
|
-
var Text = makePolymorphic(TextComponent);
|
|
7600
|
-
|
|
8199
|
+
// src/components/FormField/FormField.tsx
|
|
8200
|
+
var import_react29 = require("react");
|
|
8201
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
8202
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
8203
|
+
|
|
7601
8204
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
7602
|
-
var
|
|
8205
|
+
var import_react28 = require("react");
|
|
7603
8206
|
|
|
7604
8207
|
// src/components/FormGroup/FormGroup.tsx
|
|
7605
|
-
var
|
|
7606
|
-
var
|
|
7607
|
-
var
|
|
7608
|
-
var StyledFieldset =
|
|
8208
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
8209
|
+
var import_react27 = require("react");
|
|
8210
|
+
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
8211
|
+
var StyledFieldset = import_styled_components45.default.fieldset`
|
|
7609
8212
|
border: 0;
|
|
7610
8213
|
`;
|
|
7611
|
-
var StyledLegend =
|
|
8214
|
+
var StyledLegend = import_styled_components45.default.legend`
|
|
7612
8215
|
margin-bottom: var(--space-01);
|
|
7613
8216
|
`;
|
|
7614
8217
|
var FormGroup = ({ children, label, ...props }) => {
|
|
7615
|
-
const ref = (0,
|
|
7616
|
-
return /* @__PURE__ */ (0,
|
|
8218
|
+
const ref = (0, import_react27.useRef)();
|
|
8219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(
|
|
7617
8220
|
Stack,
|
|
7618
8221
|
{
|
|
7619
8222
|
...props,
|
|
7620
8223
|
ref,
|
|
7621
8224
|
renderAs: StyledFieldset,
|
|
7622
8225
|
children: [
|
|
7623
|
-
/* @__PURE__ */ (0,
|
|
8226
|
+
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
7624
8227
|
Heading,
|
|
7625
8228
|
{
|
|
7626
8229
|
renderAs: StyledLegend,
|
|
@@ -7636,8 +8239,8 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
7636
8239
|
FormGroup.displayName = "FormGroup";
|
|
7637
8240
|
|
|
7638
8241
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
7639
|
-
var
|
|
7640
|
-
var CheckboxGroupContext = (0,
|
|
8242
|
+
var import_jsx_runtime189 = require("react/jsx-runtime");
|
|
8243
|
+
var CheckboxGroupContext = (0, import_react28.createContext)(null);
|
|
7641
8244
|
var CheckboxGroup = ({
|
|
7642
8245
|
children,
|
|
7643
8246
|
name,
|
|
@@ -7645,19 +8248,19 @@ var CheckboxGroup = ({
|
|
|
7645
8248
|
value,
|
|
7646
8249
|
...props
|
|
7647
8250
|
}) => {
|
|
7648
|
-
const context = (0,
|
|
8251
|
+
const context = (0, import_react28.useMemo)(() => {
|
|
7649
8252
|
return {
|
|
7650
8253
|
name,
|
|
7651
8254
|
onChange
|
|
7652
8255
|
};
|
|
7653
8256
|
}, [name, onChange]);
|
|
7654
|
-
return /* @__PURE__ */ (0,
|
|
8257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(FormGroup, { ...props, children }) });
|
|
7655
8258
|
};
|
|
7656
8259
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
7657
8260
|
|
|
7658
8261
|
// src/components/FormField/FormField.tsx
|
|
7659
|
-
var
|
|
7660
|
-
var StyledFormField =
|
|
8262
|
+
var import_jsx_runtime190 = require("react/jsx-runtime");
|
|
8263
|
+
var StyledFormField = import_styled_components46.default.div`
|
|
7661
8264
|
--form-field-spacing: var(--wui-space-01);
|
|
7662
8265
|
--form-field-error-color: var(--wui-color-text-secondary-error);
|
|
7663
8266
|
|
|
@@ -7665,7 +8268,7 @@ var StyledFormField = import_styled_components39.default.div`
|
|
|
7665
8268
|
flex-direction: column;
|
|
7666
8269
|
gap: var(--form-field-spacing);
|
|
7667
8270
|
`;
|
|
7668
|
-
var StyledErrorList =
|
|
8271
|
+
var StyledErrorList = import_styled_components46.default.ul`
|
|
7669
8272
|
margin: 0;
|
|
7670
8273
|
padding: 0;
|
|
7671
8274
|
padding-left: var(--wui-space-04);
|
|
@@ -7674,8 +8277,8 @@ var StyledErrorList = import_styled_components39.default.ul`
|
|
|
7674
8277
|
gap: var(--wui-space-01);
|
|
7675
8278
|
`;
|
|
7676
8279
|
var ErrorMessages = ({ errors, id }) => {
|
|
7677
|
-
const isMultipleErrors = (0,
|
|
7678
|
-
return isMultipleErrors ? /* @__PURE__ */ (0,
|
|
8280
|
+
const isMultipleErrors = (0, import_type_guards26.isArray)(errors);
|
|
8281
|
+
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
7679
8282
|
Text,
|
|
7680
8283
|
{
|
|
7681
8284
|
colorScheme: "error",
|
|
@@ -7685,7 +8288,7 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
7685
8288
|
children: error
|
|
7686
8289
|
},
|
|
7687
8290
|
`${id}-${index}`
|
|
7688
|
-
)) }) : /* @__PURE__ */ (0,
|
|
8291
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
7689
8292
|
Text,
|
|
7690
8293
|
{
|
|
7691
8294
|
colorScheme: "error",
|
|
@@ -7705,8 +8308,8 @@ var FormField = ({
|
|
|
7705
8308
|
value,
|
|
7706
8309
|
...props
|
|
7707
8310
|
}) => {
|
|
7708
|
-
const formState = (0,
|
|
7709
|
-
const checkboxGroup = (0,
|
|
8311
|
+
const formState = (0, import_react29.useContext)(FormContext);
|
|
8312
|
+
const checkboxGroup = (0, import_react29.useContext)(CheckboxGroupContext);
|
|
7710
8313
|
const id = props.id ?? `${formState.formId}-${name}`;
|
|
7711
8314
|
const isInlineLabel = children.type === Checkbox;
|
|
7712
8315
|
const computedError = error ?? formState.errors[name];
|
|
@@ -7717,19 +8320,19 @@ var FormField = ({
|
|
|
7717
8320
|
label: isInlineLabel ? label : void 0,
|
|
7718
8321
|
...props
|
|
7719
8322
|
};
|
|
7720
|
-
if ((0,
|
|
8323
|
+
if ((0, import_type_guards26.isUndefined)(value) && (0, import_type_guards26.isNotUndefined)(defaultValue)) {
|
|
7721
8324
|
childProps = {
|
|
7722
8325
|
...childProps,
|
|
7723
8326
|
defaultValue
|
|
7724
8327
|
};
|
|
7725
8328
|
}
|
|
7726
|
-
if ((0,
|
|
7727
|
-
const computedName = (0,
|
|
8329
|
+
if ((0, import_type_guards26.isNotNil)(checkboxGroup)) {
|
|
8330
|
+
const computedName = (0, import_type_guards26.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
7728
8331
|
const handleChange = (event) => {
|
|
7729
|
-
if ((0,
|
|
8332
|
+
if ((0, import_type_guards26.isNotUndefined)(props.onChange)) {
|
|
7730
8333
|
props.onChange(event);
|
|
7731
8334
|
}
|
|
7732
|
-
if ((0,
|
|
8335
|
+
if ((0, import_type_guards26.isNotUndefined)(checkboxGroup.onChange)) {
|
|
7733
8336
|
checkboxGroup.onChange(event);
|
|
7734
8337
|
}
|
|
7735
8338
|
};
|
|
@@ -7737,15 +8340,15 @@ var FormField = ({
|
|
|
7737
8340
|
...childProps,
|
|
7738
8341
|
name: computedName,
|
|
7739
8342
|
onChange: handleChange,
|
|
7740
|
-
"aria-invalid": (0,
|
|
7741
|
-
"aria-describedby": (0,
|
|
8343
|
+
"aria-invalid": (0, import_type_guards26.isNotNil)(error),
|
|
8344
|
+
"aria-describedby": (0, import_type_guards26.isNotNil)(error) ? `${id}-error` : void 0
|
|
7742
8345
|
};
|
|
7743
8346
|
}
|
|
7744
|
-
|
|
7745
|
-
return /* @__PURE__ */ (0,
|
|
7746
|
-
!isInlineLabel && /* @__PURE__ */ (0,
|
|
7747
|
-
(0,
|
|
7748
|
-
(0,
|
|
8347
|
+
import_react29.Children.only(children);
|
|
8348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(StyledFormField, { ...props, children: [
|
|
8349
|
+
!isInlineLabel && /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(Label, { htmlFor: id, children: label }),
|
|
8350
|
+
(0, import_react29.cloneElement)(children, childProps),
|
|
8351
|
+
(0, import_type_guards26.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
7749
8352
|
ErrorMessages,
|
|
7750
8353
|
{
|
|
7751
8354
|
errors: computedError,
|
|
@@ -7757,9 +8360,9 @@ var FormField = ({
|
|
|
7757
8360
|
FormField.displayName = "FormField";
|
|
7758
8361
|
|
|
7759
8362
|
// src/components/FormGroup/RadioGroup.tsx
|
|
7760
|
-
var
|
|
7761
|
-
var
|
|
7762
|
-
var RadioGroupContext = (0,
|
|
8363
|
+
var import_react30 = require("react");
|
|
8364
|
+
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
8365
|
+
var RadioGroupContext = (0, import_react30.createContext)(null);
|
|
7763
8366
|
var RadioGroup = ({
|
|
7764
8367
|
children,
|
|
7765
8368
|
name,
|
|
@@ -7767,21 +8370,21 @@ var RadioGroup = ({
|
|
|
7767
8370
|
value,
|
|
7768
8371
|
...props
|
|
7769
8372
|
}) => {
|
|
7770
|
-
const context = (0,
|
|
8373
|
+
const context = (0, import_react30.useMemo)(() => {
|
|
7771
8374
|
return {
|
|
7772
8375
|
name,
|
|
7773
8376
|
onChange
|
|
7774
8377
|
};
|
|
7775
8378
|
}, [name, onChange]);
|
|
7776
|
-
return /* @__PURE__ */ (0,
|
|
8379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(FormGroup, { ...props, children }) });
|
|
7777
8380
|
};
|
|
7778
8381
|
RadioGroup.displayName = "RadioGroup";
|
|
7779
8382
|
|
|
7780
8383
|
// src/components/IconButton/IconButton.tsx
|
|
7781
|
-
var
|
|
7782
|
-
var
|
|
7783
|
-
var
|
|
7784
|
-
var StyledButton2 = (0,
|
|
8384
|
+
var import_react31 = require("react");
|
|
8385
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
8386
|
+
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
8387
|
+
var StyledButton2 = (0, import_styled_components47.default)(Button)`
|
|
7785
8388
|
--icon-button-size-sm: 24px;
|
|
7786
8389
|
--icon-button-size-md: 32px;
|
|
7787
8390
|
--icon-button-size-lg: 40px;
|
|
@@ -7795,10 +8398,10 @@ var StyledButton2 = (0, import_styled_components40.default)(Button)`
|
|
|
7795
8398
|
align-items: center;
|
|
7796
8399
|
line-height: 1;
|
|
7797
8400
|
`;
|
|
7798
|
-
var IconButton = (0,
|
|
8401
|
+
var IconButton = (0, import_react31.forwardRef)(
|
|
7799
8402
|
({ children, label, size = "md", ...props }, ref) => {
|
|
7800
8403
|
const responsiveSize = useResponsiveProp(size);
|
|
7801
|
-
return /* @__PURE__ */ (0,
|
|
8404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7802
8405
|
StyledButton2,
|
|
7803
8406
|
{
|
|
7804
8407
|
...props,
|
|
@@ -7806,7 +8409,7 @@ var IconButton = (0, import_react29.forwardRef)(
|
|
|
7806
8409
|
"aria-label": label,
|
|
7807
8410
|
"data-wistia-ui-icon-button": true,
|
|
7808
8411
|
size: responsiveSize,
|
|
7809
|
-
children: (0,
|
|
8412
|
+
children: (0, import_react31.cloneElement)(import_react31.Children.only(children), {
|
|
7810
8413
|
size: responsiveSize
|
|
7811
8414
|
})
|
|
7812
8415
|
}
|
|
@@ -7815,183 +8418,20 @@ var IconButton = (0, import_react29.forwardRef)(
|
|
|
7815
8418
|
);
|
|
7816
8419
|
IconButton.displayName = "IconButton";
|
|
7817
8420
|
|
|
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
8421
|
// src/components/Menu/Menu.tsx
|
|
7982
|
-
var
|
|
8422
|
+
var import_styled_components48 = __toESM(require("styled-components"));
|
|
7983
8423
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
7984
|
-
var
|
|
7985
|
-
var
|
|
8424
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
8425
|
+
var import_react33 = require("react");
|
|
7986
8426
|
|
|
7987
8427
|
// src/components/Menu/MenuContext.tsx
|
|
7988
|
-
var
|
|
7989
|
-
var MenuContext = (0,
|
|
7990
|
-
var useMenuContext = () => (0,
|
|
8428
|
+
var import_react32 = require("react");
|
|
8429
|
+
var MenuContext = (0, import_react32.createContext)({ compact: false });
|
|
8430
|
+
var useMenuContext = () => (0, import_react32.useContext)(MenuContext);
|
|
7991
8431
|
|
|
7992
8432
|
// src/components/Menu/Menu.tsx
|
|
7993
|
-
var
|
|
7994
|
-
var open =
|
|
8433
|
+
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
8434
|
+
var open = import_styled_components48.keyframes`
|
|
7995
8435
|
from {
|
|
7996
8436
|
opacity: 0;
|
|
7997
8437
|
transform: scale(.97) translateY(-8px);
|
|
@@ -8001,7 +8441,7 @@ var open = import_styled_components42.keyframes`
|
|
|
8001
8441
|
transform: scale(1);
|
|
8002
8442
|
}
|
|
8003
8443
|
`;
|
|
8004
|
-
var close =
|
|
8444
|
+
var close = import_styled_components48.keyframes`
|
|
8005
8445
|
from {
|
|
8006
8446
|
opacity: 1;
|
|
8007
8447
|
transform: scale(1);
|
|
@@ -8011,7 +8451,7 @@ var close = import_styled_components42.keyframes`
|
|
|
8011
8451
|
transform: scale(.97) translateY(-8px);
|
|
8012
8452
|
}
|
|
8013
8453
|
`;
|
|
8014
|
-
var menuItemCss =
|
|
8454
|
+
var menuItemCss = import_styled_components48.css`
|
|
8015
8455
|
--menu-label-description-gap: var(--wui-space-01);
|
|
8016
8456
|
--menu-item-inner-gap: var(--wui-space-03);
|
|
8017
8457
|
--menu-item-left-icon-size: 24px;
|
|
@@ -8022,7 +8462,7 @@ var menuItemCss = import_styled_components42.css`
|
|
|
8022
8462
|
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
8023
8463
|
--menu-divider-margin: var(--wui-space-02);
|
|
8024
8464
|
`;
|
|
8025
|
-
var compactMenuItemCss =
|
|
8465
|
+
var compactMenuItemCss = import_styled_components48.css`
|
|
8026
8466
|
--menu-label-description-gap: 0;
|
|
8027
8467
|
--menu-item-inner-gap: var(--wui-space-02);
|
|
8028
8468
|
--menu-item-left-icon-size: 16px;
|
|
@@ -8033,7 +8473,7 @@ var compactMenuItemCss = import_styled_components42.css`
|
|
|
8033
8473
|
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
8034
8474
|
--menu-divider-margin: var(--wui-space-01);
|
|
8035
8475
|
`;
|
|
8036
|
-
var menuContentCss =
|
|
8476
|
+
var menuContentCss = import_styled_components48.css`
|
|
8037
8477
|
--menu-font-family: var(--wui-typography-family-default);
|
|
8038
8478
|
--menu-bg: var(--wui-color-bg-surface);
|
|
8039
8479
|
--menu-shadow: var(--wui-elevation-01);
|
|
@@ -8075,7 +8515,7 @@ var menuContentCss = import_styled_components42.css`
|
|
|
8075
8515
|
margin: var(--menu-divider-margin) 0;
|
|
8076
8516
|
}
|
|
8077
8517
|
`;
|
|
8078
|
-
var MenuContent = (0,
|
|
8518
|
+
var MenuContent = (0, import_styled_components48.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
8079
8519
|
${menuContentCss}
|
|
8080
8520
|
`;
|
|
8081
8521
|
var Menu = ({
|
|
@@ -8091,9 +8531,9 @@ var Menu = ({
|
|
|
8091
8531
|
onInteractOutside,
|
|
8092
8532
|
...props
|
|
8093
8533
|
}) => {
|
|
8094
|
-
const contextValue = (0,
|
|
8534
|
+
const contextValue = (0, import_react33.useMemo)(() => ({ compact }), [compact]);
|
|
8095
8535
|
let controlProps = {
|
|
8096
|
-
...(0,
|
|
8536
|
+
...(0, import_type_guards27.isNotNil)(onOpenChange) && (0, import_type_guards27.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8097
8537
|
};
|
|
8098
8538
|
if (disabled) {
|
|
8099
8539
|
controlProps = {
|
|
@@ -8101,24 +8541,24 @@ var Menu = ({
|
|
|
8101
8541
|
onOpenChange: () => null
|
|
8102
8542
|
};
|
|
8103
8543
|
}
|
|
8104
|
-
return /* @__PURE__ */ (0,
|
|
8544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(
|
|
8105
8545
|
import_react_dropdown_menu.DropdownMenu,
|
|
8106
8546
|
{
|
|
8107
8547
|
modal: false,
|
|
8108
8548
|
...controlProps,
|
|
8109
8549
|
children: [
|
|
8110
|
-
/* @__PURE__ */ (0,
|
|
8550
|
+
/* @__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
8551
|
Button,
|
|
8112
8552
|
{
|
|
8113
8553
|
"aria-expanded": isOpen,
|
|
8114
8554
|
disabled,
|
|
8115
8555
|
forceState: isOpen ? "active" : void 0,
|
|
8116
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8556
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(Icon, { type: "caret-down" }),
|
|
8117
8557
|
...triggerProps,
|
|
8118
8558
|
children: label
|
|
8119
8559
|
}
|
|
8120
8560
|
) }),
|
|
8121
|
-
/* @__PURE__ */ (0,
|
|
8561
|
+
/* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
8122
8562
|
MenuContent,
|
|
8123
8563
|
{
|
|
8124
8564
|
...props,
|
|
@@ -8138,19 +8578,19 @@ var Menu = ({
|
|
|
8138
8578
|
Menu.displayName = "Menu";
|
|
8139
8579
|
|
|
8140
8580
|
// src/components/Menu/MenuLabel.tsx
|
|
8141
|
-
var
|
|
8581
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
8142
8582
|
var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
|
|
8143
|
-
var
|
|
8144
|
-
var StyledMenuLabel = (0,
|
|
8583
|
+
var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
8584
|
+
var StyledMenuLabel = (0, import_styled_components49.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
|
|
8145
8585
|
padding: var(--wui-space-02);
|
|
8146
8586
|
`;
|
|
8147
8587
|
var MenuLabel = ({ children, ...props }) => {
|
|
8148
|
-
return /* @__PURE__ */ (0,
|
|
8588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
8149
8589
|
StyledMenuLabel,
|
|
8150
8590
|
{
|
|
8151
8591
|
asChild: true,
|
|
8152
8592
|
...props,
|
|
8153
|
-
children: /* @__PURE__ */ (0,
|
|
8593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
8154
8594
|
Heading,
|
|
8155
8595
|
{
|
|
8156
8596
|
renderAs: "span",
|
|
@@ -8165,17 +8605,17 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
8165
8605
|
MenuLabel.displayName = "MenuLabel";
|
|
8166
8606
|
|
|
8167
8607
|
// src/components/Menu/SubMenu.tsx
|
|
8168
|
-
var
|
|
8169
|
-
var
|
|
8608
|
+
var import_react35 = require("react");
|
|
8609
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
8170
8610
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
8171
|
-
var
|
|
8611
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
8172
8612
|
|
|
8173
8613
|
// src/components/Menu/MenuItemButton.tsx
|
|
8174
|
-
var
|
|
8175
|
-
var
|
|
8176
|
-
var
|
|
8177
|
-
var
|
|
8178
|
-
var StyledButton3 = (0,
|
|
8614
|
+
var import_react34 = require("react");
|
|
8615
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
8616
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8617
|
+
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
8618
|
+
var StyledButton3 = (0, import_styled_components50.default)(Button)`
|
|
8179
8619
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
8180
8620
|
|
|
8181
8621
|
display: flex;
|
|
@@ -8214,7 +8654,7 @@ var StyledButton3 = (0, import_styled_components44.default)(Button)`
|
|
|
8214
8654
|
padding-left: var(--wui-space-04);
|
|
8215
8655
|
}
|
|
8216
8656
|
`;
|
|
8217
|
-
var StyledLeftIconContainer =
|
|
8657
|
+
var StyledLeftIconContainer = import_styled_components50.default.div`
|
|
8218
8658
|
height: var(--menu-item-left-icon-size);
|
|
8219
8659
|
width: var(--menu-item-left-icon-size);
|
|
8220
8660
|
|
|
@@ -8223,7 +8663,7 @@ var StyledLeftIconContainer = import_styled_components44.default.div`
|
|
|
8223
8663
|
width: var(--menu-item-left-icon-size);
|
|
8224
8664
|
}
|
|
8225
8665
|
`;
|
|
8226
|
-
var StyledRightIconContainer =
|
|
8666
|
+
var StyledRightIconContainer = import_styled_components50.default.div`
|
|
8227
8667
|
height: var(--menu-item-right-icon-size);
|
|
8228
8668
|
width: var(--menu-item-right-icon-size);
|
|
8229
8669
|
|
|
@@ -8232,28 +8672,28 @@ var StyledRightIconContainer = import_styled_components44.default.div`
|
|
|
8232
8672
|
width: var(--menu-item-right-icon-size);
|
|
8233
8673
|
}
|
|
8234
8674
|
`;
|
|
8235
|
-
var StyledLabelAndDescriptionContainer =
|
|
8675
|
+
var StyledLabelAndDescriptionContainer = import_styled_components50.default.div`
|
|
8236
8676
|
display: flex;
|
|
8237
8677
|
flex-direction: column;
|
|
8238
8678
|
gap: var(--menu-label-description-gap);
|
|
8239
8679
|
flex-basis: 100%;
|
|
8240
8680
|
`;
|
|
8241
|
-
var StyledBadgeContainer =
|
|
8681
|
+
var StyledBadgeContainer = import_styled_components50.default.div`
|
|
8242
8682
|
align-self: start;
|
|
8243
8683
|
justify-self: end;
|
|
8244
8684
|
font-size: var(--wui-typography-label-4-size);
|
|
8245
8685
|
color: var(--wui-color-text-secondary);
|
|
8246
8686
|
`;
|
|
8247
|
-
var MenuItemButton = (0,
|
|
8687
|
+
var MenuItemButton = (0, import_react34.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
8248
8688
|
let { colorScheme, badge } = props;
|
|
8249
8689
|
if (appearance === "dangerous") {
|
|
8250
|
-
if ((0,
|
|
8690
|
+
if ((0, import_type_guards28.isNotUndefined)(colorScheme)) {
|
|
8251
8691
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
8252
8692
|
}
|
|
8253
8693
|
colorScheme = "error";
|
|
8254
8694
|
}
|
|
8255
8695
|
if (appearance === "gated") {
|
|
8256
|
-
badge = /* @__PURE__ */ (0,
|
|
8696
|
+
badge = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
8257
8697
|
Icon,
|
|
8258
8698
|
{
|
|
8259
8699
|
colorScheme: "purple",
|
|
@@ -8265,7 +8705,7 @@ var MenuItemButton = (0, import_react33.forwardRef)(({ children, appearance, com
|
|
|
8265
8705
|
}
|
|
8266
8706
|
);
|
|
8267
8707
|
}
|
|
8268
|
-
return /* @__PURE__ */ (0,
|
|
8708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(
|
|
8269
8709
|
StyledButton3,
|
|
8270
8710
|
{
|
|
8271
8711
|
...props,
|
|
@@ -8275,10 +8715,10 @@ var MenuItemButton = (0, import_react33.forwardRef)(({ children, appearance, com
|
|
|
8275
8715
|
fullWidth: true,
|
|
8276
8716
|
unstyled: true,
|
|
8277
8717
|
children: [
|
|
8278
|
-
props.leftIcon ? /* @__PURE__ */ (0,
|
|
8279
|
-
/* @__PURE__ */ (0,
|
|
8280
|
-
(0,
|
|
8281
|
-
props.rightIcon ? /* @__PURE__ */ (0,
|
|
8718
|
+
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
8719
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
8720
|
+
(0, import_type_guards28.isNotNil)(badge) || (0, import_type_guards28.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
8721
|
+
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
8282
8722
|
]
|
|
8283
8723
|
}
|
|
8284
8724
|
);
|
|
@@ -8286,33 +8726,33 @@ var MenuItemButton = (0, import_react33.forwardRef)(({ children, appearance, com
|
|
|
8286
8726
|
MenuItemButton.displayName = "MenuItemButton";
|
|
8287
8727
|
|
|
8288
8728
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
8289
|
-
var
|
|
8290
|
-
var
|
|
8291
|
-
var StyledMenuItemLabel =
|
|
8292
|
-
var StyledMenuItemDescription = (0,
|
|
8729
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
8730
|
+
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
8731
|
+
var StyledMenuItemLabel = import_styled_components51.default.span``;
|
|
8732
|
+
var StyledMenuItemDescription = (0, import_styled_components51.default)(Text).attrs({
|
|
8293
8733
|
variant: "body4",
|
|
8294
8734
|
prominence: "secondary"
|
|
8295
8735
|
})``;
|
|
8296
8736
|
var MenuItemLabel = ({ children }) => {
|
|
8297
|
-
return /* @__PURE__ */ (0,
|
|
8737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(StyledMenuItemLabel, { children });
|
|
8298
8738
|
};
|
|
8299
8739
|
var MenuItemDescription = ({ children }) => {
|
|
8300
|
-
return /* @__PURE__ */ (0,
|
|
8740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(StyledMenuItemDescription, { children });
|
|
8301
8741
|
};
|
|
8302
8742
|
|
|
8303
8743
|
// src/components/Menu/SubMenu.tsx
|
|
8304
|
-
var
|
|
8305
|
-
var SubMenuContent = (0,
|
|
8744
|
+
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
8745
|
+
var SubMenuContent = (0, import_styled_components52.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
|
|
8306
8746
|
${menuContentCss}
|
|
8307
8747
|
|
|
8308
8748
|
${mq.smAndDown} {
|
|
8309
8749
|
transform: translateX(-100%) !important;
|
|
8310
8750
|
}
|
|
8311
8751
|
`;
|
|
8312
|
-
var StyledMobileSubMenuItems =
|
|
8752
|
+
var StyledMobileSubMenuItems = import_styled_components52.default.div`
|
|
8313
8753
|
margin-left: var(--wui-space-04);
|
|
8314
8754
|
`;
|
|
8315
|
-
var StyledSubTrigger = (0,
|
|
8755
|
+
var StyledSubTrigger = (0, import_styled_components52.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
|
|
8316
8756
|
outline: none;
|
|
8317
8757
|
|
|
8318
8758
|
&[data-state='open'],
|
|
@@ -8323,11 +8763,11 @@ var StyledSubTrigger = (0, import_styled_components46.default)(import_react_drop
|
|
|
8323
8763
|
var SubMenuTrigger = (props) => {
|
|
8324
8764
|
const { isSmAndUp } = useMq();
|
|
8325
8765
|
const Trigger3 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
|
|
8326
|
-
return /* @__PURE__ */ (0,
|
|
8766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Trigger3, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
|
|
8327
8767
|
MenuItemButton,
|
|
8328
8768
|
{
|
|
8329
8769
|
...props,
|
|
8330
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8770
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Icon, { type: "caret-right" })
|
|
8331
8771
|
}
|
|
8332
8772
|
) });
|
|
8333
8773
|
};
|
|
@@ -8339,16 +8779,16 @@ var SubMenu = ({
|
|
|
8339
8779
|
...props
|
|
8340
8780
|
}) => {
|
|
8341
8781
|
const { isSmAndUp } = useMq();
|
|
8342
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
8782
|
+
const [isExpanded, setIsExpanded] = (0, import_react35.useState)(false);
|
|
8343
8783
|
const { compact } = useMenuContext();
|
|
8344
|
-
return isSmAndUp ? /* @__PURE__ */ (0,
|
|
8345
|
-
/* @__PURE__ */ (0,
|
|
8346
|
-
/* @__PURE__ */ (0,
|
|
8347
|
-
(0,
|
|
8784
|
+
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
8785
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
8786
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemLabel, { children: label }),
|
|
8787
|
+
(0, import_type_guards29.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemDescription, { children: description }) : null
|
|
8348
8788
|
] }),
|
|
8349
|
-
/* @__PURE__ */ (0,
|
|
8350
|
-
] }) : /* @__PURE__ */ (0,
|
|
8351
|
-
/* @__PURE__ */ (0,
|
|
8789
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
8790
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
8791
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
8352
8792
|
SubMenuTrigger,
|
|
8353
8793
|
{
|
|
8354
8794
|
...props,
|
|
@@ -8357,28 +8797,28 @@ var SubMenu = ({
|
|
|
8357
8797
|
setIsExpanded((prev) => !prev);
|
|
8358
8798
|
},
|
|
8359
8799
|
children: [
|
|
8360
|
-
/* @__PURE__ */ (0,
|
|
8361
|
-
/* @__PURE__ */ (0,
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemLabel, { children: label }),
|
|
8801
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(MenuItemDescription, { children: description })
|
|
8362
8802
|
]
|
|
8363
8803
|
}
|
|
8364
8804
|
),
|
|
8365
|
-
/* @__PURE__ */ (0,
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime197.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
|
|
8366
8806
|
] });
|
|
8367
8807
|
};
|
|
8368
8808
|
SubMenu.displayName = "SubMenu";
|
|
8369
8809
|
|
|
8370
8810
|
// src/components/Menu/MenuItem.tsx
|
|
8371
|
-
var
|
|
8811
|
+
var import_react36 = require("react");
|
|
8372
8812
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
8373
|
-
var
|
|
8374
|
-
var MenuItem = (0,
|
|
8813
|
+
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
8814
|
+
var MenuItem = (0, import_react36.forwardRef)(
|
|
8375
8815
|
({ onSelect = () => null, ...props }, ref) => {
|
|
8376
|
-
return /* @__PURE__ */ (0,
|
|
8816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
8377
8817
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
8378
8818
|
{
|
|
8379
8819
|
asChild: true,
|
|
8380
8820
|
onSelect,
|
|
8381
|
-
children: /* @__PURE__ */ (0,
|
|
8821
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
8382
8822
|
MenuItemButton,
|
|
8383
8823
|
{
|
|
8384
8824
|
...props,
|
|
@@ -8394,10 +8834,10 @@ MenuItem.displayName = "MenuItem";
|
|
|
8394
8834
|
|
|
8395
8835
|
// src/components/Menu/MenuRadioGroup.tsx
|
|
8396
8836
|
var import_react_dropdown_menu5 = require("@radix-ui/react-dropdown-menu");
|
|
8397
|
-
var
|
|
8837
|
+
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
8398
8838
|
var MenuRadioGroup = ({ children, label, ...props }) => {
|
|
8399
|
-
return /* @__PURE__ */ (0,
|
|
8400
|
-
/* @__PURE__ */ (0,
|
|
8839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
|
|
8840
|
+
/* @__PURE__ */ (0, import_jsx_runtime199.jsx)(MenuLabel, { children: label }),
|
|
8401
8841
|
children
|
|
8402
8842
|
] });
|
|
8403
8843
|
};
|
|
@@ -8405,11 +8845,11 @@ MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
|
8405
8845
|
|
|
8406
8846
|
// src/components/Menu/RadioMenuItem.tsx
|
|
8407
8847
|
var import_react_dropdown_menu6 = require("@radix-ui/react-dropdown-menu");
|
|
8408
|
-
var
|
|
8848
|
+
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
8409
8849
|
var RadioMenuItem = ({
|
|
8410
8850
|
onSelect,
|
|
8411
8851
|
value,
|
|
8412
|
-
indicator = /* @__PURE__ */ (0,
|
|
8852
|
+
indicator = /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8413
8853
|
Icon,
|
|
8414
8854
|
{
|
|
8415
8855
|
size: "sm",
|
|
@@ -8419,17 +8859,17 @@ var RadioMenuItem = ({
|
|
|
8419
8859
|
...props
|
|
8420
8860
|
}) => {
|
|
8421
8861
|
const extraProps = onSelect ? { onSelect } : {};
|
|
8422
|
-
return /* @__PURE__ */ (0,
|
|
8862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8423
8863
|
import_react_dropdown_menu6.DropdownMenuRadioItem,
|
|
8424
8864
|
{
|
|
8425
8865
|
...extraProps,
|
|
8426
8866
|
asChild: true,
|
|
8427
8867
|
value,
|
|
8428
|
-
children: /* @__PURE__ */ (0,
|
|
8868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8429
8869
|
MenuItemButton,
|
|
8430
8870
|
{
|
|
8431
8871
|
...props,
|
|
8432
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8872
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
|
|
8433
8873
|
}
|
|
8434
8874
|
)
|
|
8435
8875
|
}
|
|
@@ -8439,9 +8879,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
8439
8879
|
|
|
8440
8880
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
8441
8881
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
8442
|
-
var
|
|
8882
|
+
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
8443
8883
|
var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
8444
|
-
return checked ? /* @__PURE__ */ (0,
|
|
8884
|
+
return checked ? /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
8445
8885
|
"svg",
|
|
8446
8886
|
{
|
|
8447
8887
|
...props,
|
|
@@ -8451,14 +8891,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8451
8891
|
width: "24",
|
|
8452
8892
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8453
8893
|
children: [
|
|
8454
|
-
/* @__PURE__ */ (0,
|
|
8894
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8455
8895
|
"path",
|
|
8456
8896
|
{
|
|
8457
8897
|
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
8898
|
fill: "#2949e5"
|
|
8459
8899
|
}
|
|
8460
8900
|
),
|
|
8461
|
-
/* @__PURE__ */ (0,
|
|
8901
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8462
8902
|
"path",
|
|
8463
8903
|
{
|
|
8464
8904
|
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 +8907,7 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8467
8907
|
)
|
|
8468
8908
|
]
|
|
8469
8909
|
}
|
|
8470
|
-
) : /* @__PURE__ */ (0,
|
|
8910
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
8471
8911
|
"svg",
|
|
8472
8912
|
{
|
|
8473
8913
|
...props,
|
|
@@ -8477,14 +8917,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8477
8917
|
width: "24",
|
|
8478
8918
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8479
8919
|
children: [
|
|
8480
|
-
/* @__PURE__ */ (0,
|
|
8920
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8481
8921
|
"path",
|
|
8482
8922
|
{
|
|
8483
8923
|
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
8924
|
fill: "#fcfcfd"
|
|
8485
8925
|
}
|
|
8486
8926
|
),
|
|
8487
|
-
/* @__PURE__ */ (0,
|
|
8927
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8488
8928
|
"path",
|
|
8489
8929
|
{
|
|
8490
8930
|
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 +8941,18 @@ var CheckboxMenuItem = ({
|
|
|
8501
8941
|
onCheckedChange,
|
|
8502
8942
|
...props
|
|
8503
8943
|
}) => {
|
|
8504
|
-
return /* @__PURE__ */ (0,
|
|
8944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8505
8945
|
import_react_dropdown_menu7.DropdownMenuCheckboxItem,
|
|
8506
8946
|
{
|
|
8507
8947
|
asChild: true,
|
|
8508
8948
|
checked,
|
|
8509
8949
|
onCheckedChange,
|
|
8510
8950
|
onSelect,
|
|
8511
|
-
children: /* @__PURE__ */ (0,
|
|
8951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8512
8952
|
MenuItemButton,
|
|
8513
8953
|
{
|
|
8514
8954
|
...props,
|
|
8515
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8955
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(CheckboxIndicator2, { checked })
|
|
8516
8956
|
}
|
|
8517
8957
|
)
|
|
8518
8958
|
}
|
|
@@ -8521,59 +8961,37 @@ var CheckboxMenuItem = ({
|
|
|
8521
8961
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
8522
8962
|
|
|
8523
8963
|
// src/components/Modal/Modal.tsx
|
|
8524
|
-
var
|
|
8525
|
-
var
|
|
8964
|
+
var import_react40 = require("react");
|
|
8965
|
+
var import_styled_components57 = __toESM(require("styled-components"));
|
|
8526
8966
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
8527
|
-
var
|
|
8967
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
8528
8968
|
|
|
8529
8969
|
// src/components/Modal/ModalHeader.tsx
|
|
8530
|
-
var
|
|
8970
|
+
var import_styled_components54 = __toESM(require("styled-components"));
|
|
8531
8971
|
var import_react_dialog2 = require("@radix-ui/react-dialog");
|
|
8532
8972
|
|
|
8533
8973
|
// src/components/Modal/ModalCloseButton.tsx
|
|
8534
|
-
var
|
|
8974
|
+
var import_styled_components53 = __toESM(require("styled-components"));
|
|
8535
8975
|
var import_react_dialog = require("@radix-ui/react-dialog");
|
|
8536
|
-
var
|
|
8537
|
-
var CloseButton = (0,
|
|
8976
|
+
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
8977
|
+
var CloseButton = (0, import_styled_components53.default)(import_react_dialog.Close)`
|
|
8538
8978
|
align-self: start;
|
|
8539
8979
|
`;
|
|
8540
8980
|
var ModalCloseButton = () => {
|
|
8541
|
-
return /* @__PURE__ */ (0,
|
|
8981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(CloseButton, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8542
8982
|
IconButton,
|
|
8543
8983
|
{
|
|
8544
8984
|
label: "Dismiss modal",
|
|
8545
8985
|
size: "sm",
|
|
8546
8986
|
variant: "ghost",
|
|
8547
|
-
children: /* @__PURE__ */ (0,
|
|
8987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(Icon, { type: "close" })
|
|
8548
8988
|
}
|
|
8549
|
-
) });
|
|
8550
|
-
};
|
|
8551
|
-
|
|
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 });
|
|
8989
|
+
) });
|
|
8571
8990
|
};
|
|
8572
|
-
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
8573
8991
|
|
|
8574
8992
|
// src/components/Modal/ModalHeader.tsx
|
|
8575
|
-
var
|
|
8576
|
-
var Header =
|
|
8993
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
8994
|
+
var Header = import_styled_components54.default.header`
|
|
8577
8995
|
display: flex;
|
|
8578
8996
|
order: 1;
|
|
8579
8997
|
gap: var(--wui-space-01);
|
|
@@ -8585,7 +9003,7 @@ var Header = import_styled_components49.default.header`
|
|
|
8585
9003
|
margin-top: 0;
|
|
8586
9004
|
}
|
|
8587
9005
|
`;
|
|
8588
|
-
var Title = (0,
|
|
9006
|
+
var Title = (0, import_styled_components54.default)(import_react_dialog2.Title)`
|
|
8589
9007
|
font-family: var(--wui-typography-heading-2-family);
|
|
8590
9008
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
8591
9009
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -8597,28 +9015,28 @@ var ModalHeader = ({
|
|
|
8597
9015
|
hideCloseButton
|
|
8598
9016
|
}) => {
|
|
8599
9017
|
const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
|
|
8600
|
-
return /* @__PURE__ */ (0,
|
|
8601
|
-
/* @__PURE__ */ (0,
|
|
8602
|
-
hideCloseButton ? null : /* @__PURE__ */ (0,
|
|
9018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(Header, { children: [
|
|
9019
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(TitleWrapper, { children: title }),
|
|
9020
|
+
hideCloseButton ? null : /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(ModalCloseButton, {})
|
|
8603
9021
|
] });
|
|
8604
9022
|
};
|
|
8605
9023
|
|
|
8606
9024
|
// src/components/Modal/ModalContent.tsx
|
|
8607
|
-
var
|
|
8608
|
-
var
|
|
9025
|
+
var import_react38 = require("react");
|
|
9026
|
+
var import_styled_components55 = __toESM(require("styled-components"));
|
|
8609
9027
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
8610
9028
|
|
|
8611
9029
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
8612
|
-
var
|
|
8613
|
-
var
|
|
9030
|
+
var import_react37 = require("react");
|
|
9031
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
8614
9032
|
var useFocusRestore = () => {
|
|
8615
|
-
const previouslyFocusedRef = (0,
|
|
8616
|
-
(0,
|
|
9033
|
+
const previouslyFocusedRef = (0, import_react37.useRef)(null);
|
|
9034
|
+
(0, import_react37.useEffect)(() => {
|
|
8617
9035
|
previouslyFocusedRef.current = document.activeElement;
|
|
8618
9036
|
}, []);
|
|
8619
|
-
(0,
|
|
9037
|
+
(0, import_react37.useEffect)(() => {
|
|
8620
9038
|
return () => {
|
|
8621
|
-
if ((0,
|
|
9039
|
+
if ((0, import_type_guards30.isNotNil)(previouslyFocusedRef.current)) {
|
|
8622
9040
|
setTimeout(() => {
|
|
8623
9041
|
previouslyFocusedRef.current?.focus();
|
|
8624
9042
|
}, 0);
|
|
@@ -8628,8 +9046,8 @@ var useFocusRestore = () => {
|
|
|
8628
9046
|
};
|
|
8629
9047
|
|
|
8630
9048
|
// src/components/Modal/ModalContent.tsx
|
|
8631
|
-
var
|
|
8632
|
-
var StyledModalContent = (0,
|
|
9049
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
9050
|
+
var StyledModalContent = (0, import_styled_components55.default)(import_react_dialog3.Content)`
|
|
8633
9051
|
background-color: var(--wui-color-bg-app);
|
|
8634
9052
|
box-sizing: border-box;
|
|
8635
9053
|
display: flex;
|
|
@@ -8670,10 +9088,10 @@ var StyledModalContent = (0, import_styled_components50.default)(import_react_di
|
|
|
8670
9088
|
}
|
|
8671
9089
|
}
|
|
8672
9090
|
`;
|
|
8673
|
-
var ModalContent = (0,
|
|
9091
|
+
var ModalContent = (0, import_react38.forwardRef)(
|
|
8674
9092
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
8675
9093
|
useFocusRestore();
|
|
8676
|
-
return /* @__PURE__ */ (0,
|
|
9094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8677
9095
|
StyledModalContent,
|
|
8678
9096
|
{
|
|
8679
9097
|
ref,
|
|
@@ -8688,9 +9106,9 @@ var ModalContent = (0, import_react37.forwardRef)(
|
|
|
8688
9106
|
);
|
|
8689
9107
|
|
|
8690
9108
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
8691
|
-
var
|
|
8692
|
-
var
|
|
8693
|
-
var
|
|
9109
|
+
var import_react39 = require("react");
|
|
9110
|
+
var import_styled_components56 = __toESM(require("styled-components"));
|
|
9111
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8694
9112
|
var backdropAnimationDuration = 150;
|
|
8695
9113
|
var alignVerticalMap = {
|
|
8696
9114
|
stretch: "normal",
|
|
@@ -8703,7 +9121,7 @@ var alignHorizontalMap = {
|
|
|
8703
9121
|
center: "center",
|
|
8704
9122
|
right: "end"
|
|
8705
9123
|
};
|
|
8706
|
-
var BackdropComponent =
|
|
9124
|
+
var BackdropComponent = import_styled_components56.default.div`
|
|
8707
9125
|
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
8708
9126
|
animation-name: backdropShow;
|
|
8709
9127
|
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
@@ -8726,8 +9144,8 @@ var BackdropComponent = import_styled_components51.default.div`
|
|
|
8726
9144
|
}
|
|
8727
9145
|
}
|
|
8728
9146
|
`;
|
|
8729
|
-
var Backdrop = (0,
|
|
8730
|
-
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
9147
|
+
var Backdrop = (0, import_react39.forwardRef)(
|
|
9148
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
8731
9149
|
BackdropComponent,
|
|
8732
9150
|
{
|
|
8733
9151
|
ref,
|
|
@@ -8741,14 +9159,14 @@ var Backdrop = (0, import_react38.forwardRef)(
|
|
|
8741
9159
|
Backdrop.displayName = "Backdrop";
|
|
8742
9160
|
|
|
8743
9161
|
// src/components/Modal/Modal.tsx
|
|
8744
|
-
var
|
|
9162
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
8745
9163
|
var DEFAULT_MODAL_WIDTH = "532px";
|
|
8746
|
-
var ModalBody =
|
|
9164
|
+
var ModalBody = import_styled_components57.default.div`
|
|
8747
9165
|
flex-direction: column;
|
|
8748
9166
|
display: flex;
|
|
8749
9167
|
order: 2;
|
|
8750
9168
|
`;
|
|
8751
|
-
var Modal = (0,
|
|
9169
|
+
var Modal = (0, import_react40.forwardRef)(
|
|
8752
9170
|
({
|
|
8753
9171
|
children,
|
|
8754
9172
|
fullHeight = false,
|
|
@@ -8761,24 +9179,24 @@ var Modal = (0, import_react39.forwardRef)(
|
|
|
8761
9179
|
width = DEFAULT_MODAL_WIDTH,
|
|
8762
9180
|
...props
|
|
8763
9181
|
}, ref) => {
|
|
8764
|
-
return /* @__PURE__ */ (0,
|
|
9182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
8765
9183
|
import_react_dialog4.Root,
|
|
8766
9184
|
{
|
|
8767
9185
|
onOpenChange: (open2) => {
|
|
8768
|
-
if (!open2 && (0,
|
|
9186
|
+
if (!open2 && (0, import_type_guards31.isNotNil)(onRequestClose)) {
|
|
8769
9187
|
onRequestClose();
|
|
8770
9188
|
}
|
|
8771
9189
|
},
|
|
8772
9190
|
open: isOpen,
|
|
8773
|
-
children: /* @__PURE__ */ (0,
|
|
8774
|
-
/* @__PURE__ */ (0,
|
|
8775
|
-
/* @__PURE__ */ (0,
|
|
9191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(import_react_dialog4.Portal, { children: [
|
|
9192
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Backdrop, {}),
|
|
9193
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
8776
9194
|
ModalContent,
|
|
8777
9195
|
{
|
|
8778
9196
|
ref,
|
|
8779
9197
|
fullHeight,
|
|
8780
9198
|
onOpenAutoFocus: (event) => {
|
|
8781
|
-
if ((0,
|
|
9199
|
+
if ((0, import_type_guards31.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
8782
9200
|
event.preventDefault();
|
|
8783
9201
|
requestAnimationFrame(() => {
|
|
8784
9202
|
initialFocusRef.current?.focus();
|
|
@@ -8788,8 +9206,8 @@ var Modal = (0, import_react39.forwardRef)(
|
|
|
8788
9206
|
width,
|
|
8789
9207
|
...props,
|
|
8790
9208
|
children: [
|
|
8791
|
-
/* @__PURE__ */ (0,
|
|
8792
|
-
/* @__PURE__ */ (0,
|
|
9209
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(ModalBody, { children }),
|
|
9210
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
8793
9211
|
ModalHeader,
|
|
8794
9212
|
{
|
|
8795
9213
|
hideCloseButton,
|
|
@@ -8808,16 +9226,16 @@ var Modal = (0, import_react39.forwardRef)(
|
|
|
8808
9226
|
Modal.displayName = "Modal";
|
|
8809
9227
|
|
|
8810
9228
|
// src/components/Radio/Radio.tsx
|
|
8811
|
-
var
|
|
8812
|
-
var
|
|
8813
|
-
var
|
|
8814
|
-
var
|
|
8815
|
-
var StyledLabelWrapper2 =
|
|
9229
|
+
var import_react41 = require("react");
|
|
9230
|
+
var import_styled_components58 = __toESM(require("styled-components"));
|
|
9231
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9232
|
+
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
9233
|
+
var StyledLabelWrapper2 = import_styled_components58.default.div`
|
|
8816
9234
|
display: flex;
|
|
8817
9235
|
flex-direction: column;
|
|
8818
9236
|
padding-left: var(--wui-space-02);
|
|
8819
9237
|
`;
|
|
8820
|
-
var StyledRadio =
|
|
9238
|
+
var StyledRadio = import_styled_components58.default.input`
|
|
8821
9239
|
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
8822
9240
|
appearance: none;
|
|
8823
9241
|
margin: 0;
|
|
@@ -8843,11 +9261,11 @@ var StyledRadio = import_styled_components53.default.input`
|
|
|
8843
9261
|
transform: scale(1);
|
|
8844
9262
|
}
|
|
8845
9263
|
`;
|
|
8846
|
-
var disabledStyle2 =
|
|
9264
|
+
var disabledStyle2 = import_styled_components58.css`
|
|
8847
9265
|
cursor: not-allowed;
|
|
8848
9266
|
opacity: 0.5;
|
|
8849
9267
|
`;
|
|
8850
|
-
var errorStyle =
|
|
9268
|
+
var errorStyle = import_styled_components58.css`
|
|
8851
9269
|
/* TODO Lamp to design error state */
|
|
8852
9270
|
&:hover,
|
|
8853
9271
|
&:focus,
|
|
@@ -8855,11 +9273,11 @@ var errorStyle = import_styled_components53.css`
|
|
|
8855
9273
|
border-color: transparent !important;
|
|
8856
9274
|
}
|
|
8857
9275
|
`;
|
|
8858
|
-
var defaultHoverStyle =
|
|
9276
|
+
var defaultHoverStyle = import_styled_components58.css`
|
|
8859
9277
|
/* TODO Lamp to design hover state */
|
|
8860
9278
|
cursor: pointer;
|
|
8861
9279
|
`;
|
|
8862
|
-
var StyledRadioWrapper =
|
|
9280
|
+
var StyledRadioWrapper = import_styled_components58.default.div`
|
|
8863
9281
|
align-items: baseline;
|
|
8864
9282
|
border: 1px solid transparent;
|
|
8865
9283
|
border-radius: 4px;
|
|
@@ -8882,7 +9300,7 @@ var StyledRadioWrapper = import_styled_components53.default.div`
|
|
|
8882
9300
|
|
|
8883
9301
|
${({ disabled }) => disabled && disabledStyle2};
|
|
8884
9302
|
`;
|
|
8885
|
-
var Radio = (0,
|
|
9303
|
+
var Radio = (0, import_react41.forwardRef)(
|
|
8886
9304
|
({
|
|
8887
9305
|
checked,
|
|
8888
9306
|
disabled = false,
|
|
@@ -8895,15 +9313,15 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8895
9313
|
value = "false",
|
|
8896
9314
|
...otherProps
|
|
8897
9315
|
}, ref) => {
|
|
8898
|
-
const generatedId = (0,
|
|
8899
|
-
const computedId = (0,
|
|
8900
|
-
return /* @__PURE__ */ (0,
|
|
9316
|
+
const generatedId = (0, import_react41.useId)();
|
|
9317
|
+
const computedId = (0, import_type_guards32.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
|
|
9318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(
|
|
8901
9319
|
StyledRadioWrapper,
|
|
8902
9320
|
{
|
|
8903
9321
|
"aria-invalid": otherProps["aria-invalid"],
|
|
8904
9322
|
disabled,
|
|
8905
9323
|
children: [
|
|
8906
|
-
/* @__PURE__ */ (0,
|
|
9324
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
8907
9325
|
StyledRadio,
|
|
8908
9326
|
{
|
|
8909
9327
|
ref,
|
|
@@ -8918,8 +9336,8 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8918
9336
|
...otherProps
|
|
8919
9337
|
}
|
|
8920
9338
|
),
|
|
8921
|
-
/* @__PURE__ */ (0,
|
|
8922
|
-
/* @__PURE__ */ (0,
|
|
9339
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(StyledLabelWrapper2, { children: [
|
|
9340
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
8923
9341
|
Label,
|
|
8924
9342
|
{
|
|
8925
9343
|
disabled,
|
|
@@ -8928,7 +9346,7 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8928
9346
|
children: label
|
|
8929
9347
|
}
|
|
8930
9348
|
),
|
|
8931
|
-
/* @__PURE__ */ (0,
|
|
9349
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(LabelDescription, { children: description })
|
|
8932
9350
|
] })
|
|
8933
9351
|
]
|
|
8934
9352
|
}
|
|
@@ -8938,12 +9356,12 @@ var Radio = (0, import_react40.forwardRef)(
|
|
|
8938
9356
|
Radio.displayName = "Radio";
|
|
8939
9357
|
|
|
8940
9358
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
8941
|
-
var
|
|
8942
|
-
var
|
|
9359
|
+
var import_react42 = require("react");
|
|
9360
|
+
var import_styled_components59 = __toESM(require("styled-components"));
|
|
8943
9361
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
8944
|
-
var
|
|
8945
|
-
var
|
|
8946
|
-
var
|
|
9362
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
9363
|
+
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
9364
|
+
var segmentedControlStyles = import_styled_components59.css`
|
|
8947
9365
|
display: inline-flex;
|
|
8948
9366
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
8949
9367
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -8951,7 +9369,10 @@ var StyledSegmentedControl = (0, import_styled_components54.default)(import_reac
|
|
|
8951
9369
|
gap: var(--wui-space-01);
|
|
8952
9370
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
8953
9371
|
`;
|
|
8954
|
-
var
|
|
9372
|
+
var StyledSegmentedControl = (0, import_styled_components59.default)(import_react_toggle_group.Root)`
|
|
9373
|
+
${segmentedControlStyles}
|
|
9374
|
+
`;
|
|
9375
|
+
var SegmentedControl = (0, import_react42.forwardRef)(
|
|
8955
9376
|
({
|
|
8956
9377
|
children,
|
|
8957
9378
|
disabled = false,
|
|
@@ -8960,475 +9381,126 @@ var SegmentedControl = (0, import_react41.forwardRef)(
|
|
|
8960
9381
|
onSelectedValueChange,
|
|
8961
9382
|
...props
|
|
8962
9383
|
}, ref) => {
|
|
8963
|
-
if ((0,
|
|
9384
|
+
if ((0, import_type_guards33.isNil)(children)) {
|
|
8964
9385
|
return null;
|
|
8965
9386
|
}
|
|
8966
|
-
return /* @__PURE__ */ (0,
|
|
9387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
8967
9388
|
StyledSegmentedControl,
|
|
8968
9389
|
{
|
|
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
|
-
var import_react42 = require("react");
|
|
8987
|
-
var import_styled_components55 = __toESM(require("styled-components"));
|
|
8988
|
-
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
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"));
|
|
9074
|
-
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
|
-
|
|
9122
|
-
svg path {
|
|
9123
|
-
fill: var(--wui-color-icon);
|
|
9124
|
-
}
|
|
9125
|
-
|
|
9126
|
-
:hover {
|
|
9127
|
-
background: var(--wui-color-bg-surface-secondary-hover);
|
|
9128
|
-
}
|
|
9129
|
-
|
|
9130
|
-
:active {
|
|
9131
|
-
background: var(--wui-color-bg-surface-secondary-active);
|
|
9132
|
-
}
|
|
9133
|
-
|
|
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
|
-
display: inline-flex;
|
|
9145
|
-
overflow: hidden;
|
|
9146
|
-
|
|
9147
|
-
> * {
|
|
9148
|
-
transition: background var(--wui-duration-01) var(--wui-motion-ease);
|
|
9149
|
-
}
|
|
9150
|
-
`;
|
|
9151
|
-
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
9152
|
-
if ((0, import_type_guards34.isNil)(onClickRemove)) {
|
|
9153
|
-
return null;
|
|
9154
|
-
}
|
|
9155
|
-
if ((0, import_type_guards34.isNil)(onClickRemoveLabel)) {
|
|
9156
|
-
throw new Error(
|
|
9157
|
-
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
9158
|
-
);
|
|
9159
|
-
}
|
|
9160
|
-
return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(import_jsx_runtime205.Fragment, { children: [
|
|
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
|
-
] });
|
|
9181
|
-
};
|
|
9182
|
-
var Tag = (0, import_react43.forwardRef)(
|
|
9183
|
-
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
9184
|
-
const labelProps = (0, import_type_guards34.isNotNil)(href) && (0, import_type_guards34.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
9185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
|
|
9186
|
-
StyledTag,
|
|
9187
|
-
{
|
|
9188
|
-
ref,
|
|
9189
|
-
$colorScheme: colorScheme,
|
|
9190
|
-
...otherProps,
|
|
9191
|
-
children: [
|
|
9192
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
9193
|
-
TagLabel,
|
|
9194
|
-
{
|
|
9195
|
-
...labelProps,
|
|
9196
|
-
$colorScheme: colorScheme,
|
|
9197
|
-
children: label
|
|
9198
|
-
}
|
|
9199
|
-
),
|
|
9200
|
-
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
9201
|
-
RemoveButton,
|
|
9202
|
-
{
|
|
9203
|
-
colorScheme,
|
|
9204
|
-
onClickRemove,
|
|
9205
|
-
onClickRemoveLabel
|
|
9206
|
-
}
|
|
9207
|
-
)
|
|
9208
|
-
]
|
|
9390
|
+
ref,
|
|
9391
|
+
$fullWidth: fullWidth,
|
|
9392
|
+
disabled,
|
|
9393
|
+
loop: true,
|
|
9394
|
+
onValueChange: onSelectedValueChange,
|
|
9395
|
+
rovingFocus: true,
|
|
9396
|
+
type: "single",
|
|
9397
|
+
value: selectedValue,
|
|
9398
|
+
...props,
|
|
9399
|
+
children
|
|
9209
9400
|
}
|
|
9210
9401
|
);
|
|
9211
9402
|
}
|
|
9212
9403
|
);
|
|
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};
|
|
9404
|
+
SegmentedControl.displayName = "SegmentedControl";
|
|
9238
9405
|
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9406
|
+
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
9407
|
+
var import_react43 = require("react");
|
|
9408
|
+
var import_styled_components60 = __toESM(require("styled-components"));
|
|
9409
|
+
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
9410
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
9411
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
9412
|
+
var segmentedControlItemStyles = import_styled_components60.css`
|
|
9413
|
+
all: unset; /* ToggleGroupItem is a button element */
|
|
9414
|
+
align-items: center;
|
|
9415
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
9416
|
+
color: var(--wui-color-text-secondary);
|
|
9417
|
+
cursor: pointer;
|
|
9418
|
+
display: flex;
|
|
9419
|
+
flex-grow: 1;
|
|
9420
|
+
flex-shrink: 1;
|
|
9421
|
+
font-size: var(--wui-typography-label-3-size);
|
|
9422
|
+
justify-content: center;
|
|
9423
|
+
padding: 6px 8px;
|
|
9245
9424
|
user-select: none;
|
|
9246
|
-
animation-duration: 400ms;
|
|
9247
|
-
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
9248
|
-
will-change: transform, opacity;
|
|
9249
|
-
max-width: 30em;
|
|
9250
9425
|
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9426
|
+
/* Icon component */
|
|
9427
|
+
svg {
|
|
9428
|
+
height: 16px;
|
|
9429
|
+
width: 16px;
|
|
9254
9430
|
|
|
9255
|
-
|
|
9256
|
-
|
|
9431
|
+
/* add right margin if there's a label and an icon */
|
|
9432
|
+
${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
|
|
9257
9433
|
}
|
|
9258
9434
|
|
|
9259
|
-
|
|
9260
|
-
|
|
9435
|
+
&:hover {
|
|
9436
|
+
background-color: var(--wui-color-bg-surface-secondary-hover);
|
|
9261
9437
|
}
|
|
9262
9438
|
|
|
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;
|
|
9439
|
+
&:focus-visible {
|
|
9440
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
9283
9441
|
}
|
|
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
9442
|
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
var
|
|
9324
|
-
var
|
|
9325
|
-
|
|
9326
|
-
return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
9327
|
-
"g",
|
|
9328
|
-
{
|
|
9329
|
-
"data-testid": "ui-wistia-logo-brandmark",
|
|
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;
|
|
9443
|
+
/* note: react-toggle-group uses "on" and react-tabs uses "active" */
|
|
9444
|
+
&[data-state='on'],
|
|
9445
|
+
&[data-state='active'] {
|
|
9446
|
+
background-color: var(--wui-color-bg-fill-white);
|
|
9447
|
+
color: var(--wui-color-text-selected);
|
|
9448
|
+
cursor: default;
|
|
9347
9449
|
}
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9450
|
+
|
|
9451
|
+
&:focus-visible,
|
|
9452
|
+
&[data-state='on'],
|
|
9453
|
+
&[data-state='active'] {
|
|
9454
|
+
svg path {
|
|
9455
|
+
fill: var(--wui-color-focus-ring);
|
|
9354
9456
|
}
|
|
9355
|
-
);
|
|
9356
|
-
};
|
|
9357
|
-
var computedViewBox = (iconOnly) => {
|
|
9358
|
-
if (iconOnly) {
|
|
9359
|
-
return "0 0 34.4 26.78";
|
|
9360
9457
|
}
|
|
9361
|
-
return "0 0 144 31.47";
|
|
9362
|
-
};
|
|
9363
|
-
var WistiaLogoComponent = import_styled_components58.default.svg`
|
|
9364
|
-
height: ${({ height }) => `${height}px`};
|
|
9365
9458
|
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
max-width: 100%;
|
|
9459
|
+
&[data-disabled] {
|
|
9460
|
+
cursor: not-allowed;
|
|
9369
9461
|
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
${({ $hoverColor }) => $hoverColor !== void 0 ? `fill: ${$hoverColor}` : null};
|
|
9462
|
+
&:hover {
|
|
9463
|
+
background-color: inherit;
|
|
9373
9464
|
}
|
|
9374
9465
|
}
|
|
9375
9466
|
`;
|
|
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
|
-
WistiaLogoComponent,
|
|
9407
|
-
{
|
|
9408
|
-
$hoverColor: hoverColor,
|
|
9409
|
-
height,
|
|
9410
|
-
role: "img",
|
|
9411
|
-
viewBox: computedViewBox(iconOnly),
|
|
9412
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9413
|
-
...otherProps,
|
|
9414
|
-
children: [
|
|
9415
|
-
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)("title", { children: title }),
|
|
9416
|
-
(0, import_type_guards35.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("desc", { children: description }) : null,
|
|
9417
|
-
renderBrandmark(brandmarkColor, iconOnly),
|
|
9418
|
-
renderLogotype(logotypeColor, iconOnly)
|
|
9419
|
-
]
|
|
9420
|
-
}
|
|
9421
|
-
);
|
|
9422
|
-
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("a", { href, children: Logo }) : Logo;
|
|
9423
|
-
};
|
|
9424
|
-
WistiaLogo.displayName = "WistiaLogo";
|
|
9467
|
+
var StyledSegmentedControlItem = (0, import_styled_components60.default)(import_react_toggle_group2.Item)`
|
|
9468
|
+
${segmentedControlItemStyles}
|
|
9469
|
+
`;
|
|
9470
|
+
var SegmentedControlItem = (0, import_react43.forwardRef)(
|
|
9471
|
+
({ disabled, icon, label, "aria-label": ariaLabel, value }, ref) => {
|
|
9472
|
+
const handleClick = (event) => {
|
|
9473
|
+
const target = event.target;
|
|
9474
|
+
const { state } = target.dataset;
|
|
9475
|
+
if (state === "on") {
|
|
9476
|
+
event.preventDefault();
|
|
9477
|
+
}
|
|
9478
|
+
};
|
|
9479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
|
|
9480
|
+
StyledSegmentedControlItem,
|
|
9481
|
+
{
|
|
9482
|
+
ref,
|
|
9483
|
+
$hasLabel: (0, import_type_guards34.isNotNil)(label),
|
|
9484
|
+
"aria-label": (0, import_type_guards34.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9485
|
+
disabled,
|
|
9486
|
+
onClick: handleClick,
|
|
9487
|
+
value,
|
|
9488
|
+
children: [
|
|
9489
|
+
icon,
|
|
9490
|
+
label
|
|
9491
|
+
]
|
|
9492
|
+
}
|
|
9493
|
+
);
|
|
9494
|
+
}
|
|
9495
|
+
);
|
|
9496
|
+
SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
9425
9497
|
|
|
9426
9498
|
// src/components/Select/Select.tsx
|
|
9427
9499
|
var import_react_select = require("@radix-ui/react-select");
|
|
9428
9500
|
var import_react44 = require("react");
|
|
9429
|
-
var
|
|
9430
|
-
var
|
|
9431
|
-
var StyledTrigger = (0,
|
|
9501
|
+
var import_styled_components61 = __toESM(require("styled-components"));
|
|
9502
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
9503
|
+
var StyledTrigger = (0, import_styled_components61.default)(import_react_select.Trigger)`
|
|
9432
9504
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9433
9505
|
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
9434
9506
|
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -9469,7 +9541,7 @@ var StyledTrigger = (0, import_styled_components59.default)(import_react_select.
|
|
|
9469
9541
|
background-color: var(--wui-color-bg-surface-disabled);
|
|
9470
9542
|
}
|
|
9471
9543
|
`;
|
|
9472
|
-
var StyledContent2 = (0,
|
|
9544
|
+
var StyledContent2 = (0, import_styled_components61.default)(import_react_select.Content)`
|
|
9473
9545
|
--wui-select-content-border: var(--wui-color-border);
|
|
9474
9546
|
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
9475
9547
|
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -9495,13 +9567,13 @@ var Select = (0, import_react44.forwardRef)(
|
|
|
9495
9567
|
...props
|
|
9496
9568
|
}, forwardedRef) => {
|
|
9497
9569
|
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
9498
|
-
return /* @__PURE__ */ (0,
|
|
9570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
9499
9571
|
import_react_select.Root,
|
|
9500
9572
|
{
|
|
9501
9573
|
...props,
|
|
9502
9574
|
onValueChange: onChange,
|
|
9503
9575
|
children: [
|
|
9504
|
-
/* @__PURE__ */ (0,
|
|
9576
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
9505
9577
|
StyledTrigger,
|
|
9506
9578
|
{
|
|
9507
9579
|
ref: forwardedRef,
|
|
@@ -9509,8 +9581,8 @@ var Select = (0, import_react44.forwardRef)(
|
|
|
9509
9581
|
$fullWidth: responsiveFullWidth,
|
|
9510
9582
|
...props,
|
|
9511
9583
|
children: [
|
|
9512
|
-
/* @__PURE__ */ (0,
|
|
9513
|
-
/* @__PURE__ */ (0,
|
|
9584
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.Value, { placeholder }),
|
|
9585
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
9514
9586
|
Icon,
|
|
9515
9587
|
{
|
|
9516
9588
|
size: "md",
|
|
@@ -9520,10 +9592,10 @@ var Select = (0, import_react44.forwardRef)(
|
|
|
9520
9592
|
]
|
|
9521
9593
|
}
|
|
9522
9594
|
),
|
|
9523
|
-
/* @__PURE__ */ (0,
|
|
9524
|
-
/* @__PURE__ */ (0,
|
|
9525
|
-
/* @__PURE__ */ (0,
|
|
9526
|
-
/* @__PURE__ */ (0,
|
|
9595
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(StyledContent2, { position: "popper", children: [
|
|
9596
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(Icon, { type: "caret-up" }) }),
|
|
9597
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.Viewport, { children }),
|
|
9598
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(Icon, { type: "caret-down" }) })
|
|
9527
9599
|
] }) })
|
|
9528
9600
|
]
|
|
9529
9601
|
}
|
|
@@ -9535,9 +9607,9 @@ Select.displayName = "Select";
|
|
|
9535
9607
|
// src/components/Select/SelectOption.tsx
|
|
9536
9608
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
9537
9609
|
var import_react45 = require("react");
|
|
9538
|
-
var
|
|
9539
|
-
var
|
|
9540
|
-
var StyledItem = (0,
|
|
9610
|
+
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9611
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
9612
|
+
var StyledItem = (0, import_styled_components62.default)(import_react_select2.Item)`
|
|
9541
9613
|
${variantStyleMap2.body3};
|
|
9542
9614
|
display: flex;
|
|
9543
9615
|
padding: var(--wui-select-option-padding);
|
|
@@ -9560,25 +9632,25 @@ var StyledItem = (0, import_styled_components60.default)(import_react_select2.It
|
|
|
9560
9632
|
background-color: transparent;
|
|
9561
9633
|
}
|
|
9562
9634
|
`;
|
|
9563
|
-
var StyledIconContainer =
|
|
9635
|
+
var StyledIconContainer = import_styled_components62.default.span`
|
|
9564
9636
|
width: 12px;
|
|
9565
9637
|
`;
|
|
9566
9638
|
var SelectOption = (0, import_react45.forwardRef)(
|
|
9567
9639
|
({ children, ...props }, forwardedRef) => {
|
|
9568
|
-
return /* @__PURE__ */ (0,
|
|
9640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
|
|
9569
9641
|
StyledItem,
|
|
9570
9642
|
{
|
|
9571
9643
|
...props,
|
|
9572
9644
|
ref: forwardedRef,
|
|
9573
9645
|
children: [
|
|
9574
|
-
/* @__PURE__ */ (0,
|
|
9646
|
+
/* @__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)(
|
|
9575
9647
|
Icon,
|
|
9576
9648
|
{
|
|
9577
9649
|
size: "sm",
|
|
9578
9650
|
type: "checkmark"
|
|
9579
9651
|
}
|
|
9580
9652
|
) }) }),
|
|
9581
|
-
/* @__PURE__ */ (0,
|
|
9653
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(import_react_select2.ItemText, { children })
|
|
9582
9654
|
]
|
|
9583
9655
|
}
|
|
9584
9656
|
);
|
|
@@ -9588,14 +9660,14 @@ SelectOption.displayName = "Option";
|
|
|
9588
9660
|
|
|
9589
9661
|
// src/components/Select/SelectOptionGroup.tsx
|
|
9590
9662
|
var import_react_select3 = require("@radix-ui/react-select");
|
|
9591
|
-
var
|
|
9592
|
-
var
|
|
9593
|
-
var
|
|
9663
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9664
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
9665
|
+
var StyledLabel4 = (0, import_styled_components63.default)(import_react_select3.Label)`
|
|
9594
9666
|
padding: var(--wui-select-option-padding);
|
|
9595
9667
|
`;
|
|
9596
9668
|
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
9597
|
-
return /* @__PURE__ */ (0,
|
|
9598
|
-
/* @__PURE__ */ (0,
|
|
9669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(import_react_select3.Group, { ...props, children: [
|
|
9670
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledLabel4, { children: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
9599
9671
|
Text,
|
|
9600
9672
|
{
|
|
9601
9673
|
prominence: "secondary",
|
|
@@ -9607,315 +9679,459 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
9607
9679
|
] });
|
|
9608
9680
|
};
|
|
9609
9681
|
|
|
9610
|
-
// src/components/
|
|
9611
|
-
var
|
|
9682
|
+
// src/components/Tabs/Tabs.tsx
|
|
9683
|
+
var import_react48 = require("react");
|
|
9684
|
+
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
9612
9685
|
var import_type_guards36 = require("@wistia/type-guards");
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
padding: var(--wui-space-03);
|
|
9622
|
-
background: var(--wui-color-bg-surface-secondary);
|
|
9623
|
-
flex: 1;
|
|
9624
|
-
border-radius: var(--wui-border-radius-02);
|
|
9625
|
-
position: relative;
|
|
9626
|
-
`;
|
|
9627
|
-
var shimmer = import_styled_components62.keyframes`
|
|
9628
|
-
0% {
|
|
9629
|
-
background-position: 200% 0;
|
|
9630
|
-
}
|
|
9631
|
-
100% {
|
|
9632
|
-
background-position: -200% 0;
|
|
9633
|
-
}
|
|
9686
|
+
|
|
9687
|
+
// src/components/Tabs/TabPanel.tsx
|
|
9688
|
+
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9689
|
+
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
9690
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
9691
|
+
var StyledTabPanel = (0, import_styled_components64.default)(import_react_tabs.Content)`
|
|
9692
|
+
display: flex;
|
|
9693
|
+
flex-direction: column;
|
|
9634
9694
|
`;
|
|
9635
|
-
var
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9695
|
+
var TabPanel = ({ children, value, ...props }) => {
|
|
9696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
9697
|
+
StyledTabPanel,
|
|
9698
|
+
{
|
|
9699
|
+
value,
|
|
9700
|
+
...props,
|
|
9701
|
+
children
|
|
9702
|
+
}
|
|
9641
9703
|
);
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
var
|
|
9647
|
-
|
|
9648
|
-
|
|
9704
|
+
};
|
|
9705
|
+
TabPanel.displayName = "TabPanel";
|
|
9706
|
+
|
|
9707
|
+
// src/components/Tabs/TabList.tsx
|
|
9708
|
+
var import_styled_components65 = __toESM(require("styled-components"));
|
|
9709
|
+
var import_react_tabs2 = require("@radix-ui/react-tabs");
|
|
9710
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
9711
|
+
var StyledTabList = (0, import_styled_components65.default)(import_react_tabs2.List)`
|
|
9712
|
+
${segmentedControlStyles}
|
|
9713
|
+
|
|
9714
|
+
margin-bottom: var(--wui-space-04);
|
|
9649
9715
|
`;
|
|
9650
|
-
var
|
|
9651
|
-
|
|
9652
|
-
|
|
9716
|
+
var TabList = ({
|
|
9717
|
+
children,
|
|
9718
|
+
fullWidth,
|
|
9719
|
+
ariaLabel,
|
|
9720
|
+
...props
|
|
9721
|
+
}) => {
|
|
9722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
9723
|
+
StyledTabList,
|
|
9724
|
+
{
|
|
9725
|
+
$fullWidth: fullWidth,
|
|
9726
|
+
"aria-label": ariaLabel,
|
|
9727
|
+
...props,
|
|
9728
|
+
children
|
|
9729
|
+
}
|
|
9730
|
+
);
|
|
9731
|
+
};
|
|
9732
|
+
TabList.displayName = "TabList";
|
|
9733
|
+
|
|
9734
|
+
// src/components/Tabs/TabItem.tsx
|
|
9735
|
+
var import_react46 = require("react");
|
|
9736
|
+
var import_styled_components66 = __toESM(require("styled-components"));
|
|
9737
|
+
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
9738
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
9739
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
9740
|
+
var StyledTabItem = (0, import_styled_components66.default)(import_react_tabs3.Trigger)`
|
|
9741
|
+
${segmentedControlItemStyles}
|
|
9742
|
+
|
|
9743
|
+
&[data-state='active'] {
|
|
9744
|
+
background-color: white;
|
|
9745
|
+
}
|
|
9653
9746
|
`;
|
|
9654
|
-
var
|
|
9655
|
-
|
|
9747
|
+
var TabItem = (0, import_react46.forwardRef)(
|
|
9748
|
+
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, ref) => {
|
|
9749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(
|
|
9750
|
+
StyledTabItem,
|
|
9751
|
+
{
|
|
9752
|
+
ref,
|
|
9753
|
+
$hasLabel: (0, import_type_guards35.isNotNil)(label),
|
|
9754
|
+
"aria-label": (0, import_type_guards35.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9755
|
+
disabled,
|
|
9756
|
+
value,
|
|
9757
|
+
children: [
|
|
9758
|
+
icon,
|
|
9759
|
+
label
|
|
9760
|
+
]
|
|
9761
|
+
}
|
|
9762
|
+
);
|
|
9763
|
+
}
|
|
9764
|
+
);
|
|
9765
|
+
TabItem.displayName = "TabItem";
|
|
9766
|
+
|
|
9767
|
+
// src/components/Tabs/extractTabItems.ts
|
|
9768
|
+
var import_react47 = require("react");
|
|
9769
|
+
var extractTabItems = (children) => {
|
|
9770
|
+
const tabItems = [];
|
|
9771
|
+
import_react47.Children.forEach(children, (child) => {
|
|
9772
|
+
if (!(0, import_react47.isValidElement)(child)) {
|
|
9773
|
+
return;
|
|
9774
|
+
}
|
|
9775
|
+
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
9776
|
+
tabItems.push(child);
|
|
9777
|
+
} else if (child.type === import_react47.Fragment) {
|
|
9778
|
+
const fragmentElement = child;
|
|
9779
|
+
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
9780
|
+
} else if ((child.props.children ?? null) != null) {
|
|
9781
|
+
const childChildren = child.props.children;
|
|
9782
|
+
tabItems.push(...extractTabItems(childChildren));
|
|
9783
|
+
} else {
|
|
9784
|
+
}
|
|
9785
|
+
});
|
|
9786
|
+
return tabItems;
|
|
9787
|
+
};
|
|
9788
|
+
|
|
9789
|
+
// src/components/Tabs/Tabs.tsx
|
|
9790
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
9791
|
+
var Tabs = (0, import_react48.forwardRef)(
|
|
9792
|
+
({
|
|
9793
|
+
children,
|
|
9794
|
+
fullWidth = true,
|
|
9795
|
+
"aria-label": ariaLabel,
|
|
9796
|
+
defaultSelectedValue,
|
|
9797
|
+
selectedValue,
|
|
9798
|
+
onSelectedValueChange,
|
|
9799
|
+
...otherProps
|
|
9800
|
+
}, ref) => {
|
|
9801
|
+
const tabItems = extractTabItems(children);
|
|
9802
|
+
const modeProps = defaultSelectedValue !== void 0 ? { defaultValue: defaultSelectedValue } : { value: selectedValue, onValueChange: onSelectedValueChange };
|
|
9803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(
|
|
9804
|
+
import_react_tabs4.Root,
|
|
9805
|
+
{
|
|
9806
|
+
ref,
|
|
9807
|
+
activationMode: "automatic",
|
|
9808
|
+
...otherProps,
|
|
9809
|
+
...modeProps,
|
|
9810
|
+
children: [
|
|
9811
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9812
|
+
TabList,
|
|
9813
|
+
{
|
|
9814
|
+
ariaLabel,
|
|
9815
|
+
fullWidth,
|
|
9816
|
+
children: tabItems.map((tab) => {
|
|
9817
|
+
const {
|
|
9818
|
+
value,
|
|
9819
|
+
disabled = false,
|
|
9820
|
+
icon,
|
|
9821
|
+
label,
|
|
9822
|
+
"aria-label": ariaLabelForTab
|
|
9823
|
+
} = tab.props;
|
|
9824
|
+
if ((0, import_type_guards36.isNil)(icon)) {
|
|
9825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9826
|
+
TabItem,
|
|
9827
|
+
{
|
|
9828
|
+
disabled,
|
|
9829
|
+
label,
|
|
9830
|
+
value
|
|
9831
|
+
},
|
|
9832
|
+
value
|
|
9833
|
+
);
|
|
9834
|
+
}
|
|
9835
|
+
if ((0, import_type_guards36.isNotNil)(label)) {
|
|
9836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9837
|
+
TabItem,
|
|
9838
|
+
{
|
|
9839
|
+
disabled,
|
|
9840
|
+
icon,
|
|
9841
|
+
label,
|
|
9842
|
+
value
|
|
9843
|
+
},
|
|
9844
|
+
value
|
|
9845
|
+
);
|
|
9846
|
+
}
|
|
9847
|
+
if ((0, import_type_guards36.isNotNil)(ariaLabelForTab)) {
|
|
9848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9849
|
+
TabItem,
|
|
9850
|
+
{
|
|
9851
|
+
"aria-label": ariaLabelForTab,
|
|
9852
|
+
disabled,
|
|
9853
|
+
icon,
|
|
9854
|
+
value
|
|
9855
|
+
},
|
|
9856
|
+
value
|
|
9857
|
+
);
|
|
9858
|
+
}
|
|
9859
|
+
throw new Error("A `Tab` with an icon must have either label or aria-label");
|
|
9860
|
+
})
|
|
9861
|
+
}
|
|
9862
|
+
),
|
|
9863
|
+
tabItems.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9864
|
+
TabPanel,
|
|
9865
|
+
{
|
|
9866
|
+
value: tab.props.value,
|
|
9867
|
+
children: tab.props.children
|
|
9868
|
+
},
|
|
9869
|
+
tab.props.value
|
|
9870
|
+
))
|
|
9871
|
+
]
|
|
9872
|
+
}
|
|
9873
|
+
);
|
|
9874
|
+
}
|
|
9875
|
+
);
|
|
9876
|
+
Tabs.displayName = "Tabs";
|
|
9877
|
+
|
|
9878
|
+
// src/components/Tabs/Tab.tsx
|
|
9879
|
+
var import_react49 = require("react");
|
|
9880
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
9881
|
+
var Tab = (0, import_react49.forwardRef)(({ children }, ref) => {
|
|
9882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { ref, children });
|
|
9883
|
+
});
|
|
9884
|
+
Tab.displayName = "Tab";
|
|
9885
|
+
|
|
9886
|
+
// src/components/Tag/Tag.tsx
|
|
9887
|
+
var import_react50 = require("react");
|
|
9888
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9889
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
9890
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
9891
|
+
var TagLabel = import_styled_components67.default.a`
|
|
9892
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9893
|
+
font-size: var(--wui-typography-label-4-size);
|
|
9894
|
+
font-weight: var(--wui-typography-label-4-weight);
|
|
9895
|
+
line-height: var(--wui-typography-label-4-line-height);
|
|
9896
|
+
border-radius: var(--wui-border-radius-01);
|
|
9897
|
+
align-items: center;
|
|
9898
|
+
color: var(--wui-color-text);
|
|
9899
|
+
text-decoration: none;
|
|
9900
|
+
padding: var(--wui-space-01);
|
|
9901
|
+
|
|
9902
|
+
:not(:only-child) {
|
|
9903
|
+
padding-right: var(--wui-space-01);
|
|
9904
|
+
}
|
|
9905
|
+
|
|
9906
|
+
:is(a):hover {
|
|
9907
|
+
background: var(--wui-color-bg-surface-secondary-hover);
|
|
9908
|
+
}
|
|
9909
|
+
|
|
9910
|
+
:is(a):active {
|
|
9911
|
+
background: var(--wui-color-bg-surface-secondary-active);
|
|
9912
|
+
}
|
|
9913
|
+
|
|
9914
|
+
:focus-visible {
|
|
9915
|
+
outline: unset;
|
|
9916
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9917
|
+
}
|
|
9656
9918
|
`;
|
|
9657
|
-
var
|
|
9658
|
-
|
|
9919
|
+
var TagDivider = import_styled_components67.default.div`
|
|
9920
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9921
|
+
border-left: 1px solid var(--wui-color-border);
|
|
9922
|
+
display: flex;
|
|
9923
|
+
height: 14px;
|
|
9924
|
+
width: 1px;
|
|
9659
9925
|
`;
|
|
9660
|
-
var
|
|
9926
|
+
var StyledRemoveButton = import_styled_components67.default.button`
|
|
9927
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9928
|
+
all: unset;
|
|
9929
|
+
cursor: pointer;
|
|
9661
9930
|
display: flex;
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
align-
|
|
9931
|
+
height: 22px;
|
|
9932
|
+
width: 12px;
|
|
9933
|
+
align-items: center;
|
|
9934
|
+
padding: 0 var(--wui-space-01);
|
|
9935
|
+
border-radius: var(--wui-border-radius-01);
|
|
9936
|
+
|
|
9937
|
+
svg path {
|
|
9938
|
+
fill: var(--wui-color-icon);
|
|
9939
|
+
}
|
|
9940
|
+
|
|
9941
|
+
:hover {
|
|
9942
|
+
background: var(--wui-color-bg-surface-secondary-hover);
|
|
9943
|
+
}
|
|
9944
|
+
|
|
9945
|
+
:active {
|
|
9946
|
+
background: var(--wui-color-bg-surface-secondary-active);
|
|
9947
|
+
}
|
|
9948
|
+
|
|
9949
|
+
:focus-visible {
|
|
9950
|
+
outline: unset;
|
|
9951
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9952
|
+
}
|
|
9665
9953
|
`;
|
|
9666
|
-
var
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9954
|
+
var StyledTag = import_styled_components67.default.div`
|
|
9955
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9956
|
+
align-items: center;
|
|
9957
|
+
background-color: var(--wui-color-bg-surface-secondary);
|
|
9958
|
+
border-radius: var(--wui-border-radius-01);
|
|
9959
|
+
display: inline-flex;
|
|
9960
|
+
overflow: hidden;
|
|
9961
|
+
|
|
9962
|
+
> * {
|
|
9963
|
+
transition: background var(--wui-duration-01) var(--wui-motion-ease);
|
|
9964
|
+
}
|
|
9670
9965
|
`;
|
|
9671
|
-
var
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
}
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9966
|
+
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
9967
|
+
if ((0, import_type_guards37.isNil)(onClickRemove)) {
|
|
9968
|
+
return null;
|
|
9969
|
+
}
|
|
9970
|
+
if ((0, import_type_guards37.isNil)(onClickRemoveLabel)) {
|
|
9971
|
+
throw new Error(
|
|
9972
|
+
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
9973
|
+
);
|
|
9974
|
+
}
|
|
9975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(import_jsx_runtime218.Fragment, { children: [
|
|
9976
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
9977
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
9978
|
+
StyledRemoveButton,
|
|
9979
|
+
{
|
|
9980
|
+
$colorScheme: colorScheme,
|
|
9981
|
+
onClick: onClickRemove,
|
|
9982
|
+
type: "button",
|
|
9983
|
+
children: [
|
|
9984
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
9985
|
+
Icon,
|
|
9986
|
+
{
|
|
9987
|
+
size: "sm",
|
|
9988
|
+
type: "close"
|
|
9989
|
+
}
|
|
9990
|
+
),
|
|
9991
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
9992
|
+
]
|
|
9993
|
+
}
|
|
9994
|
+
)
|
|
9995
|
+
] });
|
|
9996
|
+
};
|
|
9997
|
+
var Tag = (0, import_react50.forwardRef)(
|
|
9998
|
+
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
9999
|
+
const labelProps = (0, import_type_guards37.isNotNil)(href) && (0, import_type_guards37.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
10000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
10001
|
+
StyledTag,
|
|
10002
|
+
{
|
|
10003
|
+
ref,
|
|
10004
|
+
$colorScheme: colorScheme,
|
|
10005
|
+
...otherProps,
|
|
10006
|
+
children: [
|
|
10007
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
10008
|
+
TagLabel,
|
|
10009
|
+
{
|
|
10010
|
+
...labelProps,
|
|
10011
|
+
$colorScheme: colorScheme,
|
|
10012
|
+
children: label
|
|
10013
|
+
}
|
|
10014
|
+
),
|
|
10015
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
10016
|
+
RemoveButton,
|
|
10017
|
+
{
|
|
10018
|
+
colorScheme,
|
|
10019
|
+
onClickRemove,
|
|
10020
|
+
onClickRemoveLabel
|
|
10021
|
+
}
|
|
10022
|
+
)
|
|
10023
|
+
]
|
|
10024
|
+
}
|
|
10025
|
+
);
|
|
9704
10026
|
}
|
|
9705
10027
|
);
|
|
9706
|
-
|
|
10028
|
+
Tag.displayName = "Tag";
|
|
9707
10029
|
|
|
9708
|
-
// src/components/
|
|
9709
|
-
var
|
|
9710
|
-
var
|
|
9711
|
-
var
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
10030
|
+
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
10031
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10032
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10033
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
10034
|
+
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
10035
|
+
if (iconOnly) {
|
|
10036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
10037
|
+
"g",
|
|
10038
|
+
{
|
|
10039
|
+
"data-testid": "ui-wistia-logo-brandmark",
|
|
10040
|
+
fill: brandmarkColor,
|
|
10041
|
+
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" })
|
|
10042
|
+
}
|
|
10043
|
+
);
|
|
9717
10044
|
}
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
children,
|
|
9721
|
-
cardMaxWidth = "none",
|
|
9722
|
-
colorScheme = "inherit",
|
|
9723
|
-
...props
|
|
9724
|
-
}) => {
|
|
9725
|
-
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
9726
|
-
StyledDataCards,
|
|
10045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
10046
|
+
"g",
|
|
9727
10047
|
{
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
direction: "row",
|
|
9732
|
-
fill: "horizontal",
|
|
9733
|
-
gap: "space-02",
|
|
9734
|
-
renderAs: "dl",
|
|
9735
|
-
wrapItems: true,
|
|
9736
|
-
children
|
|
10048
|
+
"data-testid": "ui-wistia-logo-brandmark",
|
|
10049
|
+
fill: brandmarkColor,
|
|
10050
|
+
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
10051
|
}
|
|
9738
10052
|
);
|
|
9739
10053
|
};
|
|
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
|
-
] });
|
|
10054
|
+
var renderLogotype = (logotypeColor, iconOnly) => {
|
|
10055
|
+
if (iconOnly) {
|
|
10056
|
+
return null;
|
|
10057
|
+
}
|
|
10058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
10059
|
+
"g",
|
|
10060
|
+
{
|
|
10061
|
+
"data-testid": "ui-wistia-logo-logotype",
|
|
10062
|
+
fill: logotypeColor,
|
|
10063
|
+
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" })
|
|
10064
|
+
}
|
|
10065
|
+
);
|
|
9778
10066
|
};
|
|
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;
|
|
10067
|
+
var computedViewBox = (iconOnly) => {
|
|
10068
|
+
if (iconOnly) {
|
|
10069
|
+
return "0 0 34.4 26.78";
|
|
9787
10070
|
}
|
|
10071
|
+
return "0 0 144 31.47";
|
|
10072
|
+
};
|
|
10073
|
+
var WistiaLogoComponent = import_styled_components68.default.svg`
|
|
10074
|
+
height: ${({ height }) => `${height}px`};
|
|
9788
10075
|
|
|
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
|
-
}
|
|
10076
|
+
/* ensure it will always fit on mobile */
|
|
10077
|
+
max-height: 22vw;
|
|
10078
|
+
max-width: 100%;
|
|
9808
10079
|
|
|
9809
10080
|
&:hover {
|
|
9810
|
-
|
|
9811
|
-
|
|
10081
|
+
path {
|
|
10082
|
+
${({ $hoverColor }) => $hoverColor !== void 0 ? `fill: ${$hoverColor}` : null};
|
|
10083
|
+
}
|
|
9812
10084
|
}
|
|
9813
10085
|
`;
|
|
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
|
|
10086
|
+
var WistiaLogo = ({
|
|
10087
|
+
description = void 0,
|
|
10088
|
+
height = 100,
|
|
10089
|
+
hoverColor = void 0,
|
|
10090
|
+
href = void 0,
|
|
10091
|
+
iconOnly = false,
|
|
10092
|
+
title = "Wistia Logo",
|
|
10093
|
+
variant = "standard",
|
|
10094
|
+
...otherProps
|
|
9830
10095
|
}) => {
|
|
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);
|
|
10096
|
+
const primaryColor = "#2949e5";
|
|
10097
|
+
const darkColor = "#000934";
|
|
10098
|
+
const lightColor = "#ffffff";
|
|
10099
|
+
const VARIANT_COLORS = {
|
|
10100
|
+
standard: {
|
|
10101
|
+
brandmark: primaryColor,
|
|
10102
|
+
logotype: darkColor
|
|
10103
|
+
},
|
|
10104
|
+
dark: {
|
|
10105
|
+
brandmark: darkColor,
|
|
10106
|
+
logotype: darkColor
|
|
10107
|
+
},
|
|
10108
|
+
light: {
|
|
10109
|
+
brandmark: lightColor,
|
|
10110
|
+
logotype: lightColor
|
|
9866
10111
|
}
|
|
9867
10112
|
};
|
|
9868
|
-
const
|
|
9869
|
-
|
|
10113
|
+
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
10114
|
+
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
10115
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(
|
|
10116
|
+
WistiaLogoComponent,
|
|
9870
10117
|
{
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
10118
|
+
$hoverColor: hoverColor,
|
|
10119
|
+
height,
|
|
10120
|
+
role: "img",
|
|
10121
|
+
viewBox: computedViewBox(iconOnly),
|
|
10122
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10123
|
+
...otherProps,
|
|
10124
|
+
children: [
|
|
10125
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)("title", { children: title }),
|
|
10126
|
+
(0, import_type_guards38.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("desc", { children: description }) : null,
|
|
10127
|
+
renderBrandmark(brandmarkColor, iconOnly),
|
|
10128
|
+
renderLogotype(logotypeColor, iconOnly)
|
|
10129
|
+
]
|
|
9876
10130
|
}
|
|
9877
10131
|
);
|
|
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
|
-
] });
|
|
10132
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("a", { href, children: Logo }) : Logo;
|
|
9918
10133
|
};
|
|
10134
|
+
WistiaLogo.displayName = "WistiaLogo";
|
|
9919
10135
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9920
10136
|
0 && (module.exports = {
|
|
9921
10137
|
ActionButton,
|
|
@@ -9965,6 +10181,8 @@ var EditableHeading = ({
|
|
|
9965
10181
|
SelectOptionGroup,
|
|
9966
10182
|
Stack,
|
|
9967
10183
|
SubMenu,
|
|
10184
|
+
Tab,
|
|
10185
|
+
Tabs,
|
|
9968
10186
|
Tag,
|
|
9969
10187
|
Text,
|
|
9970
10188
|
Tooltip,
|