@wistia/ui 0.5.6 → 0.5.7-beta.1e89027e.02d5c53
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 +1096 -722
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +159 -73
- package/dist/index.d.ts +159 -73
- package/dist/index.mjs +991 -621
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.5.
|
|
3
|
+
* @license @wistia/ui v0.5.7-beta.1e89027e.02d5c53
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -51,6 +51,9 @@ __export(index_exports, {
|
|
|
51
51
|
Checkbox: () => Checkbox,
|
|
52
52
|
CheckboxGroup: () => CheckboxGroup,
|
|
53
53
|
CheckboxMenuItem: () => CheckboxMenuItem,
|
|
54
|
+
Collapsible: () => Collapsible,
|
|
55
|
+
CollapsibleContent: () => CollapsibleContent,
|
|
56
|
+
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
54
57
|
ColorSchemeWrapper: () => ColorSchemeWrapper,
|
|
55
58
|
DataCard: () => DataCard,
|
|
56
59
|
DataCardTrend: () => DataCardTrend,
|
|
@@ -75,6 +78,7 @@ __export(index_exports, {
|
|
|
75
78
|
MenuLabel: () => MenuLabel,
|
|
76
79
|
MenuRadioGroup: () => MenuRadioGroup,
|
|
77
80
|
Modal: () => Modal,
|
|
81
|
+
Popover: () => Popover,
|
|
78
82
|
Radio: () => Radio,
|
|
79
83
|
RadioGroup: () => RadioGroup,
|
|
80
84
|
RadioMenuItem: () => RadioMenuItem,
|
|
@@ -2278,45 +2282,55 @@ var defaultScheme = import_styled_components14.css`
|
|
|
2278
2282
|
--wui-color-focus-ring: var(--wui-blue-9);
|
|
2279
2283
|
`;
|
|
2280
2284
|
var navScheme = import_styled_components14.css`
|
|
2281
|
-
--wui-color-bg-
|
|
2282
|
-
|
|
2285
|
+
--wui-color-bg-app: #1e3399;
|
|
2286
|
+
|
|
2283
2287
|
--wui-color-bg-fill: var(--wui-blue-1);
|
|
2284
|
-
--wui-color-bg-
|
|
2285
|
-
--wui-color-bg-
|
|
2286
|
-
|
|
2287
|
-
--wui-color-bg-surface
|
|
2288
|
-
--wui-color-bg-surface-
|
|
2289
|
-
--wui-color-bg-surface-
|
|
2290
|
-
|
|
2291
|
-
--wui-color-
|
|
2292
|
-
--wui-color-
|
|
2293
|
-
--wui-color-
|
|
2294
|
-
|
|
2295
|
-
--wui-color-
|
|
2296
|
-
|
|
2297
|
-
--wui-color-
|
|
2298
|
-
--wui-color-
|
|
2299
|
-
--wui-color-
|
|
2300
|
-
|
|
2301
|
-
--wui-color-
|
|
2288
|
+
--wui-color-bg-fill: #e7e9f4;
|
|
2289
|
+
--wui-color-bg-fill-active: #dcdfef;
|
|
2290
|
+
|
|
2291
|
+
--wui-color-bg-surface: transparent;
|
|
2292
|
+
--wui-color-bg-surface-hover: #15267b;
|
|
2293
|
+
--wui-color-bg-surface-active: #122271;
|
|
2294
|
+
|
|
2295
|
+
--wui-color-bg-surface-secondary: #15267b;
|
|
2296
|
+
--wui-color-bg-surface-secondary-hover: #122271;
|
|
2297
|
+
--wui-color-bg-surface-secondary-active: #101e67;
|
|
2298
|
+
|
|
2299
|
+
--wui-color-bg-surface-tertiary: #0d1a5c;
|
|
2300
|
+
|
|
2301
|
+
--wui-color-border: #101e67;
|
|
2302
|
+
--wui-color-border-hover: #0e1c61;
|
|
2303
|
+
--wui-color-border-active: #0d1a5c;
|
|
2304
|
+
|
|
2305
|
+
--wui-color-border-secondary: var(--wui-color-bg-fill);
|
|
2306
|
+
--wui-color-border-secondary-hover: var(--wui-color-bg-fill-hover);
|
|
2307
|
+
--wui-color-border-secondary-active: var(--wui-color-bg-fill-active);
|
|
2308
|
+
|
|
2309
|
+
--wui-color-icon: var(--wui-blue-1);
|
|
2310
|
+
--wui-color-icon-on-fill: var(--wui-color-bg-app);
|
|
2311
|
+
|
|
2302
2312
|
--wui-color-text: var(--wui-blue-1);
|
|
2313
|
+
--wui-color-text-on-fill: var(--wui-color-bg-app);
|
|
2314
|
+
--wui-color-text-link: var(--wui-blue-4);
|
|
2315
|
+
--wui-color-text-secondary: var(--wui-blue-6);
|
|
2303
2316
|
--wui-color-text-button: var(--wui-blue-1);
|
|
2317
|
+
|
|
2304
2318
|
--wui-color-focus-ring: var(--wui-blue-1);
|
|
2305
2319
|
|
|
2306
2320
|
/* Nav - Disabled */
|
|
2307
|
-
--wui-color-bg-surface-disabled:
|
|
2321
|
+
--wui-color-bg-surface-disabled: transparent;
|
|
2308
2322
|
--wui-color-icon-disabled: var(--wui-blue-8);
|
|
2309
2323
|
--wui-color-text-disabled: var(--wui-blue-8);
|
|
2310
2324
|
|
|
2311
2325
|
/* Nav - Selected */
|
|
2312
|
-
--wui-color-bg-surface-selected: var(--wui-
|
|
2313
|
-
--wui-color-bg-surface-selected-active: var(--wui-
|
|
2314
|
-
--wui-color-bg-surface-selected-hover: var(--wui-
|
|
2315
|
-
--wui-color-icon-selected: var(--wui-
|
|
2316
|
-
--wui-color-text-selected: var(--wui-
|
|
2317
|
-
--wui-color-border-selected:
|
|
2318
|
-
--wui-color-border-hover-selected:
|
|
2319
|
-
--wui-color-border-active-selected:
|
|
2326
|
+
--wui-color-bg-surface-selected: var(--wui-color-bg-fill);
|
|
2327
|
+
--wui-color-bg-surface-selected-active: var(--wui-color-bg-fill-active);
|
|
2328
|
+
--wui-color-bg-surface-selected-hover: var(--wui-color-bg-fill-hover);
|
|
2329
|
+
--wui-color-icon-selected: var(--wui-color-bg-app);
|
|
2330
|
+
--wui-color-text-selected: var(--wui-color-bg-app);
|
|
2331
|
+
--wui-color-border-selected: transparent;
|
|
2332
|
+
--wui-color-border-hover-selected: transparent;
|
|
2333
|
+
--wui-color-border-active-selected: transparent;
|
|
2320
2334
|
`;
|
|
2321
2335
|
var getColorScheme = (colorScheme) => {
|
|
2322
2336
|
if (colorScheme === "nav") {
|
|
@@ -6753,7 +6767,12 @@ var ButtonGroupComponent = import_styled_components28.default.div`
|
|
|
6753
6767
|
display: flex;
|
|
6754
6768
|
|
|
6755
6769
|
/* this helps ensure that primary buttons appear at the top of the column */
|
|
6756
|
-
flex-direction: ${({ $align }) =>
|
|
6770
|
+
flex-direction: ${({ $collapse, $align }) => {
|
|
6771
|
+
if (!$collapse) {
|
|
6772
|
+
return "row";
|
|
6773
|
+
}
|
|
6774
|
+
return $align === "right" ? "column-reverse" : "column";
|
|
6775
|
+
}};
|
|
6757
6776
|
gap: var(--wui-space-02);
|
|
6758
6777
|
align-items: center;
|
|
6759
6778
|
justify-content: ${({ $align }) => getAlignment($align)};
|
|
@@ -6773,6 +6792,7 @@ var ButtonGroup = ({
|
|
|
6773
6792
|
children,
|
|
6774
6793
|
align = "left",
|
|
6775
6794
|
fullWidth = false,
|
|
6795
|
+
collapseOnSmallScreens = true,
|
|
6776
6796
|
...otherProps
|
|
6777
6797
|
}) => {
|
|
6778
6798
|
if ((0, import_type_guards18.isNil)(children)) {
|
|
@@ -6782,6 +6802,7 @@ var ButtonGroup = ({
|
|
|
6782
6802
|
ButtonGroupComponent,
|
|
6783
6803
|
{
|
|
6784
6804
|
$align: align,
|
|
6805
|
+
$collapse: collapseOnSmallScreens,
|
|
6785
6806
|
$fullWidth: fullWidth,
|
|
6786
6807
|
...otherProps,
|
|
6787
6808
|
children
|
|
@@ -7181,11 +7202,63 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
7181
7202
|
);
|
|
7182
7203
|
Checkbox.displayName = "Checkbox";
|
|
7183
7204
|
|
|
7184
|
-
// src/components/
|
|
7185
|
-
var
|
|
7205
|
+
// src/components/Collapsible/Collapsible.tsx
|
|
7206
|
+
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
7186
7207
|
var import_type_guards21 = require("@wistia/type-guards");
|
|
7208
|
+
var import_styled_components34 = __toESM(require("styled-components"));
|
|
7187
7209
|
var import_jsx_runtime176 = require("react/jsx-runtime");
|
|
7188
|
-
var
|
|
7210
|
+
var StyledRoot = (0, import_styled_components34.default)(import_react_collapsible.Root)`
|
|
7211
|
+
&[data-state='closed'] [data-wui-collapsible-content] {
|
|
7212
|
+
display: -webkit-box;
|
|
7213
|
+
-webkit-box-orient: vertical;
|
|
7214
|
+
-webkit-line-clamp: var(--wui-collapsible-content-clamp-lines);
|
|
7215
|
+
overflow: hidden;
|
|
7216
|
+
}
|
|
7217
|
+
`;
|
|
7218
|
+
var Collapsible = ({
|
|
7219
|
+
children,
|
|
7220
|
+
isOpen = false,
|
|
7221
|
+
onOpenChange
|
|
7222
|
+
}) => {
|
|
7223
|
+
const controlProps = {
|
|
7224
|
+
...(0, import_type_guards21.isNotNil)(onOpenChange) && (0, import_type_guards21.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
7225
|
+
};
|
|
7226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledRoot, { ...controlProps, children });
|
|
7227
|
+
};
|
|
7228
|
+
Collapsible.displayName = "Collapsible";
|
|
7229
|
+
|
|
7230
|
+
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
7231
|
+
var import_react20 = require("react");
|
|
7232
|
+
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
7233
|
+
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
7234
|
+
var CollapsibleTrigger = ({ children }) => {
|
|
7235
|
+
import_react20.Children.only(children);
|
|
7236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
7237
|
+
};
|
|
7238
|
+
|
|
7239
|
+
// src/components/Collapsible/CollapsibleContent.tsx
|
|
7240
|
+
var import_styled_components35 = __toESM(require("styled-components"));
|
|
7241
|
+
var import_react_collapsible3 = require("@radix-ui/react-collapsible");
|
|
7242
|
+
var import_type_guards22 = require("@wistia/type-guards");
|
|
7243
|
+
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
7244
|
+
var ClampedContent = import_styled_components35.default.div.attrs({ "data-wui-collapsible-content": true })`
|
|
7245
|
+
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
7246
|
+
`;
|
|
7247
|
+
var CollapsibleContent = ({ clamp, children }) => {
|
|
7248
|
+
if ((0, import_type_guards22.isNotUndefined)(clamp)) {
|
|
7249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(ClampedContent, { $clamp: clamp, children });
|
|
7250
|
+
}
|
|
7251
|
+
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: [
|
|
7252
|
+
children,
|
|
7253
|
+
" "
|
|
7254
|
+
] }) });
|
|
7255
|
+
};
|
|
7256
|
+
|
|
7257
|
+
// src/components/DataCards/DataCard.tsx
|
|
7258
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
7259
|
+
var import_type_guards23 = require("@wistia/type-guards");
|
|
7260
|
+
var import_jsx_runtime179 = require("react/jsx-runtime");
|
|
7261
|
+
var StyledDataCard = import_styled_components36.default.div`
|
|
7189
7262
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
7190
7263
|
display: grid;
|
|
7191
7264
|
grid-template-areas: 'label slot' 'value value';
|
|
@@ -7198,7 +7271,7 @@ var StyledDataCard = import_styled_components34.default.div`
|
|
|
7198
7271
|
border-radius: var(--wui-border-radius-02);
|
|
7199
7272
|
position: relative;
|
|
7200
7273
|
`;
|
|
7201
|
-
var shimmer =
|
|
7274
|
+
var shimmer = import_styled_components36.keyframes`
|
|
7202
7275
|
0% {
|
|
7203
7276
|
background-position: 200% 0;
|
|
7204
7277
|
}
|
|
@@ -7206,7 +7279,7 @@ var shimmer = import_styled_components34.keyframes`
|
|
|
7206
7279
|
background-position: -200% 0;
|
|
7207
7280
|
}
|
|
7208
7281
|
`;
|
|
7209
|
-
var LoadingBackground =
|
|
7282
|
+
var LoadingBackground = import_styled_components36.default.div`
|
|
7210
7283
|
background: linear-gradient(
|
|
7211
7284
|
90deg,
|
|
7212
7285
|
var(--wui-color-bg-surface-tertiary) 25%,
|
|
@@ -7217,27 +7290,27 @@ var LoadingBackground = import_styled_components34.default.div`
|
|
|
7217
7290
|
animation: ${shimmer} 1.5s infinite;
|
|
7218
7291
|
border-radius: var(--wui-border-radius-01);
|
|
7219
7292
|
`;
|
|
7220
|
-
var StyledLoadingLabel = (0,
|
|
7293
|
+
var StyledLoadingLabel = (0, import_styled_components36.default)(LoadingBackground)`
|
|
7221
7294
|
width: 80px;
|
|
7222
7295
|
height: var(--wui-typography-heading-6-line-height);
|
|
7223
7296
|
`;
|
|
7224
|
-
var StyledLoadingValue = (0,
|
|
7297
|
+
var StyledLoadingValue = (0, import_styled_components36.default)(LoadingBackground)`
|
|
7225
7298
|
width: 90%;
|
|
7226
7299
|
height: var(--wui-typography-heading-3-line-height);
|
|
7227
7300
|
`;
|
|
7228
|
-
var StyledLabel3 = (0,
|
|
7301
|
+
var StyledLabel3 = (0, import_styled_components36.default)(Heading)`
|
|
7229
7302
|
grid-area: label;
|
|
7230
7303
|
`;
|
|
7231
|
-
var StyledValue = (0,
|
|
7304
|
+
var StyledValue = (0, import_styled_components36.default)(Heading)`
|
|
7232
7305
|
grid-area: value;
|
|
7233
7306
|
`;
|
|
7234
|
-
var StyledSlot =
|
|
7307
|
+
var StyledSlot = import_styled_components36.default.div`
|
|
7235
7308
|
display: flex;
|
|
7236
7309
|
justify-content: flex-end;
|
|
7237
7310
|
grid-area: slot;
|
|
7238
7311
|
align-self: center;
|
|
7239
7312
|
`;
|
|
7240
|
-
var StyledDataCardTrendContainer =
|
|
7313
|
+
var StyledDataCardTrendContainer = import_styled_components36.default.div`
|
|
7241
7314
|
position: absolute;
|
|
7242
7315
|
bottom: var(--wui-space-01);
|
|
7243
7316
|
right: var(--wui-space-01);
|
|
@@ -7250,39 +7323,39 @@ var DataCard = ({
|
|
|
7250
7323
|
isLoading = false,
|
|
7251
7324
|
trend,
|
|
7252
7325
|
...props
|
|
7253
|
-
}) => /* @__PURE__ */ (0,
|
|
7326
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)(
|
|
7254
7327
|
StyledDataCard,
|
|
7255
7328
|
{
|
|
7256
7329
|
$colorScheme: colorScheme,
|
|
7257
7330
|
...props,
|
|
7258
7331
|
children: [
|
|
7259
|
-
/* @__PURE__ */ (0,
|
|
7332
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
7260
7333
|
StyledLabel3,
|
|
7261
7334
|
{
|
|
7262
7335
|
renderAs: "dt",
|
|
7263
7336
|
variant: "heading6",
|
|
7264
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
7337
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(StyledLoadingLabel, {}) : label
|
|
7265
7338
|
}
|
|
7266
7339
|
),
|
|
7267
|
-
/* @__PURE__ */ (0,
|
|
7340
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
7268
7341
|
StyledValue,
|
|
7269
7342
|
{
|
|
7270
7343
|
renderAs: "dd",
|
|
7271
7344
|
variant: "heading3",
|
|
7272
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
7345
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(StyledLoadingValue, {}) : value
|
|
7273
7346
|
}
|
|
7274
7347
|
),
|
|
7275
|
-
(0,
|
|
7276
|
-
(0,
|
|
7348
|
+
(0, import_type_guards23.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
7349
|
+
(0, import_type_guards23.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
7277
7350
|
]
|
|
7278
7351
|
}
|
|
7279
7352
|
);
|
|
7280
7353
|
DataCard.displayName = "DataCard";
|
|
7281
7354
|
|
|
7282
7355
|
// src/components/DataCards/DataCards.tsx
|
|
7283
|
-
var
|
|
7284
|
-
var
|
|
7285
|
-
var StyledDataCards = (0,
|
|
7356
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
7357
|
+
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
7358
|
+
var StyledDataCards = (0, import_styled_components37.default)(Box)`
|
|
7286
7359
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7287
7360
|
margin-top: 0; /* Remove default <dl> style */
|
|
7288
7361
|
> * {
|
|
@@ -7296,7 +7369,7 @@ var DataCards = ({
|
|
|
7296
7369
|
colorScheme = "inherit",
|
|
7297
7370
|
...props
|
|
7298
7371
|
}) => {
|
|
7299
|
-
return /* @__PURE__ */ (0,
|
|
7372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
|
|
7300
7373
|
StyledDataCards,
|
|
7301
7374
|
{
|
|
7302
7375
|
...props,
|
|
@@ -7314,25 +7387,25 @@ var DataCards = ({
|
|
|
7314
7387
|
DataCards.displayName = "DataCards";
|
|
7315
7388
|
|
|
7316
7389
|
// src/components/DataCards/DataCardTrend.tsx
|
|
7317
|
-
var
|
|
7390
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7318
7391
|
|
|
7319
7392
|
// src/components/Text/Text.tsx
|
|
7320
|
-
var
|
|
7321
|
-
var
|
|
7322
|
-
var
|
|
7323
|
-
var bodyBoldStyles =
|
|
7393
|
+
var import_react21 = require("react");
|
|
7394
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
7395
|
+
var import_jsx_runtime181 = require("react/jsx-runtime");
|
|
7396
|
+
var bodyBoldStyles = import_styled_components38.css`
|
|
7324
7397
|
> strong,
|
|
7325
7398
|
b {
|
|
7326
7399
|
font-weight: var(--wui-typography-weight-body-bold);
|
|
7327
7400
|
}
|
|
7328
7401
|
`;
|
|
7329
|
-
var labelBoldStyles =
|
|
7402
|
+
var labelBoldStyles = import_styled_components38.css`
|
|
7330
7403
|
> strong,
|
|
7331
7404
|
b {
|
|
7332
7405
|
font-weight: var(--wui-typography-weight-label-bold);
|
|
7333
7406
|
}
|
|
7334
7407
|
`;
|
|
7335
|
-
var body1TextStyle =
|
|
7408
|
+
var body1TextStyle = import_styled_components38.css`
|
|
7336
7409
|
--font-family: var(--wui-typography-body-1-family);
|
|
7337
7410
|
--font-size: var(--wui-typography-body-1-size);
|
|
7338
7411
|
--font-weight: var(--wui-typography-body-1-weight);
|
|
@@ -7340,7 +7413,7 @@ var body1TextStyle = import_styled_components36.css`
|
|
|
7340
7413
|
--paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
|
|
7341
7414
|
${bodyBoldStyles}
|
|
7342
7415
|
`;
|
|
7343
|
-
var body2TextStyle =
|
|
7416
|
+
var body2TextStyle = import_styled_components38.css`
|
|
7344
7417
|
--font-family: var(--wui-typography-body-2-family);
|
|
7345
7418
|
--font-size: var(--wui-typography-body-2-size);
|
|
7346
7419
|
--font-weight: var(--wui-typography-body-2-weight);
|
|
@@ -7348,7 +7421,7 @@ var body2TextStyle = import_styled_components36.css`
|
|
|
7348
7421
|
--paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
|
|
7349
7422
|
${bodyBoldStyles}
|
|
7350
7423
|
`;
|
|
7351
|
-
var body3TextStyle =
|
|
7424
|
+
var body3TextStyle = import_styled_components38.css`
|
|
7352
7425
|
--font-family: var(--wui-typography-body-3-family);
|
|
7353
7426
|
--font-size: var(--wui-typography-body-3-size);
|
|
7354
7427
|
--font-weight: var(--wui-typography-body-3-weight);
|
|
@@ -7356,7 +7429,7 @@ var body3TextStyle = import_styled_components36.css`
|
|
|
7356
7429
|
--paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
|
|
7357
7430
|
${bodyBoldStyles}
|
|
7358
7431
|
`;
|
|
7359
|
-
var body4TextStyle =
|
|
7432
|
+
var body4TextStyle = import_styled_components38.css`
|
|
7360
7433
|
--font-family: var(--wui-typography-body-4-family);
|
|
7361
7434
|
--font-size: var(--wui-typography-body-4-size);
|
|
7362
7435
|
--font-weight: var(--wui-typography-body-4-weight);
|
|
@@ -7364,47 +7437,47 @@ var body4TextStyle = import_styled_components36.css`
|
|
|
7364
7437
|
--paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
|
|
7365
7438
|
${bodyBoldStyles}
|
|
7366
7439
|
`;
|
|
7367
|
-
var label1TextStyle =
|
|
7440
|
+
var label1TextStyle = import_styled_components38.css`
|
|
7368
7441
|
--font-family: var(--wui-typography-label-1-family);
|
|
7369
7442
|
--font-size: var(--wui-typography-label-1-size);
|
|
7370
7443
|
--font-weight: var(--wui-typography-label-1-weight);
|
|
7371
7444
|
--line-height: var(--wui-typography-label-1-line-height);
|
|
7372
7445
|
${labelBoldStyles}
|
|
7373
7446
|
`;
|
|
7374
|
-
var label2TextStyle =
|
|
7447
|
+
var label2TextStyle = import_styled_components38.css`
|
|
7375
7448
|
--font-family: var(--wui-typography-label-2-family);
|
|
7376
7449
|
--font-size: var(--wui-typography-label-2-size);
|
|
7377
7450
|
--font-weight: var(--wui-typography-label-2-weight);
|
|
7378
7451
|
--line-height: var(--wui-typography-label-2-line-height);
|
|
7379
7452
|
${labelBoldStyles}
|
|
7380
7453
|
`;
|
|
7381
|
-
var label3TextStyle =
|
|
7454
|
+
var label3TextStyle = import_styled_components38.css`
|
|
7382
7455
|
--font-family: var(--wui-typography-label-3-family);
|
|
7383
7456
|
--font-size: var(--wui-typography-label-3-size);
|
|
7384
7457
|
--font-weight: var(--wui-typography-label-3-weight);
|
|
7385
7458
|
--line-height: var(--wui-typography-label-3-line-height);
|
|
7386
7459
|
${labelBoldStyles}
|
|
7387
7460
|
`;
|
|
7388
|
-
var label4TextStyle =
|
|
7461
|
+
var label4TextStyle = import_styled_components38.css`
|
|
7389
7462
|
--font-family: var(--wui-typography-label-4-family);
|
|
7390
7463
|
--font-size: var(--wui-typography-label-4-size);
|
|
7391
7464
|
--font-weight: var(--wui-typography-label-4-weight);
|
|
7392
7465
|
--line-height: var(--wui-typography-label-4-line-height);
|
|
7393
7466
|
${labelBoldStyles}
|
|
7394
7467
|
`;
|
|
7395
|
-
var body1MonoTextStyle =
|
|
7468
|
+
var body1MonoTextStyle = import_styled_components38.css`
|
|
7396
7469
|
${body1TextStyle};
|
|
7397
7470
|
--font-family: var(--wui-typography-family-mono);
|
|
7398
7471
|
`;
|
|
7399
|
-
var body2MonoTextStyle =
|
|
7472
|
+
var body2MonoTextStyle = import_styled_components38.css`
|
|
7400
7473
|
${body2TextStyle};
|
|
7401
7474
|
--font-family: var(--wui-typography-family-mono);
|
|
7402
7475
|
`;
|
|
7403
|
-
var body3MonoTextStyle =
|
|
7476
|
+
var body3MonoTextStyle = import_styled_components38.css`
|
|
7404
7477
|
${body3TextStyle};
|
|
7405
7478
|
--font-family: var(--wui-typography-family-mono);
|
|
7406
7479
|
`;
|
|
7407
|
-
var body4MonoTextStyle =
|
|
7480
|
+
var body4MonoTextStyle = import_styled_components38.css`
|
|
7408
7481
|
${body4TextStyle};
|
|
7409
7482
|
--font-family: var(--wui-typography-family-mono);
|
|
7410
7483
|
`;
|
|
@@ -7439,7 +7512,7 @@ var variantElementMap2 = {
|
|
|
7439
7512
|
label3: labelElement,
|
|
7440
7513
|
label4: labelElement
|
|
7441
7514
|
};
|
|
7442
|
-
var StyledText =
|
|
7515
|
+
var StyledText = import_styled_components38.default.div`
|
|
7443
7516
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7444
7517
|
--text-color: ${({ $prominence, $disabled }) => {
|
|
7445
7518
|
if ($disabled) {
|
|
@@ -7463,19 +7536,19 @@ var StyledText = import_styled_components36.default.div`
|
|
|
7463
7536
|
margin: 0;
|
|
7464
7537
|
${({ $variant }) => variantStyleMap2[$variant]}
|
|
7465
7538
|
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
7466
|
-
${({ $inline }) => $inline &&
|
|
7539
|
+
${({ $inline }) => $inline && import_styled_components38.css`
|
|
7467
7540
|
display: inline-block;
|
|
7468
7541
|
`}
|
|
7469
|
-
${({ $disabled }) => $disabled &&
|
|
7542
|
+
${({ $disabled }) => $disabled && import_styled_components38.css`
|
|
7470
7543
|
--text-color: var(--wui-color-text-disabled);
|
|
7471
7544
|
`}
|
|
7472
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
7545
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components38.css`
|
|
7473
7546
|
user-select: none;
|
|
7474
7547
|
`}
|
|
7475
|
-
${({ $align }) =>
|
|
7548
|
+
${({ $align }) => import_styled_components38.css`
|
|
7476
7549
|
text-align: ${$align};
|
|
7477
7550
|
`}
|
|
7478
|
-
${({ as }) => as === "p" &&
|
|
7551
|
+
${({ as }) => as === "p" && import_styled_components38.css`
|
|
7479
7552
|
display: block;
|
|
7480
7553
|
|
|
7481
7554
|
+ p {
|
|
@@ -7483,7 +7556,7 @@ var StyledText = import_styled_components36.default.div`
|
|
|
7483
7556
|
}
|
|
7484
7557
|
`}
|
|
7485
7558
|
`;
|
|
7486
|
-
var TextComponent = (0,
|
|
7559
|
+
var TextComponent = (0, import_react21.forwardRef)(
|
|
7487
7560
|
({
|
|
7488
7561
|
align = "left",
|
|
7489
7562
|
colorScheme = "inherit",
|
|
@@ -7496,7 +7569,7 @@ var TextComponent = (0, import_react20.forwardRef)(
|
|
|
7496
7569
|
renderAs,
|
|
7497
7570
|
...otherProps
|
|
7498
7571
|
}, ref) => {
|
|
7499
|
-
return /* @__PURE__ */ (0,
|
|
7572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
|
|
7500
7573
|
StyledText,
|
|
7501
7574
|
{
|
|
7502
7575
|
ref,
|
|
@@ -7518,8 +7591,8 @@ TextComponent.displayName = "Text";
|
|
|
7518
7591
|
var Text = makePolymorphic(TextComponent);
|
|
7519
7592
|
|
|
7520
7593
|
// src/components/DataCards/DataCardTrend.tsx
|
|
7521
|
-
var
|
|
7522
|
-
var StyledDataCardTrend =
|
|
7594
|
+
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
7595
|
+
var StyledDataCardTrend = import_styled_components39.default.div`
|
|
7523
7596
|
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
7524
7597
|
background: var(--wui-color-bg-app);
|
|
7525
7598
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -7534,8 +7607,8 @@ var DataCardTrend = ({
|
|
|
7534
7607
|
children,
|
|
7535
7608
|
...props
|
|
7536
7609
|
}) => {
|
|
7537
|
-
return /* @__PURE__ */ (0,
|
|
7538
|
-
/* @__PURE__ */ (0,
|
|
7610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
7611
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
7539
7612
|
Icon,
|
|
7540
7613
|
{
|
|
7541
7614
|
size: "md",
|
|
@@ -7543,7 +7616,7 @@ var DataCardTrend = ({
|
|
|
7543
7616
|
...props
|
|
7544
7617
|
}
|
|
7545
7618
|
),
|
|
7546
|
-
/* @__PURE__ */ (0,
|
|
7619
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
7547
7620
|
Text,
|
|
7548
7621
|
{
|
|
7549
7622
|
prominence: "secondary",
|
|
@@ -7555,22 +7628,22 @@ var DataCardTrend = ({
|
|
|
7555
7628
|
};
|
|
7556
7629
|
|
|
7557
7630
|
// src/components/Divider/Divider.tsx
|
|
7558
|
-
var
|
|
7559
|
-
var
|
|
7560
|
-
var horizontalBorderCss =
|
|
7631
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
7632
|
+
var import_jsx_runtime183 = require("react/jsx-runtime");
|
|
7633
|
+
var horizontalBorderCss = import_styled_components40.css`
|
|
7561
7634
|
border-top-color: var(--wui-color-border);
|
|
7562
7635
|
border-top-style: solid;
|
|
7563
7636
|
border-top-width: 1px;
|
|
7564
7637
|
clear: both; /* for horizontal dividers, ensure it clears any floats */
|
|
7565
7638
|
height: 0;
|
|
7566
7639
|
`;
|
|
7567
|
-
var verticalBorderCss =
|
|
7640
|
+
var verticalBorderCss = import_styled_components40.css`
|
|
7568
7641
|
background-color: var(--wui-color-border);
|
|
7569
7642
|
max-width: 1px;
|
|
7570
7643
|
min-height: 100%;
|
|
7571
7644
|
width: 1px;
|
|
7572
7645
|
`;
|
|
7573
|
-
var DividerComponent =
|
|
7646
|
+
var DividerComponent = import_styled_components40.default.div`
|
|
7574
7647
|
${({ $orientation }) => {
|
|
7575
7648
|
switch ($orientation) {
|
|
7576
7649
|
case "vertical":
|
|
@@ -7585,7 +7658,7 @@ var Divider = ({
|
|
|
7585
7658
|
orientation = "horizontal",
|
|
7586
7659
|
...otherProps
|
|
7587
7660
|
}) => {
|
|
7588
|
-
return /* @__PURE__ */ (0,
|
|
7661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
7589
7662
|
DividerComponent,
|
|
7590
7663
|
{
|
|
7591
7664
|
$orientation: orientation,
|
|
@@ -7598,15 +7671,15 @@ var Divider = ({
|
|
|
7598
7671
|
Divider.displayName = "Divider";
|
|
7599
7672
|
|
|
7600
7673
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
7601
|
-
var
|
|
7602
|
-
var
|
|
7674
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
7675
|
+
var import_react23 = require("react");
|
|
7603
7676
|
|
|
7604
7677
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7605
|
-
var
|
|
7606
|
-
var
|
|
7607
|
-
var
|
|
7608
|
-
var VisuallyHidden =
|
|
7609
|
-
var VisuallyHiddenButFocusable =
|
|
7678
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7679
|
+
var import_type_guards24 = require("@wistia/type-guards");
|
|
7680
|
+
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
7681
|
+
var VisuallyHidden = import_styled_components41.default.div({ ...visuallyHiddenStyle });
|
|
7682
|
+
var VisuallyHiddenButFocusable = import_styled_components41.default.div({
|
|
7610
7683
|
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7611
7684
|
});
|
|
7612
7685
|
var ScreenReaderOnly = ({
|
|
@@ -7615,26 +7688,26 @@ var ScreenReaderOnly = ({
|
|
|
7615
7688
|
focusable = false,
|
|
7616
7689
|
...otherProps
|
|
7617
7690
|
}) => {
|
|
7618
|
-
const accessibleText = (0,
|
|
7691
|
+
const accessibleText = (0, import_type_guards24.isNotNil)(text) ? text : children;
|
|
7619
7692
|
if (focusable) {
|
|
7620
|
-
return /* @__PURE__ */ (0,
|
|
7693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7621
7694
|
}
|
|
7622
|
-
return /* @__PURE__ */ (0,
|
|
7695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7623
7696
|
};
|
|
7624
7697
|
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7625
7698
|
|
|
7626
7699
|
// src/components/Tooltip/Tooltip.tsx
|
|
7627
7700
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
7628
|
-
var
|
|
7629
|
-
var
|
|
7630
|
-
var CompactTooltipStyles =
|
|
7701
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
7702
|
+
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
7703
|
+
var CompactTooltipStyles = import_styled_components42.css`
|
|
7631
7704
|
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
7632
7705
|
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
7633
7706
|
--tooltip-font-weight: var(--wui-typography-label-4-weight);
|
|
7634
7707
|
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
7635
7708
|
--tooltip-vertical-padding: var(--wui-space-03);
|
|
7636
7709
|
`;
|
|
7637
|
-
var StyledContent = (0,
|
|
7710
|
+
var StyledContent = (0, import_styled_components42.default)(import_react_tooltip2.Content)`
|
|
7638
7711
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
7639
7712
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
7640
7713
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -7692,14 +7765,14 @@ var Tooltip = ({
|
|
|
7692
7765
|
if (forceOpen === true) {
|
|
7693
7766
|
rootProps.open = true;
|
|
7694
7767
|
}
|
|
7695
|
-
return /* @__PURE__ */ (0,
|
|
7768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
|
|
7696
7769
|
import_react_tooltip2.Root,
|
|
7697
7770
|
{
|
|
7698
7771
|
delayDuration: delay,
|
|
7699
7772
|
...rootProps,
|
|
7700
7773
|
children: [
|
|
7701
|
-
/* @__PURE__ */ (0,
|
|
7702
|
-
/* @__PURE__ */ (0,
|
|
7774
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
7775
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
|
|
7703
7776
|
StyledContent,
|
|
7704
7777
|
{
|
|
7705
7778
|
$compact: compact,
|
|
@@ -7707,7 +7780,7 @@ var Tooltip = ({
|
|
|
7707
7780
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
7708
7781
|
children: [
|
|
7709
7782
|
content,
|
|
7710
|
-
!hideArrow ? /* @__PURE__ */ (0,
|
|
7783
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7711
7784
|
"svg",
|
|
7712
7785
|
{
|
|
7713
7786
|
fill: "var(--tooltip-bg)",
|
|
@@ -7716,7 +7789,7 @@ var Tooltip = ({
|
|
|
7716
7789
|
viewBox: "0 0 12 8",
|
|
7717
7790
|
width: "12",
|
|
7718
7791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7719
|
-
children: /* @__PURE__ */ (0,
|
|
7792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime185.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" })
|
|
7720
7793
|
}
|
|
7721
7794
|
) }) : null
|
|
7722
7795
|
]
|
|
@@ -7729,11 +7802,11 @@ var Tooltip = ({
|
|
|
7729
7802
|
Tooltip.displayName = "Tooltip";
|
|
7730
7803
|
|
|
7731
7804
|
// src/components/Input/Input.tsx
|
|
7732
|
-
var
|
|
7733
|
-
var
|
|
7734
|
-
var
|
|
7735
|
-
var
|
|
7736
|
-
var inputStyles =
|
|
7805
|
+
var import_react22 = require("react");
|
|
7806
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
7807
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
7808
|
+
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
7809
|
+
var inputStyles = import_styled_components43.css`
|
|
7737
7810
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7738
7811
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
7739
7812
|
--wui-input-color-border: var(--wui-color-border);
|
|
@@ -7774,7 +7847,7 @@ var inputStyles = import_styled_components41.css`
|
|
|
7774
7847
|
}
|
|
7775
7848
|
}
|
|
7776
7849
|
`;
|
|
7777
|
-
var StyledInputContainer =
|
|
7850
|
+
var StyledInputContainer = import_styled_components43.default.div`
|
|
7778
7851
|
display: inline-flex;
|
|
7779
7852
|
position: relative;
|
|
7780
7853
|
${inputStyles};
|
|
@@ -7818,7 +7891,7 @@ var StyledInputContainer = import_styled_components41.default.div`
|
|
|
7818
7891
|
padding-right: 32px;
|
|
7819
7892
|
}
|
|
7820
7893
|
`;
|
|
7821
|
-
var Input = (0,
|
|
7894
|
+
var Input = (0, import_react22.forwardRef)(
|
|
7822
7895
|
({
|
|
7823
7896
|
fullWidth = false,
|
|
7824
7897
|
monospace = false,
|
|
@@ -7828,27 +7901,27 @@ var Input = (0, import_react21.forwardRef)(
|
|
|
7828
7901
|
rightIcon,
|
|
7829
7902
|
...props
|
|
7830
7903
|
}, externalRef) => {
|
|
7831
|
-
const internalRef = (0,
|
|
7832
|
-
const ref = (0,
|
|
7904
|
+
const internalRef = (0, import_react22.useRef)();
|
|
7905
|
+
const ref = (0, import_type_guards25.isNotNil)(externalRef) && (0, import_type_guards25.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
7833
7906
|
let leftIconToDisplay = leftIcon;
|
|
7834
|
-
if ((0,
|
|
7835
|
-
leftIconToDisplay = /* @__PURE__ */ (0,
|
|
7907
|
+
if ((0, import_type_guards25.isNil)(leftIcon) && type === "search") {
|
|
7908
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(Icon, { type: "search" });
|
|
7836
7909
|
}
|
|
7837
|
-
if ((0,
|
|
7838
|
-
leftIconToDisplay = (0,
|
|
7910
|
+
if ((0, import_type_guards25.isNotNil)(leftIconToDisplay)) {
|
|
7911
|
+
leftIconToDisplay = (0, import_react22.cloneElement)(leftIconToDisplay, {
|
|
7839
7912
|
size: "md",
|
|
7840
7913
|
className: "wui-input-left-icon"
|
|
7841
7914
|
});
|
|
7842
7915
|
}
|
|
7843
7916
|
let rightIconToDisplay = rightIcon;
|
|
7844
|
-
if ((0,
|
|
7845
|
-
rightIconToDisplay = (0,
|
|
7917
|
+
if ((0, import_type_guards25.isNotNil)(rightIconToDisplay)) {
|
|
7918
|
+
rightIconToDisplay = (0, import_react22.cloneElement)(rightIconToDisplay, {
|
|
7846
7919
|
size: "md",
|
|
7847
7920
|
className: "wui-input-right-icon"
|
|
7848
7921
|
});
|
|
7849
7922
|
}
|
|
7850
7923
|
const handleFocus = (event) => {
|
|
7851
|
-
if ((0,
|
|
7924
|
+
if ((0, import_type_guards25.isNotNil)(props.onFocus)) {
|
|
7852
7925
|
props.onFocus(event);
|
|
7853
7926
|
}
|
|
7854
7927
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -7857,21 +7930,21 @@ var Input = (0, import_react21.forwardRef)(
|
|
|
7857
7930
|
});
|
|
7858
7931
|
}
|
|
7859
7932
|
};
|
|
7860
|
-
return /* @__PURE__ */ (0,
|
|
7933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(
|
|
7861
7934
|
StyledInputContainer,
|
|
7862
7935
|
{
|
|
7863
7936
|
$fullWidth: fullWidth,
|
|
7864
7937
|
$monospace: monospace,
|
|
7865
7938
|
children: [
|
|
7866
7939
|
leftIconToDisplay ?? null,
|
|
7867
|
-
type === "multiline" ? /* @__PURE__ */ (0,
|
|
7940
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7868
7941
|
"textarea",
|
|
7869
7942
|
{
|
|
7870
7943
|
...props,
|
|
7871
7944
|
ref,
|
|
7872
7945
|
onFocus: handleFocus
|
|
7873
7946
|
}
|
|
7874
|
-
) : /* @__PURE__ */ (0,
|
|
7947
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
7875
7948
|
"input",
|
|
7876
7949
|
{
|
|
7877
7950
|
...props,
|
|
@@ -7889,8 +7962,8 @@ var Input = (0, import_react21.forwardRef)(
|
|
|
7889
7962
|
Input.displayName = "Input";
|
|
7890
7963
|
|
|
7891
7964
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
7892
|
-
var
|
|
7893
|
-
var StyledInput = (0,
|
|
7965
|
+
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
7966
|
+
var StyledInput = (0, import_styled_components44.default)(Input)`
|
|
7894
7967
|
:not([rows]) {
|
|
7895
7968
|
min-height: unset;
|
|
7896
7969
|
}
|
|
@@ -7910,7 +7983,7 @@ var StyledInput = (0, import_styled_components42.default)(Input)`
|
|
|
7910
7983
|
height: ${({ $height }) => `${$height}px`};
|
|
7911
7984
|
}
|
|
7912
7985
|
`;
|
|
7913
|
-
var editableStyles =
|
|
7986
|
+
var editableStyles = import_styled_components44.css`
|
|
7914
7987
|
&:has(+ :focus-within) {
|
|
7915
7988
|
background: var(--wui-color-bg-surface-hover);
|
|
7916
7989
|
}
|
|
@@ -7920,7 +7993,7 @@ var editableStyles = import_styled_components42.css`
|
|
|
7920
7993
|
cursor: pointer;
|
|
7921
7994
|
}
|
|
7922
7995
|
`;
|
|
7923
|
-
var StyledHeading2 = (0,
|
|
7996
|
+
var StyledHeading2 = (0, import_styled_components44.default)(Heading)`
|
|
7924
7997
|
width: 100%;
|
|
7925
7998
|
border-radius: var(--wui-border-radius-02);
|
|
7926
7999
|
padding: var(--wui-space-02);
|
|
@@ -7937,11 +8010,11 @@ var EditableHeading = ({
|
|
|
7937
8010
|
forceEditing = false,
|
|
7938
8011
|
editingDisabled = false
|
|
7939
8012
|
}) => {
|
|
7940
|
-
const [isEditing, setIsEditing] = (0,
|
|
7941
|
-
const [value, setValue] = (0,
|
|
7942
|
-
const [previousValue, setPreviousValue] = (0,
|
|
7943
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
7944
|
-
const headingRef = (0,
|
|
8013
|
+
const [isEditing, setIsEditing] = (0, import_react23.useState)(false);
|
|
8014
|
+
const [value, setValue] = (0, import_react23.useState)(children);
|
|
8015
|
+
const [previousValue, setPreviousValue] = (0, import_react23.useState)(children);
|
|
8016
|
+
const [headingHeight, setHeadingHeight] = (0, import_react23.useState)("60");
|
|
8017
|
+
const headingRef = (0, import_react23.useRef)(null);
|
|
7945
8018
|
const handleSetEditing = (editing) => {
|
|
7946
8019
|
if (editingDisabled) return;
|
|
7947
8020
|
if (editing && headingRef.current) {
|
|
@@ -7974,7 +8047,7 @@ var EditableHeading = ({
|
|
|
7974
8047
|
handleSetEditing(false);
|
|
7975
8048
|
}
|
|
7976
8049
|
};
|
|
7977
|
-
const HeadingComponent2 = /* @__PURE__ */ (0,
|
|
8050
|
+
const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
7978
8051
|
StyledHeading2,
|
|
7979
8052
|
{
|
|
7980
8053
|
ref: headingRef,
|
|
@@ -7988,7 +8061,7 @@ var EditableHeading = ({
|
|
|
7988
8061
|
return HeadingComponent2;
|
|
7989
8062
|
}
|
|
7990
8063
|
if (isEditing || forceEditing) {
|
|
7991
|
-
return /* @__PURE__ */ (0,
|
|
8064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
7992
8065
|
StyledInput,
|
|
7993
8066
|
{
|
|
7994
8067
|
$height: headingHeight,
|
|
@@ -8006,8 +8079,8 @@ var EditableHeading = ({
|
|
|
8006
8079
|
}
|
|
8007
8080
|
);
|
|
8008
8081
|
}
|
|
8009
|
-
return /* @__PURE__ */ (0,
|
|
8010
|
-
/* @__PURE__ */ (0,
|
|
8082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(import_jsx_runtime187.Fragment, { children: [
|
|
8083
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
8011
8084
|
Tooltip,
|
|
8012
8085
|
{
|
|
8013
8086
|
compact: true,
|
|
@@ -8015,7 +8088,7 @@ var EditableHeading = ({
|
|
|
8015
8088
|
children: HeadingComponent2
|
|
8016
8089
|
}
|
|
8017
8090
|
),
|
|
8018
|
-
/* @__PURE__ */ (0,
|
|
8091
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
8019
8092
|
"button",
|
|
8020
8093
|
{
|
|
8021
8094
|
"aria-label": ariaLabel,
|
|
@@ -8027,25 +8100,25 @@ var EditableHeading = ({
|
|
|
8027
8100
|
};
|
|
8028
8101
|
|
|
8029
8102
|
// src/components/Form/Form.tsx
|
|
8030
|
-
var
|
|
8031
|
-
var
|
|
8032
|
-
var
|
|
8103
|
+
var import_react25 = require("react");
|
|
8104
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
8105
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
8033
8106
|
|
|
8034
8107
|
// src/components/Stack/Stack.tsx
|
|
8035
|
-
var
|
|
8036
|
-
var
|
|
8037
|
-
var
|
|
8108
|
+
var import_react24 = require("react");
|
|
8109
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
8110
|
+
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
8038
8111
|
var DEFAULT_ELEMENT4 = "div";
|
|
8039
|
-
var StyledStack =
|
|
8112
|
+
var StyledStack = import_styled_components45.default.div`
|
|
8040
8113
|
display: flex;
|
|
8041
8114
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
8042
8115
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
8043
8116
|
`;
|
|
8044
|
-
var StackComponent = (0,
|
|
8117
|
+
var StackComponent = (0, import_react24.forwardRef)(
|
|
8045
8118
|
({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
|
|
8046
8119
|
const responsiveGap = useResponsiveProp(gap);
|
|
8047
8120
|
const responsiveDirection = useResponsiveProp(direction);
|
|
8048
|
-
return /* @__PURE__ */ (0,
|
|
8121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
8049
8122
|
StyledStack,
|
|
8050
8123
|
{
|
|
8051
8124
|
ref,
|
|
@@ -8061,29 +8134,29 @@ StackComponent.displayName = "Stack";
|
|
|
8061
8134
|
var Stack = makePolymorphic(StackComponent);
|
|
8062
8135
|
|
|
8063
8136
|
// src/components/Form/Form.tsx
|
|
8064
|
-
var
|
|
8065
|
-
var StyledForm =
|
|
8137
|
+
var import_jsx_runtime189 = require("react/jsx-runtime");
|
|
8138
|
+
var StyledForm = import_styled_components46.default.form`
|
|
8066
8139
|
--form-default-width: 690px;
|
|
8067
8140
|
|
|
8068
8141
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
8069
8142
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
8070
8143
|
`;
|
|
8071
|
-
var FormContext = (0,
|
|
8144
|
+
var FormContext = (0, import_react25.createContext)({
|
|
8072
8145
|
values: {},
|
|
8073
8146
|
errors: {},
|
|
8074
8147
|
hasSubmitted: false,
|
|
8075
8148
|
formId: ""
|
|
8076
8149
|
});
|
|
8077
8150
|
var FormComponent = ({ children, action, values = {}, validate, fullWidth = false, ...props }, forwardedRef) => {
|
|
8078
|
-
const [errors, setErrors] = (0,
|
|
8079
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
8080
|
-
const innerRef = (0,
|
|
8151
|
+
const [errors, setErrors] = (0, import_react25.useState)({});
|
|
8152
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react25.useState)(false);
|
|
8153
|
+
const innerRef = (0, import_react25.useRef)();
|
|
8081
8154
|
const ref = forwardedRef ?? innerRef;
|
|
8082
|
-
const autoId = (0,
|
|
8155
|
+
const autoId = (0, import_react25.useId)();
|
|
8083
8156
|
const id = props.id ?? autoId;
|
|
8084
8157
|
const handleValidate = (nextFormData) => {
|
|
8085
8158
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
8086
|
-
if ((0,
|
|
8159
|
+
if ((0, import_type_guards26.isUndefined)(validate)) {
|
|
8087
8160
|
return {};
|
|
8088
8161
|
}
|
|
8089
8162
|
return validate(nextData);
|
|
@@ -8093,7 +8166,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
8093
8166
|
props.onBlur(event);
|
|
8094
8167
|
}
|
|
8095
8168
|
const formData = new FormData(event.currentTarget);
|
|
8096
|
-
if ((0,
|
|
8169
|
+
if ((0, import_type_guards26.isNotUndefined)(validate)) {
|
|
8097
8170
|
handleValidate(formData);
|
|
8098
8171
|
}
|
|
8099
8172
|
};
|
|
@@ -8121,7 +8194,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
8121
8194
|
void action(null);
|
|
8122
8195
|
}
|
|
8123
8196
|
};
|
|
8124
|
-
const context = (0,
|
|
8197
|
+
const context = (0, import_react25.useMemo)(() => {
|
|
8125
8198
|
return {
|
|
8126
8199
|
values,
|
|
8127
8200
|
errors,
|
|
@@ -8131,7 +8204,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
8131
8204
|
}, [values, errors, id, hasSubmitted]);
|
|
8132
8205
|
return (
|
|
8133
8206
|
// @ts-expect-error - generic context providers are a giant pain
|
|
8134
|
-
/* @__PURE__ */ (0,
|
|
8207
|
+
/* @__PURE__ */ (0, import_jsx_runtime189.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(
|
|
8135
8208
|
Stack,
|
|
8136
8209
|
{
|
|
8137
8210
|
gap: "space-05",
|
|
@@ -8149,15 +8222,15 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
8149
8222
|
);
|
|
8150
8223
|
};
|
|
8151
8224
|
FormComponent.displayName = "Form";
|
|
8152
|
-
var Form = (0,
|
|
8225
|
+
var Form = (0, import_react25.forwardRef)(FormComponent);
|
|
8153
8226
|
|
|
8154
8227
|
// src/components/Form/useFormState.tsx
|
|
8155
|
-
var
|
|
8228
|
+
var import_react26 = require("react");
|
|
8156
8229
|
var useFormState = (action, initialData = {}) => {
|
|
8157
|
-
const [data, setData] = (0,
|
|
8158
|
-
const [isPending, setIsPending] = (0,
|
|
8159
|
-
const [error, setError] = (0,
|
|
8160
|
-
const formAction = (0,
|
|
8230
|
+
const [data, setData] = (0, import_react26.useState)(initialData);
|
|
8231
|
+
const [isPending, setIsPending] = (0, import_react26.useState)(false);
|
|
8232
|
+
const [error, setError] = (0, import_react26.useState)(null);
|
|
8233
|
+
const formAction = (0, import_react26.useCallback)(
|
|
8161
8234
|
async (nextFormData) => {
|
|
8162
8235
|
if (nextFormData === null) {
|
|
8163
8236
|
setData(initialData);
|
|
@@ -8188,23 +8261,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
8188
8261
|
};
|
|
8189
8262
|
|
|
8190
8263
|
// src/components/Form/FormErrorSummary.tsx
|
|
8191
|
-
var
|
|
8192
|
-
var
|
|
8193
|
-
var
|
|
8264
|
+
var import_react27 = require("react");
|
|
8265
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
8266
|
+
var import_jsx_runtime190 = require("react/jsx-runtime");
|
|
8194
8267
|
var ErrorItem = ({ name, error, formId }) => {
|
|
8195
|
-
return /* @__PURE__ */ (0,
|
|
8268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(Link, { href: `${formId}-${name}`, children: error }) }, name);
|
|
8196
8269
|
};
|
|
8197
8270
|
var FormErrorSummary = ({ description }) => {
|
|
8198
|
-
const ref = (0,
|
|
8199
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
8271
|
+
const ref = (0, import_react27.useRef)(null);
|
|
8272
|
+
const { formId, errors, hasSubmitted } = (0, import_react27.useContext)(FormContext);
|
|
8200
8273
|
const isValid = Object.keys(errors).length === 0;
|
|
8201
8274
|
if (isValid || !hasSubmitted) {
|
|
8202
8275
|
return null;
|
|
8203
8276
|
}
|
|
8204
|
-
return /* @__PURE__ */ (0,
|
|
8205
|
-
/* @__PURE__ */ (0,
|
|
8206
|
-
/* @__PURE__ */ (0,
|
|
8207
|
-
([name, error]) => (0,
|
|
8277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("div", { ref, children: [
|
|
8278
|
+
/* @__PURE__ */ (0, import_jsx_runtime190.jsx)("p", { children: description }),
|
|
8279
|
+
/* @__PURE__ */ (0, import_jsx_runtime190.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards27.isNotUndefined)(error)).map(
|
|
8280
|
+
([name, error]) => (0, import_type_guards27.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
8208
8281
|
ErrorItem,
|
|
8209
8282
|
{
|
|
8210
8283
|
error: err,
|
|
@@ -8212,7 +8285,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
8212
8285
|
name
|
|
8213
8286
|
},
|
|
8214
8287
|
err
|
|
8215
|
-
)) : /* @__PURE__ */ (0,
|
|
8288
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
|
|
8216
8289
|
ErrorItem,
|
|
8217
8290
|
{
|
|
8218
8291
|
error: error ?? "",
|
|
@@ -8226,33 +8299,33 @@ var FormErrorSummary = ({ description }) => {
|
|
|
8226
8299
|
};
|
|
8227
8300
|
|
|
8228
8301
|
// src/components/FormField/FormField.tsx
|
|
8229
|
-
var
|
|
8230
|
-
var
|
|
8231
|
-
var
|
|
8302
|
+
var import_react30 = require("react");
|
|
8303
|
+
var import_styled_components48 = __toESM(require("styled-components"));
|
|
8304
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8232
8305
|
|
|
8233
8306
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8234
|
-
var
|
|
8307
|
+
var import_react29 = require("react");
|
|
8235
8308
|
|
|
8236
8309
|
// src/components/FormGroup/FormGroup.tsx
|
|
8237
|
-
var
|
|
8238
|
-
var
|
|
8239
|
-
var
|
|
8240
|
-
var StyledFieldset =
|
|
8310
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
8311
|
+
var import_react28 = require("react");
|
|
8312
|
+
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
8313
|
+
var StyledFieldset = import_styled_components47.default.fieldset`
|
|
8241
8314
|
border: 0;
|
|
8242
8315
|
`;
|
|
8243
|
-
var StyledLegend =
|
|
8316
|
+
var StyledLegend = import_styled_components47.default.legend`
|
|
8244
8317
|
margin-bottom: var(--space-01);
|
|
8245
8318
|
`;
|
|
8246
8319
|
var FormGroup = ({ children, label, ...props }) => {
|
|
8247
|
-
const ref = (0,
|
|
8248
|
-
return /* @__PURE__ */ (0,
|
|
8320
|
+
const ref = (0, import_react28.useRef)();
|
|
8321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
8249
8322
|
Stack,
|
|
8250
8323
|
{
|
|
8251
8324
|
...props,
|
|
8252
8325
|
ref,
|
|
8253
8326
|
renderAs: StyledFieldset,
|
|
8254
8327
|
children: [
|
|
8255
|
-
/* @__PURE__ */ (0,
|
|
8328
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
8256
8329
|
Heading,
|
|
8257
8330
|
{
|
|
8258
8331
|
renderAs: StyledLegend,
|
|
@@ -8268,8 +8341,8 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
8268
8341
|
FormGroup.displayName = "FormGroup";
|
|
8269
8342
|
|
|
8270
8343
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8271
|
-
var
|
|
8272
|
-
var CheckboxGroupContext = (0,
|
|
8344
|
+
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
8345
|
+
var CheckboxGroupContext = (0, import_react29.createContext)(null);
|
|
8273
8346
|
var CheckboxGroup = ({
|
|
8274
8347
|
children,
|
|
8275
8348
|
name,
|
|
@@ -8277,19 +8350,19 @@ var CheckboxGroup = ({
|
|
|
8277
8350
|
value,
|
|
8278
8351
|
...props
|
|
8279
8352
|
}) => {
|
|
8280
|
-
const context = (0,
|
|
8353
|
+
const context = (0, import_react29.useMemo)(() => {
|
|
8281
8354
|
return {
|
|
8282
8355
|
name,
|
|
8283
8356
|
onChange
|
|
8284
8357
|
};
|
|
8285
8358
|
}, [name, onChange]);
|
|
8286
|
-
return /* @__PURE__ */ (0,
|
|
8359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(FormGroup, { ...props, children }) });
|
|
8287
8360
|
};
|
|
8288
8361
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
8289
8362
|
|
|
8290
8363
|
// src/components/FormField/FormField.tsx
|
|
8291
|
-
var
|
|
8292
|
-
var StyledFormField =
|
|
8364
|
+
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
8365
|
+
var StyledFormField = import_styled_components48.default.div`
|
|
8293
8366
|
--form-field-spacing: var(--wui-space-01);
|
|
8294
8367
|
--form-field-error-color: var(--wui-color-text-secondary-error);
|
|
8295
8368
|
|
|
@@ -8297,7 +8370,7 @@ var StyledFormField = import_styled_components46.default.div`
|
|
|
8297
8370
|
flex-direction: column;
|
|
8298
8371
|
gap: var(--form-field-spacing);
|
|
8299
8372
|
`;
|
|
8300
|
-
var StyledErrorList =
|
|
8373
|
+
var StyledErrorList = import_styled_components48.default.ul`
|
|
8301
8374
|
margin: 0;
|
|
8302
8375
|
padding: 0;
|
|
8303
8376
|
padding-left: var(--wui-space-04);
|
|
@@ -8306,8 +8379,8 @@ var StyledErrorList = import_styled_components46.default.ul`
|
|
|
8306
8379
|
gap: var(--wui-space-01);
|
|
8307
8380
|
`;
|
|
8308
8381
|
var ErrorMessages = ({ errors, id }) => {
|
|
8309
|
-
const isMultipleErrors = (0,
|
|
8310
|
-
return isMultipleErrors ? /* @__PURE__ */ (0,
|
|
8382
|
+
const isMultipleErrors = (0, import_type_guards28.isArray)(errors);
|
|
8383
|
+
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
8311
8384
|
Text,
|
|
8312
8385
|
{
|
|
8313
8386
|
colorScheme: "error",
|
|
@@ -8317,7 +8390,7 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
8317
8390
|
children: error
|
|
8318
8391
|
},
|
|
8319
8392
|
`${id}-${index}`
|
|
8320
|
-
)) }) : /* @__PURE__ */ (0,
|
|
8393
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
8321
8394
|
Text,
|
|
8322
8395
|
{
|
|
8323
8396
|
colorScheme: "error",
|
|
@@ -8337,8 +8410,8 @@ var FormField = ({
|
|
|
8337
8410
|
value,
|
|
8338
8411
|
...props
|
|
8339
8412
|
}) => {
|
|
8340
|
-
const formState = (0,
|
|
8341
|
-
const checkboxGroup = (0,
|
|
8413
|
+
const formState = (0, import_react30.useContext)(FormContext);
|
|
8414
|
+
const checkboxGroup = (0, import_react30.useContext)(CheckboxGroupContext);
|
|
8342
8415
|
const id = props.id ?? `${formState.formId}-${name}`;
|
|
8343
8416
|
const isInlineLabel = children.type === Checkbox;
|
|
8344
8417
|
const computedError = error ?? formState.errors[name];
|
|
@@ -8349,19 +8422,19 @@ var FormField = ({
|
|
|
8349
8422
|
label: isInlineLabel ? label : void 0,
|
|
8350
8423
|
...props
|
|
8351
8424
|
};
|
|
8352
|
-
if ((0,
|
|
8425
|
+
if ((0, import_type_guards28.isUndefined)(value) && (0, import_type_guards28.isNotUndefined)(defaultValue)) {
|
|
8353
8426
|
childProps = {
|
|
8354
8427
|
...childProps,
|
|
8355
8428
|
defaultValue
|
|
8356
8429
|
};
|
|
8357
8430
|
}
|
|
8358
|
-
if ((0,
|
|
8359
|
-
const computedName = (0,
|
|
8431
|
+
if ((0, import_type_guards28.isNotNil)(checkboxGroup)) {
|
|
8432
|
+
const computedName = (0, import_type_guards28.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
8360
8433
|
const handleChange = (event) => {
|
|
8361
|
-
if ((0,
|
|
8434
|
+
if ((0, import_type_guards28.isNotUndefined)(props.onChange)) {
|
|
8362
8435
|
props.onChange(event);
|
|
8363
8436
|
}
|
|
8364
|
-
if ((0,
|
|
8437
|
+
if ((0, import_type_guards28.isNotUndefined)(checkboxGroup.onChange)) {
|
|
8365
8438
|
checkboxGroup.onChange(event);
|
|
8366
8439
|
}
|
|
8367
8440
|
};
|
|
@@ -8369,15 +8442,15 @@ var FormField = ({
|
|
|
8369
8442
|
...childProps,
|
|
8370
8443
|
name: computedName,
|
|
8371
8444
|
onChange: handleChange,
|
|
8372
|
-
"aria-invalid": (0,
|
|
8373
|
-
"aria-describedby": (0,
|
|
8445
|
+
"aria-invalid": (0, import_type_guards28.isNotNil)(error),
|
|
8446
|
+
"aria-describedby": (0, import_type_guards28.isNotNil)(error) ? `${id}-error` : void 0
|
|
8374
8447
|
};
|
|
8375
8448
|
}
|
|
8376
|
-
|
|
8377
|
-
return /* @__PURE__ */ (0,
|
|
8378
|
-
!isInlineLabel && /* @__PURE__ */ (0,
|
|
8379
|
-
(0,
|
|
8380
|
-
(0,
|
|
8449
|
+
import_react30.Children.only(children);
|
|
8450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(StyledFormField, { ...props, children: [
|
|
8451
|
+
!isInlineLabel && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(Label, { htmlFor: id, children: label }),
|
|
8452
|
+
(0, import_react30.cloneElement)(children, childProps),
|
|
8453
|
+
(0, import_type_guards28.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
8381
8454
|
ErrorMessages,
|
|
8382
8455
|
{
|
|
8383
8456
|
errors: computedError,
|
|
@@ -8389,9 +8462,9 @@ var FormField = ({
|
|
|
8389
8462
|
FormField.displayName = "FormField";
|
|
8390
8463
|
|
|
8391
8464
|
// src/components/FormGroup/RadioGroup.tsx
|
|
8392
|
-
var
|
|
8393
|
-
var
|
|
8394
|
-
var RadioGroupContext = (0,
|
|
8465
|
+
var import_react31 = require("react");
|
|
8466
|
+
var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
8467
|
+
var RadioGroupContext = (0, import_react31.createContext)(null);
|
|
8395
8468
|
var RadioGroup = ({
|
|
8396
8469
|
children,
|
|
8397
8470
|
name,
|
|
@@ -8399,21 +8472,21 @@ var RadioGroup = ({
|
|
|
8399
8472
|
value,
|
|
8400
8473
|
...props
|
|
8401
8474
|
}) => {
|
|
8402
|
-
const context = (0,
|
|
8475
|
+
const context = (0, import_react31.useMemo)(() => {
|
|
8403
8476
|
return {
|
|
8404
8477
|
name,
|
|
8405
8478
|
onChange
|
|
8406
8479
|
};
|
|
8407
8480
|
}, [name, onChange]);
|
|
8408
|
-
return /* @__PURE__ */ (0,
|
|
8481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(FormGroup, { ...props, children }) });
|
|
8409
8482
|
};
|
|
8410
8483
|
RadioGroup.displayName = "RadioGroup";
|
|
8411
8484
|
|
|
8412
8485
|
// src/components/IconButton/IconButton.tsx
|
|
8413
|
-
var
|
|
8414
|
-
var
|
|
8415
|
-
var
|
|
8416
|
-
var StyledButton2 = (0,
|
|
8486
|
+
var import_react32 = require("react");
|
|
8487
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
8488
|
+
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
8489
|
+
var StyledButton2 = (0, import_styled_components49.default)(Button)`
|
|
8417
8490
|
--icon-button-size-sm: 24px;
|
|
8418
8491
|
--icon-button-size-md: 32px;
|
|
8419
8492
|
--icon-button-size-lg: 40px;
|
|
@@ -8427,10 +8500,10 @@ var StyledButton2 = (0, import_styled_components47.default)(Button)`
|
|
|
8427
8500
|
align-items: center;
|
|
8428
8501
|
line-height: 1;
|
|
8429
8502
|
`;
|
|
8430
|
-
var IconButton = (0,
|
|
8503
|
+
var IconButton = (0, import_react32.forwardRef)(
|
|
8431
8504
|
({ children, label, size = "md", ...props }, ref) => {
|
|
8432
8505
|
const responsiveSize = useResponsiveProp(size);
|
|
8433
|
-
return /* @__PURE__ */ (0,
|
|
8506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
8434
8507
|
StyledButton2,
|
|
8435
8508
|
{
|
|
8436
8509
|
...props,
|
|
@@ -8438,7 +8511,7 @@ var IconButton = (0, import_react31.forwardRef)(
|
|
|
8438
8511
|
"aria-label": label,
|
|
8439
8512
|
"data-wistia-ui-icon-button": true,
|
|
8440
8513
|
size: responsiveSize,
|
|
8441
|
-
children: (0,
|
|
8514
|
+
children: (0, import_react32.cloneElement)(import_react32.Children.only(children), {
|
|
8442
8515
|
size: responsiveSize
|
|
8443
8516
|
})
|
|
8444
8517
|
}
|
|
@@ -8448,19 +8521,19 @@ var IconButton = (0, import_react31.forwardRef)(
|
|
|
8448
8521
|
IconButton.displayName = "IconButton";
|
|
8449
8522
|
|
|
8450
8523
|
// src/components/Menu/Menu.tsx
|
|
8451
|
-
var
|
|
8524
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
8452
8525
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
8453
|
-
var
|
|
8454
|
-
var
|
|
8526
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
8527
|
+
var import_react34 = require("react");
|
|
8455
8528
|
|
|
8456
8529
|
// src/components/Menu/MenuContext.tsx
|
|
8457
|
-
var
|
|
8458
|
-
var MenuContext = (0,
|
|
8459
|
-
var useMenuContext = () => (0,
|
|
8530
|
+
var import_react33 = require("react");
|
|
8531
|
+
var MenuContext = (0, import_react33.createContext)({ compact: false });
|
|
8532
|
+
var useMenuContext = () => (0, import_react33.useContext)(MenuContext);
|
|
8460
8533
|
|
|
8461
8534
|
// src/components/Menu/Menu.tsx
|
|
8462
|
-
var
|
|
8463
|
-
var open =
|
|
8535
|
+
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
8536
|
+
var open = import_styled_components50.keyframes`
|
|
8464
8537
|
from {
|
|
8465
8538
|
opacity: 0;
|
|
8466
8539
|
transform: scale(.97) translateY(-8px);
|
|
@@ -8470,7 +8543,7 @@ var open = import_styled_components48.keyframes`
|
|
|
8470
8543
|
transform: scale(1);
|
|
8471
8544
|
}
|
|
8472
8545
|
`;
|
|
8473
|
-
var close =
|
|
8546
|
+
var close = import_styled_components50.keyframes`
|
|
8474
8547
|
from {
|
|
8475
8548
|
opacity: 1;
|
|
8476
8549
|
transform: scale(1);
|
|
@@ -8480,7 +8553,7 @@ var close = import_styled_components48.keyframes`
|
|
|
8480
8553
|
transform: scale(.97) translateY(-8px);
|
|
8481
8554
|
}
|
|
8482
8555
|
`;
|
|
8483
|
-
var menuItemCss =
|
|
8556
|
+
var menuItemCss = import_styled_components50.css`
|
|
8484
8557
|
--menu-label-description-gap: var(--wui-space-01);
|
|
8485
8558
|
--menu-item-inner-gap: var(--wui-space-03);
|
|
8486
8559
|
--menu-item-left-icon-size: 24px;
|
|
@@ -8491,7 +8564,7 @@ var menuItemCss = import_styled_components48.css`
|
|
|
8491
8564
|
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
8492
8565
|
--menu-divider-margin: var(--wui-space-02);
|
|
8493
8566
|
`;
|
|
8494
|
-
var compactMenuItemCss =
|
|
8567
|
+
var compactMenuItemCss = import_styled_components50.css`
|
|
8495
8568
|
--menu-label-description-gap: 0;
|
|
8496
8569
|
--menu-item-inner-gap: var(--wui-space-02);
|
|
8497
8570
|
--menu-item-left-icon-size: 16px;
|
|
@@ -8502,7 +8575,7 @@ var compactMenuItemCss = import_styled_components48.css`
|
|
|
8502
8575
|
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
8503
8576
|
--menu-divider-margin: var(--wui-space-01);
|
|
8504
8577
|
`;
|
|
8505
|
-
var menuContentCss =
|
|
8578
|
+
var menuContentCss = import_styled_components50.css`
|
|
8506
8579
|
--menu-font-family: var(--wui-typography-family-default);
|
|
8507
8580
|
--menu-bg: var(--wui-color-bg-surface);
|
|
8508
8581
|
--menu-shadow: var(--wui-elevation-01);
|
|
@@ -8544,7 +8617,7 @@ var menuContentCss = import_styled_components48.css`
|
|
|
8544
8617
|
margin: var(--menu-divider-margin) 0;
|
|
8545
8618
|
}
|
|
8546
8619
|
`;
|
|
8547
|
-
var MenuContent = (0,
|
|
8620
|
+
var MenuContent = (0, import_styled_components50.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
8548
8621
|
${menuContentCss}
|
|
8549
8622
|
`;
|
|
8550
8623
|
var Menu = ({
|
|
@@ -8560,9 +8633,9 @@ var Menu = ({
|
|
|
8560
8633
|
onInteractOutside,
|
|
8561
8634
|
...props
|
|
8562
8635
|
}) => {
|
|
8563
|
-
const contextValue = (0,
|
|
8636
|
+
const contextValue = (0, import_react34.useMemo)(() => ({ compact }), [compact]);
|
|
8564
8637
|
let controlProps = {
|
|
8565
|
-
...(0,
|
|
8638
|
+
...(0, import_type_guards29.isNotNil)(onOpenChange) && (0, import_type_guards29.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8566
8639
|
};
|
|
8567
8640
|
if (disabled) {
|
|
8568
8641
|
controlProps = {
|
|
@@ -8570,24 +8643,24 @@ var Menu = ({
|
|
|
8570
8643
|
onOpenChange: () => null
|
|
8571
8644
|
};
|
|
8572
8645
|
}
|
|
8573
|
-
return /* @__PURE__ */ (0,
|
|
8646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)(
|
|
8574
8647
|
import_react_dropdown_menu.DropdownMenu,
|
|
8575
8648
|
{
|
|
8576
8649
|
modal: false,
|
|
8577
8650
|
...controlProps,
|
|
8578
8651
|
children: [
|
|
8579
|
-
/* @__PURE__ */ (0,
|
|
8652
|
+
/* @__PURE__ */ (0, import_jsx_runtime196.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards29.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
8580
8653
|
Button,
|
|
8581
8654
|
{
|
|
8582
8655
|
"aria-expanded": isOpen,
|
|
8583
8656
|
disabled,
|
|
8584
8657
|
forceState: isOpen ? "active" : void 0,
|
|
8585
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8658
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(Icon, { type: "caret-down" }),
|
|
8586
8659
|
...triggerProps,
|
|
8587
8660
|
children: label
|
|
8588
8661
|
}
|
|
8589
8662
|
) }),
|
|
8590
|
-
/* @__PURE__ */ (0,
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime196.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
8591
8664
|
MenuContent,
|
|
8592
8665
|
{
|
|
8593
8666
|
...props,
|
|
@@ -8607,19 +8680,19 @@ var Menu = ({
|
|
|
8607
8680
|
Menu.displayName = "Menu";
|
|
8608
8681
|
|
|
8609
8682
|
// src/components/Menu/MenuLabel.tsx
|
|
8610
|
-
var
|
|
8683
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
8611
8684
|
var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
|
|
8612
|
-
var
|
|
8613
|
-
var StyledMenuLabel = (0,
|
|
8685
|
+
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
8686
|
+
var StyledMenuLabel = (0, import_styled_components51.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
|
|
8614
8687
|
padding: var(--wui-space-02);
|
|
8615
8688
|
`;
|
|
8616
8689
|
var MenuLabel = ({ children, ...props }) => {
|
|
8617
|
-
return /* @__PURE__ */ (0,
|
|
8690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
|
|
8618
8691
|
StyledMenuLabel,
|
|
8619
8692
|
{
|
|
8620
8693
|
asChild: true,
|
|
8621
8694
|
...props,
|
|
8622
|
-
children: /* @__PURE__ */ (0,
|
|
8695
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
|
|
8623
8696
|
Heading,
|
|
8624
8697
|
{
|
|
8625
8698
|
renderAs: "span",
|
|
@@ -8634,17 +8707,17 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
8634
8707
|
MenuLabel.displayName = "MenuLabel";
|
|
8635
8708
|
|
|
8636
8709
|
// src/components/Menu/SubMenu.tsx
|
|
8637
|
-
var
|
|
8638
|
-
var
|
|
8710
|
+
var import_react36 = require("react");
|
|
8711
|
+
var import_styled_components54 = __toESM(require("styled-components"));
|
|
8639
8712
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
8640
|
-
var
|
|
8713
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
8641
8714
|
|
|
8642
8715
|
// src/components/Menu/MenuItemButton.tsx
|
|
8643
|
-
var
|
|
8644
|
-
var
|
|
8645
|
-
var
|
|
8646
|
-
var
|
|
8647
|
-
var StyledButton3 = (0,
|
|
8716
|
+
var import_react35 = require("react");
|
|
8717
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
8718
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
8719
|
+
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
8720
|
+
var StyledButton3 = (0, import_styled_components52.default)(Button)`
|
|
8648
8721
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
8649
8722
|
|
|
8650
8723
|
display: flex;
|
|
@@ -8683,7 +8756,7 @@ var StyledButton3 = (0, import_styled_components50.default)(Button)`
|
|
|
8683
8756
|
padding-left: var(--wui-space-04);
|
|
8684
8757
|
}
|
|
8685
8758
|
`;
|
|
8686
|
-
var StyledLeftIconContainer =
|
|
8759
|
+
var StyledLeftIconContainer = import_styled_components52.default.div`
|
|
8687
8760
|
height: var(--menu-item-left-icon-size);
|
|
8688
8761
|
width: var(--menu-item-left-icon-size);
|
|
8689
8762
|
|
|
@@ -8694,7 +8767,7 @@ var StyledLeftIconContainer = import_styled_components50.default.div`
|
|
|
8694
8767
|
}
|
|
8695
8768
|
}
|
|
8696
8769
|
`;
|
|
8697
|
-
var StyledRightIconContainer =
|
|
8770
|
+
var StyledRightIconContainer = import_styled_components52.default.div`
|
|
8698
8771
|
height: var(--menu-item-right-icon-size);
|
|
8699
8772
|
width: var(--menu-item-right-icon-size);
|
|
8700
8773
|
|
|
@@ -8705,28 +8778,28 @@ var StyledRightIconContainer = import_styled_components50.default.div`
|
|
|
8705
8778
|
}
|
|
8706
8779
|
}
|
|
8707
8780
|
`;
|
|
8708
|
-
var StyledLabelAndDescriptionContainer =
|
|
8781
|
+
var StyledLabelAndDescriptionContainer = import_styled_components52.default.div`
|
|
8709
8782
|
display: flex;
|
|
8710
8783
|
flex-direction: column;
|
|
8711
8784
|
gap: var(--menu-label-description-gap);
|
|
8712
8785
|
flex-basis: 100%;
|
|
8713
8786
|
`;
|
|
8714
|
-
var StyledBadgeContainer =
|
|
8787
|
+
var StyledBadgeContainer = import_styled_components52.default.div`
|
|
8715
8788
|
align-self: start;
|
|
8716
8789
|
justify-self: end;
|
|
8717
8790
|
font-size: var(--wui-typography-label-4-size);
|
|
8718
8791
|
color: var(--wui-color-text-secondary);
|
|
8719
8792
|
`;
|
|
8720
|
-
var MenuItemButton = (0,
|
|
8793
|
+
var MenuItemButton = (0, import_react35.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
8721
8794
|
let { colorScheme, badge } = props;
|
|
8722
8795
|
if (appearance === "dangerous") {
|
|
8723
|
-
if ((0,
|
|
8796
|
+
if ((0, import_type_guards30.isNotUndefined)(colorScheme)) {
|
|
8724
8797
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
8725
8798
|
}
|
|
8726
8799
|
colorScheme = "error";
|
|
8727
8800
|
}
|
|
8728
8801
|
if (appearance === "gated") {
|
|
8729
|
-
badge = /* @__PURE__ */ (0,
|
|
8802
|
+
badge = /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
8730
8803
|
Icon,
|
|
8731
8804
|
{
|
|
8732
8805
|
colorScheme: "purple",
|
|
@@ -8738,7 +8811,7 @@ var MenuItemButton = (0, import_react34.forwardRef)(({ children, appearance, com
|
|
|
8738
8811
|
}
|
|
8739
8812
|
);
|
|
8740
8813
|
}
|
|
8741
|
-
return /* @__PURE__ */ (0,
|
|
8814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(
|
|
8742
8815
|
StyledButton3,
|
|
8743
8816
|
{
|
|
8744
8817
|
...props,
|
|
@@ -8748,10 +8821,10 @@ var MenuItemButton = (0, import_react34.forwardRef)(({ children, appearance, com
|
|
|
8748
8821
|
fullWidth: true,
|
|
8749
8822
|
unstyled: true,
|
|
8750
8823
|
children: [
|
|
8751
|
-
props.leftIcon ? /* @__PURE__ */ (0,
|
|
8752
|
-
/* @__PURE__ */ (0,
|
|
8753
|
-
(0,
|
|
8754
|
-
props.rightIcon ? /* @__PURE__ */ (0,
|
|
8824
|
+
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime198.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
8826
|
+
(0, import_type_guards30.isNotNil)(badge) || (0, import_type_guards30.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
8827
|
+
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
8755
8828
|
]
|
|
8756
8829
|
}
|
|
8757
8830
|
);
|
|
@@ -8759,33 +8832,33 @@ var MenuItemButton = (0, import_react34.forwardRef)(({ children, appearance, com
|
|
|
8759
8832
|
MenuItemButton.displayName = "MenuItemButton";
|
|
8760
8833
|
|
|
8761
8834
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
8762
|
-
var
|
|
8763
|
-
var
|
|
8764
|
-
var StyledMenuItemLabel =
|
|
8765
|
-
var StyledMenuItemDescription = (0,
|
|
8835
|
+
var import_styled_components53 = __toESM(require("styled-components"));
|
|
8836
|
+
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
8837
|
+
var StyledMenuItemLabel = import_styled_components53.default.span``;
|
|
8838
|
+
var StyledMenuItemDescription = (0, import_styled_components53.default)(Text).attrs({
|
|
8766
8839
|
variant: "body4",
|
|
8767
8840
|
prominence: "secondary"
|
|
8768
8841
|
})``;
|
|
8769
8842
|
var MenuItemLabel = ({ children }) => {
|
|
8770
|
-
return /* @__PURE__ */ (0,
|
|
8843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(StyledMenuItemLabel, { children });
|
|
8771
8844
|
};
|
|
8772
8845
|
var MenuItemDescription = ({ children }) => {
|
|
8773
|
-
return /* @__PURE__ */ (0,
|
|
8846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(StyledMenuItemDescription, { children });
|
|
8774
8847
|
};
|
|
8775
8848
|
|
|
8776
8849
|
// src/components/Menu/SubMenu.tsx
|
|
8777
|
-
var
|
|
8778
|
-
var SubMenuContent = (0,
|
|
8850
|
+
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
8851
|
+
var SubMenuContent = (0, import_styled_components54.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
|
|
8779
8852
|
${menuContentCss}
|
|
8780
8853
|
|
|
8781
8854
|
${mq.smAndDown} {
|
|
8782
8855
|
transform: translateX(-100%) !important;
|
|
8783
8856
|
}
|
|
8784
8857
|
`;
|
|
8785
|
-
var StyledMobileSubMenuItems =
|
|
8858
|
+
var StyledMobileSubMenuItems = import_styled_components54.default.div`
|
|
8786
8859
|
margin-left: var(--wui-space-04);
|
|
8787
8860
|
`;
|
|
8788
|
-
var StyledSubTrigger = (0,
|
|
8861
|
+
var StyledSubTrigger = (0, import_styled_components54.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
|
|
8789
8862
|
outline: none;
|
|
8790
8863
|
|
|
8791
8864
|
&[data-state='open'],
|
|
@@ -8795,12 +8868,12 @@ var StyledSubTrigger = (0, import_styled_components52.default)(import_react_drop
|
|
|
8795
8868
|
`;
|
|
8796
8869
|
var SubMenuTrigger = (props) => {
|
|
8797
8870
|
const { isSmAndUp } = useMq();
|
|
8798
|
-
const
|
|
8799
|
-
return /* @__PURE__ */ (0,
|
|
8871
|
+
const Trigger5 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
|
|
8872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(Trigger5, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8800
8873
|
MenuItemButton,
|
|
8801
8874
|
{
|
|
8802
8875
|
...props,
|
|
8803
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8876
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(Icon, { type: "caret-right" })
|
|
8804
8877
|
}
|
|
8805
8878
|
) });
|
|
8806
8879
|
};
|
|
@@ -8812,16 +8885,16 @@ var SubMenu = ({
|
|
|
8812
8885
|
...props
|
|
8813
8886
|
}) => {
|
|
8814
8887
|
const { isSmAndUp } = useMq();
|
|
8815
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
8888
|
+
const [isExpanded, setIsExpanded] = (0, import_react36.useState)(false);
|
|
8816
8889
|
const { compact } = useMenuContext();
|
|
8817
|
-
return isSmAndUp ? /* @__PURE__ */ (0,
|
|
8818
|
-
/* @__PURE__ */ (0,
|
|
8819
|
-
/* @__PURE__ */ (0,
|
|
8820
|
-
(0,
|
|
8890
|
+
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
8891
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
8892
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(MenuItemLabel, { children: label }),
|
|
8893
|
+
(0, import_type_guards31.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(MenuItemDescription, { children: description }) : null
|
|
8821
8894
|
] }),
|
|
8822
|
-
/* @__PURE__ */ (0,
|
|
8823
|
-
] }) : /* @__PURE__ */ (0,
|
|
8824
|
-
/* @__PURE__ */ (0,
|
|
8895
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
8896
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(
|
|
8825
8898
|
SubMenuTrigger,
|
|
8826
8899
|
{
|
|
8827
8900
|
...props,
|
|
@@ -8830,28 +8903,28 @@ var SubMenu = ({
|
|
|
8830
8903
|
setIsExpanded((prev) => !prev);
|
|
8831
8904
|
},
|
|
8832
8905
|
children: [
|
|
8833
|
-
/* @__PURE__ */ (0,
|
|
8834
|
-
/* @__PURE__ */ (0,
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(MenuItemLabel, { children: label }),
|
|
8907
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(MenuItemDescription, { children: description })
|
|
8835
8908
|
]
|
|
8836
8909
|
}
|
|
8837
8910
|
),
|
|
8838
|
-
/* @__PURE__ */ (0,
|
|
8911
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
|
|
8839
8912
|
] });
|
|
8840
8913
|
};
|
|
8841
8914
|
SubMenu.displayName = "SubMenu";
|
|
8842
8915
|
|
|
8843
8916
|
// src/components/Menu/MenuItem.tsx
|
|
8844
|
-
var
|
|
8917
|
+
var import_react37 = require("react");
|
|
8845
8918
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
8846
|
-
var
|
|
8847
|
-
var MenuItem = (0,
|
|
8919
|
+
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
8920
|
+
var MenuItem = (0, import_react37.forwardRef)(
|
|
8848
8921
|
({ onSelect = () => null, ...props }, ref) => {
|
|
8849
|
-
return /* @__PURE__ */ (0,
|
|
8922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8850
8923
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
8851
8924
|
{
|
|
8852
8925
|
asChild: true,
|
|
8853
8926
|
onSelect,
|
|
8854
|
-
children: /* @__PURE__ */ (0,
|
|
8927
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
8855
8928
|
MenuItemButton,
|
|
8856
8929
|
{
|
|
8857
8930
|
...props,
|
|
@@ -8867,10 +8940,10 @@ MenuItem.displayName = "MenuItem";
|
|
|
8867
8940
|
|
|
8868
8941
|
// src/components/Menu/MenuRadioGroup.tsx
|
|
8869
8942
|
var import_react_dropdown_menu5 = require("@radix-ui/react-dropdown-menu");
|
|
8870
|
-
var
|
|
8943
|
+
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
8871
8944
|
var MenuRadioGroup = ({ children, label, ...props }) => {
|
|
8872
|
-
return /* @__PURE__ */ (0,
|
|
8873
|
-
/* @__PURE__ */ (0,
|
|
8945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
|
|
8946
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(MenuLabel, { children: label }),
|
|
8874
8947
|
children
|
|
8875
8948
|
] });
|
|
8876
8949
|
};
|
|
@@ -8878,11 +8951,11 @@ MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
|
8878
8951
|
|
|
8879
8952
|
// src/components/Menu/RadioMenuItem.tsx
|
|
8880
8953
|
var import_react_dropdown_menu6 = require("@radix-ui/react-dropdown-menu");
|
|
8881
|
-
var
|
|
8954
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
8882
8955
|
var RadioMenuItem = ({
|
|
8883
8956
|
onSelect,
|
|
8884
8957
|
value,
|
|
8885
|
-
indicator = /* @__PURE__ */ (0,
|
|
8958
|
+
indicator = /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8886
8959
|
Icon,
|
|
8887
8960
|
{
|
|
8888
8961
|
size: "sm",
|
|
@@ -8892,17 +8965,17 @@ var RadioMenuItem = ({
|
|
|
8892
8965
|
...props
|
|
8893
8966
|
}) => {
|
|
8894
8967
|
const extraProps = onSelect ? { onSelect } : {};
|
|
8895
|
-
return /* @__PURE__ */ (0,
|
|
8968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8896
8969
|
import_react_dropdown_menu6.DropdownMenuRadioItem,
|
|
8897
8970
|
{
|
|
8898
8971
|
...extraProps,
|
|
8899
8972
|
asChild: true,
|
|
8900
8973
|
value,
|
|
8901
|
-
children: /* @__PURE__ */ (0,
|
|
8974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8902
8975
|
MenuItemButton,
|
|
8903
8976
|
{
|
|
8904
8977
|
...props,
|
|
8905
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
8978
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
|
|
8906
8979
|
}
|
|
8907
8980
|
)
|
|
8908
8981
|
}
|
|
@@ -8912,9 +8985,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
8912
8985
|
|
|
8913
8986
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
8914
8987
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
8915
|
-
var
|
|
8988
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8916
8989
|
var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
8917
|
-
return checked ? /* @__PURE__ */ (0,
|
|
8990
|
+
return checked ? /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
|
|
8918
8991
|
"svg",
|
|
8919
8992
|
{
|
|
8920
8993
|
...props,
|
|
@@ -8924,14 +8997,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8924
8997
|
width: "24",
|
|
8925
8998
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8926
8999
|
children: [
|
|
8927
|
-
/* @__PURE__ */ (0,
|
|
9000
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8928
9001
|
"path",
|
|
8929
9002
|
{
|
|
8930
9003
|
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",
|
|
8931
9004
|
fill: "#2949e5"
|
|
8932
9005
|
}
|
|
8933
9006
|
),
|
|
8934
|
-
/* @__PURE__ */ (0,
|
|
9007
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8935
9008
|
"path",
|
|
8936
9009
|
{
|
|
8937
9010
|
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",
|
|
@@ -8940,7 +9013,7 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8940
9013
|
)
|
|
8941
9014
|
]
|
|
8942
9015
|
}
|
|
8943
|
-
) : /* @__PURE__ */ (0,
|
|
9016
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
|
|
8944
9017
|
"svg",
|
|
8945
9018
|
{
|
|
8946
9019
|
...props,
|
|
@@ -8950,14 +9023,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8950
9023
|
width: "24",
|
|
8951
9024
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8952
9025
|
children: [
|
|
8953
|
-
/* @__PURE__ */ (0,
|
|
9026
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8954
9027
|
"path",
|
|
8955
9028
|
{
|
|
8956
9029
|
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",
|
|
8957
9030
|
fill: "#fcfcfd"
|
|
8958
9031
|
}
|
|
8959
9032
|
),
|
|
8960
|
-
/* @__PURE__ */ (0,
|
|
9033
|
+
/* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8961
9034
|
"path",
|
|
8962
9035
|
{
|
|
8963
9036
|
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",
|
|
@@ -8974,18 +9047,18 @@ var CheckboxMenuItem = ({
|
|
|
8974
9047
|
onCheckedChange,
|
|
8975
9048
|
...props
|
|
8976
9049
|
}) => {
|
|
8977
|
-
return /* @__PURE__ */ (0,
|
|
9050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8978
9051
|
import_react_dropdown_menu7.DropdownMenuCheckboxItem,
|
|
8979
9052
|
{
|
|
8980
9053
|
asChild: true,
|
|
8981
9054
|
checked,
|
|
8982
9055
|
onCheckedChange,
|
|
8983
9056
|
onSelect,
|
|
8984
|
-
children: /* @__PURE__ */ (0,
|
|
9057
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8985
9058
|
MenuItemButton,
|
|
8986
9059
|
{
|
|
8987
9060
|
...props,
|
|
8988
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
9061
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(CheckboxIndicator2, { checked })
|
|
8989
9062
|
}
|
|
8990
9063
|
)
|
|
8991
9064
|
}
|
|
@@ -8994,37 +9067,37 @@ var CheckboxMenuItem = ({
|
|
|
8994
9067
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
8995
9068
|
|
|
8996
9069
|
// src/components/Modal/Modal.tsx
|
|
8997
|
-
var
|
|
8998
|
-
var
|
|
9070
|
+
var import_react41 = require("react");
|
|
9071
|
+
var import_styled_components59 = __toESM(require("styled-components"));
|
|
8999
9072
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
9000
|
-
var
|
|
9073
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
9001
9074
|
|
|
9002
9075
|
// src/components/Modal/ModalHeader.tsx
|
|
9003
|
-
var
|
|
9076
|
+
var import_styled_components56 = __toESM(require("styled-components"));
|
|
9004
9077
|
var import_react_dialog2 = require("@radix-ui/react-dialog");
|
|
9005
9078
|
|
|
9006
9079
|
// src/components/Modal/ModalCloseButton.tsx
|
|
9007
|
-
var
|
|
9080
|
+
var import_styled_components55 = __toESM(require("styled-components"));
|
|
9008
9081
|
var import_react_dialog = require("@radix-ui/react-dialog");
|
|
9009
|
-
var
|
|
9010
|
-
var CloseButton = (0,
|
|
9082
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
9083
|
+
var CloseButton = (0, import_styled_components55.default)(import_react_dialog.Close)`
|
|
9011
9084
|
align-self: start;
|
|
9012
9085
|
`;
|
|
9013
9086
|
var ModalCloseButton = () => {
|
|
9014
|
-
return /* @__PURE__ */ (0,
|
|
9087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(CloseButton, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
9015
9088
|
IconButton,
|
|
9016
9089
|
{
|
|
9017
9090
|
label: "Dismiss modal",
|
|
9018
9091
|
size: "sm",
|
|
9019
9092
|
variant: "ghost",
|
|
9020
|
-
children: /* @__PURE__ */ (0,
|
|
9093
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(Icon, { type: "close" })
|
|
9021
9094
|
}
|
|
9022
9095
|
) });
|
|
9023
9096
|
};
|
|
9024
9097
|
|
|
9025
9098
|
// src/components/Modal/ModalHeader.tsx
|
|
9026
|
-
var
|
|
9027
|
-
var Header =
|
|
9099
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
9100
|
+
var Header = import_styled_components56.default.header`
|
|
9028
9101
|
display: flex;
|
|
9029
9102
|
order: 1;
|
|
9030
9103
|
gap: var(--wui-space-01);
|
|
@@ -9036,7 +9109,7 @@ var Header = import_styled_components54.default.header`
|
|
|
9036
9109
|
margin-top: 0;
|
|
9037
9110
|
}
|
|
9038
9111
|
`;
|
|
9039
|
-
var Title = (0,
|
|
9112
|
+
var Title = (0, import_styled_components56.default)(import_react_dialog2.Title)`
|
|
9040
9113
|
font-family: var(--wui-typography-heading-2-family);
|
|
9041
9114
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
9042
9115
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -9048,28 +9121,28 @@ var ModalHeader = ({
|
|
|
9048
9121
|
hideCloseButton
|
|
9049
9122
|
}) => {
|
|
9050
9123
|
const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
|
|
9051
|
-
return /* @__PURE__ */ (0,
|
|
9052
|
-
/* @__PURE__ */ (0,
|
|
9053
|
-
hideCloseButton ? null : /* @__PURE__ */ (0,
|
|
9124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(Header, { children: [
|
|
9125
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(TitleWrapper, { children: title }),
|
|
9126
|
+
hideCloseButton ? null : /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(ModalCloseButton, {})
|
|
9054
9127
|
] });
|
|
9055
9128
|
};
|
|
9056
9129
|
|
|
9057
9130
|
// src/components/Modal/ModalContent.tsx
|
|
9058
|
-
var
|
|
9059
|
-
var
|
|
9131
|
+
var import_react39 = require("react");
|
|
9132
|
+
var import_styled_components57 = __toESM(require("styled-components"));
|
|
9060
9133
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
9061
9134
|
|
|
9062
9135
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
9063
|
-
var
|
|
9064
|
-
var
|
|
9136
|
+
var import_react38 = require("react");
|
|
9137
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9065
9138
|
var useFocusRestore = () => {
|
|
9066
|
-
const previouslyFocusedRef = (0,
|
|
9067
|
-
(0,
|
|
9139
|
+
const previouslyFocusedRef = (0, import_react38.useRef)(null);
|
|
9140
|
+
(0, import_react38.useEffect)(() => {
|
|
9068
9141
|
previouslyFocusedRef.current = document.activeElement;
|
|
9069
9142
|
}, []);
|
|
9070
|
-
(0,
|
|
9143
|
+
(0, import_react38.useEffect)(() => {
|
|
9071
9144
|
return () => {
|
|
9072
|
-
if ((0,
|
|
9145
|
+
if ((0, import_type_guards32.isNotNil)(previouslyFocusedRef.current)) {
|
|
9073
9146
|
setTimeout(() => {
|
|
9074
9147
|
previouslyFocusedRef.current?.focus();
|
|
9075
9148
|
}, 0);
|
|
@@ -9079,8 +9152,8 @@ var useFocusRestore = () => {
|
|
|
9079
9152
|
};
|
|
9080
9153
|
|
|
9081
9154
|
// src/components/Modal/ModalContent.tsx
|
|
9082
|
-
var
|
|
9083
|
-
var StyledModalContent = (0,
|
|
9155
|
+
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
9156
|
+
var StyledModalContent = (0, import_styled_components57.default)(import_react_dialog3.Content)`
|
|
9084
9157
|
background-color: var(--wui-color-bg-app);
|
|
9085
9158
|
box-sizing: border-box;
|
|
9086
9159
|
display: flex;
|
|
@@ -9121,10 +9194,10 @@ var StyledModalContent = (0, import_styled_components55.default)(import_react_di
|
|
|
9121
9194
|
}
|
|
9122
9195
|
}
|
|
9123
9196
|
`;
|
|
9124
|
-
var ModalContent = (0,
|
|
9197
|
+
var ModalContent = (0, import_react39.forwardRef)(
|
|
9125
9198
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
9126
9199
|
useFocusRestore();
|
|
9127
|
-
return /* @__PURE__ */ (0,
|
|
9200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
9128
9201
|
StyledModalContent,
|
|
9129
9202
|
{
|
|
9130
9203
|
ref,
|
|
@@ -9139,9 +9212,9 @@ var ModalContent = (0, import_react38.forwardRef)(
|
|
|
9139
9212
|
);
|
|
9140
9213
|
|
|
9141
9214
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
9142
|
-
var
|
|
9143
|
-
var
|
|
9144
|
-
var
|
|
9215
|
+
var import_react40 = require("react");
|
|
9216
|
+
var import_styled_components58 = __toESM(require("styled-components"));
|
|
9217
|
+
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
9145
9218
|
var backdropAnimationDuration = 150;
|
|
9146
9219
|
var alignVerticalMap = {
|
|
9147
9220
|
stretch: "normal",
|
|
@@ -9154,7 +9227,7 @@ var alignHorizontalMap = {
|
|
|
9154
9227
|
center: "center",
|
|
9155
9228
|
right: "end"
|
|
9156
9229
|
};
|
|
9157
|
-
var BackdropComponent =
|
|
9230
|
+
var BackdropComponent = import_styled_components58.default.div`
|
|
9158
9231
|
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
9159
9232
|
animation-name: backdropShow;
|
|
9160
9233
|
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
@@ -9177,8 +9250,8 @@ var BackdropComponent = import_styled_components56.default.div`
|
|
|
9177
9250
|
}
|
|
9178
9251
|
}
|
|
9179
9252
|
`;
|
|
9180
|
-
var Backdrop = (0,
|
|
9181
|
-
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
9253
|
+
var Backdrop = (0, import_react40.forwardRef)(
|
|
9254
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
9182
9255
|
BackdropComponent,
|
|
9183
9256
|
{
|
|
9184
9257
|
ref,
|
|
@@ -9192,14 +9265,14 @@ var Backdrop = (0, import_react39.forwardRef)(
|
|
|
9192
9265
|
Backdrop.displayName = "Backdrop";
|
|
9193
9266
|
|
|
9194
9267
|
// src/components/Modal/Modal.tsx
|
|
9195
|
-
var
|
|
9268
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
9196
9269
|
var DEFAULT_MODAL_WIDTH = "532px";
|
|
9197
|
-
var ModalBody =
|
|
9270
|
+
var ModalBody = import_styled_components59.default.div`
|
|
9198
9271
|
flex-direction: column;
|
|
9199
9272
|
display: flex;
|
|
9200
9273
|
order: 2;
|
|
9201
9274
|
`;
|
|
9202
|
-
var Modal = (0,
|
|
9275
|
+
var Modal = (0, import_react41.forwardRef)(
|
|
9203
9276
|
({
|
|
9204
9277
|
children,
|
|
9205
9278
|
fullHeight = false,
|
|
@@ -9212,24 +9285,24 @@ var Modal = (0, import_react40.forwardRef)(
|
|
|
9212
9285
|
width = DEFAULT_MODAL_WIDTH,
|
|
9213
9286
|
...props
|
|
9214
9287
|
}, ref) => {
|
|
9215
|
-
return /* @__PURE__ */ (0,
|
|
9288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
9216
9289
|
import_react_dialog4.Root,
|
|
9217
9290
|
{
|
|
9218
9291
|
onOpenChange: (open2) => {
|
|
9219
|
-
if (!open2 && (0,
|
|
9292
|
+
if (!open2 && (0, import_type_guards33.isNotNil)(onRequestClose)) {
|
|
9220
9293
|
onRequestClose();
|
|
9221
9294
|
}
|
|
9222
9295
|
},
|
|
9223
9296
|
open: isOpen,
|
|
9224
|
-
children: /* @__PURE__ */ (0,
|
|
9225
|
-
/* @__PURE__ */ (0,
|
|
9226
|
-
/* @__PURE__ */ (0,
|
|
9297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(import_react_dialog4.Portal, { children: [
|
|
9298
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(Backdrop, {}),
|
|
9299
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
|
|
9227
9300
|
ModalContent,
|
|
9228
9301
|
{
|
|
9229
9302
|
ref,
|
|
9230
9303
|
fullHeight,
|
|
9231
9304
|
onOpenAutoFocus: (event) => {
|
|
9232
|
-
if ((0,
|
|
9305
|
+
if ((0, import_type_guards33.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
9233
9306
|
event.preventDefault();
|
|
9234
9307
|
requestAnimationFrame(() => {
|
|
9235
9308
|
initialFocusRef.current?.focus();
|
|
@@ -9239,8 +9312,8 @@ var Modal = (0, import_react40.forwardRef)(
|
|
|
9239
9312
|
width,
|
|
9240
9313
|
...props,
|
|
9241
9314
|
children: [
|
|
9242
|
-
/* @__PURE__ */ (0,
|
|
9243
|
-
/* @__PURE__ */ (0,
|
|
9315
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(ModalBody, { children }),
|
|
9316
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
9244
9317
|
ModalHeader,
|
|
9245
9318
|
{
|
|
9246
9319
|
hideCloseButton,
|
|
@@ -9258,17 +9331,81 @@ var Modal = (0, import_react40.forwardRef)(
|
|
|
9258
9331
|
);
|
|
9259
9332
|
Modal.displayName = "Modal";
|
|
9260
9333
|
|
|
9334
|
+
// src/components/Popover/Popover.tsx
|
|
9335
|
+
var import_react_popover = require("@radix-ui/react-popover");
|
|
9336
|
+
var import_styled_components60 = __toESM(require("styled-components"));
|
|
9337
|
+
|
|
9338
|
+
// src/private/helpers/getControls/getControlProps.tsx
|
|
9339
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
9340
|
+
var getControlProps = (isOpen, onOpenChange) => {
|
|
9341
|
+
return (0, import_type_guards34.isNotNil)(onOpenChange) && (0, import_type_guards34.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
9342
|
+
};
|
|
9343
|
+
|
|
9344
|
+
// src/components/Popover/Popover.tsx
|
|
9345
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
9346
|
+
var StyledContent2 = (0, import_styled_components60.default)(import_react_popover.Content)`
|
|
9347
|
+
border-radius: var(--wui-border-radius-02);
|
|
9348
|
+
padding: var(--wui-space-04);
|
|
9349
|
+
max-width: 320px;
|
|
9350
|
+
background-color: var(--wui-color-bg-surface);
|
|
9351
|
+
box-shadow: var(--wui-elevation-01);
|
|
9352
|
+
border: 1px solid var(--wui-color-border);
|
|
9353
|
+
|
|
9354
|
+
[data-wui-popover-close] {
|
|
9355
|
+
position: absolute;
|
|
9356
|
+
top: var(--wui-space-02);
|
|
9357
|
+
right: var(--wui-space-02);
|
|
9358
|
+
}
|
|
9359
|
+
`;
|
|
9360
|
+
var StyledArrow = (0, import_styled_components60.default)(import_react_popover.Arrow)`
|
|
9361
|
+
fill: white;
|
|
9362
|
+
display: none;
|
|
9363
|
+
`;
|
|
9364
|
+
var Popover = ({
|
|
9365
|
+
children,
|
|
9366
|
+
trigger,
|
|
9367
|
+
isOpen = false,
|
|
9368
|
+
hideCloseButton = false,
|
|
9369
|
+
onOpenChange,
|
|
9370
|
+
...props
|
|
9371
|
+
}) => {
|
|
9372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(import_react_popover.Root, { ...getControlProps(isOpen, onOpenChange), children: [
|
|
9373
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_popover.Trigger, { asChild: true, children: trigger }),
|
|
9374
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
9375
|
+
StyledContent2,
|
|
9376
|
+
{
|
|
9377
|
+
sideOffset: 5,
|
|
9378
|
+
...props,
|
|
9379
|
+
children: [
|
|
9380
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(StyledArrow, {}),
|
|
9381
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_popover.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
9382
|
+
IconButton,
|
|
9383
|
+
{
|
|
9384
|
+
"data-wui-popover-close": true,
|
|
9385
|
+
label: "Close",
|
|
9386
|
+
variant: "ghost",
|
|
9387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(Icon, { type: "close" })
|
|
9388
|
+
}
|
|
9389
|
+
) }),
|
|
9390
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)("div", { children })
|
|
9391
|
+
]
|
|
9392
|
+
}
|
|
9393
|
+
) })
|
|
9394
|
+
] });
|
|
9395
|
+
};
|
|
9396
|
+
Popover.displayName = "Popover";
|
|
9397
|
+
|
|
9261
9398
|
// src/components/Radio/Radio.tsx
|
|
9262
|
-
var
|
|
9263
|
-
var
|
|
9264
|
-
var
|
|
9265
|
-
var
|
|
9266
|
-
var StyledLabelWrapper2 =
|
|
9399
|
+
var import_react42 = require("react");
|
|
9400
|
+
var import_styled_components61 = __toESM(require("styled-components"));
|
|
9401
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
9402
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
9403
|
+
var StyledLabelWrapper2 = import_styled_components61.default.div`
|
|
9267
9404
|
display: flex;
|
|
9268
9405
|
flex-direction: column;
|
|
9269
9406
|
padding-left: var(--wui-space-02);
|
|
9270
9407
|
`;
|
|
9271
|
-
var StyledRadio =
|
|
9408
|
+
var StyledRadio = import_styled_components61.default.input`
|
|
9272
9409
|
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
9273
9410
|
appearance: none;
|
|
9274
9411
|
margin: 0;
|
|
@@ -9294,11 +9431,11 @@ var StyledRadio = import_styled_components58.default.input`
|
|
|
9294
9431
|
transform: scale(1);
|
|
9295
9432
|
}
|
|
9296
9433
|
`;
|
|
9297
|
-
var disabledStyle2 =
|
|
9434
|
+
var disabledStyle2 = import_styled_components61.css`
|
|
9298
9435
|
cursor: not-allowed;
|
|
9299
9436
|
opacity: 0.5;
|
|
9300
9437
|
`;
|
|
9301
|
-
var errorStyle =
|
|
9438
|
+
var errorStyle = import_styled_components61.css`
|
|
9302
9439
|
/* TODO Lamp to design error state */
|
|
9303
9440
|
&:hover,
|
|
9304
9441
|
&:focus,
|
|
@@ -9306,11 +9443,11 @@ var errorStyle = import_styled_components58.css`
|
|
|
9306
9443
|
border-color: transparent !important;
|
|
9307
9444
|
}
|
|
9308
9445
|
`;
|
|
9309
|
-
var defaultHoverStyle =
|
|
9446
|
+
var defaultHoverStyle = import_styled_components61.css`
|
|
9310
9447
|
/* TODO Lamp to design hover state */
|
|
9311
9448
|
cursor: pointer;
|
|
9312
9449
|
`;
|
|
9313
|
-
var StyledRadioWrapper =
|
|
9450
|
+
var StyledRadioWrapper = import_styled_components61.default.div`
|
|
9314
9451
|
align-items: baseline;
|
|
9315
9452
|
border: 1px solid transparent;
|
|
9316
9453
|
border-radius: 4px;
|
|
@@ -9333,7 +9470,7 @@ var StyledRadioWrapper = import_styled_components58.default.div`
|
|
|
9333
9470
|
|
|
9334
9471
|
${({ disabled }) => disabled && disabledStyle2};
|
|
9335
9472
|
`;
|
|
9336
|
-
var Radio = (0,
|
|
9473
|
+
var Radio = (0, import_react42.forwardRef)(
|
|
9337
9474
|
({
|
|
9338
9475
|
checked,
|
|
9339
9476
|
disabled = false,
|
|
@@ -9346,15 +9483,15 @@ var Radio = (0, import_react41.forwardRef)(
|
|
|
9346
9483
|
value = "false",
|
|
9347
9484
|
...otherProps
|
|
9348
9485
|
}, ref) => {
|
|
9349
|
-
const generatedId = (0,
|
|
9350
|
-
const computedId = (0,
|
|
9351
|
-
return /* @__PURE__ */ (0,
|
|
9486
|
+
const generatedId = (0, import_react42.useId)();
|
|
9487
|
+
const computedId = (0, import_type_guards35.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
|
|
9488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
|
|
9352
9489
|
StyledRadioWrapper,
|
|
9353
9490
|
{
|
|
9354
9491
|
"aria-invalid": otherProps["aria-invalid"],
|
|
9355
9492
|
disabled,
|
|
9356
9493
|
children: [
|
|
9357
|
-
/* @__PURE__ */ (0,
|
|
9494
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9358
9495
|
StyledRadio,
|
|
9359
9496
|
{
|
|
9360
9497
|
ref,
|
|
@@ -9369,8 +9506,8 @@ var Radio = (0, import_react41.forwardRef)(
|
|
|
9369
9506
|
...otherProps
|
|
9370
9507
|
}
|
|
9371
9508
|
),
|
|
9372
|
-
/* @__PURE__ */ (0,
|
|
9373
|
-
/* @__PURE__ */ (0,
|
|
9509
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(StyledLabelWrapper2, { children: [
|
|
9510
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9374
9511
|
Label,
|
|
9375
9512
|
{
|
|
9376
9513
|
disabled,
|
|
@@ -9379,7 +9516,7 @@ var Radio = (0, import_react41.forwardRef)(
|
|
|
9379
9516
|
children: label
|
|
9380
9517
|
}
|
|
9381
9518
|
),
|
|
9382
|
-
/* @__PURE__ */ (0,
|
|
9519
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(LabelDescription, { children: description })
|
|
9383
9520
|
] })
|
|
9384
9521
|
]
|
|
9385
9522
|
}
|
|
@@ -9389,23 +9526,112 @@ var Radio = (0, import_react41.forwardRef)(
|
|
|
9389
9526
|
Radio.displayName = "Radio";
|
|
9390
9527
|
|
|
9391
9528
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
9392
|
-
var
|
|
9393
|
-
var
|
|
9529
|
+
var import_react46 = require("react");
|
|
9530
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9394
9531
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
9395
|
-
var
|
|
9396
|
-
|
|
9397
|
-
|
|
9532
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
9533
|
+
|
|
9534
|
+
// src/components/SegmentedControl/useSelectedItemMeasurements.tsx
|
|
9535
|
+
var import_react43 = require("react");
|
|
9536
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
9537
|
+
var SelectedItemMeasurementsContext = (0, import_react43.createContext)(
|
|
9538
|
+
null
|
|
9539
|
+
);
|
|
9540
|
+
var SelectedItemMeasurementsProvider = ({
|
|
9541
|
+
children
|
|
9542
|
+
}) => {
|
|
9543
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react43.useState)(null);
|
|
9544
|
+
const contextValue = (0, import_react43.useMemo)(
|
|
9545
|
+
() => ({
|
|
9546
|
+
setSelectedItemMeasurements,
|
|
9547
|
+
selectedItemMeasurements
|
|
9548
|
+
}),
|
|
9549
|
+
[selectedItemMeasurements]
|
|
9550
|
+
);
|
|
9551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(SelectedItemMeasurementsContext.Provider, { value: contextValue, children });
|
|
9552
|
+
};
|
|
9553
|
+
var useSelectedItemMeasurements = () => {
|
|
9554
|
+
const context = (0, import_react43.useContext)(SelectedItemMeasurementsContext);
|
|
9555
|
+
if (context === null) {
|
|
9556
|
+
throw new Error(
|
|
9557
|
+
"useSelectedItemMeasurements must be used within a SelectedItemMeasurementsProvider"
|
|
9558
|
+
);
|
|
9559
|
+
}
|
|
9560
|
+
return context;
|
|
9561
|
+
};
|
|
9562
|
+
|
|
9563
|
+
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
9564
|
+
var import_react45 = require("react");
|
|
9565
|
+
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9566
|
+
|
|
9567
|
+
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
9568
|
+
var import_react44 = require("react");
|
|
9569
|
+
var SegmentedControlValueContext = (0, import_react44.createContext)(null);
|
|
9570
|
+
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
9571
|
+
var useSegmentedControlValue = () => {
|
|
9572
|
+
const context = (0, import_react44.useContext)(SegmentedControlValueContext);
|
|
9573
|
+
if (context === null) {
|
|
9574
|
+
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
9575
|
+
}
|
|
9576
|
+
return context;
|
|
9577
|
+
};
|
|
9578
|
+
|
|
9579
|
+
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
9580
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
9581
|
+
var Z_INDEX_TO_SIT_BEHIND_SIBLINGS = -1;
|
|
9582
|
+
var SelectedItemIndicatorDiv = import_styled_components62.default.div`
|
|
9583
|
+
background-color: var(--wui-color-bg-fill-white);
|
|
9584
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
9585
|
+
left: 0;
|
|
9586
|
+
position: absolute;
|
|
9587
|
+
top: 0;
|
|
9588
|
+
transition:
|
|
9589
|
+
transform var(--wui-motion-duration-03) var(--wui-motion-ease-out),
|
|
9590
|
+
width var(--wui-motion-duration-02) var(--wui-motion-ease-out);
|
|
9591
|
+
z-index: ${Z_INDEX_TO_SIT_BEHIND_SIBLINGS};
|
|
9592
|
+
`;
|
|
9593
|
+
var SelectedItemIndicator = () => {
|
|
9594
|
+
const selectedValue = useSegmentedControlValue();
|
|
9595
|
+
const { selectedItemMeasurements } = useSelectedItemMeasurements();
|
|
9596
|
+
const selectedItemIndicatorStyle = (0, import_react45.useMemo)(
|
|
9597
|
+
() => selectedItemMeasurements != null ? {
|
|
9598
|
+
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
9599
|
+
transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
|
|
9600
|
+
width: `${selectedItemMeasurements.offsetWidth}px`
|
|
9601
|
+
} : {},
|
|
9602
|
+
[selectedItemMeasurements]
|
|
9603
|
+
);
|
|
9604
|
+
if (!selectedValue) {
|
|
9605
|
+
return null;
|
|
9606
|
+
}
|
|
9607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
9608
|
+
SelectedItemIndicatorDiv,
|
|
9609
|
+
{
|
|
9610
|
+
style: {
|
|
9611
|
+
width: selectedItemIndicatorStyle.width,
|
|
9612
|
+
transform: selectedItemIndicatorStyle.transform,
|
|
9613
|
+
height: selectedItemIndicatorStyle.height
|
|
9614
|
+
}
|
|
9615
|
+
}
|
|
9616
|
+
);
|
|
9617
|
+
};
|
|
9618
|
+
|
|
9619
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
9620
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
9621
|
+
var segmentedControlStyles = import_styled_components63.css`
|
|
9398
9622
|
display: inline-flex;
|
|
9399
9623
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
9400
9624
|
border-radius: var(--wui-border-radius-rounded);
|
|
9401
9625
|
border: 2px solid var(--wui-color-bg-surface-secondary);
|
|
9402
9626
|
gap: var(--wui-space-01);
|
|
9627
|
+
isolation: isolate;
|
|
9628
|
+
position: relative;
|
|
9403
9629
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
9404
9630
|
`;
|
|
9405
|
-
var StyledSegmentedControl = (0,
|
|
9631
|
+
var StyledSegmentedControl = (0, import_styled_components63.default)(import_react_toggle_group.Root)`
|
|
9406
9632
|
${segmentedControlStyles}
|
|
9407
9633
|
`;
|
|
9408
|
-
var SegmentedControl = (0,
|
|
9634
|
+
var SegmentedControl = (0, import_react46.forwardRef)(
|
|
9409
9635
|
({
|
|
9410
9636
|
children,
|
|
9411
9637
|
disabled = false,
|
|
@@ -9414,10 +9640,10 @@ var SegmentedControl = (0, import_react42.forwardRef)(
|
|
|
9414
9640
|
onSelectedValueChange,
|
|
9415
9641
|
...props
|
|
9416
9642
|
}, ref) => {
|
|
9417
|
-
if ((0,
|
|
9643
|
+
if ((0, import_type_guards36.isNil)(children)) {
|
|
9418
9644
|
return null;
|
|
9419
9645
|
}
|
|
9420
|
-
return /* @__PURE__ */ (0,
|
|
9646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
9421
9647
|
StyledSegmentedControl,
|
|
9422
9648
|
{
|
|
9423
9649
|
ref,
|
|
@@ -9429,7 +9655,10 @@ var SegmentedControl = (0, import_react42.forwardRef)(
|
|
|
9429
9655
|
type: "single",
|
|
9430
9656
|
value: selectedValue,
|
|
9431
9657
|
...props,
|
|
9432
|
-
children
|
|
9658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SegmentedControlValueProvider, { value: selectedValue, children: /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(SelectedItemMeasurementsProvider, { children: [
|
|
9659
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SelectedItemIndicator, {}),
|
|
9660
|
+
children
|
|
9661
|
+
] }) })
|
|
9433
9662
|
}
|
|
9434
9663
|
);
|
|
9435
9664
|
}
|
|
@@ -9437,12 +9666,28 @@ var SegmentedControl = (0, import_react42.forwardRef)(
|
|
|
9437
9666
|
SegmentedControl.displayName = "SegmentedControl";
|
|
9438
9667
|
|
|
9439
9668
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
9440
|
-
var
|
|
9441
|
-
var
|
|
9669
|
+
var import_react47 = require("react");
|
|
9670
|
+
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9442
9671
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
9443
|
-
var
|
|
9444
|
-
|
|
9445
|
-
|
|
9672
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
9673
|
+
|
|
9674
|
+
// src/private/helpers/mergeRefs/mergeRefs.ts
|
|
9675
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
9676
|
+
var mergeRefs = (refs) => (value) => {
|
|
9677
|
+
refs.forEach((ref) => {
|
|
9678
|
+
if ((0, import_type_guards37.isFunction)(ref)) {
|
|
9679
|
+
ref(value);
|
|
9680
|
+
return;
|
|
9681
|
+
}
|
|
9682
|
+
if ((0, import_type_guards37.isNotNil)(ref)) {
|
|
9683
|
+
ref.current = value;
|
|
9684
|
+
}
|
|
9685
|
+
});
|
|
9686
|
+
};
|
|
9687
|
+
|
|
9688
|
+
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
9689
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
9690
|
+
var segmentedControlItemStyles = import_styled_components64.css`
|
|
9446
9691
|
all: unset; /* ToggleGroupItem is a button element */
|
|
9447
9692
|
align-items: center;
|
|
9448
9693
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -9452,8 +9697,9 @@ var segmentedControlItemStyles = import_styled_components60.css`
|
|
|
9452
9697
|
flex-grow: 1;
|
|
9453
9698
|
flex-shrink: 1;
|
|
9454
9699
|
font-size: var(--wui-typography-label-3-size);
|
|
9700
|
+
font-weight: var(--wui-typography-label-3-weight);
|
|
9455
9701
|
justify-content: center;
|
|
9456
|
-
padding: 6px 8px;
|
|
9702
|
+
padding: 6px ${({ $hasLabel }) => $hasLabel ? "8px" : "6px"};
|
|
9457
9703
|
user-select: none;
|
|
9458
9704
|
|
|
9459
9705
|
/* Icon component */
|
|
@@ -9465,18 +9711,17 @@ var segmentedControlItemStyles = import_styled_components60.css`
|
|
|
9465
9711
|
${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
|
|
9466
9712
|
}
|
|
9467
9713
|
|
|
9468
|
-
&:hover {
|
|
9469
|
-
background-color: var(--wui-color-bg-surface-secondary-hover);
|
|
9470
|
-
}
|
|
9471
|
-
|
|
9472
9714
|
&:focus-visible {
|
|
9473
9715
|
outline: 2px solid var(--wui-color-focus-ring);
|
|
9474
9716
|
}
|
|
9475
9717
|
|
|
9718
|
+
&:hover:not([data-state='on'], [data-state='active']) {
|
|
9719
|
+
background-color: var(--wui-color-bg-surface-secondary-hover);
|
|
9720
|
+
}
|
|
9721
|
+
|
|
9476
9722
|
/* note: react-toggle-group uses "on" and react-tabs uses "active" */
|
|
9477
9723
|
&[data-state='on'],
|
|
9478
9724
|
&[data-state='active'] {
|
|
9479
|
-
background-color: var(--wui-color-bg-fill-white);
|
|
9480
9725
|
color: var(--wui-color-text-selected);
|
|
9481
9726
|
cursor: default;
|
|
9482
9727
|
}
|
|
@@ -9491,17 +9736,26 @@ var segmentedControlItemStyles = import_styled_components60.css`
|
|
|
9491
9736
|
|
|
9492
9737
|
&[data-disabled] {
|
|
9493
9738
|
cursor: not-allowed;
|
|
9739
|
+
color: var(--wui-color-text-disabled);
|
|
9740
|
+
|
|
9741
|
+
svg path {
|
|
9742
|
+
fill: var(--wui-color-icon-disabled);
|
|
9743
|
+
}
|
|
9494
9744
|
|
|
9495
9745
|
&:hover {
|
|
9496
9746
|
background-color: inherit;
|
|
9497
9747
|
}
|
|
9498
9748
|
}
|
|
9499
9749
|
`;
|
|
9500
|
-
var StyledSegmentedControlItem = (0,
|
|
9750
|
+
var StyledSegmentedControlItem = (0, import_styled_components64.default)(import_react_toggle_group2.Item)`
|
|
9501
9751
|
${segmentedControlItemStyles}
|
|
9502
9752
|
`;
|
|
9503
|
-
var SegmentedControlItem = (0,
|
|
9504
|
-
({ disabled, icon, label, "aria-label": ariaLabel, value },
|
|
9753
|
+
var SegmentedControlItem = (0, import_react47.forwardRef)(
|
|
9754
|
+
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
9755
|
+
const selectedValue = useSegmentedControlValue();
|
|
9756
|
+
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
9757
|
+
const buttonRef = (0, import_react47.useRef)(null);
|
|
9758
|
+
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
9505
9759
|
const handleClick = (event) => {
|
|
9506
9760
|
const target = event.target;
|
|
9507
9761
|
const { state } = target.dataset;
|
|
@@ -9509,12 +9763,37 @@ var SegmentedControlItem = (0, import_react43.forwardRef)(
|
|
|
9509
9763
|
event.preventDefault();
|
|
9510
9764
|
}
|
|
9511
9765
|
};
|
|
9512
|
-
|
|
9766
|
+
(0, import_react47.useEffect)(() => {
|
|
9767
|
+
const buttonElem = buttonRef.current;
|
|
9768
|
+
if (!buttonElem) {
|
|
9769
|
+
return void 0;
|
|
9770
|
+
}
|
|
9771
|
+
if (selectedValue !== value) {
|
|
9772
|
+
return void 0;
|
|
9773
|
+
}
|
|
9774
|
+
setSelectedItemMeasurements({
|
|
9775
|
+
offsetLeft: buttonElem.offsetLeft,
|
|
9776
|
+
offsetWidth: buttonElem.offsetWidth,
|
|
9777
|
+
offsetHeight: buttonElem.offsetHeight
|
|
9778
|
+
});
|
|
9779
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
9780
|
+
setSelectedItemMeasurements({
|
|
9781
|
+
offsetLeft: buttonElem.offsetLeft,
|
|
9782
|
+
offsetWidth: buttonElem.offsetWidth,
|
|
9783
|
+
offsetHeight: buttonElem.offsetHeight
|
|
9784
|
+
});
|
|
9785
|
+
});
|
|
9786
|
+
resizeObserver.observe(buttonElem);
|
|
9787
|
+
return () => {
|
|
9788
|
+
resizeObserver.disconnect();
|
|
9789
|
+
};
|
|
9790
|
+
}, [selectedValue, setSelectedItemMeasurements, value]);
|
|
9791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(
|
|
9513
9792
|
StyledSegmentedControlItem,
|
|
9514
9793
|
{
|
|
9515
|
-
ref,
|
|
9516
|
-
$hasLabel: (0,
|
|
9517
|
-
"aria-label": (0,
|
|
9794
|
+
ref: combinedRef,
|
|
9795
|
+
$hasLabel: (0, import_type_guards38.isNotNil)(label),
|
|
9796
|
+
"aria-label": (0, import_type_guards38.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9518
9797
|
disabled,
|
|
9519
9798
|
onClick: handleClick,
|
|
9520
9799
|
value,
|
|
@@ -9528,205 +9807,21 @@ var SegmentedControlItem = (0, import_react43.forwardRef)(
|
|
|
9528
9807
|
);
|
|
9529
9808
|
SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
9530
9809
|
|
|
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);
|
|
9550
|
-
|
|
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
9810
|
// src/components/Tabs/Tabs.tsx
|
|
9716
|
-
var
|
|
9811
|
+
var import_react52 = require("react");
|
|
9717
9812
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
9718
|
-
var
|
|
9813
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
9719
9814
|
|
|
9720
9815
|
// src/components/Tabs/TabPanel.tsx
|
|
9721
|
-
var
|
|
9816
|
+
var import_styled_components65 = __toESM(require("styled-components"));
|
|
9722
9817
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
9723
|
-
var
|
|
9724
|
-
var StyledTabPanel = (0,
|
|
9818
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
9819
|
+
var StyledTabPanel = (0, import_styled_components65.default)(import_react_tabs.Content)`
|
|
9725
9820
|
display: flex;
|
|
9726
9821
|
flex-direction: column;
|
|
9727
9822
|
`;
|
|
9728
9823
|
var TabPanel = ({ children, value, ...props }) => {
|
|
9729
|
-
return /* @__PURE__ */ (0,
|
|
9824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9730
9825
|
StyledTabPanel,
|
|
9731
9826
|
{
|
|
9732
9827
|
value,
|
|
@@ -9738,10 +9833,10 @@ var TabPanel = ({ children, value, ...props }) => {
|
|
|
9738
9833
|
TabPanel.displayName = "TabPanel";
|
|
9739
9834
|
|
|
9740
9835
|
// src/components/Tabs/TabList.tsx
|
|
9741
|
-
var
|
|
9836
|
+
var import_styled_components66 = __toESM(require("styled-components"));
|
|
9742
9837
|
var import_react_tabs2 = require("@radix-ui/react-tabs");
|
|
9743
|
-
var
|
|
9744
|
-
var StyledTabList = (0,
|
|
9838
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
9839
|
+
var StyledTabList = (0, import_styled_components66.default)(import_react_tabs2.List)`
|
|
9745
9840
|
${segmentedControlStyles}
|
|
9746
9841
|
|
|
9747
9842
|
margin-bottom: var(--wui-space-04);
|
|
@@ -9752,7 +9847,7 @@ var TabList = ({
|
|
|
9752
9847
|
ariaLabel,
|
|
9753
9848
|
...props
|
|
9754
9849
|
}) => {
|
|
9755
|
-
return /* @__PURE__ */ (0,
|
|
9850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
9756
9851
|
StyledTabList,
|
|
9757
9852
|
{
|
|
9758
9853
|
$fullWidth: fullWidth,
|
|
@@ -9765,26 +9860,69 @@ var TabList = ({
|
|
|
9765
9860
|
TabList.displayName = "TabList";
|
|
9766
9861
|
|
|
9767
9862
|
// src/components/Tabs/TabItem.tsx
|
|
9768
|
-
var
|
|
9769
|
-
var
|
|
9863
|
+
var import_react49 = require("react");
|
|
9864
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9770
9865
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
9771
|
-
var
|
|
9772
|
-
|
|
9773
|
-
|
|
9866
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
9867
|
+
|
|
9868
|
+
// src/components/Tabs/useTabsValue.tsx
|
|
9869
|
+
var import_react48 = require("react");
|
|
9870
|
+
var TabsValueContext = (0, import_react48.createContext)(null);
|
|
9871
|
+
var TabsValueProvider = TabsValueContext.Provider;
|
|
9872
|
+
var useTabsValue = () => {
|
|
9873
|
+
const context = (0, import_react48.useContext)(TabsValueContext);
|
|
9874
|
+
if (context === null) {
|
|
9875
|
+
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
9876
|
+
}
|
|
9877
|
+
return context;
|
|
9878
|
+
};
|
|
9879
|
+
|
|
9880
|
+
// src/components/Tabs/TabItem.tsx
|
|
9881
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
9882
|
+
var StyledTabItem = (0, import_styled_components67.default)(import_react_tabs3.Trigger)`
|
|
9774
9883
|
${segmentedControlItemStyles}
|
|
9775
9884
|
|
|
9776
|
-
|
|
9777
|
-
|
|
9885
|
+
&:focus-visible {
|
|
9886
|
+
outline: none;
|
|
9778
9887
|
}
|
|
9779
9888
|
`;
|
|
9780
|
-
var TabItem = (0,
|
|
9781
|
-
({ disabled = false, icon, label, "aria-label": ariaLabel, value },
|
|
9782
|
-
|
|
9889
|
+
var TabItem = (0, import_react49.forwardRef)(
|
|
9890
|
+
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
9891
|
+
const selectedValue = useTabsValue();
|
|
9892
|
+
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
9893
|
+
const buttonRef = (0, import_react49.useRef)(null);
|
|
9894
|
+
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
9895
|
+
(0, import_react49.useEffect)(() => {
|
|
9896
|
+
const buttonElem = buttonRef.current;
|
|
9897
|
+
if (!buttonElem) {
|
|
9898
|
+
return void 0;
|
|
9899
|
+
}
|
|
9900
|
+
if (selectedValue !== value) {
|
|
9901
|
+
return void 0;
|
|
9902
|
+
}
|
|
9903
|
+
setSelectedItemMeasurements({
|
|
9904
|
+
offsetLeft: buttonElem.offsetLeft,
|
|
9905
|
+
offsetWidth: buttonElem.offsetWidth,
|
|
9906
|
+
offsetHeight: buttonElem.offsetHeight
|
|
9907
|
+
});
|
|
9908
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
9909
|
+
setSelectedItemMeasurements({
|
|
9910
|
+
offsetLeft: buttonElem.offsetLeft,
|
|
9911
|
+
offsetWidth: buttonElem.offsetWidth,
|
|
9912
|
+
offsetHeight: buttonElem.offsetHeight
|
|
9913
|
+
});
|
|
9914
|
+
});
|
|
9915
|
+
resizeObserver.observe(buttonElem);
|
|
9916
|
+
return () => {
|
|
9917
|
+
resizeObserver.disconnect();
|
|
9918
|
+
};
|
|
9919
|
+
}, [selectedValue, setSelectedItemMeasurements, value]);
|
|
9920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
9783
9921
|
StyledTabItem,
|
|
9784
9922
|
{
|
|
9785
|
-
ref,
|
|
9786
|
-
$hasLabel: (0,
|
|
9787
|
-
"aria-label": (0,
|
|
9923
|
+
ref: combinedRef,
|
|
9924
|
+
$hasLabel: (0, import_type_guards39.isNotNil)(label),
|
|
9925
|
+
"aria-label": (0, import_type_guards39.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9788
9926
|
disabled,
|
|
9789
9927
|
value,
|
|
9790
9928
|
children: [
|
|
@@ -9798,16 +9936,16 @@ var TabItem = (0, import_react46.forwardRef)(
|
|
|
9798
9936
|
TabItem.displayName = "TabItem";
|
|
9799
9937
|
|
|
9800
9938
|
// src/components/Tabs/extractTabItems.ts
|
|
9801
|
-
var
|
|
9939
|
+
var import_react50 = require("react");
|
|
9802
9940
|
var extractTabItems = (children) => {
|
|
9803
9941
|
const tabItems = [];
|
|
9804
|
-
|
|
9805
|
-
if (!(0,
|
|
9942
|
+
import_react50.Children.forEach(children, (child) => {
|
|
9943
|
+
if (!(0, import_react50.isValidElement)(child)) {
|
|
9806
9944
|
return;
|
|
9807
9945
|
}
|
|
9808
9946
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
9809
9947
|
tabItems.push(child);
|
|
9810
|
-
} else if (child.type ===
|
|
9948
|
+
} else if (child.type === import_react50.Fragment) {
|
|
9811
9949
|
const fragmentElement = child;
|
|
9812
9950
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
9813
9951
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -9819,9 +9957,44 @@ var extractTabItems = (children) => {
|
|
|
9819
9957
|
return tabItems;
|
|
9820
9958
|
};
|
|
9821
9959
|
|
|
9960
|
+
// src/components/Tabs/SelectedItemIndicator.tsx
|
|
9961
|
+
var import_react51 = require("react");
|
|
9962
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
9963
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
9964
|
+
var TabsSelectedItemIndicatorDiv = (0, import_styled_components68.default)(SelectedItemIndicatorDiv)`
|
|
9965
|
+
&:has(~ ${StyledTabItem}:focus-visible) {
|
|
9966
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
9967
|
+
}
|
|
9968
|
+
`;
|
|
9969
|
+
var SelectedItemIndicator2 = () => {
|
|
9970
|
+
const { selectedItemMeasurements } = useSelectedItemMeasurements();
|
|
9971
|
+
const selectedValue = useTabsValue();
|
|
9972
|
+
const selectedItemIndicatorStyle = (0, import_react51.useMemo)(
|
|
9973
|
+
() => selectedItemMeasurements != null ? {
|
|
9974
|
+
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
9975
|
+
transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
|
|
9976
|
+
width: `${selectedItemMeasurements.offsetWidth}px`
|
|
9977
|
+
} : {},
|
|
9978
|
+
[selectedItemMeasurements]
|
|
9979
|
+
);
|
|
9980
|
+
if (selectedValue == null) {
|
|
9981
|
+
return null;
|
|
9982
|
+
}
|
|
9983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9984
|
+
TabsSelectedItemIndicatorDiv,
|
|
9985
|
+
{
|
|
9986
|
+
style: {
|
|
9987
|
+
width: selectedItemIndicatorStyle.width,
|
|
9988
|
+
transform: selectedItemIndicatorStyle.transform,
|
|
9989
|
+
height: selectedItemIndicatorStyle.height
|
|
9990
|
+
}
|
|
9991
|
+
}
|
|
9992
|
+
);
|
|
9993
|
+
};
|
|
9994
|
+
|
|
9822
9995
|
// src/components/Tabs/Tabs.tsx
|
|
9823
|
-
var
|
|
9824
|
-
var Tabs = (0,
|
|
9996
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
9997
|
+
var Tabs = (0, import_react52.forwardRef)(
|
|
9825
9998
|
({
|
|
9826
9999
|
children,
|
|
9827
10000
|
fullWidth = true,
|
|
@@ -9832,76 +10005,89 @@ var Tabs = (0, import_react48.forwardRef)(
|
|
|
9832
10005
|
...otherProps
|
|
9833
10006
|
}, ref) => {
|
|
9834
10007
|
const tabItems = extractTabItems(children);
|
|
9835
|
-
const
|
|
9836
|
-
|
|
10008
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react52.useState)(defaultSelectedValue);
|
|
10009
|
+
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
10010
|
+
defaultValue: defaultSelectedValue,
|
|
10011
|
+
onValueChange: setInternalSelectedValue
|
|
10012
|
+
} : { value: selectedValue, onValueChange: onSelectedValueChange };
|
|
10013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9837
10014
|
import_react_tabs4.Root,
|
|
9838
10015
|
{
|
|
9839
10016
|
ref,
|
|
9840
10017
|
activationMode: "automatic",
|
|
9841
10018
|
...otherProps,
|
|
9842
10019
|
...modeProps,
|
|
9843
|
-
children:
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
label
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
10020
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
10021
|
+
TabsValueProvider,
|
|
10022
|
+
{
|
|
10023
|
+
value: defaultSelectedValue !== void 0 ? internalSelectedValue : selectedValue,
|
|
10024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(SelectedItemMeasurementsProvider, { children: [
|
|
10025
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(
|
|
10026
|
+
TabList,
|
|
10027
|
+
{
|
|
10028
|
+
ariaLabel,
|
|
10029
|
+
fullWidth,
|
|
10030
|
+
children: [
|
|
10031
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(SelectedItemIndicator2, {}),
|
|
10032
|
+
tabItems.map((tab) => {
|
|
10033
|
+
const {
|
|
10034
|
+
value,
|
|
10035
|
+
disabled = false,
|
|
10036
|
+
icon,
|
|
10037
|
+
label,
|
|
10038
|
+
"aria-label": ariaLabelForTab
|
|
10039
|
+
} = tab.props;
|
|
10040
|
+
if ((0, import_type_guards40.isNil)(icon)) {
|
|
10041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
10042
|
+
TabItem,
|
|
10043
|
+
{
|
|
10044
|
+
disabled,
|
|
10045
|
+
label,
|
|
10046
|
+
value
|
|
10047
|
+
},
|
|
10048
|
+
value
|
|
10049
|
+
);
|
|
10050
|
+
}
|
|
10051
|
+
if ((0, import_type_guards40.isNotNil)(label)) {
|
|
10052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
10053
|
+
TabItem,
|
|
10054
|
+
{
|
|
10055
|
+
disabled,
|
|
10056
|
+
icon,
|
|
10057
|
+
label,
|
|
10058
|
+
value
|
|
10059
|
+
},
|
|
10060
|
+
value
|
|
10061
|
+
);
|
|
10062
|
+
}
|
|
10063
|
+
if ((0, import_type_guards40.isNotNil)(ariaLabelForTab)) {
|
|
10064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
10065
|
+
TabItem,
|
|
10066
|
+
{
|
|
10067
|
+
"aria-label": ariaLabelForTab,
|
|
10068
|
+
disabled,
|
|
10069
|
+
icon,
|
|
10070
|
+
value
|
|
10071
|
+
},
|
|
10072
|
+
value
|
|
10073
|
+
);
|
|
10074
|
+
}
|
|
10075
|
+
throw new Error("A `Tab` with an icon must have either label or aria-label");
|
|
10076
|
+
})
|
|
10077
|
+
]
|
|
9891
10078
|
}
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
}
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
]
|
|
10079
|
+
),
|
|
10080
|
+
tabItems.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
10081
|
+
TabPanel,
|
|
10082
|
+
{
|
|
10083
|
+
value: tab.props.value,
|
|
10084
|
+
children: tab.props.children
|
|
10085
|
+
},
|
|
10086
|
+
tab.props.value
|
|
10087
|
+
))
|
|
10088
|
+
] })
|
|
10089
|
+
}
|
|
10090
|
+
)
|
|
9905
10091
|
}
|
|
9906
10092
|
);
|
|
9907
10093
|
}
|
|
@@ -9909,19 +10095,19 @@ var Tabs = (0, import_react48.forwardRef)(
|
|
|
9909
10095
|
Tabs.displayName = "Tabs";
|
|
9910
10096
|
|
|
9911
10097
|
// src/components/Tabs/Tab.tsx
|
|
9912
|
-
var
|
|
9913
|
-
var
|
|
9914
|
-
var Tab = (0,
|
|
9915
|
-
return /* @__PURE__ */ (0,
|
|
10098
|
+
var import_react53 = require("react");
|
|
10099
|
+
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
10100
|
+
var Tab = (0, import_react53.forwardRef)(({ children }, ref) => {
|
|
10101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)("div", { ref, children });
|
|
9916
10102
|
});
|
|
9917
10103
|
Tab.displayName = "Tab";
|
|
9918
10104
|
|
|
9919
10105
|
// src/components/Tag/Tag.tsx
|
|
9920
|
-
var
|
|
9921
|
-
var
|
|
9922
|
-
var
|
|
9923
|
-
var
|
|
9924
|
-
var TagLabel =
|
|
10106
|
+
var import_react54 = require("react");
|
|
10107
|
+
var import_styled_components69 = __toESM(require("styled-components"));
|
|
10108
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
10109
|
+
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
10110
|
+
var TagLabel = import_styled_components69.default.a`
|
|
9925
10111
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9926
10112
|
font-size: var(--wui-typography-label-4-size);
|
|
9927
10113
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -9949,14 +10135,14 @@ var TagLabel = import_styled_components67.default.a`
|
|
|
9949
10135
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9950
10136
|
}
|
|
9951
10137
|
`;
|
|
9952
|
-
var TagDivider =
|
|
10138
|
+
var TagDivider = import_styled_components69.default.div`
|
|
9953
10139
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9954
10140
|
border-left: 1px solid var(--wui-color-border);
|
|
9955
10141
|
display: flex;
|
|
9956
10142
|
height: 14px;
|
|
9957
10143
|
width: 1px;
|
|
9958
10144
|
`;
|
|
9959
|
-
var StyledRemoveButton =
|
|
10145
|
+
var StyledRemoveButton = import_styled_components69.default.button`
|
|
9960
10146
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9961
10147
|
all: unset;
|
|
9962
10148
|
cursor: pointer;
|
|
@@ -9984,7 +10170,7 @@ var StyledRemoveButton = import_styled_components67.default.button`
|
|
|
9984
10170
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9985
10171
|
}
|
|
9986
10172
|
`;
|
|
9987
|
-
var StyledTag =
|
|
10173
|
+
var StyledTag = import_styled_components69.default.div`
|
|
9988
10174
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9989
10175
|
align-items: center;
|
|
9990
10176
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -9997,47 +10183,47 @@ var StyledTag = import_styled_components67.default.div`
|
|
|
9997
10183
|
}
|
|
9998
10184
|
`;
|
|
9999
10185
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
10000
|
-
if ((0,
|
|
10186
|
+
if ((0, import_type_guards41.isNil)(onClickRemove)) {
|
|
10001
10187
|
return null;
|
|
10002
10188
|
}
|
|
10003
|
-
if ((0,
|
|
10189
|
+
if ((0, import_type_guards41.isNil)(onClickRemoveLabel)) {
|
|
10004
10190
|
throw new Error(
|
|
10005
10191
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
10006
10192
|
);
|
|
10007
10193
|
}
|
|
10008
|
-
return /* @__PURE__ */ (0,
|
|
10009
|
-
/* @__PURE__ */ (0,
|
|
10010
|
-
/* @__PURE__ */ (0,
|
|
10194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(import_jsx_runtime222.Fragment, { children: [
|
|
10195
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
10196
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
|
|
10011
10197
|
StyledRemoveButton,
|
|
10012
10198
|
{
|
|
10013
10199
|
$colorScheme: colorScheme,
|
|
10014
10200
|
onClick: onClickRemove,
|
|
10015
10201
|
type: "button",
|
|
10016
10202
|
children: [
|
|
10017
|
-
/* @__PURE__ */ (0,
|
|
10203
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
10018
10204
|
Icon,
|
|
10019
10205
|
{
|
|
10020
10206
|
size: "sm",
|
|
10021
10207
|
type: "close"
|
|
10022
10208
|
}
|
|
10023
10209
|
),
|
|
10024
|
-
/* @__PURE__ */ (0,
|
|
10210
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
10025
10211
|
]
|
|
10026
10212
|
}
|
|
10027
10213
|
)
|
|
10028
10214
|
] });
|
|
10029
10215
|
};
|
|
10030
|
-
var Tag = (0,
|
|
10216
|
+
var Tag = (0, import_react54.forwardRef)(
|
|
10031
10217
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
10032
|
-
const labelProps = (0,
|
|
10033
|
-
return /* @__PURE__ */ (0,
|
|
10218
|
+
const labelProps = (0, import_type_guards41.isNotNil)(href) && (0, import_type_guards41.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
10219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
|
|
10034
10220
|
StyledTag,
|
|
10035
10221
|
{
|
|
10036
10222
|
ref,
|
|
10037
10223
|
$colorScheme: colorScheme,
|
|
10038
10224
|
...otherProps,
|
|
10039
10225
|
children: [
|
|
10040
|
-
/* @__PURE__ */ (0,
|
|
10226
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
10041
10227
|
TagLabel,
|
|
10042
10228
|
{
|
|
10043
10229
|
...labelProps,
|
|
@@ -10045,7 +10231,7 @@ var Tag = (0, import_react50.forwardRef)(
|
|
|
10045
10231
|
children: label
|
|
10046
10232
|
}
|
|
10047
10233
|
),
|
|
10048
|
-
/* @__PURE__ */ (0,
|
|
10234
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
10049
10235
|
RemoveButton,
|
|
10050
10236
|
{
|
|
10051
10237
|
colorScheme,
|
|
@@ -10061,26 +10247,26 @@ var Tag = (0, import_react50.forwardRef)(
|
|
|
10061
10247
|
Tag.displayName = "Tag";
|
|
10062
10248
|
|
|
10063
10249
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
10064
|
-
var
|
|
10065
|
-
var
|
|
10066
|
-
var
|
|
10250
|
+
var import_styled_components70 = __toESM(require("styled-components"));
|
|
10251
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
10252
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
10067
10253
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
10068
10254
|
if (iconOnly) {
|
|
10069
|
-
return /* @__PURE__ */ (0,
|
|
10255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
10070
10256
|
"g",
|
|
10071
10257
|
{
|
|
10072
10258
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
10073
10259
|
fill: brandmarkColor,
|
|
10074
|
-
children: /* @__PURE__ */ (0,
|
|
10260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
10075
10261
|
}
|
|
10076
10262
|
);
|
|
10077
10263
|
}
|
|
10078
|
-
return /* @__PURE__ */ (0,
|
|
10264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
10079
10265
|
"g",
|
|
10080
10266
|
{
|
|
10081
10267
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
10082
10268
|
fill: brandmarkColor,
|
|
10083
|
-
children: /* @__PURE__ */ (0,
|
|
10269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
10084
10270
|
}
|
|
10085
10271
|
);
|
|
10086
10272
|
};
|
|
@@ -10088,12 +10274,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
10088
10274
|
if (iconOnly) {
|
|
10089
10275
|
return null;
|
|
10090
10276
|
}
|
|
10091
|
-
return /* @__PURE__ */ (0,
|
|
10277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
10092
10278
|
"g",
|
|
10093
10279
|
{
|
|
10094
10280
|
"data-testid": "ui-wistia-logo-logotype",
|
|
10095
10281
|
fill: logotypeColor,
|
|
10096
|
-
children: /* @__PURE__ */ (0,
|
|
10282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
|
|
10097
10283
|
}
|
|
10098
10284
|
);
|
|
10099
10285
|
};
|
|
@@ -10103,7 +10289,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
10103
10289
|
}
|
|
10104
10290
|
return "0 0 144 31.47";
|
|
10105
10291
|
};
|
|
10106
|
-
var WistiaLogoComponent =
|
|
10292
|
+
var WistiaLogoComponent = import_styled_components70.default.svg`
|
|
10107
10293
|
height: ${({ height }) => `${height}px`};
|
|
10108
10294
|
|
|
10109
10295
|
/* ensure it will always fit on mobile */
|
|
@@ -10145,7 +10331,7 @@ var WistiaLogo = ({
|
|
|
10145
10331
|
};
|
|
10146
10332
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
10147
10333
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
10148
|
-
const Logo = /* @__PURE__ */ (0,
|
|
10334
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(
|
|
10149
10335
|
WistiaLogoComponent,
|
|
10150
10336
|
{
|
|
10151
10337
|
$hoverColor: hoverColor,
|
|
@@ -10155,16 +10341,200 @@ var WistiaLogo = ({
|
|
|
10155
10341
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10156
10342
|
...otherProps,
|
|
10157
10343
|
children: [
|
|
10158
|
-
/* @__PURE__ */ (0,
|
|
10159
|
-
(0,
|
|
10344
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)("title", { children: title }),
|
|
10345
|
+
(0, import_type_guards42.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("desc", { children: description }) : null,
|
|
10160
10346
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
10161
10347
|
renderLogotype(logotypeColor, iconOnly)
|
|
10162
10348
|
]
|
|
10163
10349
|
}
|
|
10164
10350
|
);
|
|
10165
|
-
return href !== void 0 ? /* @__PURE__ */ (0,
|
|
10351
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("a", { href, children: Logo }) : Logo;
|
|
10166
10352
|
};
|
|
10167
10353
|
WistiaLogo.displayName = "WistiaLogo";
|
|
10354
|
+
|
|
10355
|
+
// src/components/Select/Select.tsx
|
|
10356
|
+
var import_react_select = require("@radix-ui/react-select");
|
|
10357
|
+
var import_react55 = require("react");
|
|
10358
|
+
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10359
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
10360
|
+
var StyledTrigger = (0, import_styled_components71.default)(import_react_select.Trigger)`
|
|
10361
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
10362
|
+
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
10363
|
+
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
10364
|
+
--wui-select-color-border: var(--wui-color-border);
|
|
10365
|
+
--wui-select-color-border-focus: var(--wui-color-border-active);
|
|
10366
|
+
--wui-select-color-border-error: var(--wui-color-border-error);
|
|
10367
|
+
--wui-select-color-border-disabled: var(--wui-color-border-disabled);
|
|
10368
|
+
--wui-select-border-radius: var(--wui-border-radius-rounded);
|
|
10369
|
+
--wui-select-multiline-border-radius: var(--wui-border-radius-02);
|
|
10370
|
+
--wui-select-vertical-padding: var(--wui-space-02);
|
|
10371
|
+
--wui-select-horizontal-padding: var(--wui-space-03);
|
|
10372
|
+
--wui-select-placeholder: var(--wui-gray-10);
|
|
10373
|
+
--wui-select-color-text-error: var(--wui-color-text-error);
|
|
10374
|
+
|
|
10375
|
+
padding: var(--wui-select-vertical-padding) var(--wui-select-horizontal-padding);
|
|
10376
|
+
background-color: var(--wui-select-color-bg);
|
|
10377
|
+
border: 1px solid var(--wui-select-color-border);
|
|
10378
|
+
border-radius: var(--wui-select-border-radius);
|
|
10379
|
+
min-width: 200px;
|
|
10380
|
+
text-align: left;
|
|
10381
|
+
display: inline-flex;
|
|
10382
|
+
align-items: center;
|
|
10383
|
+
justify-content: space-between;
|
|
10384
|
+
width: ${({ $fullWidth = false }) => $fullWidth ? "100%" : "auto"};
|
|
10385
|
+
|
|
10386
|
+
&[aria-expanded='true'],
|
|
10387
|
+
&:focus {
|
|
10388
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
10389
|
+
}
|
|
10390
|
+
|
|
10391
|
+
&[aria-invalid='true'] {
|
|
10392
|
+
outline: 2px solid var(--wui-select-color-border-error);
|
|
10393
|
+
color: var(--wui-select-color-text-error);
|
|
10394
|
+
}
|
|
10395
|
+
|
|
10396
|
+
&:disabled {
|
|
10397
|
+
border-color: var(--wui-color-bg-surface-disabled);
|
|
10398
|
+
background-color: var(--wui-color-bg-surface-disabled);
|
|
10399
|
+
}
|
|
10400
|
+
`;
|
|
10401
|
+
var StyledContent3 = (0, import_styled_components71.default)(import_react_select.Content)`
|
|
10402
|
+
--wui-select-content-border: var(--wui-color-border);
|
|
10403
|
+
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
10404
|
+
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
10405
|
+
--wui-select-option-padding: var(--wui-space-02);
|
|
10406
|
+
--wui-select-option-inner-gap: var(--wui-space-03);
|
|
10407
|
+
--wui-select-option-bg-hover: var(--wui-color-bg-surface-hover);
|
|
10408
|
+
|
|
10409
|
+
overflow: hidden;
|
|
10410
|
+
transform: translateY(8px);
|
|
10411
|
+
background-color: var(--wui-select-content-bg);
|
|
10412
|
+
border: 1px solid var(--wui-select-content-border);
|
|
10413
|
+
border-radius: var(--wui-select-content-border-radius);
|
|
10414
|
+
padding: var(--wui-select-option-padding);
|
|
10415
|
+
min-width: 200px;
|
|
10416
|
+
`;
|
|
10417
|
+
var Select = (0, import_react55.forwardRef)(
|
|
10418
|
+
({
|
|
10419
|
+
colorScheme = "inherit",
|
|
10420
|
+
children,
|
|
10421
|
+
onChange = () => null,
|
|
10422
|
+
placeholder = "Select...",
|
|
10423
|
+
fullWidth = false,
|
|
10424
|
+
...props
|
|
10425
|
+
}, forwardedRef) => {
|
|
10426
|
+
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
10427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
|
|
10428
|
+
import_react_select.Root,
|
|
10429
|
+
{
|
|
10430
|
+
...props,
|
|
10431
|
+
onValueChange: onChange,
|
|
10432
|
+
children: [
|
|
10433
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
|
|
10434
|
+
StyledTrigger,
|
|
10435
|
+
{
|
|
10436
|
+
ref: forwardedRef,
|
|
10437
|
+
$colorScheme: colorScheme,
|
|
10438
|
+
$fullWidth: responsiveFullWidth,
|
|
10439
|
+
...props,
|
|
10440
|
+
children: [
|
|
10441
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_select.Value, { placeholder }),
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
10443
|
+
Icon,
|
|
10444
|
+
{
|
|
10445
|
+
size: "md",
|
|
10446
|
+
type: "caret-down"
|
|
10447
|
+
}
|
|
10448
|
+
)
|
|
10449
|
+
]
|
|
10450
|
+
}
|
|
10451
|
+
),
|
|
10452
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(StyledContent3, { position: "popper", children: [
|
|
10453
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(Icon, { type: "caret-up" }) }),
|
|
10454
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_select.Viewport, { children }),
|
|
10455
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(Icon, { type: "caret-down" }) })
|
|
10456
|
+
] }) })
|
|
10457
|
+
]
|
|
10458
|
+
}
|
|
10459
|
+
);
|
|
10460
|
+
}
|
|
10461
|
+
);
|
|
10462
|
+
Select.displayName = "Select";
|
|
10463
|
+
|
|
10464
|
+
// src/components/Select/SelectOption.tsx
|
|
10465
|
+
var import_react_select2 = require("@radix-ui/react-select");
|
|
10466
|
+
var import_react56 = require("react");
|
|
10467
|
+
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10468
|
+
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
10469
|
+
var StyledItem = (0, import_styled_components72.default)(import_react_select2.Item)`
|
|
10470
|
+
${variantStyleMap2.body3};
|
|
10471
|
+
display: flex;
|
|
10472
|
+
padding: var(--wui-select-option-padding);
|
|
10473
|
+
gap: var(--wui-select-option-inner-gap);
|
|
10474
|
+
font-size: var(--font-size);
|
|
10475
|
+
font-weight: var(--font-weight);
|
|
10476
|
+
border-radius: var(--wui-border-radius-01);
|
|
10477
|
+
|
|
10478
|
+
&:hover,
|
|
10479
|
+
&:focus-visible {
|
|
10480
|
+
background-color: var(--wui-select-option-bg-hover);
|
|
10481
|
+
outline: none;
|
|
10482
|
+
}
|
|
10483
|
+
|
|
10484
|
+
&[aria-disabled='true'] {
|
|
10485
|
+
color: var(--wui-color-text-disabled);
|
|
10486
|
+
}
|
|
10487
|
+
|
|
10488
|
+
&[aria-disabled='true']:hover {
|
|
10489
|
+
background-color: transparent;
|
|
10490
|
+
}
|
|
10491
|
+
`;
|
|
10492
|
+
var StyledIconContainer = import_styled_components72.default.span`
|
|
10493
|
+
width: 12px;
|
|
10494
|
+
`;
|
|
10495
|
+
var SelectOption = (0, import_react56.forwardRef)(
|
|
10496
|
+
({ children, ...props }, forwardedRef) => {
|
|
10497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
10498
|
+
StyledItem,
|
|
10499
|
+
{
|
|
10500
|
+
...props,
|
|
10501
|
+
ref: forwardedRef,
|
|
10502
|
+
children: [
|
|
10503
|
+
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)(StyledIconContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(import_react_select2.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
10504
|
+
Icon,
|
|
10505
|
+
{
|
|
10506
|
+
size: "sm",
|
|
10507
|
+
type: "checkmark"
|
|
10508
|
+
}
|
|
10509
|
+
) }) }),
|
|
10510
|
+
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)(import_react_select2.ItemText, { children })
|
|
10511
|
+
]
|
|
10512
|
+
}
|
|
10513
|
+
);
|
|
10514
|
+
}
|
|
10515
|
+
);
|
|
10516
|
+
SelectOption.displayName = "Option";
|
|
10517
|
+
|
|
10518
|
+
// src/components/Select/SelectOptionGroup.tsx
|
|
10519
|
+
var import_react_select3 = require("@radix-ui/react-select");
|
|
10520
|
+
var import_styled_components73 = __toESM(require("styled-components"));
|
|
10521
|
+
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
10522
|
+
var StyledLabel4 = (0, import_styled_components73.default)(import_react_select3.Label)`
|
|
10523
|
+
padding: var(--wui-select-option-padding);
|
|
10524
|
+
`;
|
|
10525
|
+
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
10526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(import_react_select3.Group, { ...props, children: [
|
|
10527
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(StyledLabel4, { children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
10528
|
+
Text,
|
|
10529
|
+
{
|
|
10530
|
+
prominence: "secondary",
|
|
10531
|
+
variant: "body3",
|
|
10532
|
+
children: label
|
|
10533
|
+
}
|
|
10534
|
+
) }),
|
|
10535
|
+
children
|
|
10536
|
+
] });
|
|
10537
|
+
};
|
|
10168
10538
|
// Annotate the CommonJS export names for ESM import in node:
|
|
10169
10539
|
0 && (module.exports = {
|
|
10170
10540
|
ActionButton,
|
|
@@ -10179,6 +10549,9 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
10179
10549
|
Checkbox,
|
|
10180
10550
|
CheckboxGroup,
|
|
10181
10551
|
CheckboxMenuItem,
|
|
10552
|
+
Collapsible,
|
|
10553
|
+
CollapsibleContent,
|
|
10554
|
+
CollapsibleTrigger,
|
|
10182
10555
|
ColorSchemeWrapper,
|
|
10183
10556
|
DataCard,
|
|
10184
10557
|
DataCardTrend,
|
|
@@ -10203,6 +10576,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
10203
10576
|
MenuLabel,
|
|
10204
10577
|
MenuRadioGroup,
|
|
10205
10578
|
Modal,
|
|
10579
|
+
Popover,
|
|
10206
10580
|
Radio,
|
|
10207
10581
|
RadioGroup,
|
|
10208
10582
|
RadioMenuItem,
|