@wistia/ui 0.9.5 → 0.9.6-beta.0bdb4e44.c8b94c3
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 +653 -760
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +26 -66
- package/dist/index.d.ts +26 -66
- package/dist/index.mjs +575 -684
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.9.
|
|
3
|
+
* @license @wistia/ui v0.9.6-beta.0bdb4e44.c8b94c3
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8076,8 +8076,8 @@ var Center = forwardRef6(
|
|
|
8076
8076
|
Center.displayName = "Center";
|
|
8077
8077
|
|
|
8078
8078
|
// src/components/Checkbox/Checkbox.tsx
|
|
8079
|
-
import { forwardRef as
|
|
8080
|
-
import
|
|
8079
|
+
import { forwardRef as forwardRef9, useId } from "react";
|
|
8080
|
+
import styled23, { css as css22 } from "styled-components";
|
|
8081
8081
|
import { isNonEmptyString as isNonEmptyString2 } from "@wistia/type-guards";
|
|
8082
8082
|
|
|
8083
8083
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
@@ -8196,9 +8196,230 @@ var FormControlLabel = ({
|
|
|
8196
8196
|
};
|
|
8197
8197
|
FormControlLabel.displayName = "FormControlLabel";
|
|
8198
8198
|
|
|
8199
|
+
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8200
|
+
import { createContext as createContext3, useMemo as useMemo4, useContext as useContext3 } from "react";
|
|
8201
|
+
|
|
8202
|
+
// src/components/FormGroup/FormGroup.tsx
|
|
8203
|
+
import styled22 from "styled-components";
|
|
8204
|
+
import { useRef as useRef6 } from "react";
|
|
8205
|
+
|
|
8206
|
+
// src/components/Stack/Stack.tsx
|
|
8207
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
8208
|
+
import styled20 from "styled-components";
|
|
8209
|
+
import { jsx as jsx208 } from "react/jsx-runtime";
|
|
8210
|
+
var DEFAULT_ELEMENT2 = "div";
|
|
8211
|
+
var StyledStack = styled20.div`
|
|
8212
|
+
display: flex;
|
|
8213
|
+
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
8214
|
+
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
8215
|
+
align-items: ${({ $alignItems }) => $alignItems};
|
|
8216
|
+
`;
|
|
8217
|
+
var StackComponent = forwardRef7(
|
|
8218
|
+
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
8219
|
+
const responsiveGap = useResponsiveProp(gap);
|
|
8220
|
+
const responsiveDirection = useResponsiveProp(direction);
|
|
8221
|
+
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
8222
|
+
return /* @__PURE__ */ jsx208(
|
|
8223
|
+
StyledStack,
|
|
8224
|
+
{
|
|
8225
|
+
ref,
|
|
8226
|
+
$alignItems: responsiveAlignItems,
|
|
8227
|
+
$direction: responsiveDirection,
|
|
8228
|
+
$gap: responsiveGap,
|
|
8229
|
+
as: renderAs ?? DEFAULT_ELEMENT2,
|
|
8230
|
+
...props
|
|
8231
|
+
}
|
|
8232
|
+
);
|
|
8233
|
+
}
|
|
8234
|
+
);
|
|
8235
|
+
StackComponent.displayName = "Stack";
|
|
8236
|
+
var Stack = makePolymorphic(StackComponent);
|
|
8237
|
+
|
|
8238
|
+
// src/components/Heading/Heading.tsx
|
|
8239
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
8240
|
+
import styled21, { css as css21 } from "styled-components";
|
|
8241
|
+
import { isNotNil as isNotNil13 } from "@wistia/type-guards";
|
|
8242
|
+
import { jsx as jsx209 } from "react/jsx-runtime";
|
|
8243
|
+
var heroStyle = css21`
|
|
8244
|
+
--font-family: var(--wui-typography-heading-hero-family);
|
|
8245
|
+
--font-size: var(--wui-typography-heading-hero-size);
|
|
8246
|
+
--font-weight: var(--wui-typography-heading-hero-weight);
|
|
8247
|
+
--line-height: var(--wui-typography-heading-hero-line-height);
|
|
8248
|
+
`;
|
|
8249
|
+
var heading1TextStyle = css21`
|
|
8250
|
+
--font-family: var(--wui-typography-heading-1-family);
|
|
8251
|
+
--font-size: var(--wui-typography-heading-1-size);
|
|
8252
|
+
--font-weight: var(--wui-typography-heading-1-weight);
|
|
8253
|
+
--line-height: var(--wui-typography-heading-1-line-height);
|
|
8254
|
+
`;
|
|
8255
|
+
var heading2TextStyle = css21`
|
|
8256
|
+
--font-family: var(--wui-typography-heading-2-family);
|
|
8257
|
+
--font-size: var(--wui-typography-heading-2-size);
|
|
8258
|
+
--font-weight: var(--wui-typography-heading-2-weight);
|
|
8259
|
+
--line-height: var(--wui-typography-heading-2-line-height);
|
|
8260
|
+
`;
|
|
8261
|
+
var heading3TextStyle = css21`
|
|
8262
|
+
--font-family: var(--wui-typography-heading-3-family);
|
|
8263
|
+
--font-size: var(--wui-typography-heading-3-size);
|
|
8264
|
+
--font-weight: var(--wui-typography-heading-3-weight);
|
|
8265
|
+
--line-height: var(--wui-typography-heading-3-line-height);
|
|
8266
|
+
`;
|
|
8267
|
+
var heading4TextStyle = css21`
|
|
8268
|
+
--font-family: var(--wui-typography-heading-4-family);
|
|
8269
|
+
--font-size: var(--wui-typography-heading-4-size);
|
|
8270
|
+
--font-weight: var(--wui-typography-heading-4-weight);
|
|
8271
|
+
--line-height: var(--wui-typography-heading-4-line-height);
|
|
8272
|
+
`;
|
|
8273
|
+
var heading5TextStyle = css21`
|
|
8274
|
+
--font-family: var(--wui-typography-heading-5-family);
|
|
8275
|
+
--font-size: var(--wui-typography-heading-5-size);
|
|
8276
|
+
--font-weight: var(--wui-typography-heading-5-weight);
|
|
8277
|
+
--line-height: var(--wui-typography-heading-5-line-height);
|
|
8278
|
+
`;
|
|
8279
|
+
var heading6TextStyle = css21`
|
|
8280
|
+
--font-family: var(--wui-typography-heading-6-family);
|
|
8281
|
+
--font-size: var(--wui-typography-heading-6-size);
|
|
8282
|
+
--font-weight: var(--wui-typography-heading-6-weight);
|
|
8283
|
+
--line-height: var(--wui-typography-heading-6-line-height);
|
|
8284
|
+
`;
|
|
8285
|
+
var variantStyleMap = {
|
|
8286
|
+
hero: heroStyle,
|
|
8287
|
+
heading1: heading1TextStyle,
|
|
8288
|
+
heading2: heading2TextStyle,
|
|
8289
|
+
heading3: heading3TextStyle,
|
|
8290
|
+
heading4: heading4TextStyle,
|
|
8291
|
+
heading5: heading5TextStyle,
|
|
8292
|
+
heading6: heading6TextStyle
|
|
8293
|
+
};
|
|
8294
|
+
var DEFAULT_ELEMENT3 = "h1";
|
|
8295
|
+
var StyledHeading = styled21.div`
|
|
8296
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8297
|
+
font-family: var(--font-family);
|
|
8298
|
+
font-size: var(--font-size);
|
|
8299
|
+
font-weight: var(--font-weight);
|
|
8300
|
+
line-height: var(--line-height);
|
|
8301
|
+
color: var(--wui-color-text);
|
|
8302
|
+
${({ $variant }) => variantStyleMap[$variant]}
|
|
8303
|
+
${({ $truncate }) => {
|
|
8304
|
+
if (isNotNil13($truncate)) {
|
|
8305
|
+
return css21`
|
|
8306
|
+
${ellipsisStyle};
|
|
8307
|
+
${lineClampCss($truncate)};
|
|
8308
|
+
`;
|
|
8309
|
+
}
|
|
8310
|
+
return void 0;
|
|
8311
|
+
}}
|
|
8312
|
+
${({ $inline }) => $inline && css21`
|
|
8313
|
+
display: inline-block;
|
|
8314
|
+
`}
|
|
8315
|
+
${({ $disabled }) => $disabled && css21`
|
|
8316
|
+
color: var(--wui-color-text-disabled);
|
|
8317
|
+
`}
|
|
8318
|
+
${({ $preventUserSelect }) => $preventUserSelect && css21`
|
|
8319
|
+
user-select: none;
|
|
8320
|
+
`}
|
|
8321
|
+
${({ $align }) => css21`
|
|
8322
|
+
text-align: ${$align};
|
|
8323
|
+
`}
|
|
8324
|
+
margin: 0;
|
|
8325
|
+
`;
|
|
8326
|
+
var variantElementMap = {
|
|
8327
|
+
hero: DEFAULT_ELEMENT3,
|
|
8328
|
+
heading1: DEFAULT_ELEMENT3,
|
|
8329
|
+
heading2: "h2",
|
|
8330
|
+
heading3: "h3",
|
|
8331
|
+
heading4: "h4",
|
|
8332
|
+
heading5: "h5",
|
|
8333
|
+
heading6: "h6"
|
|
8334
|
+
};
|
|
8335
|
+
var HeadingComponent = forwardRef8(
|
|
8336
|
+
({
|
|
8337
|
+
align = "left",
|
|
8338
|
+
colorScheme = "inherit",
|
|
8339
|
+
disabled = false,
|
|
8340
|
+
inline = false,
|
|
8341
|
+
preventUserSelect = false,
|
|
8342
|
+
truncate,
|
|
8343
|
+
variant = "heading1",
|
|
8344
|
+
renderAs,
|
|
8345
|
+
...props
|
|
8346
|
+
}, ref) => /* @__PURE__ */ jsx209(
|
|
8347
|
+
StyledHeading,
|
|
8348
|
+
{
|
|
8349
|
+
ref,
|
|
8350
|
+
$align: align,
|
|
8351
|
+
$colorScheme: colorScheme,
|
|
8352
|
+
$disabled: disabled,
|
|
8353
|
+
$inline: inline,
|
|
8354
|
+
$preventUserSelect: preventUserSelect,
|
|
8355
|
+
$truncate: truncate,
|
|
8356
|
+
$variant: variant,
|
|
8357
|
+
as: renderAs ?? variantElementMap[variant],
|
|
8358
|
+
...props
|
|
8359
|
+
}
|
|
8360
|
+
)
|
|
8361
|
+
);
|
|
8362
|
+
HeadingComponent.displayName = "Heading";
|
|
8363
|
+
var Heading = makePolymorphic(HeadingComponent);
|
|
8364
|
+
|
|
8365
|
+
// src/components/FormGroup/FormGroup.tsx
|
|
8366
|
+
import { jsx as jsx210, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8367
|
+
var StyledFieldset = styled22.fieldset`
|
|
8368
|
+
border: 0;
|
|
8369
|
+
`;
|
|
8370
|
+
var StyledLegend = styled22.legend`
|
|
8371
|
+
margin-bottom: var(--space-01);
|
|
8372
|
+
`;
|
|
8373
|
+
var FormGroup = ({ children, label, ...props }) => {
|
|
8374
|
+
const ref = useRef6();
|
|
8375
|
+
return /* @__PURE__ */ jsxs15(
|
|
8376
|
+
Stack,
|
|
8377
|
+
{
|
|
8378
|
+
...props,
|
|
8379
|
+
ref,
|
|
8380
|
+
renderAs: StyledFieldset,
|
|
8381
|
+
children: [
|
|
8382
|
+
/* @__PURE__ */ jsx210(
|
|
8383
|
+
Heading,
|
|
8384
|
+
{
|
|
8385
|
+
renderAs: StyledLegend,
|
|
8386
|
+
variant: "heading5",
|
|
8387
|
+
children: label
|
|
8388
|
+
}
|
|
8389
|
+
),
|
|
8390
|
+
children
|
|
8391
|
+
]
|
|
8392
|
+
}
|
|
8393
|
+
);
|
|
8394
|
+
};
|
|
8395
|
+
FormGroup.displayName = "FormGroup";
|
|
8396
|
+
|
|
8397
|
+
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8398
|
+
import { jsx as jsx211 } from "react/jsx-runtime";
|
|
8399
|
+
var CheckboxGroupContext = createContext3(null);
|
|
8400
|
+
var useCheckboxGroup = () => {
|
|
8401
|
+
return useContext3(CheckboxGroupContext);
|
|
8402
|
+
};
|
|
8403
|
+
var CheckboxGroup = ({
|
|
8404
|
+
children,
|
|
8405
|
+
name,
|
|
8406
|
+
onChange,
|
|
8407
|
+
value,
|
|
8408
|
+
...props
|
|
8409
|
+
}) => {
|
|
8410
|
+
const context = useMemo4(() => {
|
|
8411
|
+
return {
|
|
8412
|
+
name,
|
|
8413
|
+
onChange
|
|
8414
|
+
};
|
|
8415
|
+
}, [name, onChange]);
|
|
8416
|
+
return /* @__PURE__ */ jsx211(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx211(FormGroup, { ...props, children }) });
|
|
8417
|
+
};
|
|
8418
|
+
CheckboxGroup.displayName = "CheckboxGroup";
|
|
8419
|
+
|
|
8199
8420
|
// src/components/Checkbox/Checkbox.tsx
|
|
8200
|
-
import { jsx as
|
|
8201
|
-
var CheckIcon = () => /* @__PURE__ */
|
|
8421
|
+
import { jsx as jsx212, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
8422
|
+
var CheckIcon = () => /* @__PURE__ */ jsx212(
|
|
8202
8423
|
"svg",
|
|
8203
8424
|
{
|
|
8204
8425
|
fill: "inherit",
|
|
@@ -8206,7 +8427,7 @@ var CheckIcon = () => /* @__PURE__ */ jsx208(
|
|
|
8206
8427
|
viewBox: "0 0 10 8",
|
|
8207
8428
|
width: "10",
|
|
8208
8429
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8209
|
-
children: /* @__PURE__ */
|
|
8430
|
+
children: /* @__PURE__ */ jsx212(
|
|
8210
8431
|
"path",
|
|
8211
8432
|
{
|
|
8212
8433
|
d: "M3.47281 7.19303L0.377565 4.07999C0.191609 3.89297 0.191609 3.58973 0.377565 3.40268L1.05098 2.72537C1.23694 2.53833 1.53847 2.53833 1.72442 2.72537L3.80953 4.82245L8.27558 0.330729C8.46154 0.143704 8.76306 0.143704 8.94902 0.330729L9.62244 1.00804C9.8084 1.19506 9.8084 1.49831 9.62244 1.68535L4.14624 7.19305C3.96027 7.38008 3.65876 7.38008 3.47281 7.19303Z",
|
|
@@ -8215,7 +8436,7 @@ var CheckIcon = () => /* @__PURE__ */ jsx208(
|
|
|
8215
8436
|
)
|
|
8216
8437
|
}
|
|
8217
8438
|
);
|
|
8218
|
-
var sizeSmall =
|
|
8439
|
+
var sizeSmall = css22`
|
|
8219
8440
|
width: 14px;
|
|
8220
8441
|
height: 14px;
|
|
8221
8442
|
min-width: 14px;
|
|
@@ -8226,7 +8447,7 @@ var sizeSmall = css21`
|
|
|
8226
8447
|
height: 7px;
|
|
8227
8448
|
}
|
|
8228
8449
|
`;
|
|
8229
|
-
var sizeMedium =
|
|
8450
|
+
var sizeMedium = css22`
|
|
8230
8451
|
width: 16px;
|
|
8231
8452
|
height: 16px;
|
|
8232
8453
|
min-width: 16px;
|
|
@@ -8237,7 +8458,7 @@ var sizeMedium = css21`
|
|
|
8237
8458
|
height: 9px;
|
|
8238
8459
|
}
|
|
8239
8460
|
`;
|
|
8240
|
-
var sizeLarge =
|
|
8461
|
+
var sizeLarge = css22`
|
|
8241
8462
|
width: 20px;
|
|
8242
8463
|
height: 20px;
|
|
8243
8464
|
min-width: 20px;
|
|
@@ -8253,14 +8474,14 @@ var getSizeCss = (size) => {
|
|
|
8253
8474
|
if (size === "lg") return sizeLarge;
|
|
8254
8475
|
return sizeMedium;
|
|
8255
8476
|
};
|
|
8256
|
-
var StyledCheckboxWrapper =
|
|
8477
|
+
var StyledCheckboxWrapper = styled23.div`
|
|
8257
8478
|
display: flex;
|
|
8258
8479
|
margin: 0;
|
|
8259
8480
|
|
|
8260
8481
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
8261
8482
|
user-select: none;
|
|
8262
8483
|
`;
|
|
8263
|
-
var StyledCheckboxInput =
|
|
8484
|
+
var StyledCheckboxInput = styled23.div`
|
|
8264
8485
|
${({ $size }) => getSizeCss($size)}
|
|
8265
8486
|
line-height: 0;
|
|
8266
8487
|
margin: 0;
|
|
@@ -8282,7 +8503,7 @@ var StyledCheckboxInput = styled20.div`
|
|
|
8282
8503
|
}
|
|
8283
8504
|
}
|
|
8284
8505
|
`;
|
|
8285
|
-
var StyledHiddenCheckboxInput =
|
|
8506
|
+
var StyledHiddenCheckboxInput = styled23.input`
|
|
8286
8507
|
${visuallyHiddenStyle}
|
|
8287
8508
|
|
|
8288
8509
|
/* toggles display of faux-input background-color */
|
|
@@ -8296,7 +8517,7 @@ var StyledHiddenCheckboxInput = styled20.input`
|
|
|
8296
8517
|
display: block;
|
|
8297
8518
|
}
|
|
8298
8519
|
`;
|
|
8299
|
-
var Checkbox =
|
|
8520
|
+
var Checkbox = forwardRef9(
|
|
8300
8521
|
({
|
|
8301
8522
|
checked,
|
|
8302
8523
|
disabled = false,
|
|
@@ -8313,8 +8534,13 @@ var Checkbox = forwardRef7(
|
|
|
8313
8534
|
}, ref) => {
|
|
8314
8535
|
const generatedId = useId();
|
|
8315
8536
|
const computedId = isNonEmptyString2(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8316
|
-
|
|
8317
|
-
|
|
8537
|
+
const checkboxGroupContext = useCheckboxGroup();
|
|
8538
|
+
const contextName = checkboxGroupContext?.name;
|
|
8539
|
+
const contextOnChange = checkboxGroupContext?.onChange;
|
|
8540
|
+
const checkboxName = name ?? contextName;
|
|
8541
|
+
const handleOnChange = onChange ?? contextOnChange;
|
|
8542
|
+
return /* @__PURE__ */ jsxs16(StyledCheckboxWrapper, { disabled, children: [
|
|
8543
|
+
/* @__PURE__ */ jsx212(
|
|
8318
8544
|
StyledHiddenCheckboxInput,
|
|
8319
8545
|
{
|
|
8320
8546
|
...props,
|
|
@@ -8322,23 +8548,23 @@ var Checkbox = forwardRef7(
|
|
|
8322
8548
|
checked,
|
|
8323
8549
|
disabled,
|
|
8324
8550
|
id: computedId,
|
|
8325
|
-
name,
|
|
8326
|
-
onChange,
|
|
8551
|
+
name: checkboxName,
|
|
8552
|
+
onChange: handleOnChange,
|
|
8327
8553
|
required,
|
|
8328
8554
|
type: "checkbox",
|
|
8329
8555
|
value
|
|
8330
8556
|
}
|
|
8331
8557
|
),
|
|
8332
|
-
/* @__PURE__ */
|
|
8558
|
+
/* @__PURE__ */ jsx212(
|
|
8333
8559
|
FormControlLabel,
|
|
8334
8560
|
{
|
|
8335
|
-
controlSlot: /* @__PURE__ */
|
|
8561
|
+
controlSlot: /* @__PURE__ */ jsx212(
|
|
8336
8562
|
StyledCheckboxInput,
|
|
8337
8563
|
{
|
|
8338
8564
|
$disabled: disabled,
|
|
8339
8565
|
$size: size,
|
|
8340
8566
|
"data-wui-faux-input": "true",
|
|
8341
|
-
children: /* @__PURE__ */
|
|
8567
|
+
children: /* @__PURE__ */ jsx212(CheckIcon, {})
|
|
8342
8568
|
}
|
|
8343
8569
|
),
|
|
8344
8570
|
description,
|
|
@@ -8398,10 +8624,10 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
8398
8624
|
|
|
8399
8625
|
// src/components/Collapsible/Collapsible.tsx
|
|
8400
8626
|
import { Root as CollapsibleRoot } from "@radix-ui/react-collapsible";
|
|
8401
|
-
import { isNotNil as
|
|
8402
|
-
import
|
|
8403
|
-
import { jsx as
|
|
8404
|
-
var StyledRoot =
|
|
8627
|
+
import { isNotNil as isNotNil14 } from "@wistia/type-guards";
|
|
8628
|
+
import styled24 from "styled-components";
|
|
8629
|
+
import { jsx as jsx213 } from "react/jsx-runtime";
|
|
8630
|
+
var StyledRoot = styled24(CollapsibleRoot)`
|
|
8405
8631
|
&[data-state='closed'] [data-wui-collapsible-content] {
|
|
8406
8632
|
display: -webkit-box;
|
|
8407
8633
|
-webkit-box-orient: vertical;
|
|
@@ -8415,181 +8641,52 @@ var Collapsible = ({
|
|
|
8415
8641
|
onOpenChange
|
|
8416
8642
|
}) => {
|
|
8417
8643
|
const controlProps = {
|
|
8418
|
-
...
|
|
8644
|
+
...isNotNil14(onOpenChange) && isNotNil14(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8419
8645
|
};
|
|
8420
|
-
return /* @__PURE__ */
|
|
8646
|
+
return /* @__PURE__ */ jsx213(StyledRoot, { ...controlProps, children });
|
|
8421
8647
|
};
|
|
8422
8648
|
Collapsible.displayName = "Collapsible";
|
|
8423
8649
|
|
|
8424
8650
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8425
8651
|
import { Children as Children3 } from "react";
|
|
8426
8652
|
import { Trigger } from "@radix-ui/react-collapsible";
|
|
8427
|
-
import { jsx as
|
|
8653
|
+
import { jsx as jsx214 } from "react/jsx-runtime";
|
|
8428
8654
|
var CollapsibleTrigger = ({ children }) => {
|
|
8429
8655
|
Children3.only(children);
|
|
8430
|
-
return /* @__PURE__ */
|
|
8656
|
+
return /* @__PURE__ */ jsx214(Trigger, { asChild: true, children });
|
|
8431
8657
|
};
|
|
8432
8658
|
|
|
8433
8659
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
8434
|
-
import
|
|
8660
|
+
import styled25 from "styled-components";
|
|
8435
8661
|
import { Content } from "@radix-ui/react-collapsible";
|
|
8436
8662
|
import { isNotUndefined as isNotUndefined6 } from "@wistia/type-guards";
|
|
8437
|
-
import { Fragment as Fragment4, jsx as
|
|
8438
|
-
var ClampedContent =
|
|
8663
|
+
import { Fragment as Fragment4, jsx as jsx215, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
8664
|
+
var ClampedContent = styled25.div`
|
|
8439
8665
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
8440
8666
|
`;
|
|
8441
8667
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
8442
|
-
if (isNotUndefined6(clamp)) {
|
|
8443
|
-
return /* @__PURE__ */
|
|
8444
|
-
ClampedContent,
|
|
8445
|
-
{
|
|
8446
|
-
$clamp: clamp,
|
|
8447
|
-
"data-wui-collapsible-content": "true",
|
|
8448
|
-
children
|
|
8449
|
-
}
|
|
8450
|
-
);
|
|
8451
|
-
}
|
|
8452
|
-
return /* @__PURE__ */
|
|
8453
|
-
children,
|
|
8454
|
-
" "
|
|
8455
|
-
] }) });
|
|
8456
|
-
};
|
|
8457
|
-
|
|
8458
|
-
// src/components/DataCards/DataCard.tsx
|
|
8459
|
-
import { useRef as useRef6 } from "react";
|
|
8460
|
-
import styled24, { keyframes } from "styled-components";
|
|
8461
|
-
import { isNotNil as isNotNil15, isNotNull } from "@wistia/type-guards";
|
|
8462
|
-
|
|
8463
|
-
// src/components/Heading/Heading.tsx
|
|
8464
|
-
import { forwardRef as forwardRef8 } from "react";
|
|
8465
|
-
import styled23, { css as css22 } from "styled-components";
|
|
8466
|
-
import { isNotNil as isNotNil14 } from "@wistia/type-guards";
|
|
8467
|
-
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
8468
|
-
var heroStyle = css22`
|
|
8469
|
-
--font-family: var(--wui-typography-heading-hero-family);
|
|
8470
|
-
--font-size: var(--wui-typography-heading-hero-size);
|
|
8471
|
-
--font-weight: var(--wui-typography-heading-hero-weight);
|
|
8472
|
-
--line-height: var(--wui-typography-heading-hero-line-height);
|
|
8473
|
-
`;
|
|
8474
|
-
var heading1TextStyle = css22`
|
|
8475
|
-
--font-family: var(--wui-typography-heading-1-family);
|
|
8476
|
-
--font-size: var(--wui-typography-heading-1-size);
|
|
8477
|
-
--font-weight: var(--wui-typography-heading-1-weight);
|
|
8478
|
-
--line-height: var(--wui-typography-heading-1-line-height);
|
|
8479
|
-
`;
|
|
8480
|
-
var heading2TextStyle = css22`
|
|
8481
|
-
--font-family: var(--wui-typography-heading-2-family);
|
|
8482
|
-
--font-size: var(--wui-typography-heading-2-size);
|
|
8483
|
-
--font-weight: var(--wui-typography-heading-2-weight);
|
|
8484
|
-
--line-height: var(--wui-typography-heading-2-line-height);
|
|
8485
|
-
`;
|
|
8486
|
-
var heading3TextStyle = css22`
|
|
8487
|
-
--font-family: var(--wui-typography-heading-3-family);
|
|
8488
|
-
--font-size: var(--wui-typography-heading-3-size);
|
|
8489
|
-
--font-weight: var(--wui-typography-heading-3-weight);
|
|
8490
|
-
--line-height: var(--wui-typography-heading-3-line-height);
|
|
8491
|
-
`;
|
|
8492
|
-
var heading4TextStyle = css22`
|
|
8493
|
-
--font-family: var(--wui-typography-heading-4-family);
|
|
8494
|
-
--font-size: var(--wui-typography-heading-4-size);
|
|
8495
|
-
--font-weight: var(--wui-typography-heading-4-weight);
|
|
8496
|
-
--line-height: var(--wui-typography-heading-4-line-height);
|
|
8497
|
-
`;
|
|
8498
|
-
var heading5TextStyle = css22`
|
|
8499
|
-
--font-family: var(--wui-typography-heading-5-family);
|
|
8500
|
-
--font-size: var(--wui-typography-heading-5-size);
|
|
8501
|
-
--font-weight: var(--wui-typography-heading-5-weight);
|
|
8502
|
-
--line-height: var(--wui-typography-heading-5-line-height);
|
|
8503
|
-
`;
|
|
8504
|
-
var heading6TextStyle = css22`
|
|
8505
|
-
--font-family: var(--wui-typography-heading-6-family);
|
|
8506
|
-
--font-size: var(--wui-typography-heading-6-size);
|
|
8507
|
-
--font-weight: var(--wui-typography-heading-6-weight);
|
|
8508
|
-
--line-height: var(--wui-typography-heading-6-line-height);
|
|
8509
|
-
`;
|
|
8510
|
-
var variantStyleMap = {
|
|
8511
|
-
hero: heroStyle,
|
|
8512
|
-
heading1: heading1TextStyle,
|
|
8513
|
-
heading2: heading2TextStyle,
|
|
8514
|
-
heading3: heading3TextStyle,
|
|
8515
|
-
heading4: heading4TextStyle,
|
|
8516
|
-
heading5: heading5TextStyle,
|
|
8517
|
-
heading6: heading6TextStyle
|
|
8518
|
-
};
|
|
8519
|
-
var DEFAULT_ELEMENT2 = "h1";
|
|
8520
|
-
var StyledHeading = styled23.div`
|
|
8521
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8522
|
-
font-family: var(--font-family);
|
|
8523
|
-
font-size: var(--font-size);
|
|
8524
|
-
font-weight: var(--font-weight);
|
|
8525
|
-
line-height: var(--line-height);
|
|
8526
|
-
color: var(--wui-color-text);
|
|
8527
|
-
${({ $variant }) => variantStyleMap[$variant]}
|
|
8528
|
-
${({ $truncate }) => {
|
|
8529
|
-
if (isNotNil14($truncate)) {
|
|
8530
|
-
return css22`
|
|
8531
|
-
${ellipsisStyle};
|
|
8532
|
-
${lineClampCss($truncate)};
|
|
8533
|
-
`;
|
|
8534
|
-
}
|
|
8535
|
-
return void 0;
|
|
8536
|
-
}}
|
|
8537
|
-
${({ $inline }) => $inline && css22`
|
|
8538
|
-
display: inline-block;
|
|
8539
|
-
`}
|
|
8540
|
-
${({ $disabled }) => $disabled && css22`
|
|
8541
|
-
color: var(--wui-color-text-disabled);
|
|
8542
|
-
`}
|
|
8543
|
-
${({ $preventUserSelect }) => $preventUserSelect && css22`
|
|
8544
|
-
user-select: none;
|
|
8545
|
-
`}
|
|
8546
|
-
${({ $align }) => css22`
|
|
8547
|
-
text-align: ${$align};
|
|
8548
|
-
`}
|
|
8549
|
-
margin: 0;
|
|
8550
|
-
`;
|
|
8551
|
-
var variantElementMap = {
|
|
8552
|
-
hero: DEFAULT_ELEMENT2,
|
|
8553
|
-
heading1: DEFAULT_ELEMENT2,
|
|
8554
|
-
heading2: "h2",
|
|
8555
|
-
heading3: "h3",
|
|
8556
|
-
heading4: "h4",
|
|
8557
|
-
heading5: "h5",
|
|
8558
|
-
heading6: "h6"
|
|
8559
|
-
};
|
|
8560
|
-
var HeadingComponent = forwardRef8(
|
|
8561
|
-
({
|
|
8562
|
-
align = "left",
|
|
8563
|
-
colorScheme = "inherit",
|
|
8564
|
-
disabled = false,
|
|
8565
|
-
inline = false,
|
|
8566
|
-
preventUserSelect = false,
|
|
8567
|
-
truncate,
|
|
8568
|
-
variant = "heading1",
|
|
8569
|
-
renderAs,
|
|
8570
|
-
...props
|
|
8571
|
-
}, ref) => /* @__PURE__ */ jsx212(
|
|
8572
|
-
StyledHeading,
|
|
8573
|
-
{
|
|
8574
|
-
ref,
|
|
8575
|
-
$align: align,
|
|
8576
|
-
$colorScheme: colorScheme,
|
|
8577
|
-
$disabled: disabled,
|
|
8578
|
-
$inline: inline,
|
|
8579
|
-
$preventUserSelect: preventUserSelect,
|
|
8580
|
-
$truncate: truncate,
|
|
8581
|
-
$variant: variant,
|
|
8582
|
-
as: renderAs ?? variantElementMap[variant],
|
|
8583
|
-
...props
|
|
8584
|
-
}
|
|
8585
|
-
)
|
|
8586
|
-
);
|
|
8587
|
-
HeadingComponent.displayName = "Heading";
|
|
8588
|
-
var Heading = makePolymorphic(HeadingComponent);
|
|
8668
|
+
if (isNotUndefined6(clamp)) {
|
|
8669
|
+
return /* @__PURE__ */ jsx215(
|
|
8670
|
+
ClampedContent,
|
|
8671
|
+
{
|
|
8672
|
+
$clamp: clamp,
|
|
8673
|
+
"data-wui-collapsible-content": "true",
|
|
8674
|
+
children
|
|
8675
|
+
}
|
|
8676
|
+
);
|
|
8677
|
+
}
|
|
8678
|
+
return /* @__PURE__ */ jsx215(Content, { children: /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
8679
|
+
children,
|
|
8680
|
+
" "
|
|
8681
|
+
] }) });
|
|
8682
|
+
};
|
|
8589
8683
|
|
|
8590
8684
|
// src/components/DataCards/DataCard.tsx
|
|
8591
|
-
import {
|
|
8592
|
-
|
|
8685
|
+
import { useRef as useRef7 } from "react";
|
|
8686
|
+
import styled26, { keyframes } from "styled-components";
|
|
8687
|
+
import { isNotNil as isNotNil15, isNotNull } from "@wistia/type-guards";
|
|
8688
|
+
import { jsx as jsx216, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
8689
|
+
var StyledDataCard = styled26.div`
|
|
8593
8690
|
display: grid;
|
|
8594
8691
|
grid-template-areas: 'label slot' 'value value';
|
|
8595
8692
|
grid-template-rows: auto auto;
|
|
@@ -8652,7 +8749,7 @@ var shimmer = keyframes`
|
|
|
8652
8749
|
background-position: -200% 0;
|
|
8653
8750
|
}
|
|
8654
8751
|
`;
|
|
8655
|
-
var LoadingBackground =
|
|
8752
|
+
var LoadingBackground = styled26.div`
|
|
8656
8753
|
background: linear-gradient(
|
|
8657
8754
|
90deg,
|
|
8658
8755
|
var(--wui-color-bg-surface-tertiary) 25%,
|
|
@@ -8663,27 +8760,27 @@ var LoadingBackground = styled24.div`
|
|
|
8663
8760
|
animation: ${shimmer} 1.5s infinite;
|
|
8664
8761
|
border-radius: var(--wui-border-radius-01);
|
|
8665
8762
|
`;
|
|
8666
|
-
var StyledLoadingLabel =
|
|
8763
|
+
var StyledLoadingLabel = styled26(LoadingBackground)`
|
|
8667
8764
|
width: 80px;
|
|
8668
8765
|
height: var(--wui-typography-heading-6-line-height);
|
|
8669
8766
|
`;
|
|
8670
|
-
var StyledLoadingValue =
|
|
8767
|
+
var StyledLoadingValue = styled26(LoadingBackground)`
|
|
8671
8768
|
width: 90%;
|
|
8672
8769
|
height: var(--wui-typography-heading-3-line-height);
|
|
8673
8770
|
`;
|
|
8674
|
-
var StyledLabel2 =
|
|
8771
|
+
var StyledLabel2 = styled26(Heading)`
|
|
8675
8772
|
grid-area: label;
|
|
8676
8773
|
`;
|
|
8677
|
-
var StyledValue =
|
|
8774
|
+
var StyledValue = styled26(Heading)`
|
|
8678
8775
|
grid-area: value;
|
|
8679
8776
|
`;
|
|
8680
|
-
var StyledSlot =
|
|
8777
|
+
var StyledSlot = styled26.div`
|
|
8681
8778
|
display: flex;
|
|
8682
8779
|
justify-content: flex-end;
|
|
8683
8780
|
grid-area: slot;
|
|
8684
8781
|
align-self: center;
|
|
8685
8782
|
`;
|
|
8686
|
-
var StyledDataCardTrendContainer =
|
|
8783
|
+
var StyledDataCardTrendContainer = styled26.div`
|
|
8687
8784
|
position: absolute;
|
|
8688
8785
|
bottom: var(--wui-space-01);
|
|
8689
8786
|
right: var(--wui-space-01);
|
|
@@ -8696,34 +8793,34 @@ var DataCardInner = ({
|
|
|
8696
8793
|
isLoading = false,
|
|
8697
8794
|
trend,
|
|
8698
8795
|
...props
|
|
8699
|
-
}) => /* @__PURE__ */
|
|
8796
|
+
}) => /* @__PURE__ */ jsxs18(
|
|
8700
8797
|
StyledDataCard,
|
|
8701
8798
|
{
|
|
8702
8799
|
$colorScheme: colorScheme,
|
|
8703
8800
|
...props,
|
|
8704
8801
|
children: [
|
|
8705
|
-
/* @__PURE__ */
|
|
8802
|
+
/* @__PURE__ */ jsx216(
|
|
8706
8803
|
StyledLabel2,
|
|
8707
8804
|
{
|
|
8708
8805
|
renderAs: "dt",
|
|
8709
8806
|
variant: "heading6",
|
|
8710
|
-
children: isLoading ? /* @__PURE__ */
|
|
8807
|
+
children: isLoading ? /* @__PURE__ */ jsx216(StyledLoadingLabel, {}) : label
|
|
8711
8808
|
}
|
|
8712
8809
|
),
|
|
8713
|
-
/* @__PURE__ */
|
|
8810
|
+
/* @__PURE__ */ jsx216(
|
|
8714
8811
|
StyledValue,
|
|
8715
8812
|
{
|
|
8716
8813
|
renderAs: "dd",
|
|
8717
8814
|
variant: "heading3",
|
|
8718
|
-
children: isLoading ? /* @__PURE__ */
|
|
8815
|
+
children: isLoading ? /* @__PURE__ */ jsx216(StyledLoadingValue, {}) : value
|
|
8719
8816
|
}
|
|
8720
8817
|
),
|
|
8721
|
-
isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */
|
|
8722
|
-
isNotNull(trend) && !isLoading && /* @__PURE__ */
|
|
8818
|
+
isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */ jsx216(StyledSlot, { children: upperRightSlot }),
|
|
8819
|
+
isNotNull(trend) && !isLoading && /* @__PURE__ */ jsx216(StyledDataCardTrendContainer, { children: trend })
|
|
8723
8820
|
]
|
|
8724
8821
|
}
|
|
8725
8822
|
);
|
|
8726
|
-
var DataCardArrowIcon = /* @__PURE__ */
|
|
8823
|
+
var DataCardArrowIcon = /* @__PURE__ */ jsx216(
|
|
8727
8824
|
Icon,
|
|
8728
8825
|
{
|
|
8729
8826
|
"data-wui-data-card-hover-icon": true,
|
|
@@ -8731,14 +8828,14 @@ var DataCardArrowIcon = /* @__PURE__ */ jsx213(
|
|
|
8731
8828
|
}
|
|
8732
8829
|
);
|
|
8733
8830
|
var DataCard = (props) => {
|
|
8734
|
-
const ref =
|
|
8831
|
+
const ref = useRef7(null);
|
|
8735
8832
|
if (isNotNil15(props.href) || isNotNil15(props.onClick)) {
|
|
8736
|
-
return /* @__PURE__ */
|
|
8833
|
+
return /* @__PURE__ */ jsx216(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ jsx216(
|
|
8737
8834
|
DataCardInner,
|
|
8738
8835
|
{
|
|
8739
8836
|
upperRightSlot: props.upperRightSlot ?? DataCardArrowIcon,
|
|
8740
8837
|
...props,
|
|
8741
|
-
label: /* @__PURE__ */
|
|
8838
|
+
label: /* @__PURE__ */ jsx216(
|
|
8742
8839
|
Button,
|
|
8743
8840
|
{
|
|
8744
8841
|
ref,
|
|
@@ -8753,14 +8850,14 @@ var DataCard = (props) => {
|
|
|
8753
8850
|
}
|
|
8754
8851
|
) });
|
|
8755
8852
|
}
|
|
8756
|
-
return /* @__PURE__ */
|
|
8853
|
+
return /* @__PURE__ */ jsx216(DataCardInner, { ...props });
|
|
8757
8854
|
};
|
|
8758
8855
|
DataCard.displayName = "DataCard";
|
|
8759
8856
|
|
|
8760
8857
|
// src/components/DataCards/DataCards.tsx
|
|
8761
|
-
import
|
|
8762
|
-
import { jsx as
|
|
8763
|
-
var StyledDataCards =
|
|
8858
|
+
import styled27 from "styled-components";
|
|
8859
|
+
import { jsx as jsx217 } from "react/jsx-runtime";
|
|
8860
|
+
var StyledDataCards = styled27(Box)`
|
|
8764
8861
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8765
8862
|
margin-top: 0; /* Remove default <dl> style */
|
|
8766
8863
|
> * {
|
|
@@ -8774,7 +8871,7 @@ var DataCards = ({
|
|
|
8774
8871
|
colorScheme = "inherit",
|
|
8775
8872
|
...props
|
|
8776
8873
|
}) => {
|
|
8777
|
-
return /* @__PURE__ */
|
|
8874
|
+
return /* @__PURE__ */ jsx217(
|
|
8778
8875
|
StyledDataCards,
|
|
8779
8876
|
{
|
|
8780
8877
|
...props,
|
|
@@ -8792,13 +8889,13 @@ var DataCards = ({
|
|
|
8792
8889
|
DataCards.displayName = "DataCards";
|
|
8793
8890
|
|
|
8794
8891
|
// src/components/DataCards/DataCardTrend.tsx
|
|
8795
|
-
import
|
|
8892
|
+
import styled29 from "styled-components";
|
|
8796
8893
|
|
|
8797
8894
|
// src/components/Text/Text.tsx
|
|
8798
|
-
import { forwardRef as
|
|
8799
|
-
import
|
|
8895
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
8896
|
+
import styled28, { css as css23 } from "styled-components";
|
|
8800
8897
|
import { isNotNil as isNotNil16 } from "@wistia/type-guards";
|
|
8801
|
-
import { jsx as
|
|
8898
|
+
import { jsx as jsx218 } from "react/jsx-runtime";
|
|
8802
8899
|
var bodyBoldStyles = css23`
|
|
8803
8900
|
> strong,
|
|
8804
8901
|
b {
|
|
@@ -8903,22 +9000,22 @@ var variantStyleMap2 = {
|
|
|
8903
9000
|
};
|
|
8904
9001
|
var bodyElement = "p";
|
|
8905
9002
|
var labelElement = "span";
|
|
8906
|
-
var
|
|
9003
|
+
var DEFAULT_ELEMENT4 = bodyElement;
|
|
8907
9004
|
var variantElementMap2 = {
|
|
8908
|
-
body1:
|
|
8909
|
-
body2:
|
|
8910
|
-
body3:
|
|
8911
|
-
body4:
|
|
8912
|
-
body1Mono:
|
|
8913
|
-
body2Mono:
|
|
8914
|
-
body3Mono:
|
|
8915
|
-
body4Mono:
|
|
9005
|
+
body1: DEFAULT_ELEMENT4,
|
|
9006
|
+
body2: DEFAULT_ELEMENT4,
|
|
9007
|
+
body3: DEFAULT_ELEMENT4,
|
|
9008
|
+
body4: DEFAULT_ELEMENT4,
|
|
9009
|
+
body1Mono: DEFAULT_ELEMENT4,
|
|
9010
|
+
body2Mono: DEFAULT_ELEMENT4,
|
|
9011
|
+
body3Mono: DEFAULT_ELEMENT4,
|
|
9012
|
+
body4Mono: DEFAULT_ELEMENT4,
|
|
8916
9013
|
label1: labelElement,
|
|
8917
9014
|
label2: labelElement,
|
|
8918
9015
|
label3: labelElement,
|
|
8919
9016
|
label4: labelElement
|
|
8920
9017
|
};
|
|
8921
|
-
var StyledText =
|
|
9018
|
+
var StyledText = styled28.div`
|
|
8922
9019
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8923
9020
|
--text-color: ${({ $prominence, $disabled }) => {
|
|
8924
9021
|
if ($disabled) {
|
|
@@ -8970,7 +9067,7 @@ var StyledText = styled26.div`
|
|
|
8970
9067
|
}
|
|
8971
9068
|
`}
|
|
8972
9069
|
`;
|
|
8973
|
-
var TextComponent =
|
|
9070
|
+
var TextComponent = forwardRef10(
|
|
8974
9071
|
({
|
|
8975
9072
|
align = "left",
|
|
8976
9073
|
colorScheme = "inherit",
|
|
@@ -8983,7 +9080,7 @@ var TextComponent = forwardRef9(
|
|
|
8983
9080
|
renderAs,
|
|
8984
9081
|
...props
|
|
8985
9082
|
}, ref) => {
|
|
8986
|
-
return /* @__PURE__ */
|
|
9083
|
+
return /* @__PURE__ */ jsx218(
|
|
8987
9084
|
StyledText,
|
|
8988
9085
|
{
|
|
8989
9086
|
ref,
|
|
@@ -9005,8 +9102,8 @@ TextComponent.displayName = "Text";
|
|
|
9005
9102
|
var Text = makePolymorphic(TextComponent);
|
|
9006
9103
|
|
|
9007
9104
|
// src/components/DataCards/DataCardTrend.tsx
|
|
9008
|
-
import { jsx as
|
|
9009
|
-
var StyledDataCardTrend =
|
|
9105
|
+
import { jsx as jsx219, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
9106
|
+
var StyledDataCardTrend = styled29.div`
|
|
9010
9107
|
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
9011
9108
|
background: var(--wui-color-bg-app);
|
|
9012
9109
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -9021,8 +9118,8 @@ var DataCardTrend = ({
|
|
|
9021
9118
|
children,
|
|
9022
9119
|
...props
|
|
9023
9120
|
}) => {
|
|
9024
|
-
return /* @__PURE__ */
|
|
9025
|
-
/* @__PURE__ */
|
|
9121
|
+
return /* @__PURE__ */ jsxs19(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
9122
|
+
/* @__PURE__ */ jsx219(
|
|
9026
9123
|
Icon,
|
|
9027
9124
|
{
|
|
9028
9125
|
size: "md",
|
|
@@ -9030,7 +9127,7 @@ var DataCardTrend = ({
|
|
|
9030
9127
|
...props
|
|
9031
9128
|
}
|
|
9032
9129
|
),
|
|
9033
|
-
/* @__PURE__ */
|
|
9130
|
+
/* @__PURE__ */ jsx219(
|
|
9034
9131
|
Text,
|
|
9035
9132
|
{
|
|
9036
9133
|
prominence: "secondary",
|
|
@@ -9042,8 +9139,8 @@ var DataCardTrend = ({
|
|
|
9042
9139
|
};
|
|
9043
9140
|
|
|
9044
9141
|
// src/components/Divider/Divider.tsx
|
|
9045
|
-
import
|
|
9046
|
-
import { jsx as
|
|
9142
|
+
import styled30, { css as css24 } from "styled-components";
|
|
9143
|
+
import { jsx as jsx220 } from "react/jsx-runtime";
|
|
9047
9144
|
var horizontalBorderCss = css24`
|
|
9048
9145
|
border-top-color: var(--wui-color-border);
|
|
9049
9146
|
border-top-style: solid;
|
|
@@ -9057,7 +9154,7 @@ var verticalBorderCss = css24`
|
|
|
9057
9154
|
min-height: 100%;
|
|
9058
9155
|
width: 1px;
|
|
9059
9156
|
`;
|
|
9060
|
-
var DividerComponent =
|
|
9157
|
+
var DividerComponent = styled30.div`
|
|
9061
9158
|
${({ $orientation }) => {
|
|
9062
9159
|
switch ($orientation) {
|
|
9063
9160
|
case "vertical":
|
|
@@ -9069,7 +9166,7 @@ var DividerComponent = styled28.div`
|
|
|
9069
9166
|
}}
|
|
9070
9167
|
`;
|
|
9071
9168
|
var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
9072
|
-
return /* @__PURE__ */
|
|
9169
|
+
return /* @__PURE__ */ jsx220(
|
|
9073
9170
|
DividerComponent,
|
|
9074
9171
|
{
|
|
9075
9172
|
$orientation: orientation,
|
|
@@ -9082,8 +9179,8 @@ var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
|
9082
9179
|
Divider.displayName = "Divider";
|
|
9083
9180
|
|
|
9084
9181
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9085
|
-
import
|
|
9086
|
-
import { useState as useState9, useRef as
|
|
9182
|
+
import styled33, { css as css27 } from "styled-components";
|
|
9183
|
+
import { useState as useState9, useRef as useRef9 } from "react";
|
|
9087
9184
|
|
|
9088
9185
|
// src/components/Tooltip/Tooltip.tsx
|
|
9089
9186
|
import {
|
|
@@ -9093,8 +9190,8 @@ import {
|
|
|
9093
9190
|
Portal as TooltipPortal,
|
|
9094
9191
|
Arrow as TooltipArrow
|
|
9095
9192
|
} from "@radix-ui/react-tooltip";
|
|
9096
|
-
import
|
|
9097
|
-
import { jsx as
|
|
9193
|
+
import styled31, { keyframes as keyframes2 } from "styled-components";
|
|
9194
|
+
import { jsx as jsx221, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
9098
9195
|
var hide = keyframes2`
|
|
9099
9196
|
from {
|
|
9100
9197
|
opacity: 1;
|
|
@@ -9143,7 +9240,7 @@ var slideRightAndFade = keyframes2`
|
|
|
9143
9240
|
transform: translateX(0);
|
|
9144
9241
|
}
|
|
9145
9242
|
`;
|
|
9146
|
-
var StyledContent =
|
|
9243
|
+
var StyledContent = styled31(TooltipContent)`
|
|
9147
9244
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
9148
9245
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
9149
9246
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -9205,21 +9302,21 @@ var Tooltip = ({
|
|
|
9205
9302
|
if (forceOpen === true) {
|
|
9206
9303
|
rootProps.open = true;
|
|
9207
9304
|
}
|
|
9208
|
-
return /* @__PURE__ */
|
|
9305
|
+
return /* @__PURE__ */ jsxs20(
|
|
9209
9306
|
TooltipRoot,
|
|
9210
9307
|
{
|
|
9211
9308
|
delayDuration: delay,
|
|
9212
9309
|
...rootProps,
|
|
9213
9310
|
children: [
|
|
9214
|
-
/* @__PURE__ */
|
|
9215
|
-
/* @__PURE__ */
|
|
9311
|
+
/* @__PURE__ */ jsx221(TooltipTrigger, { asChild: true, children }),
|
|
9312
|
+
/* @__PURE__ */ jsx221(TooltipPortal, { children: /* @__PURE__ */ jsxs20(
|
|
9216
9313
|
StyledContent,
|
|
9217
9314
|
{
|
|
9218
9315
|
side: direction,
|
|
9219
9316
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
9220
9317
|
children: [
|
|
9221
9318
|
content,
|
|
9222
|
-
!hideArrow ? /* @__PURE__ */
|
|
9319
|
+
!hideArrow ? /* @__PURE__ */ jsx221(TooltipArrow, { asChild: true, children: /* @__PURE__ */ jsx221(
|
|
9223
9320
|
"svg",
|
|
9224
9321
|
{
|
|
9225
9322
|
fill: "var(--tooltip-bg)",
|
|
@@ -9228,7 +9325,7 @@ var Tooltip = ({
|
|
|
9228
9325
|
viewBox: "0 0 12 8",
|
|
9229
9326
|
width: "12",
|
|
9230
9327
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9231
|
-
children: /* @__PURE__ */
|
|
9328
|
+
children: /* @__PURE__ */ jsx221("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" })
|
|
9232
9329
|
}
|
|
9233
9330
|
) }) : null
|
|
9234
9331
|
]
|
|
@@ -9241,8 +9338,8 @@ var Tooltip = ({
|
|
|
9241
9338
|
Tooltip.displayName = "Tooltip";
|
|
9242
9339
|
|
|
9243
9340
|
// src/components/Input/Input.tsx
|
|
9244
|
-
import { forwardRef as
|
|
9245
|
-
import
|
|
9341
|
+
import { forwardRef as forwardRef11, cloneElement as cloneElement3, useRef as useRef8 } from "react";
|
|
9342
|
+
import styled32, { css as css26 } from "styled-components";
|
|
9246
9343
|
import { isNil as isNil12, isNotNil as isNotNil17, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
9247
9344
|
|
|
9248
9345
|
// src/css/sharedStyles/inputCssVariables.ts
|
|
@@ -9273,7 +9370,7 @@ var inputCssVariables = css25`
|
|
|
9273
9370
|
`;
|
|
9274
9371
|
|
|
9275
9372
|
// src/components/Input/Input.tsx
|
|
9276
|
-
import { jsx as
|
|
9373
|
+
import { jsx as jsx222, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
9277
9374
|
var inputStyles = css26`
|
|
9278
9375
|
${inputCssVariables}
|
|
9279
9376
|
input,
|
|
@@ -9309,7 +9406,7 @@ var inputStyles = css26`
|
|
|
9309
9406
|
}
|
|
9310
9407
|
}
|
|
9311
9408
|
`;
|
|
9312
|
-
var StyledInputContainer =
|
|
9409
|
+
var StyledInputContainer = styled32.div`
|
|
9313
9410
|
display: inline-flex;
|
|
9314
9411
|
position: relative;
|
|
9315
9412
|
${inputStyles};
|
|
@@ -9376,7 +9473,7 @@ var StyledInputContainer = styled30.div`
|
|
|
9376
9473
|
padding-right: 32px;
|
|
9377
9474
|
}
|
|
9378
9475
|
`;
|
|
9379
|
-
var Input =
|
|
9476
|
+
var Input = forwardRef11(
|
|
9380
9477
|
({
|
|
9381
9478
|
fullWidth = true,
|
|
9382
9479
|
monospace = false,
|
|
@@ -9386,14 +9483,14 @@ var Input = forwardRef10(
|
|
|
9386
9483
|
rightIcon,
|
|
9387
9484
|
...props
|
|
9388
9485
|
}, externalRef) => {
|
|
9389
|
-
const internalRef =
|
|
9486
|
+
const internalRef = useRef8();
|
|
9390
9487
|
const ref = (
|
|
9391
9488
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9392
9489
|
isNotNil17(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
9393
9490
|
);
|
|
9394
9491
|
let leftIconToDisplay = leftIcon;
|
|
9395
9492
|
if (isNil12(leftIcon) && type === "search") {
|
|
9396
|
-
leftIconToDisplay = /* @__PURE__ */
|
|
9493
|
+
leftIconToDisplay = /* @__PURE__ */ jsx222(Icon, { type: "search" });
|
|
9397
9494
|
}
|
|
9398
9495
|
if (isNotNil17(leftIconToDisplay)) {
|
|
9399
9496
|
leftIconToDisplay = cloneElement3(leftIconToDisplay, {
|
|
@@ -9418,21 +9515,21 @@ var Input = forwardRef10(
|
|
|
9418
9515
|
});
|
|
9419
9516
|
}
|
|
9420
9517
|
};
|
|
9421
|
-
return /* @__PURE__ */
|
|
9518
|
+
return /* @__PURE__ */ jsxs21(
|
|
9422
9519
|
StyledInputContainer,
|
|
9423
9520
|
{
|
|
9424
9521
|
$fullWidth: fullWidth,
|
|
9425
9522
|
$monospace: monospace,
|
|
9426
9523
|
children: [
|
|
9427
9524
|
leftIconToDisplay ?? null,
|
|
9428
|
-
type === "multiline" ? /* @__PURE__ */
|
|
9525
|
+
type === "multiline" ? /* @__PURE__ */ jsx222(
|
|
9429
9526
|
"textarea",
|
|
9430
9527
|
{
|
|
9431
9528
|
...props,
|
|
9432
9529
|
ref,
|
|
9433
9530
|
onFocus: handleFocus2
|
|
9434
9531
|
}
|
|
9435
|
-
) : /* @__PURE__ */
|
|
9532
|
+
) : /* @__PURE__ */ jsx222(
|
|
9436
9533
|
"input",
|
|
9437
9534
|
{
|
|
9438
9535
|
...props,
|
|
@@ -9450,8 +9547,8 @@ var Input = forwardRef10(
|
|
|
9450
9547
|
Input.displayName = "Input";
|
|
9451
9548
|
|
|
9452
9549
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9453
|
-
import { Fragment as Fragment5, jsx as
|
|
9454
|
-
var StyledInput =
|
|
9550
|
+
import { Fragment as Fragment5, jsx as jsx223, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9551
|
+
var StyledInput = styled33(Input)`
|
|
9455
9552
|
:not([rows]) {
|
|
9456
9553
|
min-height: unset;
|
|
9457
9554
|
}
|
|
@@ -9478,7 +9575,7 @@ var editableStyles = css27`
|
|
|
9478
9575
|
cursor: pointer;
|
|
9479
9576
|
}
|
|
9480
9577
|
`;
|
|
9481
|
-
var StyledHeading2 =
|
|
9578
|
+
var StyledHeading2 = styled33(Heading)`
|
|
9482
9579
|
width: 100%;
|
|
9483
9580
|
border-radius: var(--wui-border-radius-02);
|
|
9484
9581
|
padding: var(--wui-space-02);
|
|
@@ -9499,7 +9596,7 @@ var EditableHeading = ({
|
|
|
9499
9596
|
const [value, setValue] = useState9(children);
|
|
9500
9597
|
const [previousValue, setPreviousValue] = useState9(children);
|
|
9501
9598
|
const [headingHeight, setHeadingHeight] = useState9("60");
|
|
9502
|
-
const headingRef =
|
|
9599
|
+
const headingRef = useRef9(null);
|
|
9503
9600
|
const handleSetEditing = (editing) => {
|
|
9504
9601
|
if (editingDisabled) return;
|
|
9505
9602
|
if (editing && headingRef.current) {
|
|
@@ -9532,7 +9629,7 @@ var EditableHeading = ({
|
|
|
9532
9629
|
handleSetEditing(false);
|
|
9533
9630
|
}
|
|
9534
9631
|
};
|
|
9535
|
-
const HeadingComponent2 = /* @__PURE__ */
|
|
9632
|
+
const HeadingComponent2 = /* @__PURE__ */ jsx223(
|
|
9536
9633
|
StyledHeading2,
|
|
9537
9634
|
{
|
|
9538
9635
|
ref: headingRef,
|
|
@@ -9546,7 +9643,7 @@ var EditableHeading = ({
|
|
|
9546
9643
|
return HeadingComponent2;
|
|
9547
9644
|
}
|
|
9548
9645
|
if (isEditing || __forceEditing) {
|
|
9549
|
-
return /* @__PURE__ */
|
|
9646
|
+
return /* @__PURE__ */ jsx223(
|
|
9550
9647
|
StyledInput,
|
|
9551
9648
|
{
|
|
9552
9649
|
$height: headingHeight,
|
|
@@ -9564,9 +9661,9 @@ var EditableHeading = ({
|
|
|
9564
9661
|
}
|
|
9565
9662
|
);
|
|
9566
9663
|
}
|
|
9567
|
-
return /* @__PURE__ */
|
|
9568
|
-
/* @__PURE__ */
|
|
9569
|
-
/* @__PURE__ */
|
|
9664
|
+
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
9665
|
+
/* @__PURE__ */ jsx223(Tooltip, { content: tooltipText, children: HeadingComponent2 }),
|
|
9666
|
+
/* @__PURE__ */ jsx223(ScreenReaderOnly, { children: /* @__PURE__ */ jsx223(
|
|
9570
9667
|
"button",
|
|
9571
9668
|
{
|
|
9572
9669
|
"aria-label": ariaLabel,
|
|
@@ -9578,51 +9675,17 @@ var EditableHeading = ({
|
|
|
9578
9675
|
};
|
|
9579
9676
|
|
|
9580
9677
|
// src/components/Form/Form.tsx
|
|
9581
|
-
import { forwardRef as forwardRef12, useRef as
|
|
9582
|
-
import
|
|
9678
|
+
import { forwardRef as forwardRef12, useRef as useRef10, useMemo as useMemo5, createContext as createContext4, useState as useState10, useId as useId2 } from "react";
|
|
9679
|
+
import styled34 from "styled-components";
|
|
9583
9680
|
import { isNotUndefined as isNotUndefined7, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
import { forwardRef as forwardRef11 } from "react";
|
|
9587
|
-
import styled32 from "styled-components";
|
|
9588
|
-
import { jsx as jsx221 } from "react/jsx-runtime";
|
|
9589
|
-
var DEFAULT_ELEMENT4 = "div";
|
|
9590
|
-
var StyledStack = styled32.div`
|
|
9591
|
-
display: flex;
|
|
9592
|
-
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
9593
|
-
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9594
|
-
align-items: ${({ $alignItems }) => $alignItems};
|
|
9595
|
-
`;
|
|
9596
|
-
var StackComponent = forwardRef11(
|
|
9597
|
-
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9598
|
-
const responsiveGap = useResponsiveProp(gap);
|
|
9599
|
-
const responsiveDirection = useResponsiveProp(direction);
|
|
9600
|
-
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
9601
|
-
return /* @__PURE__ */ jsx221(
|
|
9602
|
-
StyledStack,
|
|
9603
|
-
{
|
|
9604
|
-
ref,
|
|
9605
|
-
$alignItems: responsiveAlignItems,
|
|
9606
|
-
$direction: responsiveDirection,
|
|
9607
|
-
$gap: responsiveGap,
|
|
9608
|
-
as: renderAs ?? DEFAULT_ELEMENT4,
|
|
9609
|
-
...props
|
|
9610
|
-
}
|
|
9611
|
-
);
|
|
9612
|
-
}
|
|
9613
|
-
);
|
|
9614
|
-
StackComponent.displayName = "Stack";
|
|
9615
|
-
var Stack = makePolymorphic(StackComponent);
|
|
9616
|
-
|
|
9617
|
-
// src/components/Form/Form.tsx
|
|
9618
|
-
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
9619
|
-
var StyledForm = styled33.form`
|
|
9681
|
+
import { jsx as jsx224 } from "react/jsx-runtime";
|
|
9682
|
+
var StyledForm = styled34.form`
|
|
9620
9683
|
--form-default-width: 690px;
|
|
9621
9684
|
|
|
9622
9685
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9623
9686
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9624
9687
|
`;
|
|
9625
|
-
var FormContext =
|
|
9688
|
+
var FormContext = createContext4({
|
|
9626
9689
|
values: {},
|
|
9627
9690
|
errors: {},
|
|
9628
9691
|
hasSubmitted: false,
|
|
@@ -9640,7 +9703,7 @@ var FormComponent = ({
|
|
|
9640
9703
|
}, forwardedRef) => {
|
|
9641
9704
|
const [errors, setErrors] = useState10({});
|
|
9642
9705
|
const [hasSubmitted, setHasSubmitted] = useState10(false);
|
|
9643
|
-
const innerRef =
|
|
9706
|
+
const innerRef = useRef10();
|
|
9644
9707
|
const ref = forwardedRef ?? innerRef;
|
|
9645
9708
|
const autoId = useId2();
|
|
9646
9709
|
const id = props.id ?? autoId;
|
|
@@ -9684,7 +9747,7 @@ var FormComponent = ({
|
|
|
9684
9747
|
void action(null);
|
|
9685
9748
|
}
|
|
9686
9749
|
};
|
|
9687
|
-
const context =
|
|
9750
|
+
const context = useMemo5(() => {
|
|
9688
9751
|
return {
|
|
9689
9752
|
values,
|
|
9690
9753
|
errors,
|
|
@@ -9695,7 +9758,7 @@ var FormComponent = ({
|
|
|
9695
9758
|
}, [labelPosition, values, errors, id, hasSubmitted]);
|
|
9696
9759
|
return (
|
|
9697
9760
|
// @ts-expect-error - generic context providers are a giant pain
|
|
9698
|
-
/* @__PURE__ */
|
|
9761
|
+
/* @__PURE__ */ jsx224(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx224(
|
|
9699
9762
|
Stack,
|
|
9700
9763
|
{
|
|
9701
9764
|
...props,
|
|
@@ -9752,23 +9815,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9752
9815
|
};
|
|
9753
9816
|
|
|
9754
9817
|
// src/components/Form/FormErrorSummary.tsx
|
|
9755
|
-
import { useContext as
|
|
9818
|
+
import { useContext as useContext4, useRef as useRef11 } from "react";
|
|
9756
9819
|
import { isArray, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
9757
|
-
import { jsx as
|
|
9820
|
+
import { jsx as jsx225, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9758
9821
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9759
|
-
return /* @__PURE__ */
|
|
9822
|
+
return /* @__PURE__ */ jsx225("li", { children: /* @__PURE__ */ jsx225(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9760
9823
|
};
|
|
9761
9824
|
var FormErrorSummary = ({ description }) => {
|
|
9762
|
-
const ref =
|
|
9763
|
-
const { formId, errors, hasSubmitted } =
|
|
9825
|
+
const ref = useRef11(null);
|
|
9826
|
+
const { formId, errors, hasSubmitted } = useContext4(FormContext);
|
|
9764
9827
|
const isValid = Object.keys(errors).length === 0;
|
|
9765
9828
|
if (isValid || !hasSubmitted) {
|
|
9766
9829
|
return null;
|
|
9767
9830
|
}
|
|
9768
|
-
return /* @__PURE__ */
|
|
9769
|
-
/* @__PURE__ */
|
|
9770
|
-
/* @__PURE__ */
|
|
9771
|
-
([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */
|
|
9831
|
+
return /* @__PURE__ */ jsxs23("div", { ref, children: [
|
|
9832
|
+
/* @__PURE__ */ jsx225("p", { children: description }),
|
|
9833
|
+
/* @__PURE__ */ jsx225("ul", { children: Object.entries(errors).filter(([, error]) => isNotUndefined8(error)).map(
|
|
9834
|
+
([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */ jsx225(
|
|
9772
9835
|
ErrorItem,
|
|
9773
9836
|
{
|
|
9774
9837
|
error: err,
|
|
@@ -9776,7 +9839,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9776
9839
|
name
|
|
9777
9840
|
},
|
|
9778
9841
|
err
|
|
9779
|
-
)) : /* @__PURE__ */
|
|
9842
|
+
)) : /* @__PURE__ */ jsx225(
|
|
9780
9843
|
ErrorItem,
|
|
9781
9844
|
{
|
|
9782
9845
|
error: error ?? "",
|
|
@@ -9790,13 +9853,13 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9790
9853
|
};
|
|
9791
9854
|
|
|
9792
9855
|
// src/components/FormField/FormField.tsx
|
|
9793
|
-
import { Children as Children4, cloneElement as cloneElement4, useContext as
|
|
9856
|
+
import { Children as Children4, cloneElement as cloneElement4, useContext as useContext5 } from "react";
|
|
9794
9857
|
import styled36 from "styled-components";
|
|
9795
9858
|
import { isArray as isArray2, isNotNil as isNotNil18, isNotUndefined as isNotUndefined9, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
9796
9859
|
|
|
9797
9860
|
// src/components/Label/Label.tsx
|
|
9798
|
-
import
|
|
9799
|
-
import { jsx as
|
|
9861
|
+
import styled35, { css as css28 } from "styled-components";
|
|
9862
|
+
import { jsx as jsx226 } from "react/jsx-runtime";
|
|
9800
9863
|
var requiredStyle = css28`
|
|
9801
9864
|
&::after {
|
|
9802
9865
|
color: var(--wui-color-text-error);
|
|
@@ -9808,7 +9871,7 @@ var requiredStyle = css28`
|
|
|
9808
9871
|
var disabledStyle3 = css28`
|
|
9809
9872
|
color: var(--wui-color-text-disabled);
|
|
9810
9873
|
`;
|
|
9811
|
-
var StyledLabel3 =
|
|
9874
|
+
var StyledLabel3 = styled35.label`
|
|
9812
9875
|
display: block;
|
|
9813
9876
|
width: 100%;
|
|
9814
9877
|
color: var(--wui-color-text);
|
|
@@ -9840,7 +9903,7 @@ var Label = ({
|
|
|
9840
9903
|
screenReaderOnly = false,
|
|
9841
9904
|
...props
|
|
9842
9905
|
}) => {
|
|
9843
|
-
return /* @__PURE__ */
|
|
9906
|
+
return /* @__PURE__ */ jsx226(
|
|
9844
9907
|
StyledLabel3,
|
|
9845
9908
|
{
|
|
9846
9909
|
...props,
|
|
@@ -9854,63 +9917,6 @@ var Label = ({
|
|
|
9854
9917
|
};
|
|
9855
9918
|
Label.displayName = "Label";
|
|
9856
9919
|
|
|
9857
|
-
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9858
|
-
import { createContext as createContext4, useMemo as useMemo5 } from "react";
|
|
9859
|
-
|
|
9860
|
-
// src/components/FormGroup/FormGroup.tsx
|
|
9861
|
-
import styled35 from "styled-components";
|
|
9862
|
-
import { useRef as useRef11 } from "react";
|
|
9863
|
-
import { jsx as jsx225, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9864
|
-
var StyledFieldset = styled35.fieldset`
|
|
9865
|
-
border: 0;
|
|
9866
|
-
`;
|
|
9867
|
-
var StyledLegend = styled35.legend`
|
|
9868
|
-
margin-bottom: var(--space-01);
|
|
9869
|
-
`;
|
|
9870
|
-
var FormGroup = ({ children, label, ...props }) => {
|
|
9871
|
-
const ref = useRef11();
|
|
9872
|
-
return /* @__PURE__ */ jsxs23(
|
|
9873
|
-
Stack,
|
|
9874
|
-
{
|
|
9875
|
-
...props,
|
|
9876
|
-
ref,
|
|
9877
|
-
renderAs: StyledFieldset,
|
|
9878
|
-
children: [
|
|
9879
|
-
/* @__PURE__ */ jsx225(
|
|
9880
|
-
Heading,
|
|
9881
|
-
{
|
|
9882
|
-
renderAs: StyledLegend,
|
|
9883
|
-
variant: "heading5",
|
|
9884
|
-
children: label
|
|
9885
|
-
}
|
|
9886
|
-
),
|
|
9887
|
-
children
|
|
9888
|
-
]
|
|
9889
|
-
}
|
|
9890
|
-
);
|
|
9891
|
-
};
|
|
9892
|
-
FormGroup.displayName = "FormGroup";
|
|
9893
|
-
|
|
9894
|
-
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9895
|
-
import { jsx as jsx226 } from "react/jsx-runtime";
|
|
9896
|
-
var CheckboxGroupContext = createContext4(null);
|
|
9897
|
-
var CheckboxGroup = ({
|
|
9898
|
-
children,
|
|
9899
|
-
name,
|
|
9900
|
-
onChange,
|
|
9901
|
-
value,
|
|
9902
|
-
...props
|
|
9903
|
-
}) => {
|
|
9904
|
-
const context = useMemo5(() => {
|
|
9905
|
-
return {
|
|
9906
|
-
name,
|
|
9907
|
-
onChange
|
|
9908
|
-
};
|
|
9909
|
-
}, [name, onChange]);
|
|
9910
|
-
return /* @__PURE__ */ jsx226(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx226(FormGroup, { ...props, children }) });
|
|
9911
|
-
};
|
|
9912
|
-
CheckboxGroup.displayName = "CheckboxGroup";
|
|
9913
|
-
|
|
9914
9920
|
// src/components/FormField/FormField.tsx
|
|
9915
9921
|
import { Fragment as Fragment6, jsx as jsx227, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9916
9922
|
var StyledFormField = styled36.div`
|
|
@@ -9986,8 +9992,8 @@ var FormField = ({
|
|
|
9986
9992
|
value,
|
|
9987
9993
|
...props
|
|
9988
9994
|
}) => {
|
|
9989
|
-
const formState =
|
|
9990
|
-
const checkboxGroup =
|
|
9995
|
+
const formState = useContext5(FormContext);
|
|
9996
|
+
const checkboxGroup = useContext5(CheckboxGroupContext);
|
|
9991
9997
|
const defaultValue = formState.values[name];
|
|
9992
9998
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9993
9999
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -10052,9 +10058,12 @@ var FormField = ({
|
|
|
10052
10058
|
FormField.displayName = "FormField";
|
|
10053
10059
|
|
|
10054
10060
|
// src/components/FormGroup/RadioGroup.tsx
|
|
10055
|
-
import { createContext as createContext5, useMemo as useMemo6 } from "react";
|
|
10061
|
+
import { createContext as createContext5, useMemo as useMemo6, useContext as useContext6 } from "react";
|
|
10056
10062
|
import { jsx as jsx228 } from "react/jsx-runtime";
|
|
10057
10063
|
var RadioGroupContext = createContext5(null);
|
|
10064
|
+
var useRadioGroup = () => {
|
|
10065
|
+
return useContext6(RadioGroupContext);
|
|
10066
|
+
};
|
|
10058
10067
|
var RadioGroup = ({
|
|
10059
10068
|
children,
|
|
10060
10069
|
name,
|
|
@@ -10295,9 +10304,9 @@ import { isNotNil as isNotNil20, isNotUndefined as isNotUndefined10 } from "@wis
|
|
|
10295
10304
|
import { useMemo as useMemo7 } from "react";
|
|
10296
10305
|
|
|
10297
10306
|
// src/components/Menu/MenuContext.tsx
|
|
10298
|
-
import { createContext as createContext6, useContext as
|
|
10307
|
+
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
10299
10308
|
var MenuContext = createContext6({ compact: false });
|
|
10300
|
-
var useMenuContext = () =>
|
|
10309
|
+
var useMenuContext = () => useContext7(MenuContext);
|
|
10301
10310
|
|
|
10302
10311
|
// src/components/Menu/Menu.tsx
|
|
10303
10312
|
import { jsx as jsx232, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
@@ -11523,6 +11532,11 @@ var Radio = forwardRef20(
|
|
|
11523
11532
|
}, ref) => {
|
|
11524
11533
|
const generatedId = useId3();
|
|
11525
11534
|
const computedId = isNonEmptyString3(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11535
|
+
const radioGroupContext = useRadioGroup();
|
|
11536
|
+
const contextName = radioGroupContext?.name;
|
|
11537
|
+
const contextOnChange = radioGroupContext?.onChange;
|
|
11538
|
+
const radioName = name ?? contextName;
|
|
11539
|
+
const handleOnChange = onChange ?? contextOnChange;
|
|
11526
11540
|
return /* @__PURE__ */ jsxs35(
|
|
11527
11541
|
StyledRadioWrapper,
|
|
11528
11542
|
{
|
|
@@ -11537,8 +11551,8 @@ var Radio = forwardRef20(
|
|
|
11537
11551
|
checked,
|
|
11538
11552
|
disabled,
|
|
11539
11553
|
id: computedId,
|
|
11540
|
-
name,
|
|
11541
|
-
onChange,
|
|
11554
|
+
name: radioName,
|
|
11555
|
+
onChange: handleOnChange,
|
|
11542
11556
|
required,
|
|
11543
11557
|
type: "radio",
|
|
11544
11558
|
value
|
|
@@ -11577,7 +11591,7 @@ import { Root as ToggleGroupRoot } from "@radix-ui/react-toggle-group";
|
|
|
11577
11591
|
import { isNil as isNil13 } from "@wistia/type-guards";
|
|
11578
11592
|
|
|
11579
11593
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11580
|
-
import { createContext as createContext7, useContext as
|
|
11594
|
+
import { createContext as createContext7, useContext as useContext8, useMemo as useMemo8, useState as useState14 } from "react";
|
|
11581
11595
|
import { jsx as jsx250 } from "react/jsx-runtime";
|
|
11582
11596
|
var SelectedItemStyleContext = createContext7(null);
|
|
11583
11597
|
var SelectedItemStyleProvider = ({
|
|
@@ -11604,7 +11618,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11604
11618
|
return /* @__PURE__ */ jsx250(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11605
11619
|
};
|
|
11606
11620
|
var useSelectedItemStyle = () => {
|
|
11607
|
-
const context =
|
|
11621
|
+
const context = useContext8(SelectedItemStyleContext);
|
|
11608
11622
|
if (context === null) {
|
|
11609
11623
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11610
11624
|
}
|
|
@@ -11615,11 +11629,11 @@ var useSelectedItemStyle = () => {
|
|
|
11615
11629
|
import styled54 from "styled-components";
|
|
11616
11630
|
|
|
11617
11631
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11618
|
-
import { createContext as createContext8, useContext as
|
|
11632
|
+
import { createContext as createContext8, useContext as useContext9 } from "react";
|
|
11619
11633
|
var SegmentedControlValueContext = createContext8(null);
|
|
11620
11634
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11621
11635
|
var useSegmentedControlValue = () => {
|
|
11622
|
-
const context =
|
|
11636
|
+
const context = useContext9(SegmentedControlValueContext);
|
|
11623
11637
|
if (context === null) {
|
|
11624
11638
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11625
11639
|
}
|
|
@@ -11736,7 +11750,7 @@ var segmentedControlItemStyles = css35`
|
|
|
11736
11750
|
outline: 2px solid var(--wui-color-focus-ring);
|
|
11737
11751
|
}
|
|
11738
11752
|
|
|
11739
|
-
&:hover:not([data-state='on'], [data-state='active']) {
|
|
11753
|
+
&:hover:not([data-state='on'], [data-state='active'], [aria-selected='true']) {
|
|
11740
11754
|
background-color: var(--wui-color-bg-surface-secondary-hover);
|
|
11741
11755
|
}
|
|
11742
11756
|
|
|
@@ -12251,7 +12265,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
12251
12265
|
};
|
|
12252
12266
|
|
|
12253
12267
|
// src/components/Table/TableCell.tsx
|
|
12254
|
-
import { useContext as
|
|
12268
|
+
import { useContext as useContext10 } from "react";
|
|
12255
12269
|
import styled63, { css as css38 } from "styled-components";
|
|
12256
12270
|
import { jsx as jsx259 } from "react/jsx-runtime";
|
|
12257
12271
|
var sharedStyles = css38`
|
|
@@ -12272,7 +12286,7 @@ var StyledTd = styled63.td`
|
|
|
12272
12286
|
line-height: var(--wui-typography-body-2-line-height);
|
|
12273
12287
|
`;
|
|
12274
12288
|
var TableCell = ({ children, ...props }) => {
|
|
12275
|
-
const section =
|
|
12289
|
+
const section = useContext10(TableSectionContext);
|
|
12276
12290
|
if (section === "head") {
|
|
12277
12291
|
return /* @__PURE__ */ jsx259(StyledTh, { ...props, children });
|
|
12278
12292
|
}
|
|
@@ -12304,89 +12318,125 @@ var TableRow = ({ children, ...props }) => {
|
|
|
12304
12318
|
};
|
|
12305
12319
|
|
|
12306
12320
|
// src/components/Tabs/Tabs.tsx
|
|
12307
|
-
import {
|
|
12308
|
-
import {
|
|
12309
|
-
import { isNotNil as
|
|
12310
|
-
import styled71 from "styled-components";
|
|
12321
|
+
import { Root as RadixTabsRoot } from "@radix-ui/react-tabs";
|
|
12322
|
+
import { useCallback as useCallback10, useState as useState15 } from "react";
|
|
12323
|
+
import { isNotNil as isNotNil30 } from "@wistia/type-guards";
|
|
12311
12324
|
|
|
12312
|
-
// src/components/Tabs/
|
|
12313
|
-
import
|
|
12314
|
-
|
|
12325
|
+
// src/components/Tabs/useTabsValue.tsx
|
|
12326
|
+
import { createContext as createContext10, useContext as useContext11 } from "react";
|
|
12327
|
+
var TabsValueContext = createContext10(null);
|
|
12328
|
+
var TabsValueProvider = TabsValueContext.Provider;
|
|
12329
|
+
var useTabsValue = () => {
|
|
12330
|
+
const context = useContext11(TabsValueContext);
|
|
12331
|
+
if (context === null) {
|
|
12332
|
+
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
12333
|
+
}
|
|
12334
|
+
return context;
|
|
12335
|
+
};
|
|
12336
|
+
|
|
12337
|
+
// src/components/Tabs/Tabs.tsx
|
|
12315
12338
|
import { jsx as jsx263 } from "react/jsx-runtime";
|
|
12316
|
-
var
|
|
12317
|
-
|
|
12318
|
-
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12339
|
+
var Tabs = ({
|
|
12340
|
+
children,
|
|
12341
|
+
value: valueProp,
|
|
12342
|
+
onValueChange: onValueChangeProp,
|
|
12343
|
+
defaultValue,
|
|
12344
|
+
...props
|
|
12345
|
+
}) => {
|
|
12346
|
+
const [value, setValue] = useState15(valueProp ?? defaultValue);
|
|
12347
|
+
const onValueChange = useCallback10(
|
|
12348
|
+
(newValue) => {
|
|
12349
|
+
setValue(newValue);
|
|
12350
|
+
if (onValueChangeProp) {
|
|
12351
|
+
onValueChangeProp(newValue);
|
|
12352
|
+
}
|
|
12353
|
+
},
|
|
12354
|
+
[onValueChangeProp]
|
|
12328
12355
|
);
|
|
12356
|
+
const rootProps = {
|
|
12357
|
+
...props,
|
|
12358
|
+
onValueChange
|
|
12359
|
+
};
|
|
12360
|
+
if (isNotNil30(value)) {
|
|
12361
|
+
rootProps.value = value;
|
|
12362
|
+
}
|
|
12363
|
+
if (isNotNil30(defaultValue)) {
|
|
12364
|
+
rootProps.defaultValue = defaultValue;
|
|
12365
|
+
}
|
|
12366
|
+
return /* @__PURE__ */ jsx263(RadixTabsRoot, { ...rootProps, children: /* @__PURE__ */ jsx263(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ jsx263(SelectedItemStyleProvider, { children }) }) });
|
|
12329
12367
|
};
|
|
12330
|
-
|
|
12368
|
+
Tabs.displayName = "Tabs";
|
|
12331
12369
|
|
|
12332
|
-
// src/components/Tabs/
|
|
12333
|
-
import
|
|
12334
|
-
import { List as RadixTabList } from "@radix-ui/react-tabs";
|
|
12370
|
+
// src/components/Tabs/TabsContent.tsx
|
|
12371
|
+
import { Content as RadixTabsContent } from "@radix-ui/react-tabs";
|
|
12335
12372
|
import { jsx as jsx264 } from "react/jsx-runtime";
|
|
12336
|
-
var
|
|
12337
|
-
|
|
12373
|
+
var TabsContent = ({ children, value }) => {
|
|
12374
|
+
return /* @__PURE__ */ jsx264(RadixTabsContent, { value, children });
|
|
12375
|
+
};
|
|
12376
|
+
TabsContent.displayName = "TabsContent";
|
|
12338
12377
|
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12378
|
+
// src/components/Tabs/TabsList.tsx
|
|
12379
|
+
import { List as RadixTabList } from "@radix-ui/react-tabs";
|
|
12380
|
+
import styled68 from "styled-components";
|
|
12381
|
+
|
|
12382
|
+
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
12383
|
+
import styled67 from "styled-components";
|
|
12384
|
+
var TabsSelectedItemIndicatorDiv = styled67(SelectedItemIndicatorDiv)`
|
|
12385
|
+
&:has(~ button[role='tab']:focus-visible) {
|
|
12386
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
12387
|
+
}
|
|
12342
12388
|
`;
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
|
|
12389
|
+
|
|
12390
|
+
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
12391
|
+
import { jsx as jsx265 } from "react/jsx-runtime";
|
|
12392
|
+
var SelectedTabIndicator = () => {
|
|
12393
|
+
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
12394
|
+
const selectedValue = useTabsValue();
|
|
12395
|
+
if (selectedValue == null) {
|
|
12396
|
+
return null;
|
|
12397
|
+
}
|
|
12398
|
+
return /* @__PURE__ */ jsx265(TabsSelectedItemIndicatorDiv, { style: selectedItemIndicatorStyle });
|
|
12399
|
+
};
|
|
12400
|
+
|
|
12401
|
+
// src/components/Tabs/TabsList.tsx
|
|
12402
|
+
import { jsx as jsx266, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
12403
|
+
var StyledRadixTabsList = styled68(RadixTabList)`
|
|
12404
|
+
${segmentedControlStyles}
|
|
12405
|
+
`;
|
|
12406
|
+
var TabsList = ({ children, fullWidth = true, ...props }) => {
|
|
12407
|
+
return /* @__PURE__ */ jsxs42(
|
|
12408
|
+
StyledRadixTabsList,
|
|
12351
12409
|
{
|
|
12352
12410
|
$fullWidth: fullWidth,
|
|
12353
|
-
"aria-label":
|
|
12354
|
-
|
|
12355
|
-
|
|
12411
|
+
"aria-label": props["aria-label"],
|
|
12412
|
+
children: [
|
|
12413
|
+
/* @__PURE__ */ jsx266(SelectedTabIndicator, {}),
|
|
12414
|
+
children
|
|
12415
|
+
]
|
|
12356
12416
|
}
|
|
12357
12417
|
);
|
|
12358
12418
|
};
|
|
12359
|
-
|
|
12419
|
+
TabsList.displayName = "TabsList";
|
|
12360
12420
|
|
|
12361
|
-
// src/components/Tabs/
|
|
12421
|
+
// src/components/Tabs/TabsTrigger.tsx
|
|
12362
12422
|
import { forwardRef as forwardRef26, useEffect as useEffect12, useRef as useRef14 } from "react";
|
|
12363
|
-
import
|
|
12364
|
-
import { Trigger as RadixTab } from "@radix-ui/react-tabs";
|
|
12365
|
-
import { isNotNil as isNotNil30 } from "@wistia/type-guards";
|
|
12366
|
-
|
|
12367
|
-
// src/components/Tabs/useTabsValue.tsx
|
|
12368
|
-
import { createContext as createContext10, useContext as useContext9 } from "react";
|
|
12369
|
-
var TabsValueContext = createContext10(null);
|
|
12370
|
-
var TabsValueProvider = TabsValueContext.Provider;
|
|
12371
|
-
var useTabsValue = () => {
|
|
12372
|
-
const context = useContext9(TabsValueContext);
|
|
12373
|
-
if (context === null) {
|
|
12374
|
-
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
12375
|
-
}
|
|
12376
|
-
return context;
|
|
12377
|
-
};
|
|
12423
|
+
import { isNotNil as isNotNil31 } from "@wistia/type-guards";
|
|
12378
12424
|
|
|
12379
|
-
// src/components/Tabs/
|
|
12380
|
-
import
|
|
12381
|
-
|
|
12425
|
+
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
12426
|
+
import styled69 from "styled-components";
|
|
12427
|
+
import { Trigger as RadixTabsTrigger } from "@radix-ui/react-tabs";
|
|
12428
|
+
var StyledRadixTabsTrigger = styled69(RadixTabsTrigger)`
|
|
12382
12429
|
${segmentedControlItemStyles}
|
|
12383
12430
|
|
|
12384
12431
|
&:focus-visible {
|
|
12385
12432
|
outline: none;
|
|
12386
12433
|
}
|
|
12387
12434
|
`;
|
|
12388
|
-
|
|
12389
|
-
|
|
12435
|
+
|
|
12436
|
+
// src/components/Tabs/TabsTrigger.tsx
|
|
12437
|
+
import { jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12438
|
+
var TabsTrigger = forwardRef26(
|
|
12439
|
+
({ disabled = false, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
12390
12440
|
const selectedValue = useTabsValue();
|
|
12391
12441
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12392
12442
|
const buttonRef = useRef14(null);
|
|
@@ -12416,12 +12466,13 @@ var TabItem = forwardRef26(
|
|
|
12416
12466
|
resizeObserver.disconnect();
|
|
12417
12467
|
};
|
|
12418
12468
|
}, [selectedValue, setSelectedItemMeasurements, value]);
|
|
12419
|
-
return /* @__PURE__ */
|
|
12420
|
-
|
|
12469
|
+
return /* @__PURE__ */ jsxs43(
|
|
12470
|
+
StyledRadixTabsTrigger,
|
|
12421
12471
|
{
|
|
12472
|
+
...otherProps,
|
|
12422
12473
|
ref: combinedRef,
|
|
12423
|
-
$hasLabel:
|
|
12424
|
-
"aria-label":
|
|
12474
|
+
$hasLabel: isNotNil31(label),
|
|
12475
|
+
"aria-label": isNotNil31(label) ? void 0 : ariaLabel,
|
|
12425
12476
|
disabled,
|
|
12426
12477
|
value,
|
|
12427
12478
|
children: [
|
|
@@ -12432,176 +12483,14 @@ var TabItem = forwardRef26(
|
|
|
12432
12483
|
);
|
|
12433
12484
|
}
|
|
12434
12485
|
);
|
|
12435
|
-
|
|
12436
|
-
|
|
12437
|
-
// src/components/Tabs/extractTabItems.ts
|
|
12438
|
-
import { Children as Children6, Fragment as Fragment7, isValidElement as isValidElement2 } from "react";
|
|
12439
|
-
var extractTabItems = (children) => {
|
|
12440
|
-
const tabItems = [];
|
|
12441
|
-
Children6.forEach(children, (child) => {
|
|
12442
|
-
if (!isValidElement2(child)) {
|
|
12443
|
-
return;
|
|
12444
|
-
}
|
|
12445
|
-
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12446
|
-
tabItems.push(child);
|
|
12447
|
-
} else if (child.type === Fragment7) {
|
|
12448
|
-
const fragmentElement = child;
|
|
12449
|
-
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12450
|
-
} else if ((child.props.children ?? null) != null) {
|
|
12451
|
-
const childChildren = child.props.children;
|
|
12452
|
-
tabItems.push(...extractTabItems(childChildren));
|
|
12453
|
-
} else {
|
|
12454
|
-
}
|
|
12455
|
-
});
|
|
12456
|
-
return tabItems;
|
|
12457
|
-
};
|
|
12458
|
-
|
|
12459
|
-
// src/components/Tabs/SelectedItemIndicator.tsx
|
|
12460
|
-
import styled70 from "styled-components";
|
|
12461
|
-
import { jsx as jsx265 } from "react/jsx-runtime";
|
|
12462
|
-
var TabsSelectedItemIndicatorDiv = styled70(SelectedItemIndicatorDiv)`
|
|
12463
|
-
&:has(~ ${StyledTabItem}:focus-visible) {
|
|
12464
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
12465
|
-
}
|
|
12466
|
-
`;
|
|
12467
|
-
var SelectedItemIndicator2 = () => {
|
|
12468
|
-
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
12469
|
-
const selectedValue = useTabsValue();
|
|
12470
|
-
if (selectedValue == null) {
|
|
12471
|
-
return null;
|
|
12472
|
-
}
|
|
12473
|
-
return /* @__PURE__ */ jsx265(TabsSelectedItemIndicatorDiv, { style: selectedItemIndicatorStyle });
|
|
12474
|
-
};
|
|
12475
|
-
|
|
12476
|
-
// src/components/Tabs/Tabs.tsx
|
|
12477
|
-
import { jsx as jsx266, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12478
|
-
var TabsContainer = styled71.div`
|
|
12479
|
-
display: flex;
|
|
12480
|
-
flex-direction: column;
|
|
12481
|
-
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12482
|
-
overflow: ${({ $stickyHeaders }) => $stickyHeaders ? "hidden" : "visible"};
|
|
12483
|
-
`;
|
|
12484
|
-
var StickyTabContent = styled71.div`
|
|
12485
|
-
flex: ${({ $stickyHeaders }) => $stickyHeaders ? "1" : "initial"};
|
|
12486
|
-
overflow-y: ${({ $stickyHeaders }) => $stickyHeaders ? "auto" : "visible"};
|
|
12487
|
-
overflow-x: ${({ $stickyHeaders }) => $stickyHeaders ? "hidden" : "visible"};
|
|
12488
|
-
`;
|
|
12489
|
-
var StyledTabsRoot = styled71(TabsRoot)`
|
|
12490
|
-
display: flex;
|
|
12491
|
-
flex-direction: column;
|
|
12492
|
-
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12493
|
-
`;
|
|
12494
|
-
var Tabs = forwardRef27(
|
|
12495
|
-
({
|
|
12496
|
-
children,
|
|
12497
|
-
fullWidth = true,
|
|
12498
|
-
"aria-label": ariaLabel,
|
|
12499
|
-
defaultSelectedValue,
|
|
12500
|
-
selectedValue,
|
|
12501
|
-
onSelectedValueChange,
|
|
12502
|
-
stickyHeaders = true,
|
|
12503
|
-
...props
|
|
12504
|
-
}, ref) => {
|
|
12505
|
-
const tabItems = extractTabItems(children);
|
|
12506
|
-
const [internalSelectedValue, setInternalSelectedValue] = useState15(defaultSelectedValue);
|
|
12507
|
-
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12508
|
-
defaultValue: defaultSelectedValue,
|
|
12509
|
-
onValueChange: setInternalSelectedValue
|
|
12510
|
-
} : { value: selectedValue, onValueChange: onSelectedValueChange };
|
|
12511
|
-
const currentValue = defaultSelectedValue !== void 0 ? internalSelectedValue : selectedValue;
|
|
12512
|
-
return /* @__PURE__ */ jsx266(TabsContainer, { $stickyHeaders: stickyHeaders, children: /* @__PURE__ */ jsx266(
|
|
12513
|
-
StyledTabsRoot,
|
|
12514
|
-
{
|
|
12515
|
-
ref,
|
|
12516
|
-
$stickyHeaders: stickyHeaders,
|
|
12517
|
-
activationMode: "automatic",
|
|
12518
|
-
...props,
|
|
12519
|
-
...modeProps,
|
|
12520
|
-
children: /* @__PURE__ */ jsx266(TabsValueProvider, { value: currentValue, children: /* @__PURE__ */ jsxs43(SelectedItemStyleProvider, { children: [
|
|
12521
|
-
/* @__PURE__ */ jsxs43(
|
|
12522
|
-
TabList,
|
|
12523
|
-
{
|
|
12524
|
-
ariaLabel,
|
|
12525
|
-
fullWidth,
|
|
12526
|
-
children: [
|
|
12527
|
-
/* @__PURE__ */ jsx266(SelectedItemIndicator2, {}),
|
|
12528
|
-
tabItems.map((tab) => {
|
|
12529
|
-
const {
|
|
12530
|
-
value,
|
|
12531
|
-
disabled = false,
|
|
12532
|
-
icon,
|
|
12533
|
-
label,
|
|
12534
|
-
"aria-label": ariaLabelForTab
|
|
12535
|
-
} = tab.props;
|
|
12536
|
-
if (isNil14(icon)) {
|
|
12537
|
-
return /* @__PURE__ */ jsx266(
|
|
12538
|
-
TabItem,
|
|
12539
|
-
{
|
|
12540
|
-
disabled,
|
|
12541
|
-
label,
|
|
12542
|
-
value
|
|
12543
|
-
},
|
|
12544
|
-
value
|
|
12545
|
-
);
|
|
12546
|
-
}
|
|
12547
|
-
if (isNotNil31(label)) {
|
|
12548
|
-
return /* @__PURE__ */ jsx266(
|
|
12549
|
-
TabItem,
|
|
12550
|
-
{
|
|
12551
|
-
disabled,
|
|
12552
|
-
icon,
|
|
12553
|
-
label,
|
|
12554
|
-
value
|
|
12555
|
-
},
|
|
12556
|
-
value
|
|
12557
|
-
);
|
|
12558
|
-
}
|
|
12559
|
-
if (isNotNil31(ariaLabelForTab)) {
|
|
12560
|
-
return /* @__PURE__ */ jsx266(
|
|
12561
|
-
TabItem,
|
|
12562
|
-
{
|
|
12563
|
-
"aria-label": ariaLabelForTab,
|
|
12564
|
-
disabled,
|
|
12565
|
-
icon,
|
|
12566
|
-
value
|
|
12567
|
-
},
|
|
12568
|
-
value
|
|
12569
|
-
);
|
|
12570
|
-
}
|
|
12571
|
-
throw new Error("A `Tab` with an icon must have either label or aria-label");
|
|
12572
|
-
})
|
|
12573
|
-
]
|
|
12574
|
-
}
|
|
12575
|
-
),
|
|
12576
|
-
/* @__PURE__ */ jsx266(StickyTabContent, { $stickyHeaders: stickyHeaders, children: tabItems.map((tab) => /* @__PURE__ */ jsx266(
|
|
12577
|
-
TabPanel,
|
|
12578
|
-
{
|
|
12579
|
-
value: tab.props.value,
|
|
12580
|
-
children: tab.props.children
|
|
12581
|
-
},
|
|
12582
|
-
tab.props.value
|
|
12583
|
-
)) })
|
|
12584
|
-
] }) })
|
|
12585
|
-
}
|
|
12586
|
-
) });
|
|
12587
|
-
}
|
|
12588
|
-
);
|
|
12589
|
-
Tabs.displayName = "Tabs";
|
|
12590
|
-
|
|
12591
|
-
// src/components/Tabs/Tab.tsx
|
|
12592
|
-
import { forwardRef as forwardRef28 } from "react";
|
|
12593
|
-
import { jsx as jsx267 } from "react/jsx-runtime";
|
|
12594
|
-
var Tab = forwardRef28(({ children }, ref) => {
|
|
12595
|
-
return /* @__PURE__ */ jsx267("div", { ref, children });
|
|
12596
|
-
});
|
|
12597
|
-
Tab.displayName = "Tab";
|
|
12486
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
12598
12487
|
|
|
12599
12488
|
// src/components/Tag/Tag.tsx
|
|
12600
|
-
import { forwardRef as
|
|
12601
|
-
import
|
|
12602
|
-
import { isNil as
|
|
12603
|
-
import { Fragment as
|
|
12604
|
-
var TagLabel =
|
|
12489
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
12490
|
+
import styled70 from "styled-components";
|
|
12491
|
+
import { isNil as isNil14, isNotNil as isNotNil32, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
|
|
12492
|
+
import { Fragment as Fragment7, jsx as jsx267, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
12493
|
+
var TagLabel = styled70.a`
|
|
12605
12494
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
12606
12495
|
font-size: var(--wui-typography-label-4-size);
|
|
12607
12496
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -12636,14 +12525,14 @@ var TagLabel = styled72.a`
|
|
|
12636
12525
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
12637
12526
|
}
|
|
12638
12527
|
`;
|
|
12639
|
-
var TagDivider =
|
|
12528
|
+
var TagDivider = styled70.div`
|
|
12640
12529
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
12641
12530
|
border-left: 1px solid var(--wui-color-border);
|
|
12642
12531
|
display: flex;
|
|
12643
12532
|
height: 14px;
|
|
12644
12533
|
width: 1px;
|
|
12645
12534
|
`;
|
|
12646
|
-
var StyledRemoveButton =
|
|
12535
|
+
var StyledRemoveButton = styled70.button`
|
|
12647
12536
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
12648
12537
|
all: unset;
|
|
12649
12538
|
cursor: pointer;
|
|
@@ -12671,7 +12560,7 @@ var StyledRemoveButton = styled72.button`
|
|
|
12671
12560
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
12672
12561
|
}
|
|
12673
12562
|
`;
|
|
12674
|
-
var StyledTag =
|
|
12563
|
+
var StyledTag = styled70.div`
|
|
12675
12564
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
12676
12565
|
align-items: center;
|
|
12677
12566
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -12684,16 +12573,16 @@ var StyledTag = styled72.div`
|
|
|
12684
12573
|
}
|
|
12685
12574
|
`;
|
|
12686
12575
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
12687
|
-
if (
|
|
12576
|
+
if (isNil14(onClickRemove)) {
|
|
12688
12577
|
return null;
|
|
12689
12578
|
}
|
|
12690
|
-
if (
|
|
12579
|
+
if (isNil14(onClickRemoveLabel)) {
|
|
12691
12580
|
throw new Error(
|
|
12692
12581
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12693
12582
|
);
|
|
12694
12583
|
}
|
|
12695
|
-
return /* @__PURE__ */ jsxs44(
|
|
12696
|
-
/* @__PURE__ */
|
|
12584
|
+
return /* @__PURE__ */ jsxs44(Fragment7, { children: [
|
|
12585
|
+
/* @__PURE__ */ jsx267(TagDivider, { $colorScheme: colorScheme }),
|
|
12697
12586
|
/* @__PURE__ */ jsxs44(
|
|
12698
12587
|
StyledRemoveButton,
|
|
12699
12588
|
{
|
|
@@ -12701,20 +12590,20 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12701
12590
|
onClick: onClickRemove,
|
|
12702
12591
|
type: "button",
|
|
12703
12592
|
children: [
|
|
12704
|
-
/* @__PURE__ */
|
|
12593
|
+
/* @__PURE__ */ jsx267(
|
|
12705
12594
|
Icon,
|
|
12706
12595
|
{
|
|
12707
12596
|
size: "sm",
|
|
12708
12597
|
type: "close"
|
|
12709
12598
|
}
|
|
12710
12599
|
),
|
|
12711
|
-
/* @__PURE__ */
|
|
12600
|
+
/* @__PURE__ */ jsx267(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
12712
12601
|
]
|
|
12713
12602
|
}
|
|
12714
12603
|
)
|
|
12715
12604
|
] });
|
|
12716
12605
|
};
|
|
12717
|
-
var Tag =
|
|
12606
|
+
var Tag = forwardRef27(
|
|
12718
12607
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12719
12608
|
const hasIcon = isNotNil32(icon);
|
|
12720
12609
|
const labelProps = isNotNil32(href) && isNonEmptyString5(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -12736,7 +12625,7 @@ var Tag = forwardRef29(
|
|
|
12736
12625
|
]
|
|
12737
12626
|
}
|
|
12738
12627
|
),
|
|
12739
|
-
/* @__PURE__ */
|
|
12628
|
+
/* @__PURE__ */ jsx267(
|
|
12740
12629
|
RemoveButton,
|
|
12741
12630
|
{
|
|
12742
12631
|
colorScheme,
|
|
@@ -12752,10 +12641,10 @@ var Tag = forwardRef29(
|
|
|
12752
12641
|
Tag.displayName = "Tag";
|
|
12753
12642
|
|
|
12754
12643
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
12755
|
-
import
|
|
12644
|
+
import styled71 from "styled-components";
|
|
12756
12645
|
import { isNotNil as isNotNil33 } from "@wistia/type-guards";
|
|
12757
|
-
import { jsx as
|
|
12758
|
-
var StyledThumbnailBadge =
|
|
12646
|
+
import { jsx as jsx268, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
12647
|
+
var StyledThumbnailBadge = styled71.div`
|
|
12759
12648
|
align-items: center;
|
|
12760
12649
|
background-color: rgb(0 0 0 / 50%);
|
|
12761
12650
|
border-radius: var(--wui-border-radius-01);
|
|
@@ -12782,15 +12671,15 @@ var StyledThumbnailBadge = styled73.div`
|
|
|
12782
12671
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
12783
12672
|
return /* @__PURE__ */ jsxs45(StyledThumbnailBadge, { ...props, children: [
|
|
12784
12673
|
isNotNil33(icon) && icon,
|
|
12785
|
-
/* @__PURE__ */
|
|
12674
|
+
/* @__PURE__ */ jsx268("span", { children: label })
|
|
12786
12675
|
] });
|
|
12787
12676
|
};
|
|
12788
12677
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12789
12678
|
|
|
12790
12679
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12791
|
-
import { forwardRef as
|
|
12792
|
-
import
|
|
12793
|
-
import { isNil as
|
|
12680
|
+
import { forwardRef as forwardRef28, useState as useState16, useRef as useRef15, useCallback as useCallback11, useMemo as useMemo9 } from "react";
|
|
12681
|
+
import styled73 from "styled-components";
|
|
12682
|
+
import { isNil as isNil15, isNotNil as isNotNil36, isUndefined as isUndefined5, isEmptyString as isEmptyString2, isString as isString2 } from "@wistia/type-guards";
|
|
12794
12683
|
|
|
12795
12684
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12796
12685
|
import { isNotNil as isNotNil34 } from "@wistia/type-guards";
|
|
@@ -12925,10 +12814,10 @@ var getBackgroundGradient = (gradientName = void 0) => {
|
|
|
12925
12814
|
};
|
|
12926
12815
|
|
|
12927
12816
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
12928
|
-
import
|
|
12817
|
+
import styled72 from "styled-components";
|
|
12929
12818
|
import { isNotNil as isNotNil35 } from "@wistia/type-guards";
|
|
12930
|
-
import { jsx as
|
|
12931
|
-
var ScrubLine =
|
|
12819
|
+
import { jsx as jsx269, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
12820
|
+
var ScrubLine = styled72.div`
|
|
12932
12821
|
position: absolute;
|
|
12933
12822
|
top: 0;
|
|
12934
12823
|
height: 100%;
|
|
@@ -13036,8 +12925,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
13036
12925
|
...props,
|
|
13037
12926
|
style: viewerStyles,
|
|
13038
12927
|
children: [
|
|
13039
|
-
/* @__PURE__ */
|
|
13040
|
-
showScrubLine ? /* @__PURE__ */
|
|
12928
|
+
/* @__PURE__ */ jsx269("div", { style: storyboardStyles }),
|
|
12929
|
+
showScrubLine ? /* @__PURE__ */ jsx269(
|
|
13041
12930
|
ScrubLine,
|
|
13042
12931
|
{
|
|
13043
12932
|
style: {
|
|
@@ -13051,20 +12940,20 @@ var ThumbnailStoryboardViewer = ({
|
|
|
13051
12940
|
};
|
|
13052
12941
|
|
|
13053
12942
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
13054
|
-
import { jsx as
|
|
13055
|
-
var WideThumbnailImage =
|
|
12943
|
+
import { jsx as jsx270, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
12944
|
+
var WideThumbnailImage = styled73.img`
|
|
13056
12945
|
height: 100%;
|
|
13057
12946
|
object-fit: cover;
|
|
13058
12947
|
width: 100%;
|
|
13059
12948
|
`;
|
|
13060
|
-
var SquareThumbnailImage =
|
|
12949
|
+
var SquareThumbnailImage = styled73.img`
|
|
13061
12950
|
backdrop-filter: blur(8px);
|
|
13062
12951
|
object-fit: contain;
|
|
13063
12952
|
width: 100%;
|
|
13064
12953
|
`;
|
|
13065
12954
|
var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
13066
12955
|
if (thumbnailImageType === "wide") {
|
|
13067
|
-
return /* @__PURE__ */
|
|
12956
|
+
return /* @__PURE__ */ jsx270(
|
|
13068
12957
|
WideThumbnailImage,
|
|
13069
12958
|
{
|
|
13070
12959
|
alt: "",
|
|
@@ -13073,7 +12962,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
13073
12962
|
}
|
|
13074
12963
|
);
|
|
13075
12964
|
}
|
|
13076
|
-
return /* @__PURE__ */
|
|
12965
|
+
return /* @__PURE__ */ jsx270(
|
|
13077
12966
|
SquareThumbnailImage,
|
|
13078
12967
|
{
|
|
13079
12968
|
alt: "",
|
|
@@ -13082,11 +12971,11 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
13082
12971
|
}
|
|
13083
12972
|
);
|
|
13084
12973
|
};
|
|
13085
|
-
var StyledThumbnail =
|
|
12974
|
+
var StyledThumbnail = styled73.div`
|
|
13086
12975
|
background-image: ${({ $backgroundUrl }) => isNotNil36($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
13087
12976
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
13088
12977
|
// if we don't have $backgroundUrl show a gradient
|
|
13089
|
-
|
|
12978
|
+
isNil15($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
13090
12979
|
)};
|
|
13091
12980
|
background-position: center center;
|
|
13092
12981
|
background-size: cover;
|
|
@@ -13111,7 +13000,7 @@ var getRelativeMousePosition = (elem, mouseEvent) => {
|
|
|
13111
13000
|
left: relativeLeft
|
|
13112
13001
|
};
|
|
13113
13002
|
};
|
|
13114
|
-
var Thumbnail =
|
|
13003
|
+
var Thumbnail = forwardRef28(
|
|
13115
13004
|
({
|
|
13116
13005
|
gradientBackground = "defaultMidOne",
|
|
13117
13006
|
thumbnailImageType = "square",
|
|
@@ -13132,7 +13021,7 @@ var Thumbnail = forwardRef30(
|
|
|
13132
13021
|
[thumbnailImageType, thumbnailUrl]
|
|
13133
13022
|
);
|
|
13134
13023
|
const isScrubbable = isNotNil36(storyboard);
|
|
13135
|
-
const trackStoryboardLoadStatus =
|
|
13024
|
+
const trackStoryboardLoadStatus = useCallback11(() => {
|
|
13136
13025
|
if (storyboardElementRef.current || !storyboard) {
|
|
13137
13026
|
return storyboardElementRef.current;
|
|
13138
13027
|
}
|
|
@@ -13142,7 +13031,7 @@ var Thumbnail = forwardRef30(
|
|
|
13142
13031
|
storyboardElementRef.current = asset;
|
|
13143
13032
|
return storyboardElementRef.current;
|
|
13144
13033
|
}, [storyboard]);
|
|
13145
|
-
const handleMouseMove =
|
|
13034
|
+
const handleMouseMove = useCallback11(
|
|
13146
13035
|
(mouseEvent) => {
|
|
13147
13036
|
if (!isScrubbable) return;
|
|
13148
13037
|
const elem = mouseEvent.currentTarget;
|
|
@@ -13155,7 +13044,7 @@ var Thumbnail = forwardRef30(
|
|
|
13155
13044
|
},
|
|
13156
13045
|
[isScrubbable, trackStoryboardLoadStatus]
|
|
13157
13046
|
);
|
|
13158
|
-
const handleMouseOut =
|
|
13047
|
+
const handleMouseOut = useCallback11(() => {
|
|
13159
13048
|
if (!isScrubbable) return;
|
|
13160
13049
|
setIsMouseOver(false);
|
|
13161
13050
|
setCursorPosition(null);
|
|
@@ -13163,7 +13052,7 @@ var Thumbnail = forwardRef30(
|
|
|
13163
13052
|
const shouldRenderStoryboard = useMemo9(() => {
|
|
13164
13053
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
13165
13054
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
13166
|
-
const renderStoryboard =
|
|
13055
|
+
const renderStoryboard = useCallback11(() => {
|
|
13167
13056
|
if (!storyboard || isUndefined5(height) || isEmptyString2(height)) return null;
|
|
13168
13057
|
const {
|
|
13169
13058
|
url,
|
|
@@ -13176,7 +13065,7 @@ var Thumbnail = forwardRef30(
|
|
|
13176
13065
|
} = storyboard;
|
|
13177
13066
|
const targetWidth = isString2(width) ? parseInt(width, 10) : Number(width);
|
|
13178
13067
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
13179
|
-
return /* @__PURE__ */
|
|
13068
|
+
return /* @__PURE__ */ jsx270(
|
|
13180
13069
|
ThumbnailStoryboardViewer,
|
|
13181
13070
|
{
|
|
13182
13071
|
cursorPosition: effectiveCursorPosition,
|
|
@@ -13196,7 +13085,7 @@ var Thumbnail = forwardRef30(
|
|
|
13196
13085
|
if (shouldRenderStoryboard) {
|
|
13197
13086
|
thumbnailContent = renderStoryboard();
|
|
13198
13087
|
} else if (isNotNil36(thumbnailUrl)) {
|
|
13199
|
-
thumbnailContent = /* @__PURE__ */
|
|
13088
|
+
thumbnailContent = /* @__PURE__ */ jsx270(
|
|
13200
13089
|
ThumbnailImage,
|
|
13201
13090
|
{
|
|
13202
13091
|
thumbnailImageType,
|
|
@@ -13231,10 +13120,10 @@ Thumbnail.displayName = "Thumbnail";
|
|
|
13231
13120
|
|
|
13232
13121
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
13233
13122
|
import React2 from "react";
|
|
13234
|
-
import
|
|
13123
|
+
import styled74 from "styled-components";
|
|
13235
13124
|
import { isNonEmptyArray } from "@wistia/type-guards";
|
|
13236
|
-
import { jsx as
|
|
13237
|
-
var StyledThumbnailCollage =
|
|
13125
|
+
import { jsx as jsx271 } from "react/jsx-runtime";
|
|
13126
|
+
var StyledThumbnailCollage = styled74.div`
|
|
13238
13127
|
display: grid;
|
|
13239
13128
|
gap: var(--wui-space-01);
|
|
13240
13129
|
width: 100%;
|
|
@@ -13316,7 +13205,7 @@ var ThumbnailCollage = ({
|
|
|
13316
13205
|
});
|
|
13317
13206
|
}) : [
|
|
13318
13207
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
13319
|
-
/* @__PURE__ */
|
|
13208
|
+
/* @__PURE__ */ jsx271(
|
|
13320
13209
|
Thumbnail,
|
|
13321
13210
|
{
|
|
13322
13211
|
gradientBackground,
|
|
@@ -13325,7 +13214,7 @@ var ThumbnailCollage = ({
|
|
|
13325
13214
|
"fallback"
|
|
13326
13215
|
)
|
|
13327
13216
|
];
|
|
13328
|
-
return /* @__PURE__ */
|
|
13217
|
+
return /* @__PURE__ */ jsx271(
|
|
13329
13218
|
StyledThumbnailCollage,
|
|
13330
13219
|
{
|
|
13331
13220
|
$gradientBackground: gradientBackground,
|
|
@@ -13337,26 +13226,26 @@ var ThumbnailCollage = ({
|
|
|
13337
13226
|
};
|
|
13338
13227
|
|
|
13339
13228
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
13340
|
-
import
|
|
13229
|
+
import styled75, { css as css40 } from "styled-components";
|
|
13341
13230
|
import { isNotNil as isNotNil37 } from "@wistia/type-guards";
|
|
13342
|
-
import { jsx as
|
|
13231
|
+
import { jsx as jsx272, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
13343
13232
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
13344
13233
|
if (iconOnly) {
|
|
13345
|
-
return /* @__PURE__ */
|
|
13234
|
+
return /* @__PURE__ */ jsx272(
|
|
13346
13235
|
"g",
|
|
13347
13236
|
{
|
|
13348
13237
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
13349
13238
|
fill: brandmarkColor,
|
|
13350
|
-
children: /* @__PURE__ */
|
|
13239
|
+
children: /* @__PURE__ */ jsx272("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
13351
13240
|
}
|
|
13352
13241
|
);
|
|
13353
13242
|
}
|
|
13354
|
-
return /* @__PURE__ */
|
|
13243
|
+
return /* @__PURE__ */ jsx272(
|
|
13355
13244
|
"g",
|
|
13356
13245
|
{
|
|
13357
13246
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
13358
13247
|
fill: brandmarkColor,
|
|
13359
|
-
children: /* @__PURE__ */
|
|
13248
|
+
children: /* @__PURE__ */ jsx272("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
13360
13249
|
}
|
|
13361
13250
|
);
|
|
13362
13251
|
};
|
|
@@ -13364,12 +13253,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
13364
13253
|
if (iconOnly) {
|
|
13365
13254
|
return null;
|
|
13366
13255
|
}
|
|
13367
|
-
return /* @__PURE__ */
|
|
13256
|
+
return /* @__PURE__ */ jsx272(
|
|
13368
13257
|
"g",
|
|
13369
13258
|
{
|
|
13370
13259
|
"data-testid": "ui-wistia-logo-logotype",
|
|
13371
13260
|
fill: logotypeColor,
|
|
13372
|
-
children: /* @__PURE__ */
|
|
13261
|
+
children: /* @__PURE__ */ jsx272("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
|
|
13373
13262
|
}
|
|
13374
13263
|
);
|
|
13375
13264
|
};
|
|
@@ -13379,7 +13268,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
13379
13268
|
}
|
|
13380
13269
|
return "0 0 144 31.47";
|
|
13381
13270
|
};
|
|
13382
|
-
var WistiaLogoComponent =
|
|
13271
|
+
var WistiaLogoComponent = styled75.svg`
|
|
13383
13272
|
height: ${({ height }) => `${height}px`};
|
|
13384
13273
|
|
|
13385
13274
|
/* ensure it will always fit on mobile */
|
|
@@ -13450,38 +13339,38 @@ var WistiaLogo = ({
|
|
|
13450
13339
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13451
13340
|
...props,
|
|
13452
13341
|
children: [
|
|
13453
|
-
/* @__PURE__ */
|
|
13454
|
-
isNotNil37(description) ? /* @__PURE__ */
|
|
13342
|
+
/* @__PURE__ */ jsx272("title", { children: title }),
|
|
13343
|
+
isNotNil37(description) ? /* @__PURE__ */ jsx272("desc", { children: description }) : null,
|
|
13455
13344
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
13456
13345
|
renderLogotype(logotypeColor, iconOnly)
|
|
13457
13346
|
]
|
|
13458
13347
|
}
|
|
13459
13348
|
);
|
|
13460
|
-
return href !== void 0 ? /* @__PURE__ */
|
|
13349
|
+
return href !== void 0 ? /* @__PURE__ */ jsx272("a", { href, children: Logo }) : Logo;
|
|
13461
13350
|
};
|
|
13462
13351
|
WistiaLogo.displayName = "WistiaLogo";
|
|
13463
13352
|
|
|
13464
13353
|
// src/components/List/List.tsx
|
|
13465
13354
|
import { isNotNil as isNotNil38 } from "@wistia/type-guards";
|
|
13466
|
-
import
|
|
13355
|
+
import styled77, { css as css41 } from "styled-components";
|
|
13467
13356
|
|
|
13468
13357
|
// src/components/List/ListItem.tsx
|
|
13469
|
-
import
|
|
13470
|
-
import { isNil as
|
|
13471
|
-
import { jsx as
|
|
13472
|
-
var ListItemComponent =
|
|
13358
|
+
import styled76 from "styled-components";
|
|
13359
|
+
import { isNil as isNil16 } from "@wistia/type-guards";
|
|
13360
|
+
import { jsx as jsx273 } from "react/jsx-runtime";
|
|
13361
|
+
var ListItemComponent = styled76.li`
|
|
13473
13362
|
margin-bottom: var(--wui-space-02);
|
|
13474
13363
|
`;
|
|
13475
13364
|
var ListItem = ({ children }) => {
|
|
13476
|
-
if (
|
|
13365
|
+
if (isNil16(children)) {
|
|
13477
13366
|
return null;
|
|
13478
13367
|
}
|
|
13479
|
-
return /* @__PURE__ */
|
|
13368
|
+
return /* @__PURE__ */ jsx273(ListItemComponent, { children });
|
|
13480
13369
|
};
|
|
13481
13370
|
ListItem.displayName = "ListItem";
|
|
13482
13371
|
|
|
13483
13372
|
// src/components/List/List.tsx
|
|
13484
|
-
import { jsx as
|
|
13373
|
+
import { jsx as jsx274, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
13485
13374
|
var spacesStyle = css41`
|
|
13486
13375
|
overflow: hidden;
|
|
13487
13376
|
padding-left: 0;
|
|
@@ -13540,7 +13429,7 @@ var unbulletedStyle = css41`
|
|
|
13540
13429
|
list-style: none;
|
|
13541
13430
|
padding-left: 0;
|
|
13542
13431
|
`;
|
|
13543
|
-
var ListComponent =
|
|
13432
|
+
var ListComponent = styled77.ul`
|
|
13544
13433
|
list-style-position: outside;
|
|
13545
13434
|
margin: 0 0 var(--wui-space-01);
|
|
13546
13435
|
padding: 0 0 0 var(--wui-space-04);
|
|
@@ -13567,7 +13456,7 @@ var ListComponent = styled79.ul`
|
|
|
13567
13456
|
`;
|
|
13568
13457
|
var renderListComponent = (listItems, variant, { ...otherProps }) => {
|
|
13569
13458
|
const elementType = variant === "ordered" ? "ol" : "ul";
|
|
13570
|
-
return /* @__PURE__ */
|
|
13459
|
+
return /* @__PURE__ */ jsx274(
|
|
13571
13460
|
ListComponent,
|
|
13572
13461
|
{
|
|
13573
13462
|
as: elementType,
|
|
@@ -13592,7 +13481,7 @@ var renderListFromArray = (listItems, variant, otherProps) => {
|
|
|
13592
13481
|
if (Array.isArray(item)) {
|
|
13593
13482
|
return null;
|
|
13594
13483
|
}
|
|
13595
|
-
return /* @__PURE__ */
|
|
13484
|
+
return /* @__PURE__ */ jsx274(ListItem, { children: item }, key);
|
|
13596
13485
|
});
|
|
13597
13486
|
return renderListComponent(items, variant, otherProps);
|
|
13598
13487
|
};
|
|
@@ -13683,7 +13572,6 @@ export {
|
|
|
13683
13572
|
Stack,
|
|
13684
13573
|
SubMenu,
|
|
13685
13574
|
Switch,
|
|
13686
|
-
Tab,
|
|
13687
13575
|
Table,
|
|
13688
13576
|
TableBody,
|
|
13689
13577
|
TableCell,
|
|
@@ -13691,6 +13579,9 @@ export {
|
|
|
13691
13579
|
TableHead,
|
|
13692
13580
|
TableRow,
|
|
13693
13581
|
Tabs,
|
|
13582
|
+
TabsContent,
|
|
13583
|
+
TabsList,
|
|
13584
|
+
TabsTrigger,
|
|
13694
13585
|
Tag,
|
|
13695
13586
|
Text,
|
|
13696
13587
|
Thumbnail,
|