@wistia/ui 0.5.4 → 0.5.5-beta.72ca8428.4bdcb4b
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 +674 -610
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +113 -72
- package/dist/index.d.ts +113 -72
- package/dist/index.mjs +577 -516
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.5.
|
|
3
|
+
* @license @wistia/ui v0.5.5-beta.72ca8428.4bdcb4b
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -5818,7 +5818,6 @@ var StyledLink = styled4.a`
|
|
|
5818
5818
|
align-items: baseline;
|
|
5819
5819
|
gap: var(--wui-space-01);
|
|
5820
5820
|
|
|
5821
|
-
/* This ensure that the icon is the corect color when the style is solid or the button is disabled */
|
|
5822
5821
|
&& {
|
|
5823
5822
|
svg {
|
|
5824
5823
|
width: var(--link-icon-size);
|
|
@@ -6090,8 +6089,10 @@ var StyledActionButton = styled6(Button)`
|
|
|
6090
6089
|
outline-color: var(--wui-color-focus-ring-disabled);
|
|
6091
6090
|
cursor: not-allowed;
|
|
6092
6091
|
|
|
6093
|
-
|
|
6094
|
-
|
|
6092
|
+
&& {
|
|
6093
|
+
svg {
|
|
6094
|
+
color: var(--wui-color-icon-disabled);
|
|
6095
|
+
}
|
|
6095
6096
|
}
|
|
6096
6097
|
}
|
|
6097
6098
|
`;
|
|
@@ -6102,9 +6103,11 @@ var StyledMainIcon = styled6.div`
|
|
|
6102
6103
|
height: 24px;
|
|
6103
6104
|
transition: color var(--wui-motion-duration-02) var(--wui-motion-ease);
|
|
6104
6105
|
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6106
|
+
&& {
|
|
6107
|
+
svg {
|
|
6108
|
+
width: 24px;
|
|
6109
|
+
height: 24px;
|
|
6110
|
+
}
|
|
6108
6111
|
}
|
|
6109
6112
|
`;
|
|
6110
6113
|
var StyledSecondaryIcon = styled6.div`
|
|
@@ -6126,9 +6129,11 @@ var StyledSecondaryIcon = styled6.div`
|
|
|
6126
6129
|
}
|
|
6127
6130
|
`};
|
|
6128
6131
|
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
+
&& {
|
|
6133
|
+
svg {
|
|
6134
|
+
width: 24px;
|
|
6135
|
+
height: 24px;
|
|
6136
|
+
}
|
|
6132
6137
|
}
|
|
6133
6138
|
`;
|
|
6134
6139
|
var StyledLabel = styled6.span`
|
|
@@ -7073,11 +7078,63 @@ var Checkbox = forwardRef7(
|
|
|
7073
7078
|
);
|
|
7074
7079
|
Checkbox.displayName = "Checkbox";
|
|
7075
7080
|
|
|
7081
|
+
// src/components/Collapsible/Collapsible.tsx
|
|
7082
|
+
import { Root } from "@radix-ui/react-collapsible";
|
|
7083
|
+
import { isNotNil as isNotNil8 } from "@wistia/type-guards";
|
|
7084
|
+
import styled19 from "styled-components";
|
|
7085
|
+
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
7086
|
+
var StyledRoot = styled19(Root)`
|
|
7087
|
+
&[data-state='closed'] [data-wui-collapsible-content] {
|
|
7088
|
+
display: -webkit-box;
|
|
7089
|
+
-webkit-box-orient: vertical;
|
|
7090
|
+
-webkit-line-clamp: var(--wui-collapsible-content-clamp-lines);
|
|
7091
|
+
overflow: hidden;
|
|
7092
|
+
}
|
|
7093
|
+
`;
|
|
7094
|
+
var Collapsible = ({
|
|
7095
|
+
children,
|
|
7096
|
+
isOpen = false,
|
|
7097
|
+
onOpenChange
|
|
7098
|
+
}) => {
|
|
7099
|
+
const controlProps = {
|
|
7100
|
+
...isNotNil8(onOpenChange) && isNotNil8(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
7101
|
+
};
|
|
7102
|
+
return /* @__PURE__ */ jsx176(StyledRoot, { ...controlProps, children });
|
|
7103
|
+
};
|
|
7104
|
+
Collapsible.displayName = "Collapsible";
|
|
7105
|
+
|
|
7106
|
+
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
7107
|
+
import { Children as Children3 } from "react";
|
|
7108
|
+
import { Trigger } from "@radix-ui/react-collapsible";
|
|
7109
|
+
import { jsx as jsx177 } from "react/jsx-runtime";
|
|
7110
|
+
var CollapsibleTrigger = ({ children }) => {
|
|
7111
|
+
Children3.only(children);
|
|
7112
|
+
return /* @__PURE__ */ jsx177(Trigger, { asChild: true, children });
|
|
7113
|
+
};
|
|
7114
|
+
|
|
7115
|
+
// src/components/Collapsible/CollapsibleContent.tsx
|
|
7116
|
+
import styled20 from "styled-components";
|
|
7117
|
+
import { Content } from "@radix-ui/react-collapsible";
|
|
7118
|
+
import { isNotUndefined as isNotUndefined4 } from "@wistia/type-guards";
|
|
7119
|
+
import { Fragment as Fragment4, jsx as jsx178, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
7120
|
+
var ClampedContent = styled20.div.attrs({ "data-wui-collapsible-content": true })`
|
|
7121
|
+
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
7122
|
+
`;
|
|
7123
|
+
var CollapsibleContent = ({ clamp, children }) => {
|
|
7124
|
+
if (isNotUndefined4(clamp)) {
|
|
7125
|
+
return /* @__PURE__ */ jsx178(ClampedContent, { $clamp: clamp, children });
|
|
7126
|
+
}
|
|
7127
|
+
return /* @__PURE__ */ jsx178(Content, { asChild: true, children: /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
7128
|
+
children,
|
|
7129
|
+
" "
|
|
7130
|
+
] }) });
|
|
7131
|
+
};
|
|
7132
|
+
|
|
7076
7133
|
// src/components/DataCards/DataCard.tsx
|
|
7077
|
-
import
|
|
7134
|
+
import styled21, { keyframes } from "styled-components";
|
|
7078
7135
|
import { isNotNull } from "@wistia/type-guards";
|
|
7079
|
-
import { jsx as
|
|
7080
|
-
var StyledDataCard =
|
|
7136
|
+
import { jsx as jsx179, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
7137
|
+
var StyledDataCard = styled21.div`
|
|
7081
7138
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
7082
7139
|
display: grid;
|
|
7083
7140
|
grid-template-areas: 'label slot' 'value value';
|
|
@@ -7098,7 +7155,7 @@ var shimmer = keyframes`
|
|
|
7098
7155
|
background-position: -200% 0;
|
|
7099
7156
|
}
|
|
7100
7157
|
`;
|
|
7101
|
-
var LoadingBackground =
|
|
7158
|
+
var LoadingBackground = styled21.div`
|
|
7102
7159
|
background: linear-gradient(
|
|
7103
7160
|
90deg,
|
|
7104
7161
|
var(--wui-color-bg-surface-tertiary) 25%,
|
|
@@ -7109,27 +7166,27 @@ var LoadingBackground = styled19.div`
|
|
|
7109
7166
|
animation: ${shimmer} 1.5s infinite;
|
|
7110
7167
|
border-radius: var(--wui-border-radius-01);
|
|
7111
7168
|
`;
|
|
7112
|
-
var StyledLoadingLabel =
|
|
7169
|
+
var StyledLoadingLabel = styled21(LoadingBackground)`
|
|
7113
7170
|
width: 80px;
|
|
7114
7171
|
height: var(--wui-typography-heading-6-line-height);
|
|
7115
7172
|
`;
|
|
7116
|
-
var StyledLoadingValue =
|
|
7173
|
+
var StyledLoadingValue = styled21(LoadingBackground)`
|
|
7117
7174
|
width: 90%;
|
|
7118
7175
|
height: var(--wui-typography-heading-3-line-height);
|
|
7119
7176
|
`;
|
|
7120
|
-
var StyledLabel3 =
|
|
7177
|
+
var StyledLabel3 = styled21(Heading)`
|
|
7121
7178
|
grid-area: label;
|
|
7122
7179
|
`;
|
|
7123
|
-
var StyledValue =
|
|
7180
|
+
var StyledValue = styled21(Heading)`
|
|
7124
7181
|
grid-area: value;
|
|
7125
7182
|
`;
|
|
7126
|
-
var StyledSlot =
|
|
7183
|
+
var StyledSlot = styled21.div`
|
|
7127
7184
|
display: flex;
|
|
7128
7185
|
justify-content: flex-end;
|
|
7129
7186
|
grid-area: slot;
|
|
7130
7187
|
align-self: center;
|
|
7131
7188
|
`;
|
|
7132
|
-
var StyledDataCardTrendContainer =
|
|
7189
|
+
var StyledDataCardTrendContainer = styled21.div`
|
|
7133
7190
|
position: absolute;
|
|
7134
7191
|
bottom: var(--wui-space-01);
|
|
7135
7192
|
right: var(--wui-space-01);
|
|
@@ -7142,39 +7199,39 @@ var DataCard = ({
|
|
|
7142
7199
|
isLoading = false,
|
|
7143
7200
|
trend,
|
|
7144
7201
|
...props
|
|
7145
|
-
}) => /* @__PURE__ */
|
|
7202
|
+
}) => /* @__PURE__ */ jsxs13(
|
|
7146
7203
|
StyledDataCard,
|
|
7147
7204
|
{
|
|
7148
7205
|
$colorScheme: colorScheme,
|
|
7149
7206
|
...props,
|
|
7150
7207
|
children: [
|
|
7151
|
-
/* @__PURE__ */
|
|
7208
|
+
/* @__PURE__ */ jsx179(
|
|
7152
7209
|
StyledLabel3,
|
|
7153
7210
|
{
|
|
7154
7211
|
renderAs: "dt",
|
|
7155
7212
|
variant: "heading6",
|
|
7156
|
-
children: isLoading ? /* @__PURE__ */
|
|
7213
|
+
children: isLoading ? /* @__PURE__ */ jsx179(StyledLoadingLabel, {}) : label
|
|
7157
7214
|
}
|
|
7158
7215
|
),
|
|
7159
|
-
/* @__PURE__ */
|
|
7216
|
+
/* @__PURE__ */ jsx179(
|
|
7160
7217
|
StyledValue,
|
|
7161
7218
|
{
|
|
7162
7219
|
renderAs: "dd",
|
|
7163
7220
|
variant: "heading3",
|
|
7164
|
-
children: isLoading ? /* @__PURE__ */
|
|
7221
|
+
children: isLoading ? /* @__PURE__ */ jsx179(StyledLoadingValue, {}) : value
|
|
7165
7222
|
}
|
|
7166
7223
|
),
|
|
7167
|
-
isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */
|
|
7168
|
-
isNotNull(trend) && !isLoading && /* @__PURE__ */
|
|
7224
|
+
isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */ jsx179(StyledSlot, { children: upperRightSlot }),
|
|
7225
|
+
isNotNull(trend) && !isLoading && /* @__PURE__ */ jsx179(StyledDataCardTrendContainer, { children: trend })
|
|
7169
7226
|
]
|
|
7170
7227
|
}
|
|
7171
7228
|
);
|
|
7172
7229
|
DataCard.displayName = "DataCard";
|
|
7173
7230
|
|
|
7174
7231
|
// src/components/DataCards/DataCards.tsx
|
|
7175
|
-
import
|
|
7176
|
-
import { jsx as
|
|
7177
|
-
var StyledDataCards =
|
|
7232
|
+
import styled22 from "styled-components";
|
|
7233
|
+
import { jsx as jsx180 } from "react/jsx-runtime";
|
|
7234
|
+
var StyledDataCards = styled22(Box)`
|
|
7178
7235
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7179
7236
|
margin-top: 0; /* Remove default <dl> style */
|
|
7180
7237
|
> * {
|
|
@@ -7188,7 +7245,7 @@ var DataCards = ({
|
|
|
7188
7245
|
colorScheme = "inherit",
|
|
7189
7246
|
...props
|
|
7190
7247
|
}) => {
|
|
7191
|
-
return /* @__PURE__ */
|
|
7248
|
+
return /* @__PURE__ */ jsx180(
|
|
7192
7249
|
StyledDataCards,
|
|
7193
7250
|
{
|
|
7194
7251
|
...props,
|
|
@@ -7206,12 +7263,12 @@ var DataCards = ({
|
|
|
7206
7263
|
DataCards.displayName = "DataCards";
|
|
7207
7264
|
|
|
7208
7265
|
// src/components/DataCards/DataCardTrend.tsx
|
|
7209
|
-
import
|
|
7266
|
+
import styled24 from "styled-components";
|
|
7210
7267
|
|
|
7211
7268
|
// src/components/Text/Text.tsx
|
|
7212
7269
|
import { forwardRef as forwardRef8 } from "react";
|
|
7213
|
-
import
|
|
7214
|
-
import { jsx as
|
|
7270
|
+
import styled23, { css as css19 } from "styled-components";
|
|
7271
|
+
import { jsx as jsx181 } from "react/jsx-runtime";
|
|
7215
7272
|
var bodyBoldStyles = css19`
|
|
7216
7273
|
> strong,
|
|
7217
7274
|
b {
|
|
@@ -7310,7 +7367,7 @@ var variantStyleMap2 = {
|
|
|
7310
7367
|
label3: label3TextStyle,
|
|
7311
7368
|
label4: label4TextStyle
|
|
7312
7369
|
};
|
|
7313
|
-
var StyledText =
|
|
7370
|
+
var StyledText = styled23.div`
|
|
7314
7371
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7315
7372
|
--text-color: ${({ $prominence, $disabled }) => {
|
|
7316
7373
|
if ($disabled) {
|
|
@@ -7364,7 +7421,7 @@ var TextComponent = forwardRef8(
|
|
|
7364
7421
|
renderAs,
|
|
7365
7422
|
...otherProps
|
|
7366
7423
|
}, ref) => {
|
|
7367
|
-
return /* @__PURE__ */
|
|
7424
|
+
return /* @__PURE__ */ jsx181(
|
|
7368
7425
|
StyledText,
|
|
7369
7426
|
{
|
|
7370
7427
|
ref,
|
|
@@ -7386,8 +7443,8 @@ TextComponent.displayName = "Text";
|
|
|
7386
7443
|
var Text = makePolymorphic(TextComponent);
|
|
7387
7444
|
|
|
7388
7445
|
// src/components/DataCards/DataCardTrend.tsx
|
|
7389
|
-
import { jsx as
|
|
7390
|
-
var StyledDataCardTrend =
|
|
7446
|
+
import { jsx as jsx182, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7447
|
+
var StyledDataCardTrend = styled24.div`
|
|
7391
7448
|
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
7392
7449
|
background: var(--wui-color-bg-app);
|
|
7393
7450
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -7402,8 +7459,8 @@ var DataCardTrend = ({
|
|
|
7402
7459
|
children,
|
|
7403
7460
|
...props
|
|
7404
7461
|
}) => {
|
|
7405
|
-
return /* @__PURE__ */
|
|
7406
|
-
/* @__PURE__ */
|
|
7462
|
+
return /* @__PURE__ */ jsxs14(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
7463
|
+
/* @__PURE__ */ jsx182(
|
|
7407
7464
|
Icon,
|
|
7408
7465
|
{
|
|
7409
7466
|
size: "md",
|
|
@@ -7411,7 +7468,7 @@ var DataCardTrend = ({
|
|
|
7411
7468
|
...props
|
|
7412
7469
|
}
|
|
7413
7470
|
),
|
|
7414
|
-
/* @__PURE__ */
|
|
7471
|
+
/* @__PURE__ */ jsx182(
|
|
7415
7472
|
Text,
|
|
7416
7473
|
{
|
|
7417
7474
|
prominence: "secondary",
|
|
@@ -7423,8 +7480,8 @@ var DataCardTrend = ({
|
|
|
7423
7480
|
};
|
|
7424
7481
|
|
|
7425
7482
|
// src/components/Divider/Divider.tsx
|
|
7426
|
-
import
|
|
7427
|
-
import { jsx as
|
|
7483
|
+
import styled25, { css as css20 } from "styled-components";
|
|
7484
|
+
import { jsx as jsx183 } from "react/jsx-runtime";
|
|
7428
7485
|
var horizontalBorderCss = css20`
|
|
7429
7486
|
border-top-color: var(--wui-color-border);
|
|
7430
7487
|
border-top-style: solid;
|
|
@@ -7438,7 +7495,7 @@ var verticalBorderCss = css20`
|
|
|
7438
7495
|
min-height: 100%;
|
|
7439
7496
|
width: 1px;
|
|
7440
7497
|
`;
|
|
7441
|
-
var DividerComponent =
|
|
7498
|
+
var DividerComponent = styled25.div`
|
|
7442
7499
|
${({ $orientation }) => {
|
|
7443
7500
|
switch ($orientation) {
|
|
7444
7501
|
case "vertical":
|
|
@@ -7453,7 +7510,7 @@ var Divider = ({
|
|
|
7453
7510
|
orientation = "horizontal",
|
|
7454
7511
|
...otherProps
|
|
7455
7512
|
}) => {
|
|
7456
|
-
return /* @__PURE__ */
|
|
7513
|
+
return /* @__PURE__ */ jsx183(
|
|
7457
7514
|
DividerComponent,
|
|
7458
7515
|
{
|
|
7459
7516
|
$orientation: orientation,
|
|
@@ -7466,15 +7523,15 @@ var Divider = ({
|
|
|
7466
7523
|
Divider.displayName = "Divider";
|
|
7467
7524
|
|
|
7468
7525
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
7469
|
-
import
|
|
7526
|
+
import styled29, { css as css23 } from "styled-components";
|
|
7470
7527
|
import { useState as useState5, useRef as useRef4 } from "react";
|
|
7471
7528
|
|
|
7472
7529
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7473
|
-
import
|
|
7474
|
-
import { isNotNil as
|
|
7475
|
-
import { jsx as
|
|
7476
|
-
var VisuallyHidden =
|
|
7477
|
-
var VisuallyHiddenButFocusable =
|
|
7530
|
+
import styled26 from "styled-components";
|
|
7531
|
+
import { isNotNil as isNotNil9 } from "@wistia/type-guards";
|
|
7532
|
+
import { jsx as jsx184 } from "react/jsx-runtime";
|
|
7533
|
+
var VisuallyHidden = styled26.div({ ...visuallyHiddenStyle });
|
|
7534
|
+
var VisuallyHiddenButFocusable = styled26.div({
|
|
7478
7535
|
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7479
7536
|
});
|
|
7480
7537
|
var ScreenReaderOnly = ({
|
|
@@ -7483,24 +7540,24 @@ var ScreenReaderOnly = ({
|
|
|
7483
7540
|
focusable = false,
|
|
7484
7541
|
...otherProps
|
|
7485
7542
|
}) => {
|
|
7486
|
-
const accessibleText =
|
|
7543
|
+
const accessibleText = isNotNil9(text) ? text : children;
|
|
7487
7544
|
if (focusable) {
|
|
7488
|
-
return /* @__PURE__ */
|
|
7545
|
+
return /* @__PURE__ */ jsx184(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7489
7546
|
}
|
|
7490
|
-
return /* @__PURE__ */
|
|
7547
|
+
return /* @__PURE__ */ jsx184(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7491
7548
|
};
|
|
7492
7549
|
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7493
7550
|
|
|
7494
7551
|
// src/components/Tooltip/Tooltip.tsx
|
|
7495
7552
|
import {
|
|
7496
|
-
Root,
|
|
7497
|
-
Content,
|
|
7498
|
-
Trigger,
|
|
7553
|
+
Root as Root2,
|
|
7554
|
+
Content as Content2,
|
|
7555
|
+
Trigger as Trigger2,
|
|
7499
7556
|
Portal,
|
|
7500
7557
|
Arrow
|
|
7501
7558
|
} from "@radix-ui/react-tooltip";
|
|
7502
|
-
import
|
|
7503
|
-
import { jsx as
|
|
7559
|
+
import styled27, { css as css21 } from "styled-components";
|
|
7560
|
+
import { jsx as jsx185, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7504
7561
|
var CompactTooltipStyles = css21`
|
|
7505
7562
|
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
7506
7563
|
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
@@ -7508,7 +7565,7 @@ var CompactTooltipStyles = css21`
|
|
|
7508
7565
|
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
7509
7566
|
--tooltip-vertical-padding: var(--wui-space-03);
|
|
7510
7567
|
`;
|
|
7511
|
-
var StyledContent =
|
|
7568
|
+
var StyledContent = styled27(Content2)`
|
|
7512
7569
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
7513
7570
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
7514
7571
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -7566,14 +7623,14 @@ var Tooltip = ({
|
|
|
7566
7623
|
if (forceOpen === true) {
|
|
7567
7624
|
rootProps.open = true;
|
|
7568
7625
|
}
|
|
7569
|
-
return /* @__PURE__ */
|
|
7570
|
-
|
|
7626
|
+
return /* @__PURE__ */ jsxs15(
|
|
7627
|
+
Root2,
|
|
7571
7628
|
{
|
|
7572
7629
|
delayDuration: delay,
|
|
7573
7630
|
...rootProps,
|
|
7574
7631
|
children: [
|
|
7575
|
-
/* @__PURE__ */
|
|
7576
|
-
/* @__PURE__ */
|
|
7632
|
+
/* @__PURE__ */ jsx185(Trigger2, { asChild: true, children }),
|
|
7633
|
+
/* @__PURE__ */ jsx185(Portal, { children: /* @__PURE__ */ jsxs15(
|
|
7577
7634
|
StyledContent,
|
|
7578
7635
|
{
|
|
7579
7636
|
$compact: compact,
|
|
@@ -7581,7 +7638,7 @@ var Tooltip = ({
|
|
|
7581
7638
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
7582
7639
|
children: [
|
|
7583
7640
|
content,
|
|
7584
|
-
!hideArrow ? /* @__PURE__ */
|
|
7641
|
+
!hideArrow ? /* @__PURE__ */ jsx185(Arrow, { asChild: true, children: /* @__PURE__ */ jsx185(
|
|
7585
7642
|
"svg",
|
|
7586
7643
|
{
|
|
7587
7644
|
fill: "var(--tooltip-bg)",
|
|
@@ -7590,7 +7647,7 @@ var Tooltip = ({
|
|
|
7590
7647
|
viewBox: "0 0 12 8",
|
|
7591
7648
|
width: "12",
|
|
7592
7649
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7593
|
-
children: /* @__PURE__ */
|
|
7650
|
+
children: /* @__PURE__ */ jsx185("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" })
|
|
7594
7651
|
}
|
|
7595
7652
|
) }) : null
|
|
7596
7653
|
]
|
|
@@ -7604,9 +7661,9 @@ Tooltip.displayName = "Tooltip";
|
|
|
7604
7661
|
|
|
7605
7662
|
// src/components/Input/Input.tsx
|
|
7606
7663
|
import { forwardRef as forwardRef9, cloneElement as cloneElement3, useRef as useRef3 } from "react";
|
|
7607
|
-
import
|
|
7608
|
-
import { isNil as isNil12, isNotNil as
|
|
7609
|
-
import { jsx as
|
|
7664
|
+
import styled28, { css as css22 } from "styled-components";
|
|
7665
|
+
import { isNil as isNil12, isNotNil as isNotNil10, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
7666
|
+
import { jsx as jsx186, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7610
7667
|
var inputStyles = css22`
|
|
7611
7668
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7612
7669
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -7648,7 +7705,7 @@ var inputStyles = css22`
|
|
|
7648
7705
|
}
|
|
7649
7706
|
}
|
|
7650
7707
|
`;
|
|
7651
|
-
var StyledInputContainer =
|
|
7708
|
+
var StyledInputContainer = styled28.div`
|
|
7652
7709
|
display: inline-flex;
|
|
7653
7710
|
position: relative;
|
|
7654
7711
|
${inputStyles};
|
|
@@ -7692,9 +7749,6 @@ var StyledInputContainer = styled26.div`
|
|
|
7692
7749
|
padding-right: 32px;
|
|
7693
7750
|
}
|
|
7694
7751
|
`;
|
|
7695
|
-
var isValidRef2 = (ref) => {
|
|
7696
|
-
return typeof ref === "object" && ref !== null && "current" in ref && isNotNil9(ref.current);
|
|
7697
|
-
};
|
|
7698
7752
|
var Input = forwardRef9(
|
|
7699
7753
|
({
|
|
7700
7754
|
fullWidth = false,
|
|
@@ -7706,49 +7760,49 @@ var Input = forwardRef9(
|
|
|
7706
7760
|
...props
|
|
7707
7761
|
}, externalRef) => {
|
|
7708
7762
|
const internalRef = useRef3();
|
|
7709
|
-
const ref =
|
|
7763
|
+
const ref = isNotNil10(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
7710
7764
|
let leftIconToDisplay = leftIcon;
|
|
7711
7765
|
if (isNil12(leftIcon) && type === "search") {
|
|
7712
|
-
leftIconToDisplay = /* @__PURE__ */
|
|
7766
|
+
leftIconToDisplay = /* @__PURE__ */ jsx186(Icon, { type: "search" });
|
|
7713
7767
|
}
|
|
7714
|
-
if (
|
|
7768
|
+
if (isNotNil10(leftIconToDisplay)) {
|
|
7715
7769
|
leftIconToDisplay = cloneElement3(leftIconToDisplay, {
|
|
7716
7770
|
size: "md",
|
|
7717
7771
|
className: "wui-input-left-icon"
|
|
7718
7772
|
});
|
|
7719
7773
|
}
|
|
7720
7774
|
let rightIconToDisplay = rightIcon;
|
|
7721
|
-
if (
|
|
7775
|
+
if (isNotNil10(rightIconToDisplay)) {
|
|
7722
7776
|
rightIconToDisplay = cloneElement3(rightIconToDisplay, {
|
|
7723
7777
|
size: "md",
|
|
7724
7778
|
className: "wui-input-right-icon"
|
|
7725
7779
|
});
|
|
7726
7780
|
}
|
|
7727
7781
|
const handleFocus = (event) => {
|
|
7728
|
-
if (
|
|
7782
|
+
if (isNotNil10(props.onFocus)) {
|
|
7729
7783
|
props.onFocus(event);
|
|
7730
7784
|
}
|
|
7731
|
-
if (autoSelect && ref && "current" in ref) {
|
|
7785
|
+
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
7732
7786
|
requestAnimationFrame(() => {
|
|
7733
7787
|
ref.current?.select();
|
|
7734
7788
|
});
|
|
7735
7789
|
}
|
|
7736
7790
|
};
|
|
7737
|
-
return /* @__PURE__ */
|
|
7791
|
+
return /* @__PURE__ */ jsxs16(
|
|
7738
7792
|
StyledInputContainer,
|
|
7739
7793
|
{
|
|
7740
7794
|
$fullWidth: fullWidth,
|
|
7741
7795
|
$monospace: monospace,
|
|
7742
7796
|
children: [
|
|
7743
7797
|
leftIconToDisplay ?? null,
|
|
7744
|
-
type === "multiline" ? /* @__PURE__ */
|
|
7798
|
+
type === "multiline" ? /* @__PURE__ */ jsx186(
|
|
7745
7799
|
"textarea",
|
|
7746
7800
|
{
|
|
7747
7801
|
...props,
|
|
7748
7802
|
ref,
|
|
7749
7803
|
onFocus: handleFocus
|
|
7750
7804
|
}
|
|
7751
|
-
) : /* @__PURE__ */
|
|
7805
|
+
) : /* @__PURE__ */ jsx186(
|
|
7752
7806
|
"input",
|
|
7753
7807
|
{
|
|
7754
7808
|
...props,
|
|
@@ -7766,8 +7820,8 @@ var Input = forwardRef9(
|
|
|
7766
7820
|
Input.displayName = "Input";
|
|
7767
7821
|
|
|
7768
7822
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
7769
|
-
import { Fragment as
|
|
7770
|
-
var StyledInput =
|
|
7823
|
+
import { Fragment as Fragment5, jsx as jsx187, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7824
|
+
var StyledInput = styled29(Input)`
|
|
7771
7825
|
:not([rows]) {
|
|
7772
7826
|
min-height: unset;
|
|
7773
7827
|
}
|
|
@@ -7797,7 +7851,7 @@ var editableStyles = css23`
|
|
|
7797
7851
|
cursor: pointer;
|
|
7798
7852
|
}
|
|
7799
7853
|
`;
|
|
7800
|
-
var StyledHeading2 =
|
|
7854
|
+
var StyledHeading2 = styled29(Heading)`
|
|
7801
7855
|
width: 100%;
|
|
7802
7856
|
border-radius: var(--wui-border-radius-02);
|
|
7803
7857
|
padding: var(--wui-space-02);
|
|
@@ -7851,7 +7905,7 @@ var EditableHeading = ({
|
|
|
7851
7905
|
handleSetEditing(false);
|
|
7852
7906
|
}
|
|
7853
7907
|
};
|
|
7854
|
-
const HeadingComponent2 = /* @__PURE__ */
|
|
7908
|
+
const HeadingComponent2 = /* @__PURE__ */ jsx187(
|
|
7855
7909
|
StyledHeading2,
|
|
7856
7910
|
{
|
|
7857
7911
|
ref: headingRef,
|
|
@@ -7865,7 +7919,7 @@ var EditableHeading = ({
|
|
|
7865
7919
|
return HeadingComponent2;
|
|
7866
7920
|
}
|
|
7867
7921
|
if (isEditing || forceEditing) {
|
|
7868
|
-
return /* @__PURE__ */
|
|
7922
|
+
return /* @__PURE__ */ jsx187(
|
|
7869
7923
|
StyledInput,
|
|
7870
7924
|
{
|
|
7871
7925
|
$height: headingHeight,
|
|
@@ -7883,8 +7937,8 @@ var EditableHeading = ({
|
|
|
7883
7937
|
}
|
|
7884
7938
|
);
|
|
7885
7939
|
}
|
|
7886
|
-
return /* @__PURE__ */
|
|
7887
|
-
/* @__PURE__ */
|
|
7940
|
+
return /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
7941
|
+
/* @__PURE__ */ jsx187(
|
|
7888
7942
|
Tooltip,
|
|
7889
7943
|
{
|
|
7890
7944
|
compact: true,
|
|
@@ -7892,7 +7946,7 @@ var EditableHeading = ({
|
|
|
7892
7946
|
children: HeadingComponent2
|
|
7893
7947
|
}
|
|
7894
7948
|
),
|
|
7895
|
-
/* @__PURE__ */
|
|
7949
|
+
/* @__PURE__ */ jsx187(ScreenReaderOnly, { children: /* @__PURE__ */ jsx187(
|
|
7896
7950
|
"button",
|
|
7897
7951
|
{
|
|
7898
7952
|
"aria-label": ariaLabel,
|
|
@@ -7905,15 +7959,15 @@ var EditableHeading = ({
|
|
|
7905
7959
|
|
|
7906
7960
|
// src/components/Form/Form.tsx
|
|
7907
7961
|
import { forwardRef as forwardRef11, useRef as useRef5, useMemo as useMemo4, createContext as createContext2, useState as useState6, useId as useId2 } from "react";
|
|
7908
|
-
import
|
|
7909
|
-
import { isNotUndefined as
|
|
7962
|
+
import styled31 from "styled-components";
|
|
7963
|
+
import { isNotUndefined as isNotUndefined5, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
7910
7964
|
|
|
7911
7965
|
// src/components/Stack/Stack.tsx
|
|
7912
7966
|
import { forwardRef as forwardRef10 } from "react";
|
|
7913
|
-
import
|
|
7914
|
-
import { jsx as
|
|
7967
|
+
import styled30 from "styled-components";
|
|
7968
|
+
import { jsx as jsx188 } from "react/jsx-runtime";
|
|
7915
7969
|
var DEFAULT_ELEMENT4 = "div";
|
|
7916
|
-
var StyledStack =
|
|
7970
|
+
var StyledStack = styled30.div`
|
|
7917
7971
|
display: flex;
|
|
7918
7972
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
7919
7973
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
@@ -7922,7 +7976,7 @@ var StackComponent = forwardRef10(
|
|
|
7922
7976
|
({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
|
|
7923
7977
|
const responsiveGap = useResponsiveProp(gap);
|
|
7924
7978
|
const responsiveDirection = useResponsiveProp(direction);
|
|
7925
|
-
return /* @__PURE__ */
|
|
7979
|
+
return /* @__PURE__ */ jsx188(
|
|
7926
7980
|
StyledStack,
|
|
7927
7981
|
{
|
|
7928
7982
|
ref,
|
|
@@ -7938,8 +7992,8 @@ StackComponent.displayName = "Stack";
|
|
|
7938
7992
|
var Stack = makePolymorphic(StackComponent);
|
|
7939
7993
|
|
|
7940
7994
|
// src/components/Form/Form.tsx
|
|
7941
|
-
import { jsx as
|
|
7942
|
-
var StyledForm =
|
|
7995
|
+
import { jsx as jsx189 } from "react/jsx-runtime";
|
|
7996
|
+
var StyledForm = styled31.form`
|
|
7943
7997
|
--form-default-width: 690px;
|
|
7944
7998
|
|
|
7945
7999
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
@@ -7970,7 +8024,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
7970
8024
|
props.onBlur(event);
|
|
7971
8025
|
}
|
|
7972
8026
|
const formData = new FormData(event.currentTarget);
|
|
7973
|
-
if (
|
|
8027
|
+
if (isNotUndefined5(validate)) {
|
|
7974
8028
|
handleValidate(formData);
|
|
7975
8029
|
}
|
|
7976
8030
|
};
|
|
@@ -8008,7 +8062,7 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
8008
8062
|
}, [values, errors, id, hasSubmitted]);
|
|
8009
8063
|
return (
|
|
8010
8064
|
// @ts-expect-error - generic context providers are a giant pain
|
|
8011
|
-
/* @__PURE__ */
|
|
8065
|
+
/* @__PURE__ */ jsx189(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx189(
|
|
8012
8066
|
Stack,
|
|
8013
8067
|
{
|
|
8014
8068
|
gap: "space-05",
|
|
@@ -8066,10 +8120,10 @@ var useFormState = (action, initialData = {}) => {
|
|
|
8066
8120
|
|
|
8067
8121
|
// src/components/Form/FormErrorSummary.tsx
|
|
8068
8122
|
import { useContext as useContext2, useRef as useRef6 } from "react";
|
|
8069
|
-
import { isArray, isNotUndefined as
|
|
8070
|
-
import { jsx as
|
|
8123
|
+
import { isArray, isNotUndefined as isNotUndefined6 } from "@wistia/type-guards";
|
|
8124
|
+
import { jsx as jsx190, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
8071
8125
|
var ErrorItem = ({ name, error, formId }) => {
|
|
8072
|
-
return /* @__PURE__ */
|
|
8126
|
+
return /* @__PURE__ */ jsx190("li", { children: /* @__PURE__ */ jsx190(Link, { href: `${formId}-${name}`, children: error }) }, name);
|
|
8073
8127
|
};
|
|
8074
8128
|
var FormErrorSummary = ({ description }) => {
|
|
8075
8129
|
const ref = useRef6(null);
|
|
@@ -8078,10 +8132,10 @@ var FormErrorSummary = ({ description }) => {
|
|
|
8078
8132
|
if (isValid || !hasSubmitted) {
|
|
8079
8133
|
return null;
|
|
8080
8134
|
}
|
|
8081
|
-
return /* @__PURE__ */
|
|
8082
|
-
/* @__PURE__ */
|
|
8083
|
-
/* @__PURE__ */
|
|
8084
|
-
([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */
|
|
8135
|
+
return /* @__PURE__ */ jsxs18("div", { ref, children: [
|
|
8136
|
+
/* @__PURE__ */ jsx190("p", { children: description }),
|
|
8137
|
+
/* @__PURE__ */ jsx190("ul", { children: Object.entries(errors).filter(([, error]) => isNotUndefined6(error)).map(
|
|
8138
|
+
([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */ jsx190(
|
|
8085
8139
|
ErrorItem,
|
|
8086
8140
|
{
|
|
8087
8141
|
error: err,
|
|
@@ -8089,7 +8143,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
8089
8143
|
name
|
|
8090
8144
|
},
|
|
8091
8145
|
err
|
|
8092
|
-
)) : /* @__PURE__ */
|
|
8146
|
+
)) : /* @__PURE__ */ jsx190(
|
|
8093
8147
|
ErrorItem,
|
|
8094
8148
|
{
|
|
8095
8149
|
error: error ?? "",
|
|
@@ -8103,33 +8157,33 @@ var FormErrorSummary = ({ description }) => {
|
|
|
8103
8157
|
};
|
|
8104
8158
|
|
|
8105
8159
|
// src/components/FormField/FormField.tsx
|
|
8106
|
-
import { Children as
|
|
8107
|
-
import
|
|
8108
|
-
import { isArray as isArray2, isNotNil as
|
|
8160
|
+
import { Children as Children4, cloneElement as cloneElement4, useContext as useContext3 } from "react";
|
|
8161
|
+
import styled33 from "styled-components";
|
|
8162
|
+
import { isArray as isArray2, isNotNil as isNotNil11, isNotUndefined as isNotUndefined7, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
8109
8163
|
|
|
8110
8164
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8111
8165
|
import { createContext as createContext3, useMemo as useMemo5 } from "react";
|
|
8112
8166
|
|
|
8113
8167
|
// src/components/FormGroup/FormGroup.tsx
|
|
8114
|
-
import
|
|
8168
|
+
import styled32 from "styled-components";
|
|
8115
8169
|
import { useRef as useRef7 } from "react";
|
|
8116
|
-
import { jsx as
|
|
8117
|
-
var StyledFieldset =
|
|
8170
|
+
import { jsx as jsx191, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8171
|
+
var StyledFieldset = styled32.fieldset`
|
|
8118
8172
|
border: 0;
|
|
8119
8173
|
`;
|
|
8120
|
-
var StyledLegend =
|
|
8174
|
+
var StyledLegend = styled32.legend`
|
|
8121
8175
|
margin-bottom: var(--space-01);
|
|
8122
8176
|
`;
|
|
8123
8177
|
var FormGroup = ({ children, label, ...props }) => {
|
|
8124
8178
|
const ref = useRef7();
|
|
8125
|
-
return /* @__PURE__ */
|
|
8179
|
+
return /* @__PURE__ */ jsxs19(
|
|
8126
8180
|
Stack,
|
|
8127
8181
|
{
|
|
8128
8182
|
...props,
|
|
8129
8183
|
ref,
|
|
8130
8184
|
renderAs: StyledFieldset,
|
|
8131
8185
|
children: [
|
|
8132
|
-
/* @__PURE__ */
|
|
8186
|
+
/* @__PURE__ */ jsx191(
|
|
8133
8187
|
Heading,
|
|
8134
8188
|
{
|
|
8135
8189
|
renderAs: StyledLegend,
|
|
@@ -8145,7 +8199,7 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
8145
8199
|
FormGroup.displayName = "FormGroup";
|
|
8146
8200
|
|
|
8147
8201
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8148
|
-
import { jsx as
|
|
8202
|
+
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
8149
8203
|
var CheckboxGroupContext = createContext3(null);
|
|
8150
8204
|
var CheckboxGroup = ({
|
|
8151
8205
|
children,
|
|
@@ -8160,13 +8214,13 @@ var CheckboxGroup = ({
|
|
|
8160
8214
|
onChange
|
|
8161
8215
|
};
|
|
8162
8216
|
}, [name, onChange]);
|
|
8163
|
-
return /* @__PURE__ */
|
|
8217
|
+
return /* @__PURE__ */ jsx192(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx192(FormGroup, { ...props, children }) });
|
|
8164
8218
|
};
|
|
8165
8219
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
8166
8220
|
|
|
8167
8221
|
// src/components/FormField/FormField.tsx
|
|
8168
|
-
import { jsx as
|
|
8169
|
-
var StyledFormField =
|
|
8222
|
+
import { jsx as jsx193, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8223
|
+
var StyledFormField = styled33.div`
|
|
8170
8224
|
--form-field-spacing: var(--wui-space-01);
|
|
8171
8225
|
--form-field-error-color: var(--wui-color-text-secondary-error);
|
|
8172
8226
|
|
|
@@ -8174,7 +8228,7 @@ var StyledFormField = styled31.div`
|
|
|
8174
8228
|
flex-direction: column;
|
|
8175
8229
|
gap: var(--form-field-spacing);
|
|
8176
8230
|
`;
|
|
8177
|
-
var StyledErrorList =
|
|
8231
|
+
var StyledErrorList = styled33.ul`
|
|
8178
8232
|
margin: 0;
|
|
8179
8233
|
padding: 0;
|
|
8180
8234
|
padding-left: var(--wui-space-04);
|
|
@@ -8184,7 +8238,7 @@ var StyledErrorList = styled31.ul`
|
|
|
8184
8238
|
`;
|
|
8185
8239
|
var ErrorMessages = ({ errors, id }) => {
|
|
8186
8240
|
const isMultipleErrors = isArray2(errors);
|
|
8187
|
-
return isMultipleErrors ? /* @__PURE__ */
|
|
8241
|
+
return isMultipleErrors ? /* @__PURE__ */ jsx193(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ jsx193(
|
|
8188
8242
|
Text,
|
|
8189
8243
|
{
|
|
8190
8244
|
colorScheme: "error",
|
|
@@ -8194,7 +8248,7 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
8194
8248
|
children: error
|
|
8195
8249
|
},
|
|
8196
8250
|
`${id}-${index}`
|
|
8197
|
-
)) }) : /* @__PURE__ */
|
|
8251
|
+
)) }) : /* @__PURE__ */ jsx193(
|
|
8198
8252
|
Text,
|
|
8199
8253
|
{
|
|
8200
8254
|
colorScheme: "error",
|
|
@@ -8226,19 +8280,19 @@ var FormField = ({
|
|
|
8226
8280
|
label: isInlineLabel ? label : void 0,
|
|
8227
8281
|
...props
|
|
8228
8282
|
};
|
|
8229
|
-
if (isUndefined4(value) &&
|
|
8283
|
+
if (isUndefined4(value) && isNotUndefined7(defaultValue)) {
|
|
8230
8284
|
childProps = {
|
|
8231
8285
|
...childProps,
|
|
8232
8286
|
defaultValue
|
|
8233
8287
|
};
|
|
8234
8288
|
}
|
|
8235
|
-
if (
|
|
8236
|
-
const computedName =
|
|
8289
|
+
if (isNotNil11(checkboxGroup)) {
|
|
8290
|
+
const computedName = isNotNil11(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
8237
8291
|
const handleChange = (event) => {
|
|
8238
|
-
if (
|
|
8292
|
+
if (isNotUndefined7(props.onChange)) {
|
|
8239
8293
|
props.onChange(event);
|
|
8240
8294
|
}
|
|
8241
|
-
if (
|
|
8295
|
+
if (isNotUndefined7(checkboxGroup.onChange)) {
|
|
8242
8296
|
checkboxGroup.onChange(event);
|
|
8243
8297
|
}
|
|
8244
8298
|
};
|
|
@@ -8246,15 +8300,15 @@ var FormField = ({
|
|
|
8246
8300
|
...childProps,
|
|
8247
8301
|
name: computedName,
|
|
8248
8302
|
onChange: handleChange,
|
|
8249
|
-
"aria-invalid":
|
|
8250
|
-
"aria-describedby":
|
|
8303
|
+
"aria-invalid": isNotNil11(error),
|
|
8304
|
+
"aria-describedby": isNotNil11(error) ? `${id}-error` : void 0
|
|
8251
8305
|
};
|
|
8252
8306
|
}
|
|
8253
|
-
|
|
8254
|
-
return /* @__PURE__ */
|
|
8255
|
-
!isInlineLabel && /* @__PURE__ */
|
|
8307
|
+
Children4.only(children);
|
|
8308
|
+
return /* @__PURE__ */ jsxs20(StyledFormField, { ...props, children: [
|
|
8309
|
+
!isInlineLabel && /* @__PURE__ */ jsx193(Label, { htmlFor: id, children: label }),
|
|
8256
8310
|
cloneElement4(children, childProps),
|
|
8257
|
-
|
|
8311
|
+
isNotNil11(computedError) ? /* @__PURE__ */ jsx193(
|
|
8258
8312
|
ErrorMessages,
|
|
8259
8313
|
{
|
|
8260
8314
|
errors: computedError,
|
|
@@ -8267,7 +8321,7 @@ FormField.displayName = "FormField";
|
|
|
8267
8321
|
|
|
8268
8322
|
// src/components/FormGroup/RadioGroup.tsx
|
|
8269
8323
|
import { createContext as createContext4, useMemo as useMemo6 } from "react";
|
|
8270
|
-
import { jsx as
|
|
8324
|
+
import { jsx as jsx194 } from "react/jsx-runtime";
|
|
8271
8325
|
var RadioGroupContext = createContext4(null);
|
|
8272
8326
|
var RadioGroup = ({
|
|
8273
8327
|
children,
|
|
@@ -8282,15 +8336,15 @@ var RadioGroup = ({
|
|
|
8282
8336
|
onChange
|
|
8283
8337
|
};
|
|
8284
8338
|
}, [name, onChange]);
|
|
8285
|
-
return /* @__PURE__ */
|
|
8339
|
+
return /* @__PURE__ */ jsx194(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx194(FormGroup, { ...props, children }) });
|
|
8286
8340
|
};
|
|
8287
8341
|
RadioGroup.displayName = "RadioGroup";
|
|
8288
8342
|
|
|
8289
8343
|
// src/components/IconButton/IconButton.tsx
|
|
8290
|
-
import { Children as
|
|
8291
|
-
import
|
|
8292
|
-
import { jsx as
|
|
8293
|
-
var StyledButton2 =
|
|
8344
|
+
import { Children as Children5, cloneElement as cloneElement5, forwardRef as forwardRef12 } from "react";
|
|
8345
|
+
import styled34 from "styled-components";
|
|
8346
|
+
import { jsx as jsx195 } from "react/jsx-runtime";
|
|
8347
|
+
var StyledButton2 = styled34(Button)`
|
|
8294
8348
|
--icon-button-size-sm: 24px;
|
|
8295
8349
|
--icon-button-size-md: 32px;
|
|
8296
8350
|
--icon-button-size-lg: 40px;
|
|
@@ -8307,7 +8361,7 @@ var StyledButton2 = styled32(Button)`
|
|
|
8307
8361
|
var IconButton = forwardRef12(
|
|
8308
8362
|
({ children, label, size = "md", ...props }, ref) => {
|
|
8309
8363
|
const responsiveSize = useResponsiveProp(size);
|
|
8310
|
-
return /* @__PURE__ */
|
|
8364
|
+
return /* @__PURE__ */ jsx195(
|
|
8311
8365
|
StyledButton2,
|
|
8312
8366
|
{
|
|
8313
8367
|
...props,
|
|
@@ -8315,7 +8369,7 @@ var IconButton = forwardRef12(
|
|
|
8315
8369
|
"aria-label": label,
|
|
8316
8370
|
"data-wistia-ui-icon-button": true,
|
|
8317
8371
|
size: responsiveSize,
|
|
8318
|
-
children: cloneElement5(
|
|
8372
|
+
children: cloneElement5(Children5.only(children), {
|
|
8319
8373
|
size: responsiveSize
|
|
8320
8374
|
})
|
|
8321
8375
|
}
|
|
@@ -8325,14 +8379,14 @@ var IconButton = forwardRef12(
|
|
|
8325
8379
|
IconButton.displayName = "IconButton";
|
|
8326
8380
|
|
|
8327
8381
|
// src/components/Menu/Menu.tsx
|
|
8328
|
-
import
|
|
8382
|
+
import styled35, { css as css24, keyframes as keyframes2 } from "styled-components";
|
|
8329
8383
|
import {
|
|
8330
8384
|
DropdownMenu,
|
|
8331
8385
|
DropdownMenuTrigger,
|
|
8332
8386
|
DropdownMenuPortal,
|
|
8333
8387
|
DropdownMenuContent
|
|
8334
8388
|
} from "@radix-ui/react-dropdown-menu";
|
|
8335
|
-
import { isNotNil as
|
|
8389
|
+
import { isNotNil as isNotNil12, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
8336
8390
|
import { useMemo as useMemo7 } from "react";
|
|
8337
8391
|
|
|
8338
8392
|
// src/components/Menu/MenuContext.tsx
|
|
@@ -8341,7 +8395,7 @@ var MenuContext = createContext5({ compact: false });
|
|
|
8341
8395
|
var useMenuContext = () => useContext4(MenuContext);
|
|
8342
8396
|
|
|
8343
8397
|
// src/components/Menu/Menu.tsx
|
|
8344
|
-
import { jsx as
|
|
8398
|
+
import { jsx as jsx196, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8345
8399
|
var open = keyframes2`
|
|
8346
8400
|
from {
|
|
8347
8401
|
opacity: 0;
|
|
@@ -8426,7 +8480,7 @@ var menuContentCss = css24`
|
|
|
8426
8480
|
margin: var(--menu-divider-margin) 0;
|
|
8427
8481
|
}
|
|
8428
8482
|
`;
|
|
8429
|
-
var MenuContent =
|
|
8483
|
+
var MenuContent = styled35(DropdownMenuContent)`
|
|
8430
8484
|
${menuContentCss}
|
|
8431
8485
|
`;
|
|
8432
8486
|
var Menu = ({
|
|
@@ -8444,7 +8498,7 @@ var Menu = ({
|
|
|
8444
8498
|
}) => {
|
|
8445
8499
|
const contextValue = useMemo7(() => ({ compact }), [compact]);
|
|
8446
8500
|
let controlProps = {
|
|
8447
|
-
...
|
|
8501
|
+
...isNotNil12(onOpenChange) && isNotNil12(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8448
8502
|
};
|
|
8449
8503
|
if (disabled) {
|
|
8450
8504
|
controlProps = {
|
|
@@ -8452,24 +8506,24 @@ var Menu = ({
|
|
|
8452
8506
|
onOpenChange: () => null
|
|
8453
8507
|
};
|
|
8454
8508
|
}
|
|
8455
|
-
return /* @__PURE__ */
|
|
8509
|
+
return /* @__PURE__ */ jsx196(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs21(
|
|
8456
8510
|
DropdownMenu,
|
|
8457
8511
|
{
|
|
8458
8512
|
modal: false,
|
|
8459
8513
|
...controlProps,
|
|
8460
8514
|
children: [
|
|
8461
|
-
/* @__PURE__ */
|
|
8515
|
+
/* @__PURE__ */ jsx196(DropdownMenuTrigger, { asChild: true, children: isNotUndefined8(trigger) ? trigger : /* @__PURE__ */ jsx196(
|
|
8462
8516
|
Button,
|
|
8463
8517
|
{
|
|
8464
8518
|
"aria-expanded": isOpen,
|
|
8465
8519
|
disabled,
|
|
8466
8520
|
forceState: isOpen ? "active" : void 0,
|
|
8467
|
-
rightIcon: /* @__PURE__ */
|
|
8521
|
+
rightIcon: /* @__PURE__ */ jsx196(Icon, { type: "caret-down" }),
|
|
8468
8522
|
...triggerProps,
|
|
8469
8523
|
children: label
|
|
8470
8524
|
}
|
|
8471
8525
|
) }),
|
|
8472
|
-
/* @__PURE__ */
|
|
8526
|
+
/* @__PURE__ */ jsx196(DropdownMenuPortal, { children: /* @__PURE__ */ jsx196(
|
|
8473
8527
|
MenuContent,
|
|
8474
8528
|
{
|
|
8475
8529
|
...props,
|
|
@@ -8489,19 +8543,19 @@ var Menu = ({
|
|
|
8489
8543
|
Menu.displayName = "Menu";
|
|
8490
8544
|
|
|
8491
8545
|
// src/components/Menu/MenuLabel.tsx
|
|
8492
|
-
import
|
|
8546
|
+
import styled36 from "styled-components";
|
|
8493
8547
|
import { DropdownMenuLabel } from "@radix-ui/react-dropdown-menu";
|
|
8494
|
-
import { jsx as
|
|
8495
|
-
var StyledMenuLabel =
|
|
8548
|
+
import { jsx as jsx197 } from "react/jsx-runtime";
|
|
8549
|
+
var StyledMenuLabel = styled36(DropdownMenuLabel)`
|
|
8496
8550
|
padding: var(--wui-space-02);
|
|
8497
8551
|
`;
|
|
8498
8552
|
var MenuLabel = ({ children, ...props }) => {
|
|
8499
|
-
return /* @__PURE__ */
|
|
8553
|
+
return /* @__PURE__ */ jsx197(
|
|
8500
8554
|
StyledMenuLabel,
|
|
8501
8555
|
{
|
|
8502
8556
|
asChild: true,
|
|
8503
8557
|
...props,
|
|
8504
|
-
children: /* @__PURE__ */
|
|
8558
|
+
children: /* @__PURE__ */ jsx197(
|
|
8505
8559
|
Heading,
|
|
8506
8560
|
{
|
|
8507
8561
|
renderAs: "span",
|
|
@@ -8517,7 +8571,7 @@ MenuLabel.displayName = "MenuLabel";
|
|
|
8517
8571
|
|
|
8518
8572
|
// src/components/Menu/SubMenu.tsx
|
|
8519
8573
|
import { useState as useState8 } from "react";
|
|
8520
|
-
import
|
|
8574
|
+
import styled39 from "styled-components";
|
|
8521
8575
|
import {
|
|
8522
8576
|
DropdownMenuPortal as DropdownMenuPortal2,
|
|
8523
8577
|
DropdownMenuSub,
|
|
@@ -8526,14 +8580,14 @@ import {
|
|
|
8526
8580
|
DropdownMenuSubTrigger,
|
|
8527
8581
|
DropdownMenuItem
|
|
8528
8582
|
} from "@radix-ui/react-dropdown-menu";
|
|
8529
|
-
import { isNotNil as
|
|
8583
|
+
import { isNotNil as isNotNil14 } from "@wistia/type-guards";
|
|
8530
8584
|
|
|
8531
8585
|
// src/components/Menu/MenuItemButton.tsx
|
|
8532
8586
|
import { forwardRef as forwardRef13 } from "react";
|
|
8533
|
-
import
|
|
8534
|
-
import { isNotNil as
|
|
8535
|
-
import { jsx as
|
|
8536
|
-
var StyledButton3 =
|
|
8587
|
+
import styled37 from "styled-components";
|
|
8588
|
+
import { isNotNil as isNotNil13, isNotUndefined as isNotUndefined9 } from "@wistia/type-guards";
|
|
8589
|
+
import { jsx as jsx198, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8590
|
+
var StyledButton3 = styled37(Button)`
|
|
8537
8591
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
8538
8592
|
|
|
8539
8593
|
display: flex;
|
|
@@ -8572,31 +8626,35 @@ var StyledButton3 = styled35(Button)`
|
|
|
8572
8626
|
padding-left: var(--wui-space-04);
|
|
8573
8627
|
}
|
|
8574
8628
|
`;
|
|
8575
|
-
var StyledLeftIconContainer =
|
|
8629
|
+
var StyledLeftIconContainer = styled37.div`
|
|
8576
8630
|
height: var(--menu-item-left-icon-size);
|
|
8577
8631
|
width: var(--menu-item-left-icon-size);
|
|
8578
8632
|
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8633
|
+
&& {
|
|
8634
|
+
svg {
|
|
8635
|
+
height: var(--menu-item-left-icon-size);
|
|
8636
|
+
width: var(--menu-item-left-icon-size);
|
|
8637
|
+
}
|
|
8582
8638
|
}
|
|
8583
8639
|
`;
|
|
8584
|
-
var StyledRightIconContainer =
|
|
8640
|
+
var StyledRightIconContainer = styled37.div`
|
|
8585
8641
|
height: var(--menu-item-right-icon-size);
|
|
8586
8642
|
width: var(--menu-item-right-icon-size);
|
|
8587
8643
|
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8644
|
+
&& {
|
|
8645
|
+
svg {
|
|
8646
|
+
height: var(--menu-item-right-icon-size);
|
|
8647
|
+
width: var(--menu-item-right-icon-size);
|
|
8648
|
+
}
|
|
8591
8649
|
}
|
|
8592
8650
|
`;
|
|
8593
|
-
var StyledLabelAndDescriptionContainer =
|
|
8651
|
+
var StyledLabelAndDescriptionContainer = styled37.div`
|
|
8594
8652
|
display: flex;
|
|
8595
8653
|
flex-direction: column;
|
|
8596
8654
|
gap: var(--menu-label-description-gap);
|
|
8597
8655
|
flex-basis: 100%;
|
|
8598
8656
|
`;
|
|
8599
|
-
var StyledBadgeContainer =
|
|
8657
|
+
var StyledBadgeContainer = styled37.div`
|
|
8600
8658
|
align-self: start;
|
|
8601
8659
|
justify-self: end;
|
|
8602
8660
|
font-size: var(--wui-typography-label-4-size);
|
|
@@ -8605,13 +8663,13 @@ var StyledBadgeContainer = styled35.div`
|
|
|
8605
8663
|
var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...props }, ref) => {
|
|
8606
8664
|
let { colorScheme, badge } = props;
|
|
8607
8665
|
if (appearance === "dangerous") {
|
|
8608
|
-
if (
|
|
8666
|
+
if (isNotUndefined9(colorScheme)) {
|
|
8609
8667
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
8610
8668
|
}
|
|
8611
8669
|
colorScheme = "error";
|
|
8612
8670
|
}
|
|
8613
8671
|
if (appearance === "gated") {
|
|
8614
|
-
badge = /* @__PURE__ */
|
|
8672
|
+
badge = /* @__PURE__ */ jsx198(
|
|
8615
8673
|
Icon,
|
|
8616
8674
|
{
|
|
8617
8675
|
colorScheme: "purple",
|
|
@@ -8623,7 +8681,7 @@ var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...pro
|
|
|
8623
8681
|
}
|
|
8624
8682
|
);
|
|
8625
8683
|
}
|
|
8626
|
-
return /* @__PURE__ */
|
|
8684
|
+
return /* @__PURE__ */ jsxs22(
|
|
8627
8685
|
StyledButton3,
|
|
8628
8686
|
{
|
|
8629
8687
|
...props,
|
|
@@ -8633,10 +8691,10 @@ var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...pro
|
|
|
8633
8691
|
fullWidth: true,
|
|
8634
8692
|
unstyled: true,
|
|
8635
8693
|
children: [
|
|
8636
|
-
props.leftIcon ? /* @__PURE__ */
|
|
8637
|
-
/* @__PURE__ */
|
|
8638
|
-
|
|
8639
|
-
props.rightIcon ? /* @__PURE__ */
|
|
8694
|
+
props.leftIcon ? /* @__PURE__ */ jsx198(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
8695
|
+
/* @__PURE__ */ jsx198(StyledLabelAndDescriptionContainer, { children }),
|
|
8696
|
+
isNotNil13(badge) || isNotNil13(command) ? /* @__PURE__ */ jsx198(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
8697
|
+
props.rightIcon ? /* @__PURE__ */ jsx198(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
8640
8698
|
]
|
|
8641
8699
|
}
|
|
8642
8700
|
);
|
|
@@ -8644,33 +8702,33 @@ var MenuItemButton = forwardRef13(({ children, appearance, command, icon, ...pro
|
|
|
8644
8702
|
MenuItemButton.displayName = "MenuItemButton";
|
|
8645
8703
|
|
|
8646
8704
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
8647
|
-
import
|
|
8648
|
-
import { jsx as
|
|
8649
|
-
var StyledMenuItemLabel =
|
|
8650
|
-
var StyledMenuItemDescription =
|
|
8705
|
+
import styled38 from "styled-components";
|
|
8706
|
+
import { jsx as jsx199 } from "react/jsx-runtime";
|
|
8707
|
+
var StyledMenuItemLabel = styled38.span``;
|
|
8708
|
+
var StyledMenuItemDescription = styled38(Text).attrs({
|
|
8651
8709
|
variant: "body4",
|
|
8652
8710
|
prominence: "secondary"
|
|
8653
8711
|
})``;
|
|
8654
8712
|
var MenuItemLabel = ({ children }) => {
|
|
8655
|
-
return /* @__PURE__ */
|
|
8713
|
+
return /* @__PURE__ */ jsx199(StyledMenuItemLabel, { children });
|
|
8656
8714
|
};
|
|
8657
8715
|
var MenuItemDescription = ({ children }) => {
|
|
8658
|
-
return /* @__PURE__ */
|
|
8716
|
+
return /* @__PURE__ */ jsx199(StyledMenuItemDescription, { children });
|
|
8659
8717
|
};
|
|
8660
8718
|
|
|
8661
8719
|
// src/components/Menu/SubMenu.tsx
|
|
8662
|
-
import { jsx as
|
|
8663
|
-
var SubMenuContent =
|
|
8720
|
+
import { jsx as jsx200, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8721
|
+
var SubMenuContent = styled39(DropdownMenuSubContent)`
|
|
8664
8722
|
${menuContentCss}
|
|
8665
8723
|
|
|
8666
8724
|
${mq.smAndDown} {
|
|
8667
8725
|
transform: translateX(-100%) !important;
|
|
8668
8726
|
}
|
|
8669
8727
|
`;
|
|
8670
|
-
var StyledMobileSubMenuItems =
|
|
8728
|
+
var StyledMobileSubMenuItems = styled39.div`
|
|
8671
8729
|
margin-left: var(--wui-space-04);
|
|
8672
8730
|
`;
|
|
8673
|
-
var StyledSubTrigger =
|
|
8731
|
+
var StyledSubTrigger = styled39(DropdownMenuSubTrigger)`
|
|
8674
8732
|
outline: none;
|
|
8675
8733
|
|
|
8676
8734
|
&[data-state='open'],
|
|
@@ -8680,12 +8738,12 @@ var StyledSubTrigger = styled37(DropdownMenuSubTrigger)`
|
|
|
8680
8738
|
`;
|
|
8681
8739
|
var SubMenuTrigger = (props) => {
|
|
8682
8740
|
const { isSmAndUp } = useMq();
|
|
8683
|
-
const
|
|
8684
|
-
return /* @__PURE__ */
|
|
8741
|
+
const Trigger4 = isSmAndUp ? StyledSubTrigger : DropdownMenuItem;
|
|
8742
|
+
return /* @__PURE__ */ jsx200(Trigger4, { asChild: true, children: /* @__PURE__ */ jsx200(
|
|
8685
8743
|
MenuItemButton,
|
|
8686
8744
|
{
|
|
8687
8745
|
...props,
|
|
8688
|
-
rightIcon: /* @__PURE__ */
|
|
8746
|
+
rightIcon: /* @__PURE__ */ jsx200(Icon, { type: "caret-right" })
|
|
8689
8747
|
}
|
|
8690
8748
|
) });
|
|
8691
8749
|
};
|
|
@@ -8699,14 +8757,14 @@ var SubMenu = ({
|
|
|
8699
8757
|
const { isSmAndUp } = useMq();
|
|
8700
8758
|
const [isExpanded, setIsExpanded] = useState8(false);
|
|
8701
8759
|
const { compact } = useMenuContext();
|
|
8702
|
-
return isSmAndUp ? /* @__PURE__ */
|
|
8703
|
-
/* @__PURE__ */
|
|
8704
|
-
/* @__PURE__ */
|
|
8705
|
-
|
|
8760
|
+
return isSmAndUp ? /* @__PURE__ */ jsxs23(DropdownMenuSub, { onOpenChange, children: [
|
|
8761
|
+
/* @__PURE__ */ jsxs23(SubMenuTrigger, { ...props, children: [
|
|
8762
|
+
/* @__PURE__ */ jsx200(MenuItemLabel, { children: label }),
|
|
8763
|
+
isNotNil14(description) ? /* @__PURE__ */ jsx200(MenuItemDescription, { children: description }) : null
|
|
8706
8764
|
] }),
|
|
8707
|
-
/* @__PURE__ */
|
|
8708
|
-
] }) : /* @__PURE__ */
|
|
8709
|
-
/* @__PURE__ */
|
|
8765
|
+
/* @__PURE__ */ jsx200(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx200(SubMenuContent, { $compact: compact, children }) })
|
|
8766
|
+
] }) : /* @__PURE__ */ jsxs23(DropdownMenuGroup, { children: [
|
|
8767
|
+
/* @__PURE__ */ jsxs23(
|
|
8710
8768
|
SubMenuTrigger,
|
|
8711
8769
|
{
|
|
8712
8770
|
...props,
|
|
@@ -8715,12 +8773,12 @@ var SubMenu = ({
|
|
|
8715
8773
|
setIsExpanded((prev) => !prev);
|
|
8716
8774
|
},
|
|
8717
8775
|
children: [
|
|
8718
|
-
/* @__PURE__ */
|
|
8719
|
-
/* @__PURE__ */
|
|
8776
|
+
/* @__PURE__ */ jsx200(MenuItemLabel, { children: label }),
|
|
8777
|
+
/* @__PURE__ */ jsx200(MenuItemDescription, { children: description })
|
|
8720
8778
|
]
|
|
8721
8779
|
}
|
|
8722
8780
|
),
|
|
8723
|
-
/* @__PURE__ */
|
|
8781
|
+
/* @__PURE__ */ jsx200(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
|
|
8724
8782
|
] });
|
|
8725
8783
|
};
|
|
8726
8784
|
SubMenu.displayName = "SubMenu";
|
|
@@ -8728,15 +8786,15 @@ SubMenu.displayName = "SubMenu";
|
|
|
8728
8786
|
// src/components/Menu/MenuItem.tsx
|
|
8729
8787
|
import { forwardRef as forwardRef14 } from "react";
|
|
8730
8788
|
import { DropdownMenuItem as DropdownMenuItem2 } from "@radix-ui/react-dropdown-menu";
|
|
8731
|
-
import { jsx as
|
|
8789
|
+
import { jsx as jsx201 } from "react/jsx-runtime";
|
|
8732
8790
|
var MenuItem = forwardRef14(
|
|
8733
8791
|
({ onSelect = () => null, ...props }, ref) => {
|
|
8734
|
-
return /* @__PURE__ */
|
|
8792
|
+
return /* @__PURE__ */ jsx201(
|
|
8735
8793
|
DropdownMenuItem2,
|
|
8736
8794
|
{
|
|
8737
8795
|
asChild: true,
|
|
8738
8796
|
onSelect,
|
|
8739
|
-
children: /* @__PURE__ */
|
|
8797
|
+
children: /* @__PURE__ */ jsx201(
|
|
8740
8798
|
MenuItemButton,
|
|
8741
8799
|
{
|
|
8742
8800
|
...props,
|
|
@@ -8754,10 +8812,10 @@ MenuItem.displayName = "MenuItem";
|
|
|
8754
8812
|
import {
|
|
8755
8813
|
DropdownMenuRadioGroup
|
|
8756
8814
|
} from "@radix-ui/react-dropdown-menu";
|
|
8757
|
-
import { jsx as
|
|
8815
|
+
import { jsx as jsx202, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
8758
8816
|
var MenuRadioGroup = ({ children, label, ...props }) => {
|
|
8759
|
-
return /* @__PURE__ */
|
|
8760
|
-
/* @__PURE__ */
|
|
8817
|
+
return /* @__PURE__ */ jsxs24(DropdownMenuRadioGroup, { ...props, children: [
|
|
8818
|
+
/* @__PURE__ */ jsx202(MenuLabel, { children: label }),
|
|
8761
8819
|
children
|
|
8762
8820
|
] });
|
|
8763
8821
|
};
|
|
@@ -8768,11 +8826,11 @@ import {
|
|
|
8768
8826
|
DropdownMenuItemIndicator,
|
|
8769
8827
|
DropdownMenuRadioItem
|
|
8770
8828
|
} from "@radix-ui/react-dropdown-menu";
|
|
8771
|
-
import { jsx as
|
|
8829
|
+
import { jsx as jsx203 } from "react/jsx-runtime";
|
|
8772
8830
|
var RadioMenuItem = ({
|
|
8773
8831
|
onSelect,
|
|
8774
8832
|
value,
|
|
8775
|
-
indicator = /* @__PURE__ */
|
|
8833
|
+
indicator = /* @__PURE__ */ jsx203(
|
|
8776
8834
|
Icon,
|
|
8777
8835
|
{
|
|
8778
8836
|
size: "sm",
|
|
@@ -8782,17 +8840,17 @@ var RadioMenuItem = ({
|
|
|
8782
8840
|
...props
|
|
8783
8841
|
}) => {
|
|
8784
8842
|
const extraProps = onSelect ? { onSelect } : {};
|
|
8785
|
-
return /* @__PURE__ */
|
|
8843
|
+
return /* @__PURE__ */ jsx203(
|
|
8786
8844
|
DropdownMenuRadioItem,
|
|
8787
8845
|
{
|
|
8788
8846
|
...extraProps,
|
|
8789
8847
|
asChild: true,
|
|
8790
8848
|
value,
|
|
8791
|
-
children: /* @__PURE__ */
|
|
8849
|
+
children: /* @__PURE__ */ jsx203(
|
|
8792
8850
|
MenuItemButton,
|
|
8793
8851
|
{
|
|
8794
8852
|
...props,
|
|
8795
|
-
rightIcon: /* @__PURE__ */
|
|
8853
|
+
rightIcon: /* @__PURE__ */ jsx203(DropdownMenuItemIndicator, { children: indicator })
|
|
8796
8854
|
}
|
|
8797
8855
|
)
|
|
8798
8856
|
}
|
|
@@ -8804,9 +8862,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
8804
8862
|
import {
|
|
8805
8863
|
DropdownMenuCheckboxItem
|
|
8806
8864
|
} from "@radix-ui/react-dropdown-menu";
|
|
8807
|
-
import { jsx as
|
|
8865
|
+
import { jsx as jsx204, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
8808
8866
|
var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
8809
|
-
return checked ? /* @__PURE__ */
|
|
8867
|
+
return checked ? /* @__PURE__ */ jsxs25(
|
|
8810
8868
|
"svg",
|
|
8811
8869
|
{
|
|
8812
8870
|
...props,
|
|
@@ -8816,14 +8874,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8816
8874
|
width: "24",
|
|
8817
8875
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8818
8876
|
children: [
|
|
8819
|
-
/* @__PURE__ */
|
|
8877
|
+
/* @__PURE__ */ jsx204(
|
|
8820
8878
|
"path",
|
|
8821
8879
|
{
|
|
8822
8880
|
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",
|
|
8823
8881
|
fill: "#2949e5"
|
|
8824
8882
|
}
|
|
8825
8883
|
),
|
|
8826
|
-
/* @__PURE__ */
|
|
8884
|
+
/* @__PURE__ */ jsx204(
|
|
8827
8885
|
"path",
|
|
8828
8886
|
{
|
|
8829
8887
|
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",
|
|
@@ -8832,7 +8890,7 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8832
8890
|
)
|
|
8833
8891
|
]
|
|
8834
8892
|
}
|
|
8835
|
-
) : /* @__PURE__ */
|
|
8893
|
+
) : /* @__PURE__ */ jsxs25(
|
|
8836
8894
|
"svg",
|
|
8837
8895
|
{
|
|
8838
8896
|
...props,
|
|
@@ -8842,14 +8900,14 @@ var CheckboxIndicator2 = ({ checked, ...props }) => {
|
|
|
8842
8900
|
width: "24",
|
|
8843
8901
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8844
8902
|
children: [
|
|
8845
|
-
/* @__PURE__ */
|
|
8903
|
+
/* @__PURE__ */ jsx204(
|
|
8846
8904
|
"path",
|
|
8847
8905
|
{
|
|
8848
8906
|
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",
|
|
8849
8907
|
fill: "#fcfcfd"
|
|
8850
8908
|
}
|
|
8851
8909
|
),
|
|
8852
|
-
/* @__PURE__ */
|
|
8910
|
+
/* @__PURE__ */ jsx204(
|
|
8853
8911
|
"path",
|
|
8854
8912
|
{
|
|
8855
8913
|
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",
|
|
@@ -8866,18 +8924,18 @@ var CheckboxMenuItem = ({
|
|
|
8866
8924
|
onCheckedChange,
|
|
8867
8925
|
...props
|
|
8868
8926
|
}) => {
|
|
8869
|
-
return /* @__PURE__ */
|
|
8927
|
+
return /* @__PURE__ */ jsx204(
|
|
8870
8928
|
DropdownMenuCheckboxItem,
|
|
8871
8929
|
{
|
|
8872
8930
|
asChild: true,
|
|
8873
8931
|
checked,
|
|
8874
8932
|
onCheckedChange,
|
|
8875
8933
|
onSelect,
|
|
8876
|
-
children: /* @__PURE__ */
|
|
8934
|
+
children: /* @__PURE__ */ jsx204(
|
|
8877
8935
|
MenuItemButton,
|
|
8878
8936
|
{
|
|
8879
8937
|
...props,
|
|
8880
|
-
leftIcon: /* @__PURE__ */
|
|
8938
|
+
leftIcon: /* @__PURE__ */ jsx204(CheckboxIndicator2, { checked })
|
|
8881
8939
|
}
|
|
8882
8940
|
)
|
|
8883
8941
|
}
|
|
@@ -8887,36 +8945,36 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
|
8887
8945
|
|
|
8888
8946
|
// src/components/Modal/Modal.tsx
|
|
8889
8947
|
import { forwardRef as forwardRef17 } from "react";
|
|
8890
|
-
import
|
|
8948
|
+
import styled44 from "styled-components";
|
|
8891
8949
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
8892
|
-
import { isNotNil as
|
|
8950
|
+
import { isNotNil as isNotNil16 } from "@wistia/type-guards";
|
|
8893
8951
|
|
|
8894
8952
|
// src/components/Modal/ModalHeader.tsx
|
|
8895
|
-
import
|
|
8953
|
+
import styled41 from "styled-components";
|
|
8896
8954
|
import { Title as DialogTitle } from "@radix-ui/react-dialog";
|
|
8897
8955
|
|
|
8898
8956
|
// src/components/Modal/ModalCloseButton.tsx
|
|
8899
|
-
import
|
|
8957
|
+
import styled40 from "styled-components";
|
|
8900
8958
|
import { Close as DialogClose } from "@radix-ui/react-dialog";
|
|
8901
|
-
import { jsx as
|
|
8902
|
-
var CloseButton =
|
|
8959
|
+
import { jsx as jsx205 } from "react/jsx-runtime";
|
|
8960
|
+
var CloseButton = styled40(DialogClose)`
|
|
8903
8961
|
align-self: start;
|
|
8904
8962
|
`;
|
|
8905
8963
|
var ModalCloseButton = () => {
|
|
8906
|
-
return /* @__PURE__ */
|
|
8964
|
+
return /* @__PURE__ */ jsx205(CloseButton, { asChild: true, children: /* @__PURE__ */ jsx205(
|
|
8907
8965
|
IconButton,
|
|
8908
8966
|
{
|
|
8909
8967
|
label: "Dismiss modal",
|
|
8910
8968
|
size: "sm",
|
|
8911
8969
|
variant: "ghost",
|
|
8912
|
-
children: /* @__PURE__ */
|
|
8970
|
+
children: /* @__PURE__ */ jsx205(Icon, { type: "close" })
|
|
8913
8971
|
}
|
|
8914
8972
|
) });
|
|
8915
8973
|
};
|
|
8916
8974
|
|
|
8917
8975
|
// src/components/Modal/ModalHeader.tsx
|
|
8918
|
-
import { jsx as
|
|
8919
|
-
var Header =
|
|
8976
|
+
import { jsx as jsx206, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
8977
|
+
var Header = styled41.header`
|
|
8920
8978
|
display: flex;
|
|
8921
8979
|
order: 1;
|
|
8922
8980
|
gap: var(--wui-space-01);
|
|
@@ -8928,7 +8986,7 @@ var Header = styled39.header`
|
|
|
8928
8986
|
margin-top: 0;
|
|
8929
8987
|
}
|
|
8930
8988
|
`;
|
|
8931
|
-
var Title =
|
|
8989
|
+
var Title = styled41(DialogTitle)`
|
|
8932
8990
|
font-family: var(--wui-typography-heading-2-family);
|
|
8933
8991
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
8934
8992
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -8940,20 +8998,20 @@ var ModalHeader = ({
|
|
|
8940
8998
|
hideCloseButton
|
|
8941
8999
|
}) => {
|
|
8942
9000
|
const TitleWrapper = hideTitle ? ScreenReaderOnly : Title;
|
|
8943
|
-
return /* @__PURE__ */
|
|
8944
|
-
/* @__PURE__ */
|
|
8945
|
-
hideCloseButton ? null : /* @__PURE__ */
|
|
9001
|
+
return /* @__PURE__ */ jsxs26(Header, { children: [
|
|
9002
|
+
/* @__PURE__ */ jsx206(TitleWrapper, { children: title }),
|
|
9003
|
+
hideCloseButton ? null : /* @__PURE__ */ jsx206(ModalCloseButton, {})
|
|
8946
9004
|
] });
|
|
8947
9005
|
};
|
|
8948
9006
|
|
|
8949
9007
|
// src/components/Modal/ModalContent.tsx
|
|
8950
9008
|
import { forwardRef as forwardRef15 } from "react";
|
|
8951
|
-
import
|
|
9009
|
+
import styled42 from "styled-components";
|
|
8952
9010
|
import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
8953
9011
|
|
|
8954
9012
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
8955
9013
|
import { useRef as useRef8, useEffect as useEffect4 } from "react";
|
|
8956
|
-
import { isNotNil as
|
|
9014
|
+
import { isNotNil as isNotNil15 } from "@wistia/type-guards";
|
|
8957
9015
|
var useFocusRestore = () => {
|
|
8958
9016
|
const previouslyFocusedRef = useRef8(null);
|
|
8959
9017
|
useEffect4(() => {
|
|
@@ -8961,7 +9019,7 @@ var useFocusRestore = () => {
|
|
|
8961
9019
|
}, []);
|
|
8962
9020
|
useEffect4(() => {
|
|
8963
9021
|
return () => {
|
|
8964
|
-
if (
|
|
9022
|
+
if (isNotNil15(previouslyFocusedRef.current)) {
|
|
8965
9023
|
setTimeout(() => {
|
|
8966
9024
|
previouslyFocusedRef.current?.focus();
|
|
8967
9025
|
}, 0);
|
|
@@ -8971,8 +9029,8 @@ var useFocusRestore = () => {
|
|
|
8971
9029
|
};
|
|
8972
9030
|
|
|
8973
9031
|
// src/components/Modal/ModalContent.tsx
|
|
8974
|
-
import { jsx as
|
|
8975
|
-
var StyledModalContent =
|
|
9032
|
+
import { jsx as jsx207 } from "react/jsx-runtime";
|
|
9033
|
+
var StyledModalContent = styled42(DialogContent)`
|
|
8976
9034
|
background-color: var(--wui-color-bg-app);
|
|
8977
9035
|
box-sizing: border-box;
|
|
8978
9036
|
display: flex;
|
|
@@ -9016,7 +9074,7 @@ var StyledModalContent = styled40(DialogContent)`
|
|
|
9016
9074
|
var ModalContent = forwardRef15(
|
|
9017
9075
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
9018
9076
|
useFocusRestore();
|
|
9019
|
-
return /* @__PURE__ */
|
|
9077
|
+
return /* @__PURE__ */ jsx207(
|
|
9020
9078
|
StyledModalContent,
|
|
9021
9079
|
{
|
|
9022
9080
|
ref,
|
|
@@ -9032,8 +9090,8 @@ var ModalContent = forwardRef15(
|
|
|
9032
9090
|
|
|
9033
9091
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
9034
9092
|
import { forwardRef as forwardRef16 } from "react";
|
|
9035
|
-
import
|
|
9036
|
-
import { jsx as
|
|
9093
|
+
import styled43 from "styled-components";
|
|
9094
|
+
import { jsx as jsx208 } from "react/jsx-runtime";
|
|
9037
9095
|
var backdropAnimationDuration = 150;
|
|
9038
9096
|
var alignVerticalMap = {
|
|
9039
9097
|
stretch: "normal",
|
|
@@ -9046,7 +9104,7 @@ var alignHorizontalMap = {
|
|
|
9046
9104
|
center: "center",
|
|
9047
9105
|
right: "end"
|
|
9048
9106
|
};
|
|
9049
|
-
var BackdropComponent =
|
|
9107
|
+
var BackdropComponent = styled43.div`
|
|
9050
9108
|
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
9051
9109
|
animation-name: backdropShow;
|
|
9052
9110
|
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
@@ -9070,7 +9128,7 @@ var BackdropComponent = styled41.div`
|
|
|
9070
9128
|
}
|
|
9071
9129
|
`;
|
|
9072
9130
|
var Backdrop = forwardRef16(
|
|
9073
|
-
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */
|
|
9131
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ jsx208(
|
|
9074
9132
|
BackdropComponent,
|
|
9075
9133
|
{
|
|
9076
9134
|
ref,
|
|
@@ -9084,9 +9142,9 @@ var Backdrop = forwardRef16(
|
|
|
9084
9142
|
Backdrop.displayName = "Backdrop";
|
|
9085
9143
|
|
|
9086
9144
|
// src/components/Modal/Modal.tsx
|
|
9087
|
-
import { jsx as
|
|
9145
|
+
import { jsx as jsx209, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
9088
9146
|
var DEFAULT_MODAL_WIDTH = "532px";
|
|
9089
|
-
var ModalBody =
|
|
9147
|
+
var ModalBody = styled44.div`
|
|
9090
9148
|
flex-direction: column;
|
|
9091
9149
|
display: flex;
|
|
9092
9150
|
order: 2;
|
|
@@ -9104,24 +9162,24 @@ var Modal = forwardRef17(
|
|
|
9104
9162
|
width = DEFAULT_MODAL_WIDTH,
|
|
9105
9163
|
...props
|
|
9106
9164
|
}, ref) => {
|
|
9107
|
-
return /* @__PURE__ */
|
|
9165
|
+
return /* @__PURE__ */ jsx209(
|
|
9108
9166
|
DialogRoot,
|
|
9109
9167
|
{
|
|
9110
9168
|
onOpenChange: (open2) => {
|
|
9111
|
-
if (!open2 &&
|
|
9169
|
+
if (!open2 && isNotNil16(onRequestClose)) {
|
|
9112
9170
|
onRequestClose();
|
|
9113
9171
|
}
|
|
9114
9172
|
},
|
|
9115
9173
|
open: isOpen,
|
|
9116
|
-
children: /* @__PURE__ */
|
|
9117
|
-
/* @__PURE__ */
|
|
9118
|
-
/* @__PURE__ */
|
|
9174
|
+
children: /* @__PURE__ */ jsxs27(DialogPortal, { children: [
|
|
9175
|
+
/* @__PURE__ */ jsx209(Backdrop, {}),
|
|
9176
|
+
/* @__PURE__ */ jsxs27(
|
|
9119
9177
|
ModalContent,
|
|
9120
9178
|
{
|
|
9121
9179
|
ref,
|
|
9122
9180
|
fullHeight,
|
|
9123
9181
|
onOpenAutoFocus: (event) => {
|
|
9124
|
-
if (
|
|
9182
|
+
if (isNotNil16(initialFocusRef) && initialFocusRef.current) {
|
|
9125
9183
|
event.preventDefault();
|
|
9126
9184
|
requestAnimationFrame(() => {
|
|
9127
9185
|
initialFocusRef.current?.focus();
|
|
@@ -9131,8 +9189,8 @@ var Modal = forwardRef17(
|
|
|
9131
9189
|
width,
|
|
9132
9190
|
...props,
|
|
9133
9191
|
children: [
|
|
9134
|
-
/* @__PURE__ */
|
|
9135
|
-
/* @__PURE__ */
|
|
9192
|
+
/* @__PURE__ */ jsx209(ModalBody, { children }),
|
|
9193
|
+
/* @__PURE__ */ jsx209(
|
|
9136
9194
|
ModalHeader,
|
|
9137
9195
|
{
|
|
9138
9196
|
hideCloseButton,
|
|
@@ -9152,15 +9210,15 @@ Modal.displayName = "Modal";
|
|
|
9152
9210
|
|
|
9153
9211
|
// src/components/Radio/Radio.tsx
|
|
9154
9212
|
import { forwardRef as forwardRef18, useId as useId3 } from "react";
|
|
9155
|
-
import
|
|
9213
|
+
import styled45, { css as css25 } from "styled-components";
|
|
9156
9214
|
import { isNonEmptyString as isNonEmptyString3 } from "@wistia/type-guards";
|
|
9157
|
-
import { jsx as
|
|
9158
|
-
var StyledLabelWrapper2 =
|
|
9215
|
+
import { jsx as jsx210, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9216
|
+
var StyledLabelWrapper2 = styled45.div`
|
|
9159
9217
|
display: flex;
|
|
9160
9218
|
flex-direction: column;
|
|
9161
9219
|
padding-left: var(--wui-space-02);
|
|
9162
9220
|
`;
|
|
9163
|
-
var StyledRadio =
|
|
9221
|
+
var StyledRadio = styled45.input`
|
|
9164
9222
|
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
9165
9223
|
appearance: none;
|
|
9166
9224
|
margin: 0;
|
|
@@ -9202,7 +9260,7 @@ var defaultHoverStyle = css25`
|
|
|
9202
9260
|
/* TODO Lamp to design hover state */
|
|
9203
9261
|
cursor: pointer;
|
|
9204
9262
|
`;
|
|
9205
|
-
var StyledRadioWrapper =
|
|
9263
|
+
var StyledRadioWrapper = styled45.div`
|
|
9206
9264
|
align-items: baseline;
|
|
9207
9265
|
border: 1px solid transparent;
|
|
9208
9266
|
border-radius: 4px;
|
|
@@ -9240,13 +9298,13 @@ var Radio = forwardRef18(
|
|
|
9240
9298
|
}, ref) => {
|
|
9241
9299
|
const generatedId = useId3();
|
|
9242
9300
|
const computedId = isNonEmptyString3(id) ? id : `ui-radio-${generatedId}`;
|
|
9243
|
-
return /* @__PURE__ */
|
|
9301
|
+
return /* @__PURE__ */ jsxs28(
|
|
9244
9302
|
StyledRadioWrapper,
|
|
9245
9303
|
{
|
|
9246
9304
|
"aria-invalid": otherProps["aria-invalid"],
|
|
9247
9305
|
disabled,
|
|
9248
9306
|
children: [
|
|
9249
|
-
/* @__PURE__ */
|
|
9307
|
+
/* @__PURE__ */ jsx210(
|
|
9250
9308
|
StyledRadio,
|
|
9251
9309
|
{
|
|
9252
9310
|
ref,
|
|
@@ -9261,8 +9319,8 @@ var Radio = forwardRef18(
|
|
|
9261
9319
|
...otherProps
|
|
9262
9320
|
}
|
|
9263
9321
|
),
|
|
9264
|
-
/* @__PURE__ */
|
|
9265
|
-
/* @__PURE__ */
|
|
9322
|
+
/* @__PURE__ */ jsxs28(StyledLabelWrapper2, { children: [
|
|
9323
|
+
/* @__PURE__ */ jsx210(
|
|
9266
9324
|
Label,
|
|
9267
9325
|
{
|
|
9268
9326
|
disabled,
|
|
@@ -9271,7 +9329,7 @@ var Radio = forwardRef18(
|
|
|
9271
9329
|
children: label
|
|
9272
9330
|
}
|
|
9273
9331
|
),
|
|
9274
|
-
/* @__PURE__ */
|
|
9332
|
+
/* @__PURE__ */ jsx210(LabelDescription, { children: description })
|
|
9275
9333
|
] })
|
|
9276
9334
|
]
|
|
9277
9335
|
}
|
|
@@ -9282,10 +9340,10 @@ Radio.displayName = "Radio";
|
|
|
9282
9340
|
|
|
9283
9341
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
9284
9342
|
import { forwardRef as forwardRef19 } from "react";
|
|
9285
|
-
import
|
|
9343
|
+
import styled46, { css as css26 } from "styled-components";
|
|
9286
9344
|
import { Root as ToggleGroupRoot } from "@radix-ui/react-toggle-group";
|
|
9287
9345
|
import { isNil as isNil13 } from "@wistia/type-guards";
|
|
9288
|
-
import { jsx as
|
|
9346
|
+
import { jsx as jsx211 } from "react/jsx-runtime";
|
|
9289
9347
|
var segmentedControlStyles = css26`
|
|
9290
9348
|
display: inline-flex;
|
|
9291
9349
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -9294,7 +9352,7 @@ var segmentedControlStyles = css26`
|
|
|
9294
9352
|
gap: var(--wui-space-01);
|
|
9295
9353
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
9296
9354
|
`;
|
|
9297
|
-
var StyledSegmentedControl =
|
|
9355
|
+
var StyledSegmentedControl = styled46(ToggleGroupRoot)`
|
|
9298
9356
|
${segmentedControlStyles}
|
|
9299
9357
|
`;
|
|
9300
9358
|
var SegmentedControl = forwardRef19(
|
|
@@ -9309,7 +9367,7 @@ var SegmentedControl = forwardRef19(
|
|
|
9309
9367
|
if (isNil13(children)) {
|
|
9310
9368
|
return null;
|
|
9311
9369
|
}
|
|
9312
|
-
return /* @__PURE__ */
|
|
9370
|
+
return /* @__PURE__ */ jsx211(
|
|
9313
9371
|
StyledSegmentedControl,
|
|
9314
9372
|
{
|
|
9315
9373
|
ref,
|
|
@@ -9330,10 +9388,10 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
9330
9388
|
|
|
9331
9389
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
9332
9390
|
import { forwardRef as forwardRef20 } from "react";
|
|
9333
|
-
import
|
|
9391
|
+
import styled47, { css as css27 } from "styled-components";
|
|
9334
9392
|
import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
9335
|
-
import { isNotNil as
|
|
9336
|
-
import { jsxs as
|
|
9393
|
+
import { isNotNil as isNotNil17 } from "@wistia/type-guards";
|
|
9394
|
+
import { jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9337
9395
|
var segmentedControlItemStyles = css27`
|
|
9338
9396
|
all: unset; /* ToggleGroupItem is a button element */
|
|
9339
9397
|
align-items: center;
|
|
@@ -9389,7 +9447,7 @@ var segmentedControlItemStyles = css27`
|
|
|
9389
9447
|
}
|
|
9390
9448
|
}
|
|
9391
9449
|
`;
|
|
9392
|
-
var StyledSegmentedControlItem =
|
|
9450
|
+
var StyledSegmentedControlItem = styled47(ToggleGroupItem)`
|
|
9393
9451
|
${segmentedControlItemStyles}
|
|
9394
9452
|
`;
|
|
9395
9453
|
var SegmentedControlItem = forwardRef20(
|
|
@@ -9401,12 +9459,12 @@ var SegmentedControlItem = forwardRef20(
|
|
|
9401
9459
|
event.preventDefault();
|
|
9402
9460
|
}
|
|
9403
9461
|
};
|
|
9404
|
-
return /* @__PURE__ */
|
|
9462
|
+
return /* @__PURE__ */ jsxs29(
|
|
9405
9463
|
StyledSegmentedControlItem,
|
|
9406
9464
|
{
|
|
9407
9465
|
ref,
|
|
9408
|
-
$hasLabel:
|
|
9409
|
-
"aria-label":
|
|
9466
|
+
$hasLabel: isNotNil17(label),
|
|
9467
|
+
"aria-label": isNotNil17(label) ? void 0 : ariaLabel,
|
|
9410
9468
|
disabled,
|
|
9411
9469
|
onClick: handleClick,
|
|
9412
9470
|
value,
|
|
@@ -9420,209 +9478,16 @@ var SegmentedControlItem = forwardRef20(
|
|
|
9420
9478
|
);
|
|
9421
9479
|
SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
9422
9480
|
|
|
9423
|
-
// src/components/Select/Select.tsx
|
|
9424
|
-
import {
|
|
9425
|
-
Root as Root2,
|
|
9426
|
-
Trigger as Trigger2,
|
|
9427
|
-
Portal as Portal2,
|
|
9428
|
-
Content as Content2,
|
|
9429
|
-
ScrollUpButton,
|
|
9430
|
-
Viewport,
|
|
9431
|
-
Value,
|
|
9432
|
-
ScrollDownButton
|
|
9433
|
-
} from "@radix-ui/react-select";
|
|
9434
|
-
import { forwardRef as forwardRef21 } from "react";
|
|
9435
|
-
import styled46 from "styled-components";
|
|
9436
|
-
import { jsx as jsx209, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9437
|
-
var StyledTrigger = styled46(Trigger2)`
|
|
9438
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9439
|
-
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
9440
|
-
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
9441
|
-
--wui-select-color-border: var(--wui-color-border);
|
|
9442
|
-
--wui-select-color-border-focus: var(--wui-color-border-active);
|
|
9443
|
-
--wui-select-color-border-error: var(--wui-color-border-error);
|
|
9444
|
-
--wui-select-color-border-disabled: var(--wui-color-border-disabled);
|
|
9445
|
-
--wui-select-border-radius: var(--wui-border-radius-rounded);
|
|
9446
|
-
--wui-select-multiline-border-radius: var(--wui-border-radius-02);
|
|
9447
|
-
--wui-select-vertical-padding: var(--wui-space-02);
|
|
9448
|
-
--wui-select-horizontal-padding: var(--wui-space-03);
|
|
9449
|
-
--wui-select-placeholder: var(--wui-gray-10);
|
|
9450
|
-
--wui-select-color-text-error: var(--wui-color-text-error);
|
|
9451
|
-
|
|
9452
|
-
padding: var(--wui-select-vertical-padding) var(--wui-select-horizontal-padding);
|
|
9453
|
-
background-color: var(--wui-select-color-bg);
|
|
9454
|
-
border: 1px solid var(--wui-select-color-border);
|
|
9455
|
-
border-radius: var(--wui-select-border-radius);
|
|
9456
|
-
min-width: 200px;
|
|
9457
|
-
text-align: left;
|
|
9458
|
-
display: inline-flex;
|
|
9459
|
-
align-items: center;
|
|
9460
|
-
justify-content: space-between;
|
|
9461
|
-
width: ${({ $fullWidth = false }) => $fullWidth ? "100%" : "auto"};
|
|
9462
|
-
|
|
9463
|
-
&[aria-expanded='true'],
|
|
9464
|
-
&:focus {
|
|
9465
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
9466
|
-
}
|
|
9467
|
-
|
|
9468
|
-
&[aria-invalid='true'] {
|
|
9469
|
-
outline: 2px solid var(--wui-select-color-border-error);
|
|
9470
|
-
color: var(--wui-select-color-text-error);
|
|
9471
|
-
}
|
|
9472
|
-
|
|
9473
|
-
&:disabled {
|
|
9474
|
-
border-color: var(--wui-color-bg-surface-disabled);
|
|
9475
|
-
background-color: var(--wui-color-bg-surface-disabled);
|
|
9476
|
-
}
|
|
9477
|
-
`;
|
|
9478
|
-
var StyledContent2 = styled46(Content2)`
|
|
9479
|
-
--wui-select-content-border: var(--wui-color-border);
|
|
9480
|
-
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
9481
|
-
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
9482
|
-
--wui-select-option-padding: var(--wui-space-02);
|
|
9483
|
-
--wui-select-option-inner-gap: var(--wui-space-03);
|
|
9484
|
-
--wui-select-option-bg-hover: var(--wui-color-bg-surface-hover);
|
|
9485
|
-
|
|
9486
|
-
overflow: hidden;
|
|
9487
|
-
transform: translateY(8px);
|
|
9488
|
-
background-color: var(--wui-select-content-bg);
|
|
9489
|
-
border: 1px solid var(--wui-select-content-border);
|
|
9490
|
-
border-radius: var(--wui-select-content-border-radius);
|
|
9491
|
-
padding: var(--wui-select-option-padding);
|
|
9492
|
-
min-width: 200px;
|
|
9493
|
-
`;
|
|
9494
|
-
var Select = forwardRef21(
|
|
9495
|
-
({
|
|
9496
|
-
colorScheme = "inherit",
|
|
9497
|
-
children,
|
|
9498
|
-
onChange = () => null,
|
|
9499
|
-
placeholder = "Select...",
|
|
9500
|
-
fullWidth = false,
|
|
9501
|
-
...props
|
|
9502
|
-
}, forwardedRef) => {
|
|
9503
|
-
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
9504
|
-
return /* @__PURE__ */ jsxs29(
|
|
9505
|
-
Root2,
|
|
9506
|
-
{
|
|
9507
|
-
...props,
|
|
9508
|
-
onValueChange: onChange,
|
|
9509
|
-
children: [
|
|
9510
|
-
/* @__PURE__ */ jsxs29(
|
|
9511
|
-
StyledTrigger,
|
|
9512
|
-
{
|
|
9513
|
-
ref: forwardedRef,
|
|
9514
|
-
$colorScheme: colorScheme,
|
|
9515
|
-
$fullWidth: responsiveFullWidth,
|
|
9516
|
-
...props,
|
|
9517
|
-
children: [
|
|
9518
|
-
/* @__PURE__ */ jsx209(Value, { placeholder }),
|
|
9519
|
-
/* @__PURE__ */ jsx209(
|
|
9520
|
-
Icon,
|
|
9521
|
-
{
|
|
9522
|
-
size: "md",
|
|
9523
|
-
type: "caret-down"
|
|
9524
|
-
}
|
|
9525
|
-
)
|
|
9526
|
-
]
|
|
9527
|
-
}
|
|
9528
|
-
),
|
|
9529
|
-
/* @__PURE__ */ jsx209(Portal2, { children: /* @__PURE__ */ jsxs29(StyledContent2, { position: "popper", children: [
|
|
9530
|
-
/* @__PURE__ */ jsx209(ScrollUpButton, { children: /* @__PURE__ */ jsx209(Icon, { type: "caret-up" }) }),
|
|
9531
|
-
/* @__PURE__ */ jsx209(Viewport, { children }),
|
|
9532
|
-
/* @__PURE__ */ jsx209(ScrollDownButton, { children: /* @__PURE__ */ jsx209(Icon, { type: "caret-down" }) })
|
|
9533
|
-
] }) })
|
|
9534
|
-
]
|
|
9535
|
-
}
|
|
9536
|
-
);
|
|
9537
|
-
}
|
|
9538
|
-
);
|
|
9539
|
-
Select.displayName = "Select";
|
|
9540
|
-
|
|
9541
|
-
// src/components/Select/SelectOption.tsx
|
|
9542
|
-
import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
9543
|
-
import { forwardRef as forwardRef22 } from "react";
|
|
9544
|
-
import styled47 from "styled-components";
|
|
9545
|
-
import { jsx as jsx210, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9546
|
-
var StyledItem = styled47(Item)`
|
|
9547
|
-
${variantStyleMap2.body3};
|
|
9548
|
-
display: flex;
|
|
9549
|
-
padding: var(--wui-select-option-padding);
|
|
9550
|
-
gap: var(--wui-select-option-inner-gap);
|
|
9551
|
-
font-size: var(--font-size);
|
|
9552
|
-
font-weight: var(--font-weight);
|
|
9553
|
-
border-radius: var(--wui-border-radius-01);
|
|
9554
|
-
|
|
9555
|
-
&:hover,
|
|
9556
|
-
&:focus-visible {
|
|
9557
|
-
background-color: var(--wui-select-option-bg-hover);
|
|
9558
|
-
outline: none;
|
|
9559
|
-
}
|
|
9560
|
-
|
|
9561
|
-
&[aria-disabled='true'] {
|
|
9562
|
-
color: var(--wui-color-text-disabled);
|
|
9563
|
-
}
|
|
9564
|
-
|
|
9565
|
-
&[aria-disabled='true']:hover {
|
|
9566
|
-
background-color: transparent;
|
|
9567
|
-
}
|
|
9568
|
-
`;
|
|
9569
|
-
var StyledIconContainer = styled47.span`
|
|
9570
|
-
width: 12px;
|
|
9571
|
-
`;
|
|
9572
|
-
var SelectOption = forwardRef22(
|
|
9573
|
-
({ children, ...props }, forwardedRef) => {
|
|
9574
|
-
return /* @__PURE__ */ jsxs30(
|
|
9575
|
-
StyledItem,
|
|
9576
|
-
{
|
|
9577
|
-
...props,
|
|
9578
|
-
ref: forwardedRef,
|
|
9579
|
-
children: [
|
|
9580
|
-
/* @__PURE__ */ jsx210(StyledIconContainer, { children: /* @__PURE__ */ jsx210(ItemIndicator, { children: /* @__PURE__ */ jsx210(
|
|
9581
|
-
Icon,
|
|
9582
|
-
{
|
|
9583
|
-
size: "sm",
|
|
9584
|
-
type: "checkmark"
|
|
9585
|
-
}
|
|
9586
|
-
) }) }),
|
|
9587
|
-
/* @__PURE__ */ jsx210(ItemText, { children })
|
|
9588
|
-
]
|
|
9589
|
-
}
|
|
9590
|
-
);
|
|
9591
|
-
}
|
|
9592
|
-
);
|
|
9593
|
-
SelectOption.displayName = "Option";
|
|
9594
|
-
|
|
9595
|
-
// src/components/Select/SelectOptionGroup.tsx
|
|
9596
|
-
import { Group, Label as Label2 } from "@radix-ui/react-select";
|
|
9597
|
-
import styled48 from "styled-components";
|
|
9598
|
-
import { jsx as jsx211, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9599
|
-
var StyledLabel4 = styled48(Label2)`
|
|
9600
|
-
padding: var(--wui-select-option-padding);
|
|
9601
|
-
`;
|
|
9602
|
-
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
9603
|
-
return /* @__PURE__ */ jsxs31(Group, { ...props, children: [
|
|
9604
|
-
/* @__PURE__ */ jsx211(StyledLabel4, { children: /* @__PURE__ */ jsx211(
|
|
9605
|
-
Text,
|
|
9606
|
-
{
|
|
9607
|
-
prominence: "secondary",
|
|
9608
|
-
variant: "body3",
|
|
9609
|
-
children: label
|
|
9610
|
-
}
|
|
9611
|
-
) }),
|
|
9612
|
-
children
|
|
9613
|
-
] });
|
|
9614
|
-
};
|
|
9615
|
-
|
|
9616
9481
|
// src/components/Tabs/Tabs.tsx
|
|
9617
|
-
import { forwardRef as
|
|
9482
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
9618
9483
|
import { Root as TabsRoot } from "@radix-ui/react-tabs";
|
|
9619
|
-
import { isNotNil as
|
|
9484
|
+
import { isNotNil as isNotNil19, isNil as isNil14 } from "@wistia/type-guards";
|
|
9620
9485
|
|
|
9621
9486
|
// src/components/Tabs/TabPanel.tsx
|
|
9622
|
-
import
|
|
9487
|
+
import styled48 from "styled-components";
|
|
9623
9488
|
import { Content as TabsContent } from "@radix-ui/react-tabs";
|
|
9624
9489
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
9625
|
-
var StyledTabPanel =
|
|
9490
|
+
var StyledTabPanel = styled48(TabsContent)`
|
|
9626
9491
|
display: flex;
|
|
9627
9492
|
flex-direction: column;
|
|
9628
9493
|
`;
|
|
@@ -9639,10 +9504,10 @@ var TabPanel = ({ children, value, ...props }) => {
|
|
|
9639
9504
|
TabPanel.displayName = "TabPanel";
|
|
9640
9505
|
|
|
9641
9506
|
// src/components/Tabs/TabList.tsx
|
|
9642
|
-
import
|
|
9507
|
+
import styled49 from "styled-components";
|
|
9643
9508
|
import { List as RadixTabList } from "@radix-ui/react-tabs";
|
|
9644
9509
|
import { jsx as jsx213 } from "react/jsx-runtime";
|
|
9645
|
-
var StyledTabList =
|
|
9510
|
+
var StyledTabList = styled49(RadixTabList)`
|
|
9646
9511
|
${segmentedControlStyles}
|
|
9647
9512
|
|
|
9648
9513
|
margin-bottom: var(--wui-space-04);
|
|
@@ -9666,26 +9531,26 @@ var TabList = ({
|
|
|
9666
9531
|
TabList.displayName = "TabList";
|
|
9667
9532
|
|
|
9668
9533
|
// src/components/Tabs/TabItem.tsx
|
|
9669
|
-
import { forwardRef as
|
|
9670
|
-
import
|
|
9534
|
+
import { forwardRef as forwardRef21 } from "react";
|
|
9535
|
+
import styled50 from "styled-components";
|
|
9671
9536
|
import { Trigger as RadixTab } from "@radix-ui/react-tabs";
|
|
9672
|
-
import { isNotNil as
|
|
9673
|
-
import { jsxs as
|
|
9674
|
-
var StyledTabItem =
|
|
9537
|
+
import { isNotNil as isNotNil18 } from "@wistia/type-guards";
|
|
9538
|
+
import { jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9539
|
+
var StyledTabItem = styled50(RadixTab)`
|
|
9675
9540
|
${segmentedControlItemStyles}
|
|
9676
9541
|
|
|
9677
9542
|
&[data-state='active'] {
|
|
9678
9543
|
background-color: white;
|
|
9679
9544
|
}
|
|
9680
9545
|
`;
|
|
9681
|
-
var TabItem =
|
|
9546
|
+
var TabItem = forwardRef21(
|
|
9682
9547
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, ref) => {
|
|
9683
|
-
return /* @__PURE__ */
|
|
9548
|
+
return /* @__PURE__ */ jsxs30(
|
|
9684
9549
|
StyledTabItem,
|
|
9685
9550
|
{
|
|
9686
9551
|
ref,
|
|
9687
|
-
$hasLabel:
|
|
9688
|
-
"aria-label":
|
|
9552
|
+
$hasLabel: isNotNil18(label),
|
|
9553
|
+
"aria-label": isNotNil18(label) ? void 0 : ariaLabel,
|
|
9689
9554
|
disabled,
|
|
9690
9555
|
value,
|
|
9691
9556
|
children: [
|
|
@@ -9699,16 +9564,16 @@ var TabItem = forwardRef23(
|
|
|
9699
9564
|
TabItem.displayName = "TabItem";
|
|
9700
9565
|
|
|
9701
9566
|
// src/components/Tabs/extractTabItems.ts
|
|
9702
|
-
import { Children as
|
|
9567
|
+
import { Children as Children6, Fragment as Fragment6, isValidElement as isValidElement2 } from "react";
|
|
9703
9568
|
var extractTabItems = (children) => {
|
|
9704
9569
|
const tabItems = [];
|
|
9705
|
-
|
|
9570
|
+
Children6.forEach(children, (child) => {
|
|
9706
9571
|
if (!isValidElement2(child)) {
|
|
9707
9572
|
return;
|
|
9708
9573
|
}
|
|
9709
9574
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
9710
9575
|
tabItems.push(child);
|
|
9711
|
-
} else if (child.type ===
|
|
9576
|
+
} else if (child.type === Fragment6) {
|
|
9712
9577
|
const fragmentElement = child;
|
|
9713
9578
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
9714
9579
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -9721,8 +9586,8 @@ var extractTabItems = (children) => {
|
|
|
9721
9586
|
};
|
|
9722
9587
|
|
|
9723
9588
|
// src/components/Tabs/Tabs.tsx
|
|
9724
|
-
import { jsx as jsx214, jsxs as
|
|
9725
|
-
var Tabs =
|
|
9589
|
+
import { jsx as jsx214, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9590
|
+
var Tabs = forwardRef22(
|
|
9726
9591
|
({
|
|
9727
9592
|
children,
|
|
9728
9593
|
fullWidth = true,
|
|
@@ -9734,7 +9599,7 @@ var Tabs = forwardRef24(
|
|
|
9734
9599
|
}, ref) => {
|
|
9735
9600
|
const tabItems = extractTabItems(children);
|
|
9736
9601
|
const modeProps = defaultSelectedValue !== void 0 ? { defaultValue: defaultSelectedValue } : { value: selectedValue, onValueChange: onSelectedValueChange };
|
|
9737
|
-
return /* @__PURE__ */
|
|
9602
|
+
return /* @__PURE__ */ jsxs31(
|
|
9738
9603
|
TabsRoot,
|
|
9739
9604
|
{
|
|
9740
9605
|
ref,
|
|
@@ -9766,7 +9631,7 @@ var Tabs = forwardRef24(
|
|
|
9766
9631
|
value
|
|
9767
9632
|
);
|
|
9768
9633
|
}
|
|
9769
|
-
if (
|
|
9634
|
+
if (isNotNil19(label)) {
|
|
9770
9635
|
return /* @__PURE__ */ jsx214(
|
|
9771
9636
|
TabItem,
|
|
9772
9637
|
{
|
|
@@ -9778,7 +9643,7 @@ var Tabs = forwardRef24(
|
|
|
9778
9643
|
value
|
|
9779
9644
|
);
|
|
9780
9645
|
}
|
|
9781
|
-
if (
|
|
9646
|
+
if (isNotNil19(ariaLabelForTab)) {
|
|
9782
9647
|
return /* @__PURE__ */ jsx214(
|
|
9783
9648
|
TabItem,
|
|
9784
9649
|
{
|
|
@@ -9810,19 +9675,19 @@ var Tabs = forwardRef24(
|
|
|
9810
9675
|
Tabs.displayName = "Tabs";
|
|
9811
9676
|
|
|
9812
9677
|
// src/components/Tabs/Tab.tsx
|
|
9813
|
-
import { forwardRef as
|
|
9678
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
9814
9679
|
import { jsx as jsx215 } from "react/jsx-runtime";
|
|
9815
|
-
var Tab =
|
|
9680
|
+
var Tab = forwardRef23(({ children }, ref) => {
|
|
9816
9681
|
return /* @__PURE__ */ jsx215("div", { ref, children });
|
|
9817
9682
|
});
|
|
9818
9683
|
Tab.displayName = "Tab";
|
|
9819
9684
|
|
|
9820
9685
|
// src/components/Tag/Tag.tsx
|
|
9821
|
-
import { forwardRef as
|
|
9822
|
-
import
|
|
9823
|
-
import { isNil as isNil15, isNotNil as
|
|
9824
|
-
import { Fragment as
|
|
9825
|
-
var TagLabel =
|
|
9686
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
9687
|
+
import styled51 from "styled-components";
|
|
9688
|
+
import { isNil as isNil15, isNotNil as isNotNil20, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
9689
|
+
import { Fragment as Fragment7, jsx as jsx216, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9690
|
+
var TagLabel = styled51.a`
|
|
9826
9691
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9827
9692
|
font-size: var(--wui-typography-label-4-size);
|
|
9828
9693
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -9850,14 +9715,14 @@ var TagLabel = styled52.a`
|
|
|
9850
9715
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9851
9716
|
}
|
|
9852
9717
|
`;
|
|
9853
|
-
var TagDivider =
|
|
9718
|
+
var TagDivider = styled51.div`
|
|
9854
9719
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9855
9720
|
border-left: 1px solid var(--wui-color-border);
|
|
9856
9721
|
display: flex;
|
|
9857
9722
|
height: 14px;
|
|
9858
9723
|
width: 1px;
|
|
9859
9724
|
`;
|
|
9860
|
-
var StyledRemoveButton =
|
|
9725
|
+
var StyledRemoveButton = styled51.button`
|
|
9861
9726
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9862
9727
|
all: unset;
|
|
9863
9728
|
cursor: pointer;
|
|
@@ -9885,7 +9750,7 @@ var StyledRemoveButton = styled52.button`
|
|
|
9885
9750
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9886
9751
|
}
|
|
9887
9752
|
`;
|
|
9888
|
-
var StyledTag =
|
|
9753
|
+
var StyledTag = styled51.div`
|
|
9889
9754
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9890
9755
|
align-items: center;
|
|
9891
9756
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -9906,9 +9771,9 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9906
9771
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
9907
9772
|
);
|
|
9908
9773
|
}
|
|
9909
|
-
return /* @__PURE__ */
|
|
9774
|
+
return /* @__PURE__ */ jsxs32(Fragment7, { children: [
|
|
9910
9775
|
/* @__PURE__ */ jsx216(TagDivider, { $colorScheme: colorScheme }),
|
|
9911
|
-
/* @__PURE__ */
|
|
9776
|
+
/* @__PURE__ */ jsxs32(
|
|
9912
9777
|
StyledRemoveButton,
|
|
9913
9778
|
{
|
|
9914
9779
|
$colorScheme: colorScheme,
|
|
@@ -9928,10 +9793,10 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9928
9793
|
)
|
|
9929
9794
|
] });
|
|
9930
9795
|
};
|
|
9931
|
-
var Tag =
|
|
9796
|
+
var Tag = forwardRef24(
|
|
9932
9797
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
9933
|
-
const labelProps =
|
|
9934
|
-
return /* @__PURE__ */
|
|
9798
|
+
const labelProps = isNotNil20(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
|
|
9799
|
+
return /* @__PURE__ */ jsxs32(
|
|
9935
9800
|
StyledTag,
|
|
9936
9801
|
{
|
|
9937
9802
|
ref,
|
|
@@ -9962,9 +9827,9 @@ var Tag = forwardRef26(
|
|
|
9962
9827
|
Tag.displayName = "Tag";
|
|
9963
9828
|
|
|
9964
9829
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
9965
|
-
import
|
|
9966
|
-
import { isNotNil as
|
|
9967
|
-
import { jsx as jsx217, jsxs as
|
|
9830
|
+
import styled52 from "styled-components";
|
|
9831
|
+
import { isNotNil as isNotNil21 } from "@wistia/type-guards";
|
|
9832
|
+
import { jsx as jsx217, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9968
9833
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
9969
9834
|
if (iconOnly) {
|
|
9970
9835
|
return /* @__PURE__ */ jsx217(
|
|
@@ -10004,7 +9869,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
10004
9869
|
}
|
|
10005
9870
|
return "0 0 144 31.47";
|
|
10006
9871
|
};
|
|
10007
|
-
var WistiaLogoComponent =
|
|
9872
|
+
var WistiaLogoComponent = styled52.svg`
|
|
10008
9873
|
height: ${({ height }) => `${height}px`};
|
|
10009
9874
|
|
|
10010
9875
|
/* ensure it will always fit on mobile */
|
|
@@ -10046,7 +9911,7 @@ var WistiaLogo = ({
|
|
|
10046
9911
|
};
|
|
10047
9912
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
10048
9913
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
10049
|
-
const Logo = /* @__PURE__ */
|
|
9914
|
+
const Logo = /* @__PURE__ */ jsxs33(
|
|
10050
9915
|
WistiaLogoComponent,
|
|
10051
9916
|
{
|
|
10052
9917
|
$hoverColor: hoverColor,
|
|
@@ -10057,7 +9922,7 @@ var WistiaLogo = ({
|
|
|
10057
9922
|
...otherProps,
|
|
10058
9923
|
children: [
|
|
10059
9924
|
/* @__PURE__ */ jsx217("title", { children: title }),
|
|
10060
|
-
|
|
9925
|
+
isNotNil21(description) ? /* @__PURE__ */ jsx217("desc", { children: description }) : null,
|
|
10061
9926
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
10062
9927
|
renderLogotype(logotypeColor, iconOnly)
|
|
10063
9928
|
]
|
|
@@ -10066,6 +9931,199 @@ var WistiaLogo = ({
|
|
|
10066
9931
|
return href !== void 0 ? /* @__PURE__ */ jsx217("a", { href, children: Logo }) : Logo;
|
|
10067
9932
|
};
|
|
10068
9933
|
WistiaLogo.displayName = "WistiaLogo";
|
|
9934
|
+
|
|
9935
|
+
// src/components/Select/Select.tsx
|
|
9936
|
+
import {
|
|
9937
|
+
Root as Root3,
|
|
9938
|
+
Trigger as Trigger3,
|
|
9939
|
+
Portal as Portal2,
|
|
9940
|
+
Content as Content3,
|
|
9941
|
+
ScrollUpButton,
|
|
9942
|
+
Viewport,
|
|
9943
|
+
Value,
|
|
9944
|
+
ScrollDownButton
|
|
9945
|
+
} from "@radix-ui/react-select";
|
|
9946
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
9947
|
+
import styled53 from "styled-components";
|
|
9948
|
+
import { jsx as jsx218, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9949
|
+
var StyledTrigger = styled53(Trigger3)`
|
|
9950
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9951
|
+
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
9952
|
+
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
9953
|
+
--wui-select-color-border: var(--wui-color-border);
|
|
9954
|
+
--wui-select-color-border-focus: var(--wui-color-border-active);
|
|
9955
|
+
--wui-select-color-border-error: var(--wui-color-border-error);
|
|
9956
|
+
--wui-select-color-border-disabled: var(--wui-color-border-disabled);
|
|
9957
|
+
--wui-select-border-radius: var(--wui-border-radius-rounded);
|
|
9958
|
+
--wui-select-multiline-border-radius: var(--wui-border-radius-02);
|
|
9959
|
+
--wui-select-vertical-padding: var(--wui-space-02);
|
|
9960
|
+
--wui-select-horizontal-padding: var(--wui-space-03);
|
|
9961
|
+
--wui-select-placeholder: var(--wui-gray-10);
|
|
9962
|
+
--wui-select-color-text-error: var(--wui-color-text-error);
|
|
9963
|
+
|
|
9964
|
+
padding: var(--wui-select-vertical-padding) var(--wui-select-horizontal-padding);
|
|
9965
|
+
background-color: var(--wui-select-color-bg);
|
|
9966
|
+
border: 1px solid var(--wui-select-color-border);
|
|
9967
|
+
border-radius: var(--wui-select-border-radius);
|
|
9968
|
+
min-width: 200px;
|
|
9969
|
+
text-align: left;
|
|
9970
|
+
display: inline-flex;
|
|
9971
|
+
align-items: center;
|
|
9972
|
+
justify-content: space-between;
|
|
9973
|
+
width: ${({ $fullWidth = false }) => $fullWidth ? "100%" : "auto"};
|
|
9974
|
+
|
|
9975
|
+
&[aria-expanded='true'],
|
|
9976
|
+
&:focus {
|
|
9977
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
9978
|
+
}
|
|
9979
|
+
|
|
9980
|
+
&[aria-invalid='true'] {
|
|
9981
|
+
outline: 2px solid var(--wui-select-color-border-error);
|
|
9982
|
+
color: var(--wui-select-color-text-error);
|
|
9983
|
+
}
|
|
9984
|
+
|
|
9985
|
+
&:disabled {
|
|
9986
|
+
border-color: var(--wui-color-bg-surface-disabled);
|
|
9987
|
+
background-color: var(--wui-color-bg-surface-disabled);
|
|
9988
|
+
}
|
|
9989
|
+
`;
|
|
9990
|
+
var StyledContent2 = styled53(Content3)`
|
|
9991
|
+
--wui-select-content-border: var(--wui-color-border);
|
|
9992
|
+
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
9993
|
+
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
9994
|
+
--wui-select-option-padding: var(--wui-space-02);
|
|
9995
|
+
--wui-select-option-inner-gap: var(--wui-space-03);
|
|
9996
|
+
--wui-select-option-bg-hover: var(--wui-color-bg-surface-hover);
|
|
9997
|
+
|
|
9998
|
+
overflow: hidden;
|
|
9999
|
+
transform: translateY(8px);
|
|
10000
|
+
background-color: var(--wui-select-content-bg);
|
|
10001
|
+
border: 1px solid var(--wui-select-content-border);
|
|
10002
|
+
border-radius: var(--wui-select-content-border-radius);
|
|
10003
|
+
padding: var(--wui-select-option-padding);
|
|
10004
|
+
min-width: 200px;
|
|
10005
|
+
`;
|
|
10006
|
+
var Select = forwardRef25(
|
|
10007
|
+
({
|
|
10008
|
+
colorScheme = "inherit",
|
|
10009
|
+
children,
|
|
10010
|
+
onChange = () => null,
|
|
10011
|
+
placeholder = "Select...",
|
|
10012
|
+
fullWidth = false,
|
|
10013
|
+
...props
|
|
10014
|
+
}, forwardedRef) => {
|
|
10015
|
+
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
10016
|
+
return /* @__PURE__ */ jsxs34(
|
|
10017
|
+
Root3,
|
|
10018
|
+
{
|
|
10019
|
+
...props,
|
|
10020
|
+
onValueChange: onChange,
|
|
10021
|
+
children: [
|
|
10022
|
+
/* @__PURE__ */ jsxs34(
|
|
10023
|
+
StyledTrigger,
|
|
10024
|
+
{
|
|
10025
|
+
ref: forwardedRef,
|
|
10026
|
+
$colorScheme: colorScheme,
|
|
10027
|
+
$fullWidth: responsiveFullWidth,
|
|
10028
|
+
...props,
|
|
10029
|
+
children: [
|
|
10030
|
+
/* @__PURE__ */ jsx218(Value, { placeholder }),
|
|
10031
|
+
/* @__PURE__ */ jsx218(
|
|
10032
|
+
Icon,
|
|
10033
|
+
{
|
|
10034
|
+
size: "md",
|
|
10035
|
+
type: "caret-down"
|
|
10036
|
+
}
|
|
10037
|
+
)
|
|
10038
|
+
]
|
|
10039
|
+
}
|
|
10040
|
+
),
|
|
10041
|
+
/* @__PURE__ */ jsx218(Portal2, { children: /* @__PURE__ */ jsxs34(StyledContent2, { position: "popper", children: [
|
|
10042
|
+
/* @__PURE__ */ jsx218(ScrollUpButton, { children: /* @__PURE__ */ jsx218(Icon, { type: "caret-up" }) }),
|
|
10043
|
+
/* @__PURE__ */ jsx218(Viewport, { children }),
|
|
10044
|
+
/* @__PURE__ */ jsx218(ScrollDownButton, { children: /* @__PURE__ */ jsx218(Icon, { type: "caret-down" }) })
|
|
10045
|
+
] }) })
|
|
10046
|
+
]
|
|
10047
|
+
}
|
|
10048
|
+
);
|
|
10049
|
+
}
|
|
10050
|
+
);
|
|
10051
|
+
Select.displayName = "Select";
|
|
10052
|
+
|
|
10053
|
+
// src/components/Select/SelectOption.tsx
|
|
10054
|
+
import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
10055
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
10056
|
+
import styled54 from "styled-components";
|
|
10057
|
+
import { jsx as jsx219, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10058
|
+
var StyledItem = styled54(Item)`
|
|
10059
|
+
${variantStyleMap2.body3};
|
|
10060
|
+
display: flex;
|
|
10061
|
+
padding: var(--wui-select-option-padding);
|
|
10062
|
+
gap: var(--wui-select-option-inner-gap);
|
|
10063
|
+
font-size: var(--font-size);
|
|
10064
|
+
font-weight: var(--font-weight);
|
|
10065
|
+
border-radius: var(--wui-border-radius-01);
|
|
10066
|
+
|
|
10067
|
+
&:hover,
|
|
10068
|
+
&:focus-visible {
|
|
10069
|
+
background-color: var(--wui-select-option-bg-hover);
|
|
10070
|
+
outline: none;
|
|
10071
|
+
}
|
|
10072
|
+
|
|
10073
|
+
&[aria-disabled='true'] {
|
|
10074
|
+
color: var(--wui-color-text-disabled);
|
|
10075
|
+
}
|
|
10076
|
+
|
|
10077
|
+
&[aria-disabled='true']:hover {
|
|
10078
|
+
background-color: transparent;
|
|
10079
|
+
}
|
|
10080
|
+
`;
|
|
10081
|
+
var StyledIconContainer = styled54.span`
|
|
10082
|
+
width: 12px;
|
|
10083
|
+
`;
|
|
10084
|
+
var SelectOption = forwardRef26(
|
|
10085
|
+
({ children, ...props }, forwardedRef) => {
|
|
10086
|
+
return /* @__PURE__ */ jsxs35(
|
|
10087
|
+
StyledItem,
|
|
10088
|
+
{
|
|
10089
|
+
...props,
|
|
10090
|
+
ref: forwardedRef,
|
|
10091
|
+
children: [
|
|
10092
|
+
/* @__PURE__ */ jsx219(StyledIconContainer, { children: /* @__PURE__ */ jsx219(ItemIndicator, { children: /* @__PURE__ */ jsx219(
|
|
10093
|
+
Icon,
|
|
10094
|
+
{
|
|
10095
|
+
size: "sm",
|
|
10096
|
+
type: "checkmark"
|
|
10097
|
+
}
|
|
10098
|
+
) }) }),
|
|
10099
|
+
/* @__PURE__ */ jsx219(ItemText, { children })
|
|
10100
|
+
]
|
|
10101
|
+
}
|
|
10102
|
+
);
|
|
10103
|
+
}
|
|
10104
|
+
);
|
|
10105
|
+
SelectOption.displayName = "Option";
|
|
10106
|
+
|
|
10107
|
+
// src/components/Select/SelectOptionGroup.tsx
|
|
10108
|
+
import { Group, Label as Label2 } from "@radix-ui/react-select";
|
|
10109
|
+
import styled55 from "styled-components";
|
|
10110
|
+
import { jsx as jsx220, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10111
|
+
var StyledLabel4 = styled55(Label2)`
|
|
10112
|
+
padding: var(--wui-select-option-padding);
|
|
10113
|
+
`;
|
|
10114
|
+
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
10115
|
+
return /* @__PURE__ */ jsxs36(Group, { ...props, children: [
|
|
10116
|
+
/* @__PURE__ */ jsx220(StyledLabel4, { children: /* @__PURE__ */ jsx220(
|
|
10117
|
+
Text,
|
|
10118
|
+
{
|
|
10119
|
+
prominence: "secondary",
|
|
10120
|
+
variant: "body3",
|
|
10121
|
+
children: label
|
|
10122
|
+
}
|
|
10123
|
+
) }),
|
|
10124
|
+
children
|
|
10125
|
+
] });
|
|
10126
|
+
};
|
|
10069
10127
|
export {
|
|
10070
10128
|
ActionButton,
|
|
10071
10129
|
Avatar,
|
|
@@ -10079,6 +10137,9 @@ export {
|
|
|
10079
10137
|
Checkbox,
|
|
10080
10138
|
CheckboxGroup,
|
|
10081
10139
|
CheckboxMenuItem,
|
|
10140
|
+
Collapsible,
|
|
10141
|
+
CollapsibleContent,
|
|
10142
|
+
CollapsibleTrigger,
|
|
10082
10143
|
ColorSchemeWrapper,
|
|
10083
10144
|
DataCard,
|
|
10084
10145
|
DataCardTrend,
|