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