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