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