@wistia/ui 0.9.4 → 0.9.5-beta.710b9e02.ea620db
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 +434 -419
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +388 -373
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.9.
|
|
3
|
+
* @license @wistia/ui v0.9.5-beta.710b9e02.ea620db
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8208,9 +8208,9 @@ var Center = (0, import_react28.forwardRef)(
|
|
|
8208
8208
|
Center.displayName = "Center";
|
|
8209
8209
|
|
|
8210
8210
|
// src/components/Checkbox/Checkbox.tsx
|
|
8211
|
-
var
|
|
8212
|
-
var
|
|
8213
|
-
var
|
|
8211
|
+
var import_react33 = require("react");
|
|
8212
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8213
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
8214
8214
|
|
|
8215
8215
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
8216
8216
|
var import_styled_components35 = __toESM(require("styled-components"));
|
|
@@ -8328,9 +8328,230 @@ var FormControlLabel = ({
|
|
|
8328
8328
|
};
|
|
8329
8329
|
FormControlLabel.displayName = "FormControlLabel";
|
|
8330
8330
|
|
|
8331
|
-
// src/components/
|
|
8331
|
+
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8332
|
+
var import_react32 = require("react");
|
|
8333
|
+
|
|
8334
|
+
// src/components/FormGroup/FormGroup.tsx
|
|
8335
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
8336
|
+
var import_react31 = require("react");
|
|
8337
|
+
|
|
8338
|
+
// src/components/Stack/Stack.tsx
|
|
8339
|
+
var import_react29 = require("react");
|
|
8340
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
8332
8341
|
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
8333
|
-
var
|
|
8342
|
+
var DEFAULT_ELEMENT2 = "div";
|
|
8343
|
+
var StyledStack = import_styled_components36.default.div`
|
|
8344
|
+
display: flex;
|
|
8345
|
+
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
8346
|
+
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
8347
|
+
align-items: ${({ $alignItems }) => $alignItems};
|
|
8348
|
+
`;
|
|
8349
|
+
var StackComponent = (0, import_react29.forwardRef)(
|
|
8350
|
+
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
8351
|
+
const responsiveGap = useResponsiveProp(gap);
|
|
8352
|
+
const responsiveDirection = useResponsiveProp(direction);
|
|
8353
|
+
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
8354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
8355
|
+
StyledStack,
|
|
8356
|
+
{
|
|
8357
|
+
ref,
|
|
8358
|
+
$alignItems: responsiveAlignItems,
|
|
8359
|
+
$direction: responsiveDirection,
|
|
8360
|
+
$gap: responsiveGap,
|
|
8361
|
+
as: renderAs ?? DEFAULT_ELEMENT2,
|
|
8362
|
+
...props
|
|
8363
|
+
}
|
|
8364
|
+
);
|
|
8365
|
+
}
|
|
8366
|
+
);
|
|
8367
|
+
StackComponent.displayName = "Stack";
|
|
8368
|
+
var Stack = makePolymorphic(StackComponent);
|
|
8369
|
+
|
|
8370
|
+
// src/components/Heading/Heading.tsx
|
|
8371
|
+
var import_react30 = require("react");
|
|
8372
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
8373
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
8374
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
8375
|
+
var heroStyle = import_styled_components37.css`
|
|
8376
|
+
--font-family: var(--wui-typography-heading-hero-family);
|
|
8377
|
+
--font-size: var(--wui-typography-heading-hero-size);
|
|
8378
|
+
--font-weight: var(--wui-typography-heading-hero-weight);
|
|
8379
|
+
--line-height: var(--wui-typography-heading-hero-line-height);
|
|
8380
|
+
`;
|
|
8381
|
+
var heading1TextStyle = import_styled_components37.css`
|
|
8382
|
+
--font-family: var(--wui-typography-heading-1-family);
|
|
8383
|
+
--font-size: var(--wui-typography-heading-1-size);
|
|
8384
|
+
--font-weight: var(--wui-typography-heading-1-weight);
|
|
8385
|
+
--line-height: var(--wui-typography-heading-1-line-height);
|
|
8386
|
+
`;
|
|
8387
|
+
var heading2TextStyle = import_styled_components37.css`
|
|
8388
|
+
--font-family: var(--wui-typography-heading-2-family);
|
|
8389
|
+
--font-size: var(--wui-typography-heading-2-size);
|
|
8390
|
+
--font-weight: var(--wui-typography-heading-2-weight);
|
|
8391
|
+
--line-height: var(--wui-typography-heading-2-line-height);
|
|
8392
|
+
`;
|
|
8393
|
+
var heading3TextStyle = import_styled_components37.css`
|
|
8394
|
+
--font-family: var(--wui-typography-heading-3-family);
|
|
8395
|
+
--font-size: var(--wui-typography-heading-3-size);
|
|
8396
|
+
--font-weight: var(--wui-typography-heading-3-weight);
|
|
8397
|
+
--line-height: var(--wui-typography-heading-3-line-height);
|
|
8398
|
+
`;
|
|
8399
|
+
var heading4TextStyle = import_styled_components37.css`
|
|
8400
|
+
--font-family: var(--wui-typography-heading-4-family);
|
|
8401
|
+
--font-size: var(--wui-typography-heading-4-size);
|
|
8402
|
+
--font-weight: var(--wui-typography-heading-4-weight);
|
|
8403
|
+
--line-height: var(--wui-typography-heading-4-line-height);
|
|
8404
|
+
`;
|
|
8405
|
+
var heading5TextStyle = import_styled_components37.css`
|
|
8406
|
+
--font-family: var(--wui-typography-heading-5-family);
|
|
8407
|
+
--font-size: var(--wui-typography-heading-5-size);
|
|
8408
|
+
--font-weight: var(--wui-typography-heading-5-weight);
|
|
8409
|
+
--line-height: var(--wui-typography-heading-5-line-height);
|
|
8410
|
+
`;
|
|
8411
|
+
var heading6TextStyle = import_styled_components37.css`
|
|
8412
|
+
--font-family: var(--wui-typography-heading-6-family);
|
|
8413
|
+
--font-size: var(--wui-typography-heading-6-size);
|
|
8414
|
+
--font-weight: var(--wui-typography-heading-6-weight);
|
|
8415
|
+
--line-height: var(--wui-typography-heading-6-line-height);
|
|
8416
|
+
`;
|
|
8417
|
+
var variantStyleMap = {
|
|
8418
|
+
hero: heroStyle,
|
|
8419
|
+
heading1: heading1TextStyle,
|
|
8420
|
+
heading2: heading2TextStyle,
|
|
8421
|
+
heading3: heading3TextStyle,
|
|
8422
|
+
heading4: heading4TextStyle,
|
|
8423
|
+
heading5: heading5TextStyle,
|
|
8424
|
+
heading6: heading6TextStyle
|
|
8425
|
+
};
|
|
8426
|
+
var DEFAULT_ELEMENT3 = "h1";
|
|
8427
|
+
var StyledHeading = import_styled_components37.default.div`
|
|
8428
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8429
|
+
font-family: var(--font-family);
|
|
8430
|
+
font-size: var(--font-size);
|
|
8431
|
+
font-weight: var(--font-weight);
|
|
8432
|
+
line-height: var(--line-height);
|
|
8433
|
+
color: var(--wui-color-text);
|
|
8434
|
+
${({ $variant }) => variantStyleMap[$variant]}
|
|
8435
|
+
${({ $truncate }) => {
|
|
8436
|
+
if ((0, import_type_guards25.isNotNil)($truncate)) {
|
|
8437
|
+
return import_styled_components37.css`
|
|
8438
|
+
${ellipsisStyle};
|
|
8439
|
+
${lineClampCss($truncate)};
|
|
8440
|
+
`;
|
|
8441
|
+
}
|
|
8442
|
+
return void 0;
|
|
8443
|
+
}}
|
|
8444
|
+
${({ $inline }) => $inline && import_styled_components37.css`
|
|
8445
|
+
display: inline-block;
|
|
8446
|
+
`}
|
|
8447
|
+
${({ $disabled }) => $disabled && import_styled_components37.css`
|
|
8448
|
+
color: var(--wui-color-text-disabled);
|
|
8449
|
+
`}
|
|
8450
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components37.css`
|
|
8451
|
+
user-select: none;
|
|
8452
|
+
`}
|
|
8453
|
+
${({ $align }) => import_styled_components37.css`
|
|
8454
|
+
text-align: ${$align};
|
|
8455
|
+
`}
|
|
8456
|
+
margin: 0;
|
|
8457
|
+
`;
|
|
8458
|
+
var variantElementMap = {
|
|
8459
|
+
hero: DEFAULT_ELEMENT3,
|
|
8460
|
+
heading1: DEFAULT_ELEMENT3,
|
|
8461
|
+
heading2: "h2",
|
|
8462
|
+
heading3: "h3",
|
|
8463
|
+
heading4: "h4",
|
|
8464
|
+
heading5: "h5",
|
|
8465
|
+
heading6: "h6"
|
|
8466
|
+
};
|
|
8467
|
+
var HeadingComponent = (0, import_react30.forwardRef)(
|
|
8468
|
+
({
|
|
8469
|
+
align = "left",
|
|
8470
|
+
colorScheme = "inherit",
|
|
8471
|
+
disabled = false,
|
|
8472
|
+
inline = false,
|
|
8473
|
+
preventUserSelect = false,
|
|
8474
|
+
truncate,
|
|
8475
|
+
variant = "heading1",
|
|
8476
|
+
renderAs,
|
|
8477
|
+
...props
|
|
8478
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
8479
|
+
StyledHeading,
|
|
8480
|
+
{
|
|
8481
|
+
ref,
|
|
8482
|
+
$align: align,
|
|
8483
|
+
$colorScheme: colorScheme,
|
|
8484
|
+
$disabled: disabled,
|
|
8485
|
+
$inline: inline,
|
|
8486
|
+
$preventUserSelect: preventUserSelect,
|
|
8487
|
+
$truncate: truncate,
|
|
8488
|
+
$variant: variant,
|
|
8489
|
+
as: renderAs ?? variantElementMap[variant],
|
|
8490
|
+
...props
|
|
8491
|
+
}
|
|
8492
|
+
)
|
|
8493
|
+
);
|
|
8494
|
+
HeadingComponent.displayName = "Heading";
|
|
8495
|
+
var Heading = makePolymorphic(HeadingComponent);
|
|
8496
|
+
|
|
8497
|
+
// src/components/FormGroup/FormGroup.tsx
|
|
8498
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
8499
|
+
var StyledFieldset = import_styled_components38.default.fieldset`
|
|
8500
|
+
border: 0;
|
|
8501
|
+
`;
|
|
8502
|
+
var StyledLegend = import_styled_components38.default.legend`
|
|
8503
|
+
margin-bottom: var(--space-01);
|
|
8504
|
+
`;
|
|
8505
|
+
var FormGroup = ({ children, label, ...props }) => {
|
|
8506
|
+
const ref = (0, import_react31.useRef)();
|
|
8507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
8508
|
+
Stack,
|
|
8509
|
+
{
|
|
8510
|
+
...props,
|
|
8511
|
+
ref,
|
|
8512
|
+
renderAs: StyledFieldset,
|
|
8513
|
+
children: [
|
|
8514
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
8515
|
+
Heading,
|
|
8516
|
+
{
|
|
8517
|
+
renderAs: StyledLegend,
|
|
8518
|
+
variant: "heading5",
|
|
8519
|
+
children: label
|
|
8520
|
+
}
|
|
8521
|
+
),
|
|
8522
|
+
children
|
|
8523
|
+
]
|
|
8524
|
+
}
|
|
8525
|
+
);
|
|
8526
|
+
};
|
|
8527
|
+
FormGroup.displayName = "FormGroup";
|
|
8528
|
+
|
|
8529
|
+
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8530
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
8531
|
+
var CheckboxGroupContext = (0, import_react32.createContext)(null);
|
|
8532
|
+
var useCheckboxGroup = () => {
|
|
8533
|
+
return (0, import_react32.useContext)(CheckboxGroupContext);
|
|
8534
|
+
};
|
|
8535
|
+
var CheckboxGroup = ({
|
|
8536
|
+
children,
|
|
8537
|
+
name,
|
|
8538
|
+
onChange,
|
|
8539
|
+
value,
|
|
8540
|
+
...props
|
|
8541
|
+
}) => {
|
|
8542
|
+
const context = (0, import_react32.useMemo)(() => {
|
|
8543
|
+
return {
|
|
8544
|
+
name,
|
|
8545
|
+
onChange
|
|
8546
|
+
};
|
|
8547
|
+
}, [name, onChange]);
|
|
8548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(FormGroup, { ...props, children }) });
|
|
8549
|
+
};
|
|
8550
|
+
CheckboxGroup.displayName = "CheckboxGroup";
|
|
8551
|
+
|
|
8552
|
+
// src/components/Checkbox/Checkbox.tsx
|
|
8553
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
8554
|
+
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8334
8555
|
"svg",
|
|
8335
8556
|
{
|
|
8336
8557
|
fill: "inherit",
|
|
@@ -8338,7 +8559,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
|
8338
8559
|
viewBox: "0 0 10 8",
|
|
8339
8560
|
width: "10",
|
|
8340
8561
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8341
|
-
children: /* @__PURE__ */ (0,
|
|
8562
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8342
8563
|
"path",
|
|
8343
8564
|
{
|
|
8344
8565
|
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",
|
|
@@ -8347,7 +8568,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
|
8347
8568
|
)
|
|
8348
8569
|
}
|
|
8349
8570
|
);
|
|
8350
|
-
var sizeSmall =
|
|
8571
|
+
var sizeSmall = import_styled_components39.css`
|
|
8351
8572
|
width: 14px;
|
|
8352
8573
|
height: 14px;
|
|
8353
8574
|
min-width: 14px;
|
|
@@ -8358,7 +8579,7 @@ var sizeSmall = import_styled_components36.css`
|
|
|
8358
8579
|
height: 7px;
|
|
8359
8580
|
}
|
|
8360
8581
|
`;
|
|
8361
|
-
var sizeMedium =
|
|
8582
|
+
var sizeMedium = import_styled_components39.css`
|
|
8362
8583
|
width: 16px;
|
|
8363
8584
|
height: 16px;
|
|
8364
8585
|
min-width: 16px;
|
|
@@ -8369,7 +8590,7 @@ var sizeMedium = import_styled_components36.css`
|
|
|
8369
8590
|
height: 9px;
|
|
8370
8591
|
}
|
|
8371
8592
|
`;
|
|
8372
|
-
var sizeLarge =
|
|
8593
|
+
var sizeLarge = import_styled_components39.css`
|
|
8373
8594
|
width: 20px;
|
|
8374
8595
|
height: 20px;
|
|
8375
8596
|
min-width: 20px;
|
|
@@ -8385,14 +8606,14 @@ var getSizeCss = (size) => {
|
|
|
8385
8606
|
if (size === "lg") return sizeLarge;
|
|
8386
8607
|
return sizeMedium;
|
|
8387
8608
|
};
|
|
8388
|
-
var StyledCheckboxWrapper =
|
|
8609
|
+
var StyledCheckboxWrapper = import_styled_components39.default.div`
|
|
8389
8610
|
display: flex;
|
|
8390
8611
|
margin: 0;
|
|
8391
8612
|
|
|
8392
8613
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
8393
8614
|
user-select: none;
|
|
8394
8615
|
`;
|
|
8395
|
-
var StyledCheckboxInput =
|
|
8616
|
+
var StyledCheckboxInput = import_styled_components39.default.div`
|
|
8396
8617
|
${({ $size }) => getSizeCss($size)}
|
|
8397
8618
|
line-height: 0;
|
|
8398
8619
|
margin: 0;
|
|
@@ -8414,7 +8635,7 @@ var StyledCheckboxInput = import_styled_components36.default.div`
|
|
|
8414
8635
|
}
|
|
8415
8636
|
}
|
|
8416
8637
|
`;
|
|
8417
|
-
var StyledHiddenCheckboxInput =
|
|
8638
|
+
var StyledHiddenCheckboxInput = import_styled_components39.default.input`
|
|
8418
8639
|
${visuallyHiddenStyle}
|
|
8419
8640
|
|
|
8420
8641
|
/* toggles display of faux-input background-color */
|
|
@@ -8428,7 +8649,7 @@ var StyledHiddenCheckboxInput = import_styled_components36.default.input`
|
|
|
8428
8649
|
display: block;
|
|
8429
8650
|
}
|
|
8430
8651
|
`;
|
|
8431
|
-
var Checkbox = (0,
|
|
8652
|
+
var Checkbox = (0, import_react33.forwardRef)(
|
|
8432
8653
|
({
|
|
8433
8654
|
checked,
|
|
8434
8655
|
disabled = false,
|
|
@@ -8443,10 +8664,15 @@ var Checkbox = (0, import_react29.forwardRef)(
|
|
|
8443
8664
|
hideLabel = false,
|
|
8444
8665
|
...props
|
|
8445
8666
|
}, ref) => {
|
|
8446
|
-
const generatedId = (0,
|
|
8447
|
-
const computedId = (0,
|
|
8448
|
-
|
|
8449
|
-
|
|
8667
|
+
const generatedId = (0, import_react33.useId)();
|
|
8668
|
+
const computedId = (0, import_type_guards26.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8669
|
+
const checkboxGroupContext = useCheckboxGroup();
|
|
8670
|
+
const contextName = checkboxGroupContext?.name;
|
|
8671
|
+
const contextOnChange = checkboxGroupContext?.onChange;
|
|
8672
|
+
const checkboxName = name ?? contextName;
|
|
8673
|
+
const handleOnChange = onChange ?? contextOnChange;
|
|
8674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
8675
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8450
8676
|
StyledHiddenCheckboxInput,
|
|
8451
8677
|
{
|
|
8452
8678
|
...props,
|
|
@@ -8454,23 +8680,23 @@ var Checkbox = (0, import_react29.forwardRef)(
|
|
|
8454
8680
|
checked,
|
|
8455
8681
|
disabled,
|
|
8456
8682
|
id: computedId,
|
|
8457
|
-
name,
|
|
8458
|
-
onChange,
|
|
8683
|
+
name: checkboxName,
|
|
8684
|
+
onChange: handleOnChange,
|
|
8459
8685
|
required,
|
|
8460
8686
|
type: "checkbox",
|
|
8461
8687
|
value
|
|
8462
8688
|
}
|
|
8463
8689
|
),
|
|
8464
|
-
/* @__PURE__ */ (0,
|
|
8690
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8465
8691
|
FormControlLabel,
|
|
8466
8692
|
{
|
|
8467
|
-
controlSlot: /* @__PURE__ */ (0,
|
|
8693
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8468
8694
|
StyledCheckboxInput,
|
|
8469
8695
|
{
|
|
8470
8696
|
$disabled: disabled,
|
|
8471
8697
|
$size: size,
|
|
8472
8698
|
"data-wui-faux-input": "true",
|
|
8473
|
-
children: /* @__PURE__ */ (0,
|
|
8699
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(CheckIcon, {})
|
|
8474
8700
|
}
|
|
8475
8701
|
),
|
|
8476
8702
|
description,
|
|
@@ -8486,14 +8712,14 @@ var Checkbox = (0, import_react29.forwardRef)(
|
|
|
8486
8712
|
Checkbox.displayName = "Checkbox";
|
|
8487
8713
|
|
|
8488
8714
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
8489
|
-
var
|
|
8715
|
+
var import_react34 = require("react");
|
|
8490
8716
|
var isClickableElement = (element) => {
|
|
8491
8717
|
if (!element) return false;
|
|
8492
8718
|
const el = element;
|
|
8493
8719
|
return el.closest("button") !== null || el.closest("a") !== null || el.closest("input") !== null || el.closest("select") !== null || el.closest("textarea") !== null || el.closest("label") !== null || el.closest("[data-wui-faux-input]") !== null;
|
|
8494
8720
|
};
|
|
8495
8721
|
var ClickRegion = ({ children, targetRef }) => {
|
|
8496
|
-
(0,
|
|
8722
|
+
(0, import_react34.useEffect)(() => {
|
|
8497
8723
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
8498
8724
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
8499
8725
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -8501,7 +8727,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8501
8727
|
} else {
|
|
8502
8728
|
}
|
|
8503
8729
|
}, [targetRef]);
|
|
8504
|
-
const handleClick = (0,
|
|
8730
|
+
const handleClick = (0, import_react34.useCallback)(
|
|
8505
8731
|
(event) => {
|
|
8506
8732
|
const node = targetRef.current;
|
|
8507
8733
|
if (event.target === node) {
|
|
@@ -8521,7 +8747,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8521
8747
|
},
|
|
8522
8748
|
[targetRef]
|
|
8523
8749
|
);
|
|
8524
|
-
return (0,
|
|
8750
|
+
return (0, import_react34.cloneElement)(import_react34.Children.only(children), {
|
|
8525
8751
|
"data-click-region": true,
|
|
8526
8752
|
onClick: handleClick
|
|
8527
8753
|
});
|
|
@@ -8530,10 +8756,10 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
8530
8756
|
|
|
8531
8757
|
// src/components/Collapsible/Collapsible.tsx
|
|
8532
8758
|
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
8533
|
-
var
|
|
8534
|
-
var
|
|
8535
|
-
var
|
|
8536
|
-
var StyledRoot = (0,
|
|
8759
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
8760
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
8761
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
8762
|
+
var StyledRoot = (0, import_styled_components40.default)(import_react_collapsible.Root)`
|
|
8537
8763
|
&[data-state='closed'] [data-wui-collapsible-content] {
|
|
8538
8764
|
display: -webkit-box;
|
|
8539
8765
|
-webkit-box-orient: vertical;
|
|
@@ -8547,32 +8773,32 @@ var Collapsible = ({
|
|
|
8547
8773
|
onOpenChange
|
|
8548
8774
|
}) => {
|
|
8549
8775
|
const controlProps = {
|
|
8550
|
-
...(0,
|
|
8776
|
+
...(0, import_type_guards27.isNotNil)(onOpenChange) && (0, import_type_guards27.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8551
8777
|
};
|
|
8552
|
-
return /* @__PURE__ */ (0,
|
|
8778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledRoot, { ...controlProps, children });
|
|
8553
8779
|
};
|
|
8554
8780
|
Collapsible.displayName = "Collapsible";
|
|
8555
8781
|
|
|
8556
8782
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8557
|
-
var
|
|
8783
|
+
var import_react35 = require("react");
|
|
8558
8784
|
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
8559
|
-
var
|
|
8785
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
8560
8786
|
var CollapsibleTrigger = ({ children }) => {
|
|
8561
|
-
|
|
8562
|
-
return /* @__PURE__ */ (0,
|
|
8787
|
+
import_react35.Children.only(children);
|
|
8788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
8563
8789
|
};
|
|
8564
8790
|
|
|
8565
8791
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
8566
|
-
var
|
|
8792
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
8567
8793
|
var import_react_collapsible3 = require("@radix-ui/react-collapsible");
|
|
8568
|
-
var
|
|
8569
|
-
var
|
|
8570
|
-
var ClampedContent =
|
|
8794
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8795
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
8796
|
+
var ClampedContent = import_styled_components41.default.div`
|
|
8571
8797
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
8572
8798
|
`;
|
|
8573
8799
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
8574
|
-
if ((0,
|
|
8575
|
-
return /* @__PURE__ */ (0,
|
|
8800
|
+
if ((0, import_type_guards28.isNotUndefined)(clamp)) {
|
|
8801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
8576
8802
|
ClampedContent,
|
|
8577
8803
|
{
|
|
8578
8804
|
$clamp: clamp,
|
|
@@ -8581,147 +8807,18 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
8581
8807
|
}
|
|
8582
8808
|
);
|
|
8583
8809
|
}
|
|
8584
|
-
return /* @__PURE__ */ (0,
|
|
8810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_react_collapsible3.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(import_jsx_runtime215.Fragment, { children: [
|
|
8585
8811
|
children,
|
|
8586
8812
|
" "
|
|
8587
8813
|
] }) });
|
|
8588
8814
|
};
|
|
8589
8815
|
|
|
8590
8816
|
// src/components/DataCards/DataCard.tsx
|
|
8591
|
-
var
|
|
8592
|
-
var
|
|
8817
|
+
var import_react36 = require("react");
|
|
8818
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8593
8819
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
var import_react32 = require("react");
|
|
8597
|
-
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8598
|
-
var import_type_guards28 = require("@wistia/type-guards");
|
|
8599
|
-
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
8600
|
-
var heroStyle = import_styled_components39.css`
|
|
8601
|
-
--font-family: var(--wui-typography-heading-hero-family);
|
|
8602
|
-
--font-size: var(--wui-typography-heading-hero-size);
|
|
8603
|
-
--font-weight: var(--wui-typography-heading-hero-weight);
|
|
8604
|
-
--line-height: var(--wui-typography-heading-hero-line-height);
|
|
8605
|
-
`;
|
|
8606
|
-
var heading1TextStyle = import_styled_components39.css`
|
|
8607
|
-
--font-family: var(--wui-typography-heading-1-family);
|
|
8608
|
-
--font-size: var(--wui-typography-heading-1-size);
|
|
8609
|
-
--font-weight: var(--wui-typography-heading-1-weight);
|
|
8610
|
-
--line-height: var(--wui-typography-heading-1-line-height);
|
|
8611
|
-
`;
|
|
8612
|
-
var heading2TextStyle = import_styled_components39.css`
|
|
8613
|
-
--font-family: var(--wui-typography-heading-2-family);
|
|
8614
|
-
--font-size: var(--wui-typography-heading-2-size);
|
|
8615
|
-
--font-weight: var(--wui-typography-heading-2-weight);
|
|
8616
|
-
--line-height: var(--wui-typography-heading-2-line-height);
|
|
8617
|
-
`;
|
|
8618
|
-
var heading3TextStyle = import_styled_components39.css`
|
|
8619
|
-
--font-family: var(--wui-typography-heading-3-family);
|
|
8620
|
-
--font-size: var(--wui-typography-heading-3-size);
|
|
8621
|
-
--font-weight: var(--wui-typography-heading-3-weight);
|
|
8622
|
-
--line-height: var(--wui-typography-heading-3-line-height);
|
|
8623
|
-
`;
|
|
8624
|
-
var heading4TextStyle = import_styled_components39.css`
|
|
8625
|
-
--font-family: var(--wui-typography-heading-4-family);
|
|
8626
|
-
--font-size: var(--wui-typography-heading-4-size);
|
|
8627
|
-
--font-weight: var(--wui-typography-heading-4-weight);
|
|
8628
|
-
--line-height: var(--wui-typography-heading-4-line-height);
|
|
8629
|
-
`;
|
|
8630
|
-
var heading5TextStyle = import_styled_components39.css`
|
|
8631
|
-
--font-family: var(--wui-typography-heading-5-family);
|
|
8632
|
-
--font-size: var(--wui-typography-heading-5-size);
|
|
8633
|
-
--font-weight: var(--wui-typography-heading-5-weight);
|
|
8634
|
-
--line-height: var(--wui-typography-heading-5-line-height);
|
|
8635
|
-
`;
|
|
8636
|
-
var heading6TextStyle = import_styled_components39.css`
|
|
8637
|
-
--font-family: var(--wui-typography-heading-6-family);
|
|
8638
|
-
--font-size: var(--wui-typography-heading-6-size);
|
|
8639
|
-
--font-weight: var(--wui-typography-heading-6-weight);
|
|
8640
|
-
--line-height: var(--wui-typography-heading-6-line-height);
|
|
8641
|
-
`;
|
|
8642
|
-
var variantStyleMap = {
|
|
8643
|
-
hero: heroStyle,
|
|
8644
|
-
heading1: heading1TextStyle,
|
|
8645
|
-
heading2: heading2TextStyle,
|
|
8646
|
-
heading3: heading3TextStyle,
|
|
8647
|
-
heading4: heading4TextStyle,
|
|
8648
|
-
heading5: heading5TextStyle,
|
|
8649
|
-
heading6: heading6TextStyle
|
|
8650
|
-
};
|
|
8651
|
-
var DEFAULT_ELEMENT2 = "h1";
|
|
8652
|
-
var StyledHeading = import_styled_components39.default.div`
|
|
8653
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8654
|
-
font-family: var(--font-family);
|
|
8655
|
-
font-size: var(--font-size);
|
|
8656
|
-
font-weight: var(--font-weight);
|
|
8657
|
-
line-height: var(--line-height);
|
|
8658
|
-
color: var(--wui-color-text);
|
|
8659
|
-
${({ $variant }) => variantStyleMap[$variant]}
|
|
8660
|
-
${({ $truncate }) => {
|
|
8661
|
-
if ((0, import_type_guards28.isNotNil)($truncate)) {
|
|
8662
|
-
return import_styled_components39.css`
|
|
8663
|
-
${ellipsisStyle};
|
|
8664
|
-
${lineClampCss($truncate)};
|
|
8665
|
-
`;
|
|
8666
|
-
}
|
|
8667
|
-
return void 0;
|
|
8668
|
-
}}
|
|
8669
|
-
${({ $inline }) => $inline && import_styled_components39.css`
|
|
8670
|
-
display: inline-block;
|
|
8671
|
-
`}
|
|
8672
|
-
${({ $disabled }) => $disabled && import_styled_components39.css`
|
|
8673
|
-
color: var(--wui-color-text-disabled);
|
|
8674
|
-
`}
|
|
8675
|
-
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components39.css`
|
|
8676
|
-
user-select: none;
|
|
8677
|
-
`}
|
|
8678
|
-
${({ $align }) => import_styled_components39.css`
|
|
8679
|
-
text-align: ${$align};
|
|
8680
|
-
`}
|
|
8681
|
-
margin: 0;
|
|
8682
|
-
`;
|
|
8683
|
-
var variantElementMap = {
|
|
8684
|
-
hero: DEFAULT_ELEMENT2,
|
|
8685
|
-
heading1: DEFAULT_ELEMENT2,
|
|
8686
|
-
heading2: "h2",
|
|
8687
|
-
heading3: "h3",
|
|
8688
|
-
heading4: "h4",
|
|
8689
|
-
heading5: "h5",
|
|
8690
|
-
heading6: "h6"
|
|
8691
|
-
};
|
|
8692
|
-
var HeadingComponent = (0, import_react32.forwardRef)(
|
|
8693
|
-
({
|
|
8694
|
-
align = "left",
|
|
8695
|
-
colorScheme = "inherit",
|
|
8696
|
-
disabled = false,
|
|
8697
|
-
inline = false,
|
|
8698
|
-
preventUserSelect = false,
|
|
8699
|
-
truncate,
|
|
8700
|
-
variant = "heading1",
|
|
8701
|
-
renderAs,
|
|
8702
|
-
...props
|
|
8703
|
-
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8704
|
-
StyledHeading,
|
|
8705
|
-
{
|
|
8706
|
-
ref,
|
|
8707
|
-
$align: align,
|
|
8708
|
-
$colorScheme: colorScheme,
|
|
8709
|
-
$disabled: disabled,
|
|
8710
|
-
$inline: inline,
|
|
8711
|
-
$preventUserSelect: preventUserSelect,
|
|
8712
|
-
$truncate: truncate,
|
|
8713
|
-
$variant: variant,
|
|
8714
|
-
as: renderAs ?? variantElementMap[variant],
|
|
8715
|
-
...props
|
|
8716
|
-
}
|
|
8717
|
-
)
|
|
8718
|
-
);
|
|
8719
|
-
HeadingComponent.displayName = "Heading";
|
|
8720
|
-
var Heading = makePolymorphic(HeadingComponent);
|
|
8721
|
-
|
|
8722
|
-
// src/components/DataCards/DataCard.tsx
|
|
8723
|
-
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
8724
|
-
var StyledDataCard = import_styled_components40.default.div`
|
|
8820
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
8821
|
+
var StyledDataCard = import_styled_components42.default.div`
|
|
8725
8822
|
display: grid;
|
|
8726
8823
|
grid-template-areas: 'label slot' 'value value';
|
|
8727
8824
|
grid-template-rows: auto auto;
|
|
@@ -8776,7 +8873,7 @@ var StyledDataCard = import_styled_components40.default.div`
|
|
|
8776
8873
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8777
8874
|
}
|
|
8778
8875
|
`;
|
|
8779
|
-
var shimmer =
|
|
8876
|
+
var shimmer = import_styled_components42.keyframes`
|
|
8780
8877
|
0% {
|
|
8781
8878
|
background-position: 200% 0;
|
|
8782
8879
|
}
|
|
@@ -8784,7 +8881,7 @@ var shimmer = import_styled_components40.keyframes`
|
|
|
8784
8881
|
background-position: -200% 0;
|
|
8785
8882
|
}
|
|
8786
8883
|
`;
|
|
8787
|
-
var LoadingBackground =
|
|
8884
|
+
var LoadingBackground = import_styled_components42.default.div`
|
|
8788
8885
|
background: linear-gradient(
|
|
8789
8886
|
90deg,
|
|
8790
8887
|
var(--wui-color-bg-surface-tertiary) 25%,
|
|
@@ -8795,27 +8892,27 @@ var LoadingBackground = import_styled_components40.default.div`
|
|
|
8795
8892
|
animation: ${shimmer} 1.5s infinite;
|
|
8796
8893
|
border-radius: var(--wui-border-radius-01);
|
|
8797
8894
|
`;
|
|
8798
|
-
var StyledLoadingLabel = (0,
|
|
8895
|
+
var StyledLoadingLabel = (0, import_styled_components42.default)(LoadingBackground)`
|
|
8799
8896
|
width: 80px;
|
|
8800
8897
|
height: var(--wui-typography-heading-6-line-height);
|
|
8801
8898
|
`;
|
|
8802
|
-
var StyledLoadingValue = (0,
|
|
8899
|
+
var StyledLoadingValue = (0, import_styled_components42.default)(LoadingBackground)`
|
|
8803
8900
|
width: 90%;
|
|
8804
8901
|
height: var(--wui-typography-heading-3-line-height);
|
|
8805
8902
|
`;
|
|
8806
|
-
var StyledLabel2 = (0,
|
|
8903
|
+
var StyledLabel2 = (0, import_styled_components42.default)(Heading)`
|
|
8807
8904
|
grid-area: label;
|
|
8808
8905
|
`;
|
|
8809
|
-
var StyledValue = (0,
|
|
8906
|
+
var StyledValue = (0, import_styled_components42.default)(Heading)`
|
|
8810
8907
|
grid-area: value;
|
|
8811
8908
|
`;
|
|
8812
|
-
var StyledSlot =
|
|
8909
|
+
var StyledSlot = import_styled_components42.default.div`
|
|
8813
8910
|
display: flex;
|
|
8814
8911
|
justify-content: flex-end;
|
|
8815
8912
|
grid-area: slot;
|
|
8816
8913
|
align-self: center;
|
|
8817
8914
|
`;
|
|
8818
|
-
var StyledDataCardTrendContainer =
|
|
8915
|
+
var StyledDataCardTrendContainer = import_styled_components42.default.div`
|
|
8819
8916
|
position: absolute;
|
|
8820
8917
|
bottom: var(--wui-space-01);
|
|
8821
8918
|
right: var(--wui-space-01);
|
|
@@ -8828,34 +8925,34 @@ var DataCardInner = ({
|
|
|
8828
8925
|
isLoading = false,
|
|
8829
8926
|
trend,
|
|
8830
8927
|
...props
|
|
8831
|
-
}) => /* @__PURE__ */ (0,
|
|
8928
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(
|
|
8832
8929
|
StyledDataCard,
|
|
8833
8930
|
{
|
|
8834
8931
|
$colorScheme: colorScheme,
|
|
8835
8932
|
...props,
|
|
8836
8933
|
children: [
|
|
8837
|
-
/* @__PURE__ */ (0,
|
|
8934
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
8838
8935
|
StyledLabel2,
|
|
8839
8936
|
{
|
|
8840
8937
|
renderAs: "dt",
|
|
8841
8938
|
variant: "heading6",
|
|
8842
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
8939
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(StyledLoadingLabel, {}) : label
|
|
8843
8940
|
}
|
|
8844
8941
|
),
|
|
8845
|
-
/* @__PURE__ */ (0,
|
|
8942
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
8846
8943
|
StyledValue,
|
|
8847
8944
|
{
|
|
8848
8945
|
renderAs: "dd",
|
|
8849
8946
|
variant: "heading3",
|
|
8850
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
8947
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(StyledLoadingValue, {}) : value
|
|
8851
8948
|
}
|
|
8852
8949
|
),
|
|
8853
|
-
(0, import_type_guards29.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0,
|
|
8854
|
-
(0, import_type_guards29.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0,
|
|
8950
|
+
(0, import_type_guards29.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
8951
|
+
(0, import_type_guards29.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
8855
8952
|
]
|
|
8856
8953
|
}
|
|
8857
8954
|
);
|
|
8858
|
-
var DataCardArrowIcon = /* @__PURE__ */ (0,
|
|
8955
|
+
var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
8859
8956
|
Icon,
|
|
8860
8957
|
{
|
|
8861
8958
|
"data-wui-data-card-hover-icon": true,
|
|
@@ -8863,14 +8960,14 @@ var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
|
8863
8960
|
}
|
|
8864
8961
|
);
|
|
8865
8962
|
var DataCard = (props) => {
|
|
8866
|
-
const ref = (0,
|
|
8963
|
+
const ref = (0, import_react36.useRef)(null);
|
|
8867
8964
|
if ((0, import_type_guards29.isNotNil)(props.href) || (0, import_type_guards29.isNotNil)(props.onClick)) {
|
|
8868
|
-
return /* @__PURE__ */ (0,
|
|
8965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
8869
8966
|
DataCardInner,
|
|
8870
8967
|
{
|
|
8871
8968
|
upperRightSlot: props.upperRightSlot ?? DataCardArrowIcon,
|
|
8872
8969
|
...props,
|
|
8873
|
-
label: /* @__PURE__ */ (0,
|
|
8970
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
8874
8971
|
Button,
|
|
8875
8972
|
{
|
|
8876
8973
|
ref,
|
|
@@ -8885,14 +8982,14 @@ var DataCard = (props) => {
|
|
|
8885
8982
|
}
|
|
8886
8983
|
) });
|
|
8887
8984
|
}
|
|
8888
|
-
return /* @__PURE__ */ (0,
|
|
8985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(DataCardInner, { ...props });
|
|
8889
8986
|
};
|
|
8890
8987
|
DataCard.displayName = "DataCard";
|
|
8891
8988
|
|
|
8892
8989
|
// src/components/DataCards/DataCards.tsx
|
|
8893
|
-
var
|
|
8894
|
-
var
|
|
8895
|
-
var StyledDataCards = (0,
|
|
8990
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8991
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
8992
|
+
var StyledDataCards = (0, import_styled_components43.default)(Box)`
|
|
8896
8993
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8897
8994
|
margin-top: 0; /* Remove default <dl> style */
|
|
8898
8995
|
> * {
|
|
@@ -8906,7 +9003,7 @@ var DataCards = ({
|
|
|
8906
9003
|
colorScheme = "inherit",
|
|
8907
9004
|
...props
|
|
8908
9005
|
}) => {
|
|
8909
|
-
return /* @__PURE__ */ (0,
|
|
9006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
8910
9007
|
StyledDataCards,
|
|
8911
9008
|
{
|
|
8912
9009
|
...props,
|
|
@@ -8924,26 +9021,26 @@ var DataCards = ({
|
|
|
8924
9021
|
DataCards.displayName = "DataCards";
|
|
8925
9022
|
|
|
8926
9023
|
// src/components/DataCards/DataCardTrend.tsx
|
|
8927
|
-
var
|
|
9024
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
8928
9025
|
|
|
8929
9026
|
// src/components/Text/Text.tsx
|
|
8930
|
-
var
|
|
8931
|
-
var
|
|
9027
|
+
var import_react37 = require("react");
|
|
9028
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
8932
9029
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8933
|
-
var
|
|
8934
|
-
var bodyBoldStyles =
|
|
9030
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
9031
|
+
var bodyBoldStyles = import_styled_components44.css`
|
|
8935
9032
|
> strong,
|
|
8936
9033
|
b {
|
|
8937
9034
|
font-weight: var(--wui-typography-weight-body-bold);
|
|
8938
9035
|
}
|
|
8939
9036
|
`;
|
|
8940
|
-
var labelBoldStyles =
|
|
9037
|
+
var labelBoldStyles = import_styled_components44.css`
|
|
8941
9038
|
> strong,
|
|
8942
9039
|
b {
|
|
8943
9040
|
font-weight: var(--wui-typography-weight-label-bold);
|
|
8944
9041
|
}
|
|
8945
9042
|
`;
|
|
8946
|
-
var body1TextStyle =
|
|
9043
|
+
var body1TextStyle = import_styled_components44.css`
|
|
8947
9044
|
--font-family: var(--wui-typography-body-1-family);
|
|
8948
9045
|
--font-size: var(--wui-typography-body-1-size);
|
|
8949
9046
|
--font-weight: var(--wui-typography-body-1-weight);
|
|
@@ -8951,7 +9048,7 @@ var body1TextStyle = import_styled_components42.css`
|
|
|
8951
9048
|
--paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
|
|
8952
9049
|
${bodyBoldStyles}
|
|
8953
9050
|
`;
|
|
8954
|
-
var body2TextStyle =
|
|
9051
|
+
var body2TextStyle = import_styled_components44.css`
|
|
8955
9052
|
--font-family: var(--wui-typography-body-2-family);
|
|
8956
9053
|
--font-size: var(--wui-typography-body-2-size);
|
|
8957
9054
|
--font-weight: var(--wui-typography-body-2-weight);
|
|
@@ -8959,7 +9056,7 @@ var body2TextStyle = import_styled_components42.css`
|
|
|
8959
9056
|
--paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
|
|
8960
9057
|
${bodyBoldStyles}
|
|
8961
9058
|
`;
|
|
8962
|
-
var body3TextStyle =
|
|
9059
|
+
var body3TextStyle = import_styled_components44.css`
|
|
8963
9060
|
--font-family: var(--wui-typography-body-3-family);
|
|
8964
9061
|
--font-size: var(--wui-typography-body-3-size);
|
|
8965
9062
|
--font-weight: var(--wui-typography-body-3-weight);
|
|
@@ -8967,7 +9064,7 @@ var body3TextStyle = import_styled_components42.css`
|
|
|
8967
9064
|
--paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
|
|
8968
9065
|
${bodyBoldStyles}
|
|
8969
9066
|
`;
|
|
8970
|
-
var body4TextStyle =
|
|
9067
|
+
var body4TextStyle = import_styled_components44.css`
|
|
8971
9068
|
--font-family: var(--wui-typography-body-4-family);
|
|
8972
9069
|
--font-size: var(--wui-typography-body-4-size);
|
|
8973
9070
|
--font-weight: var(--wui-typography-body-4-weight);
|
|
@@ -8975,47 +9072,47 @@ var body4TextStyle = import_styled_components42.css`
|
|
|
8975
9072
|
--paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
|
|
8976
9073
|
${bodyBoldStyles}
|
|
8977
9074
|
`;
|
|
8978
|
-
var label1TextStyle =
|
|
9075
|
+
var label1TextStyle = import_styled_components44.css`
|
|
8979
9076
|
--font-family: var(--wui-typography-label-1-family);
|
|
8980
9077
|
--font-size: var(--wui-typography-label-1-size);
|
|
8981
9078
|
--font-weight: var(--wui-typography-label-1-weight);
|
|
8982
9079
|
--line-height: var(--wui-typography-label-1-line-height);
|
|
8983
9080
|
${labelBoldStyles}
|
|
8984
9081
|
`;
|
|
8985
|
-
var label2TextStyle =
|
|
9082
|
+
var label2TextStyle = import_styled_components44.css`
|
|
8986
9083
|
--font-family: var(--wui-typography-label-2-family);
|
|
8987
9084
|
--font-size: var(--wui-typography-label-2-size);
|
|
8988
9085
|
--font-weight: var(--wui-typography-label-2-weight);
|
|
8989
9086
|
--line-height: var(--wui-typography-label-2-line-height);
|
|
8990
9087
|
${labelBoldStyles}
|
|
8991
9088
|
`;
|
|
8992
|
-
var label3TextStyle =
|
|
9089
|
+
var label3TextStyle = import_styled_components44.css`
|
|
8993
9090
|
--font-family: var(--wui-typography-label-3-family);
|
|
8994
9091
|
--font-size: var(--wui-typography-label-3-size);
|
|
8995
9092
|
--font-weight: var(--wui-typography-label-3-weight);
|
|
8996
9093
|
--line-height: var(--wui-typography-label-3-line-height);
|
|
8997
9094
|
${labelBoldStyles}
|
|
8998
9095
|
`;
|
|
8999
|
-
var label4TextStyle =
|
|
9096
|
+
var label4TextStyle = import_styled_components44.css`
|
|
9000
9097
|
--font-family: var(--wui-typography-label-4-family);
|
|
9001
9098
|
--font-size: var(--wui-typography-label-4-size);
|
|
9002
9099
|
--font-weight: var(--wui-typography-label-4-weight);
|
|
9003
9100
|
--line-height: var(--wui-typography-label-4-line-height);
|
|
9004
9101
|
${labelBoldStyles}
|
|
9005
9102
|
`;
|
|
9006
|
-
var body1MonoTextStyle =
|
|
9103
|
+
var body1MonoTextStyle = import_styled_components44.css`
|
|
9007
9104
|
${body1TextStyle};
|
|
9008
9105
|
--font-family: var(--wui-typography-family-mono);
|
|
9009
9106
|
`;
|
|
9010
|
-
var body2MonoTextStyle =
|
|
9107
|
+
var body2MonoTextStyle = import_styled_components44.css`
|
|
9011
9108
|
${body2TextStyle};
|
|
9012
9109
|
--font-family: var(--wui-typography-family-mono);
|
|
9013
9110
|
`;
|
|
9014
|
-
var body3MonoTextStyle =
|
|
9111
|
+
var body3MonoTextStyle = import_styled_components44.css`
|
|
9015
9112
|
${body3TextStyle};
|
|
9016
9113
|
--font-family: var(--wui-typography-family-mono);
|
|
9017
9114
|
`;
|
|
9018
|
-
var body4MonoTextStyle =
|
|
9115
|
+
var body4MonoTextStyle = import_styled_components44.css`
|
|
9019
9116
|
${body4TextStyle};
|
|
9020
9117
|
--font-family: var(--wui-typography-family-mono);
|
|
9021
9118
|
`;
|
|
@@ -9035,22 +9132,22 @@ var variantStyleMap2 = {
|
|
|
9035
9132
|
};
|
|
9036
9133
|
var bodyElement = "p";
|
|
9037
9134
|
var labelElement = "span";
|
|
9038
|
-
var
|
|
9135
|
+
var DEFAULT_ELEMENT4 = bodyElement;
|
|
9039
9136
|
var variantElementMap2 = {
|
|
9040
|
-
body1:
|
|
9041
|
-
body2:
|
|
9042
|
-
body3:
|
|
9043
|
-
body4:
|
|
9044
|
-
body1Mono:
|
|
9045
|
-
body2Mono:
|
|
9046
|
-
body3Mono:
|
|
9047
|
-
body4Mono:
|
|
9137
|
+
body1: DEFAULT_ELEMENT4,
|
|
9138
|
+
body2: DEFAULT_ELEMENT4,
|
|
9139
|
+
body3: DEFAULT_ELEMENT4,
|
|
9140
|
+
body4: DEFAULT_ELEMENT4,
|
|
9141
|
+
body1Mono: DEFAULT_ELEMENT4,
|
|
9142
|
+
body2Mono: DEFAULT_ELEMENT4,
|
|
9143
|
+
body3Mono: DEFAULT_ELEMENT4,
|
|
9144
|
+
body4Mono: DEFAULT_ELEMENT4,
|
|
9048
9145
|
label1: labelElement,
|
|
9049
9146
|
label2: labelElement,
|
|
9050
9147
|
label3: labelElement,
|
|
9051
9148
|
label4: labelElement
|
|
9052
9149
|
};
|
|
9053
|
-
var StyledText =
|
|
9150
|
+
var StyledText = import_styled_components44.default.div`
|
|
9054
9151
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9055
9152
|
--text-color: ${({ $prominence, $disabled }) => {
|
|
9056
9153
|
if ($disabled) {
|
|
@@ -9075,26 +9172,26 @@ var StyledText = import_styled_components42.default.div`
|
|
|
9075
9172
|
${({ $variant }) => variantStyleMap2[$variant]}
|
|
9076
9173
|
${({ $truncate }) => {
|
|
9077
9174
|
if ((0, import_type_guards30.isNotNil)($truncate)) {
|
|
9078
|
-
return
|
|
9175
|
+
return import_styled_components44.css`
|
|
9079
9176
|
${ellipsisStyle};
|
|
9080
9177
|
${lineClampCss($truncate)};
|
|
9081
9178
|
`;
|
|
9082
9179
|
}
|
|
9083
9180
|
return void 0;
|
|
9084
9181
|
}}
|
|
9085
|
-
${({ $inline }) => $inline &&
|
|
9182
|
+
${({ $inline }) => $inline && import_styled_components44.css`
|
|
9086
9183
|
display: inline-block;
|
|
9087
9184
|
`}
|
|
9088
|
-
${({ $disabled }) => $disabled &&
|
|
9185
|
+
${({ $disabled }) => $disabled && import_styled_components44.css`
|
|
9089
9186
|
--text-color: var(--wui-color-text-disabled);
|
|
9090
9187
|
`}
|
|
9091
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
9188
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components44.css`
|
|
9092
9189
|
user-select: none;
|
|
9093
9190
|
`}
|
|
9094
|
-
${({ $align }) =>
|
|
9191
|
+
${({ $align }) => import_styled_components44.css`
|
|
9095
9192
|
text-align: ${$align};
|
|
9096
9193
|
`}
|
|
9097
|
-
${({ as }) => as === "p" &&
|
|
9194
|
+
${({ as }) => as === "p" && import_styled_components44.css`
|
|
9098
9195
|
display: block;
|
|
9099
9196
|
|
|
9100
9197
|
+ p {
|
|
@@ -9102,7 +9199,7 @@ var StyledText = import_styled_components42.default.div`
|
|
|
9102
9199
|
}
|
|
9103
9200
|
`}
|
|
9104
9201
|
`;
|
|
9105
|
-
var TextComponent = (0,
|
|
9202
|
+
var TextComponent = (0, import_react37.forwardRef)(
|
|
9106
9203
|
({
|
|
9107
9204
|
align = "left",
|
|
9108
9205
|
colorScheme = "inherit",
|
|
@@ -9115,7 +9212,7 @@ var TextComponent = (0, import_react34.forwardRef)(
|
|
|
9115
9212
|
renderAs,
|
|
9116
9213
|
...props
|
|
9117
9214
|
}, ref) => {
|
|
9118
|
-
return /* @__PURE__ */ (0,
|
|
9215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
9119
9216
|
StyledText,
|
|
9120
9217
|
{
|
|
9121
9218
|
ref,
|
|
@@ -9137,8 +9234,8 @@ TextComponent.displayName = "Text";
|
|
|
9137
9234
|
var Text = makePolymorphic(TextComponent);
|
|
9138
9235
|
|
|
9139
9236
|
// src/components/DataCards/DataCardTrend.tsx
|
|
9140
|
-
var
|
|
9141
|
-
var StyledDataCardTrend =
|
|
9237
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
9238
|
+
var StyledDataCardTrend = import_styled_components45.default.div`
|
|
9142
9239
|
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
9143
9240
|
background: var(--wui-color-bg-app);
|
|
9144
9241
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -9153,8 +9250,8 @@ var DataCardTrend = ({
|
|
|
9153
9250
|
children,
|
|
9154
9251
|
...props
|
|
9155
9252
|
}) => {
|
|
9156
|
-
return /* @__PURE__ */ (0,
|
|
9157
|
-
/* @__PURE__ */ (0,
|
|
9253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
9254
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9158
9255
|
Icon,
|
|
9159
9256
|
{
|
|
9160
9257
|
size: "md",
|
|
@@ -9162,7 +9259,7 @@ var DataCardTrend = ({
|
|
|
9162
9259
|
...props
|
|
9163
9260
|
}
|
|
9164
9261
|
),
|
|
9165
|
-
/* @__PURE__ */ (0,
|
|
9262
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9166
9263
|
Text,
|
|
9167
9264
|
{
|
|
9168
9265
|
prominence: "secondary",
|
|
@@ -9174,22 +9271,22 @@ var DataCardTrend = ({
|
|
|
9174
9271
|
};
|
|
9175
9272
|
|
|
9176
9273
|
// src/components/Divider/Divider.tsx
|
|
9177
|
-
var
|
|
9178
|
-
var
|
|
9179
|
-
var horizontalBorderCss =
|
|
9274
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
9275
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
9276
|
+
var horizontalBorderCss = import_styled_components46.css`
|
|
9180
9277
|
border-top-color: var(--wui-color-border);
|
|
9181
9278
|
border-top-style: solid;
|
|
9182
9279
|
border-top-width: 1px;
|
|
9183
9280
|
clear: both; /* for horizontal dividers, ensure it clears any floats */
|
|
9184
9281
|
height: 0;
|
|
9185
9282
|
`;
|
|
9186
|
-
var verticalBorderCss =
|
|
9283
|
+
var verticalBorderCss = import_styled_components46.css`
|
|
9187
9284
|
background-color: var(--wui-color-border);
|
|
9188
9285
|
max-width: 1px;
|
|
9189
9286
|
min-height: 100%;
|
|
9190
9287
|
width: 1px;
|
|
9191
9288
|
`;
|
|
9192
|
-
var DividerComponent =
|
|
9289
|
+
var DividerComponent = import_styled_components46.default.div`
|
|
9193
9290
|
${({ $orientation }) => {
|
|
9194
9291
|
switch ($orientation) {
|
|
9195
9292
|
case "vertical":
|
|
@@ -9201,7 +9298,7 @@ var DividerComponent = import_styled_components44.default.div`
|
|
|
9201
9298
|
}}
|
|
9202
9299
|
`;
|
|
9203
9300
|
var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
9204
|
-
return /* @__PURE__ */ (0,
|
|
9301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9205
9302
|
DividerComponent,
|
|
9206
9303
|
{
|
|
9207
9304
|
$orientation: orientation,
|
|
@@ -9214,14 +9311,14 @@ var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
|
9214
9311
|
Divider.displayName = "Divider";
|
|
9215
9312
|
|
|
9216
9313
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9217
|
-
var
|
|
9218
|
-
var
|
|
9314
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9315
|
+
var import_react39 = require("react");
|
|
9219
9316
|
|
|
9220
9317
|
// src/components/Tooltip/Tooltip.tsx
|
|
9221
9318
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
9222
|
-
var
|
|
9223
|
-
var
|
|
9224
|
-
var hide =
|
|
9319
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9320
|
+
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9321
|
+
var hide = import_styled_components47.keyframes`
|
|
9225
9322
|
from {
|
|
9226
9323
|
opacity: 1;
|
|
9227
9324
|
}
|
|
@@ -9229,7 +9326,7 @@ var hide = import_styled_components45.keyframes`
|
|
|
9229
9326
|
opacity: 0;
|
|
9230
9327
|
}
|
|
9231
9328
|
`;
|
|
9232
|
-
var slideDownAndFade =
|
|
9329
|
+
var slideDownAndFade = import_styled_components47.keyframes`
|
|
9233
9330
|
from {
|
|
9234
9331
|
opacity: 0;
|
|
9235
9332
|
transform: translateY(-6px);
|
|
@@ -9239,7 +9336,7 @@ var slideDownAndFade = import_styled_components45.keyframes`
|
|
|
9239
9336
|
transform: translateY(0);
|
|
9240
9337
|
}
|
|
9241
9338
|
`;
|
|
9242
|
-
var slideLeftAndFade =
|
|
9339
|
+
var slideLeftAndFade = import_styled_components47.keyframes`
|
|
9243
9340
|
from {
|
|
9244
9341
|
opacity: 0;
|
|
9245
9342
|
transform: translateX(6px);
|
|
@@ -9249,7 +9346,7 @@ var slideLeftAndFade = import_styled_components45.keyframes`
|
|
|
9249
9346
|
transform: translateX(0);
|
|
9250
9347
|
}
|
|
9251
9348
|
`;
|
|
9252
|
-
var slideUpAndFade =
|
|
9349
|
+
var slideUpAndFade = import_styled_components47.keyframes`
|
|
9253
9350
|
from {
|
|
9254
9351
|
opacity: 0;
|
|
9255
9352
|
transform: translateY(6px);
|
|
@@ -9259,7 +9356,7 @@ var slideUpAndFade = import_styled_components45.keyframes`
|
|
|
9259
9356
|
transform: translateY(0);
|
|
9260
9357
|
}
|
|
9261
9358
|
`;
|
|
9262
|
-
var slideRightAndFade =
|
|
9359
|
+
var slideRightAndFade = import_styled_components47.keyframes`
|
|
9263
9360
|
from {
|
|
9264
9361
|
opacity: 0;
|
|
9265
9362
|
transform: translateX(-6px);
|
|
@@ -9269,7 +9366,7 @@ var slideRightAndFade = import_styled_components45.keyframes`
|
|
|
9269
9366
|
transform: translateX(0);
|
|
9270
9367
|
}
|
|
9271
9368
|
`;
|
|
9272
|
-
var StyledContent = (0,
|
|
9369
|
+
var StyledContent = (0, import_styled_components47.default)(import_react_tooltip2.Content)`
|
|
9273
9370
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
9274
9371
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
9275
9372
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -9331,21 +9428,21 @@ var Tooltip = ({
|
|
|
9331
9428
|
if (forceOpen === true) {
|
|
9332
9429
|
rootProps.open = true;
|
|
9333
9430
|
}
|
|
9334
|
-
return /* @__PURE__ */ (0,
|
|
9431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
|
|
9335
9432
|
import_react_tooltip2.Root,
|
|
9336
9433
|
{
|
|
9337
9434
|
delayDuration: delay,
|
|
9338
9435
|
...rootProps,
|
|
9339
9436
|
children: [
|
|
9340
|
-
/* @__PURE__ */ (0,
|
|
9341
|
-
/* @__PURE__ */ (0,
|
|
9437
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
9438
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
|
|
9342
9439
|
StyledContent,
|
|
9343
9440
|
{
|
|
9344
9441
|
side: direction,
|
|
9345
9442
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
9346
9443
|
children: [
|
|
9347
9444
|
content,
|
|
9348
|
-
!hideArrow ? /* @__PURE__ */ (0,
|
|
9445
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9349
9446
|
"svg",
|
|
9350
9447
|
{
|
|
9351
9448
|
fill: "var(--tooltip-bg)",
|
|
@@ -9354,7 +9451,7 @@ var Tooltip = ({
|
|
|
9354
9451
|
viewBox: "0 0 12 8",
|
|
9355
9452
|
width: "12",
|
|
9356
9453
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9357
|
-
children: /* @__PURE__ */ (0,
|
|
9454
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
|
|
9358
9455
|
}
|
|
9359
9456
|
) }) : null
|
|
9360
9457
|
]
|
|
@@ -9367,13 +9464,13 @@ var Tooltip = ({
|
|
|
9367
9464
|
Tooltip.displayName = "Tooltip";
|
|
9368
9465
|
|
|
9369
9466
|
// src/components/Input/Input.tsx
|
|
9370
|
-
var
|
|
9371
|
-
var
|
|
9467
|
+
var import_react38 = require("react");
|
|
9468
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9372
9469
|
var import_type_guards31 = require("@wistia/type-guards");
|
|
9373
9470
|
|
|
9374
9471
|
// src/css/sharedStyles/inputCssVariables.ts
|
|
9375
|
-
var
|
|
9376
|
-
var inputCssVariables =
|
|
9472
|
+
var import_styled_components48 = require("styled-components");
|
|
9473
|
+
var inputCssVariables = import_styled_components48.css`
|
|
9377
9474
|
/* Colors */
|
|
9378
9475
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
9379
9476
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -9399,8 +9496,8 @@ var inputCssVariables = import_styled_components46.css`
|
|
|
9399
9496
|
`;
|
|
9400
9497
|
|
|
9401
9498
|
// src/components/Input/Input.tsx
|
|
9402
|
-
var
|
|
9403
|
-
var inputStyles =
|
|
9499
|
+
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
9500
|
+
var inputStyles = import_styled_components49.css`
|
|
9404
9501
|
${inputCssVariables}
|
|
9405
9502
|
input,
|
|
9406
9503
|
textarea {
|
|
@@ -9435,7 +9532,7 @@ var inputStyles = import_styled_components47.css`
|
|
|
9435
9532
|
}
|
|
9436
9533
|
}
|
|
9437
9534
|
`;
|
|
9438
|
-
var StyledInputContainer =
|
|
9535
|
+
var StyledInputContainer = import_styled_components49.default.div`
|
|
9439
9536
|
display: inline-flex;
|
|
9440
9537
|
position: relative;
|
|
9441
9538
|
${inputStyles};
|
|
@@ -9502,7 +9599,7 @@ var StyledInputContainer = import_styled_components47.default.div`
|
|
|
9502
9599
|
padding-right: 32px;
|
|
9503
9600
|
}
|
|
9504
9601
|
`;
|
|
9505
|
-
var Input = (0,
|
|
9602
|
+
var Input = (0, import_react38.forwardRef)(
|
|
9506
9603
|
({
|
|
9507
9604
|
fullWidth = true,
|
|
9508
9605
|
monospace = false,
|
|
@@ -9512,24 +9609,24 @@ var Input = (0, import_react35.forwardRef)(
|
|
|
9512
9609
|
rightIcon,
|
|
9513
9610
|
...props
|
|
9514
9611
|
}, externalRef) => {
|
|
9515
|
-
const internalRef = (0,
|
|
9612
|
+
const internalRef = (0, import_react38.useRef)();
|
|
9516
9613
|
const ref = (
|
|
9517
9614
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9518
9615
|
(0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
9519
9616
|
);
|
|
9520
9617
|
let leftIconToDisplay = leftIcon;
|
|
9521
9618
|
if ((0, import_type_guards31.isNil)(leftIcon) && type === "search") {
|
|
9522
|
-
leftIconToDisplay = /* @__PURE__ */ (0,
|
|
9619
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(Icon, { type: "search" });
|
|
9523
9620
|
}
|
|
9524
9621
|
if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
|
|
9525
|
-
leftIconToDisplay = (0,
|
|
9622
|
+
leftIconToDisplay = (0, import_react38.cloneElement)(leftIconToDisplay, {
|
|
9526
9623
|
size: "md",
|
|
9527
9624
|
className: "wui-input-left-icon"
|
|
9528
9625
|
});
|
|
9529
9626
|
}
|
|
9530
9627
|
let rightIconToDisplay = rightIcon;
|
|
9531
9628
|
if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
|
|
9532
|
-
rightIconToDisplay = (0,
|
|
9629
|
+
rightIconToDisplay = (0, import_react38.cloneElement)(rightIconToDisplay, {
|
|
9533
9630
|
size: "md",
|
|
9534
9631
|
className: "wui-input-right-icon"
|
|
9535
9632
|
});
|
|
@@ -9544,21 +9641,21 @@ var Input = (0, import_react35.forwardRef)(
|
|
|
9544
9641
|
});
|
|
9545
9642
|
}
|
|
9546
9643
|
};
|
|
9547
|
-
return /* @__PURE__ */ (0,
|
|
9644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
|
|
9548
9645
|
StyledInputContainer,
|
|
9549
9646
|
{
|
|
9550
9647
|
$fullWidth: fullWidth,
|
|
9551
9648
|
$monospace: monospace,
|
|
9552
9649
|
children: [
|
|
9553
9650
|
leftIconToDisplay ?? null,
|
|
9554
|
-
type === "multiline" ? /* @__PURE__ */ (0,
|
|
9651
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
9555
9652
|
"textarea",
|
|
9556
9653
|
{
|
|
9557
9654
|
...props,
|
|
9558
9655
|
ref,
|
|
9559
9656
|
onFocus: handleFocus2
|
|
9560
9657
|
}
|
|
9561
|
-
) : /* @__PURE__ */ (0,
|
|
9658
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
9562
9659
|
"input",
|
|
9563
9660
|
{
|
|
9564
9661
|
...props,
|
|
@@ -9576,8 +9673,8 @@ var Input = (0, import_react35.forwardRef)(
|
|
|
9576
9673
|
Input.displayName = "Input";
|
|
9577
9674
|
|
|
9578
9675
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9579
|
-
var
|
|
9580
|
-
var StyledInput = (0,
|
|
9676
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9677
|
+
var StyledInput = (0, import_styled_components50.default)(Input)`
|
|
9581
9678
|
:not([rows]) {
|
|
9582
9679
|
min-height: unset;
|
|
9583
9680
|
}
|
|
@@ -9594,7 +9691,7 @@ var StyledInput = (0, import_styled_components48.default)(Input)`
|
|
|
9594
9691
|
height: ${({ $height }) => `${$height}px`};
|
|
9595
9692
|
}
|
|
9596
9693
|
`;
|
|
9597
|
-
var editableStyles =
|
|
9694
|
+
var editableStyles = import_styled_components50.css`
|
|
9598
9695
|
&:has(+ :focus-within) {
|
|
9599
9696
|
background: var(--wui-color-bg-surface-hover);
|
|
9600
9697
|
}
|
|
@@ -9604,7 +9701,7 @@ var editableStyles = import_styled_components48.css`
|
|
|
9604
9701
|
cursor: pointer;
|
|
9605
9702
|
}
|
|
9606
9703
|
`;
|
|
9607
|
-
var StyledHeading2 = (0,
|
|
9704
|
+
var StyledHeading2 = (0, import_styled_components50.default)(Heading)`
|
|
9608
9705
|
width: 100%;
|
|
9609
9706
|
border-radius: var(--wui-border-radius-02);
|
|
9610
9707
|
padding: var(--wui-space-02);
|
|
@@ -9621,11 +9718,11 @@ var EditableHeading = ({
|
|
|
9621
9718
|
__forceEditing = false,
|
|
9622
9719
|
editingDisabled = false
|
|
9623
9720
|
}) => {
|
|
9624
|
-
const [isEditing, setIsEditing] = (0,
|
|
9625
|
-
const [value, setValue] = (0,
|
|
9626
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9627
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9628
|
-
const headingRef = (0,
|
|
9721
|
+
const [isEditing, setIsEditing] = (0, import_react39.useState)(false);
|
|
9722
|
+
const [value, setValue] = (0, import_react39.useState)(children);
|
|
9723
|
+
const [previousValue, setPreviousValue] = (0, import_react39.useState)(children);
|
|
9724
|
+
const [headingHeight, setHeadingHeight] = (0, import_react39.useState)("60");
|
|
9725
|
+
const headingRef = (0, import_react39.useRef)(null);
|
|
9629
9726
|
const handleSetEditing = (editing) => {
|
|
9630
9727
|
if (editingDisabled) return;
|
|
9631
9728
|
if (editing && headingRef.current) {
|
|
@@ -9658,7 +9755,7 @@ var EditableHeading = ({
|
|
|
9658
9755
|
handleSetEditing(false);
|
|
9659
9756
|
}
|
|
9660
9757
|
};
|
|
9661
|
-
const HeadingComponent2 = /* @__PURE__ */ (0,
|
|
9758
|
+
const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9662
9759
|
StyledHeading2,
|
|
9663
9760
|
{
|
|
9664
9761
|
ref: headingRef,
|
|
@@ -9672,7 +9769,7 @@ var EditableHeading = ({
|
|
|
9672
9769
|
return HeadingComponent2;
|
|
9673
9770
|
}
|
|
9674
9771
|
if (isEditing || __forceEditing) {
|
|
9675
|
-
return /* @__PURE__ */ (0,
|
|
9772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9676
9773
|
StyledInput,
|
|
9677
9774
|
{
|
|
9678
9775
|
$height: headingHeight,
|
|
@@ -9690,9 +9787,9 @@ var EditableHeading = ({
|
|
|
9690
9787
|
}
|
|
9691
9788
|
);
|
|
9692
9789
|
}
|
|
9693
|
-
return /* @__PURE__ */ (0,
|
|
9694
|
-
/* @__PURE__ */ (0,
|
|
9695
|
-
/* @__PURE__ */ (0,
|
|
9790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(import_jsx_runtime223.Fragment, { children: [
|
|
9791
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Tooltip, { content: tooltipText, children: HeadingComponent2 }),
|
|
9792
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9696
9793
|
"button",
|
|
9697
9794
|
{
|
|
9698
9795
|
"aria-label": ariaLabel,
|
|
@@ -9704,51 +9801,17 @@ var EditableHeading = ({
|
|
|
9704
9801
|
};
|
|
9705
9802
|
|
|
9706
9803
|
// src/components/Form/Form.tsx
|
|
9707
|
-
var
|
|
9708
|
-
var
|
|
9804
|
+
var import_react40 = require("react");
|
|
9805
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
9709
9806
|
var import_type_guards32 = require("@wistia/type-guards");
|
|
9710
|
-
|
|
9711
|
-
|
|
9712
|
-
var import_react37 = require("react");
|
|
9713
|
-
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9714
|
-
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9715
|
-
var DEFAULT_ELEMENT4 = "div";
|
|
9716
|
-
var StyledStack = import_styled_components49.default.div`
|
|
9717
|
-
display: flex;
|
|
9718
|
-
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
9719
|
-
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9720
|
-
align-items: ${({ $alignItems }) => $alignItems};
|
|
9721
|
-
`;
|
|
9722
|
-
var StackComponent = (0, import_react37.forwardRef)(
|
|
9723
|
-
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9724
|
-
const responsiveGap = useResponsiveProp(gap);
|
|
9725
|
-
const responsiveDirection = useResponsiveProp(direction);
|
|
9726
|
-
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
9727
|
-
return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9728
|
-
StyledStack,
|
|
9729
|
-
{
|
|
9730
|
-
ref,
|
|
9731
|
-
$alignItems: responsiveAlignItems,
|
|
9732
|
-
$direction: responsiveDirection,
|
|
9733
|
-
$gap: responsiveGap,
|
|
9734
|
-
as: renderAs ?? DEFAULT_ELEMENT4,
|
|
9735
|
-
...props
|
|
9736
|
-
}
|
|
9737
|
-
);
|
|
9738
|
-
}
|
|
9739
|
-
);
|
|
9740
|
-
StackComponent.displayName = "Stack";
|
|
9741
|
-
var Stack = makePolymorphic(StackComponent);
|
|
9742
|
-
|
|
9743
|
-
// src/components/Form/Form.tsx
|
|
9744
|
-
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
9745
|
-
var StyledForm = import_styled_components50.default.form`
|
|
9807
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9808
|
+
var StyledForm = import_styled_components51.default.form`
|
|
9746
9809
|
--form-default-width: 690px;
|
|
9747
9810
|
|
|
9748
9811
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9749
9812
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9750
9813
|
`;
|
|
9751
|
-
var FormContext = (0,
|
|
9814
|
+
var FormContext = (0, import_react40.createContext)({
|
|
9752
9815
|
values: {},
|
|
9753
9816
|
errors: {},
|
|
9754
9817
|
hasSubmitted: false,
|
|
@@ -9764,11 +9827,11 @@ var FormComponent = ({
|
|
|
9764
9827
|
fullWidth = false,
|
|
9765
9828
|
...props
|
|
9766
9829
|
}, forwardedRef) => {
|
|
9767
|
-
const [errors, setErrors] = (0,
|
|
9768
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9769
|
-
const innerRef = (0,
|
|
9830
|
+
const [errors, setErrors] = (0, import_react40.useState)({});
|
|
9831
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react40.useState)(false);
|
|
9832
|
+
const innerRef = (0, import_react40.useRef)();
|
|
9770
9833
|
const ref = forwardedRef ?? innerRef;
|
|
9771
|
-
const autoId = (0,
|
|
9834
|
+
const autoId = (0, import_react40.useId)();
|
|
9772
9835
|
const id = props.id ?? autoId;
|
|
9773
9836
|
const handleValidate = (nextFormData) => {
|
|
9774
9837
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -9810,7 +9873,7 @@ var FormComponent = ({
|
|
|
9810
9873
|
void action(null);
|
|
9811
9874
|
}
|
|
9812
9875
|
};
|
|
9813
|
-
const context = (0,
|
|
9876
|
+
const context = (0, import_react40.useMemo)(() => {
|
|
9814
9877
|
return {
|
|
9815
9878
|
values,
|
|
9816
9879
|
errors,
|
|
@@ -9821,7 +9884,7 @@ var FormComponent = ({
|
|
|
9821
9884
|
}, [labelPosition, values, errors, id, hasSubmitted]);
|
|
9822
9885
|
return (
|
|
9823
9886
|
// @ts-expect-error - generic context providers are a giant pain
|
|
9824
|
-
/* @__PURE__ */ (0,
|
|
9887
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
9825
9888
|
Stack,
|
|
9826
9889
|
{
|
|
9827
9890
|
...props,
|
|
@@ -9839,15 +9902,15 @@ var FormComponent = ({
|
|
|
9839
9902
|
);
|
|
9840
9903
|
};
|
|
9841
9904
|
FormComponent.displayName = "Form";
|
|
9842
|
-
var Form = (0,
|
|
9905
|
+
var Form = (0, import_react40.forwardRef)(FormComponent);
|
|
9843
9906
|
|
|
9844
9907
|
// src/components/Form/useFormState.tsx
|
|
9845
|
-
var
|
|
9908
|
+
var import_react41 = require("react");
|
|
9846
9909
|
var useFormState = (action, initialData = {}) => {
|
|
9847
|
-
const [data, setData] = (0,
|
|
9848
|
-
const [isPending, setIsPending] = (0,
|
|
9849
|
-
const [error, setError] = (0,
|
|
9850
|
-
const formAction = (0,
|
|
9910
|
+
const [data, setData] = (0, import_react41.useState)(initialData);
|
|
9911
|
+
const [isPending, setIsPending] = (0, import_react41.useState)(false);
|
|
9912
|
+
const [error, setError] = (0, import_react41.useState)(null);
|
|
9913
|
+
const formAction = (0, import_react41.useCallback)(
|
|
9851
9914
|
async (nextFormData) => {
|
|
9852
9915
|
if (nextFormData === null) {
|
|
9853
9916
|
setData(initialData);
|
|
@@ -9878,23 +9941,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9878
9941
|
};
|
|
9879
9942
|
|
|
9880
9943
|
// src/components/Form/FormErrorSummary.tsx
|
|
9881
|
-
var
|
|
9944
|
+
var import_react42 = require("react");
|
|
9882
9945
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
9883
|
-
var
|
|
9946
|
+
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9884
9947
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9885
|
-
return /* @__PURE__ */ (0,
|
|
9948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9886
9949
|
};
|
|
9887
9950
|
var FormErrorSummary = ({ description }) => {
|
|
9888
|
-
const ref = (0,
|
|
9889
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9951
|
+
const ref = (0, import_react42.useRef)(null);
|
|
9952
|
+
const { formId, errors, hasSubmitted } = (0, import_react42.useContext)(FormContext);
|
|
9890
9953
|
const isValid = Object.keys(errors).length === 0;
|
|
9891
9954
|
if (isValid || !hasSubmitted) {
|
|
9892
9955
|
return null;
|
|
9893
9956
|
}
|
|
9894
|
-
return /* @__PURE__ */ (0,
|
|
9895
|
-
/* @__PURE__ */ (0,
|
|
9896
|
-
/* @__PURE__ */ (0,
|
|
9897
|
-
([name, error]) => (0, import_type_guards33.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0,
|
|
9957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)("div", { ref, children: [
|
|
9958
|
+
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)("p", { children: description }),
|
|
9959
|
+
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards33.isNotUndefined)(error)).map(
|
|
9960
|
+
([name, error]) => (0, import_type_guards33.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
9898
9961
|
ErrorItem,
|
|
9899
9962
|
{
|
|
9900
9963
|
error: err,
|
|
@@ -9902,7 +9965,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9902
9965
|
name
|
|
9903
9966
|
},
|
|
9904
9967
|
err
|
|
9905
|
-
)) : /* @__PURE__ */ (0,
|
|
9968
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
9906
9969
|
ErrorItem,
|
|
9907
9970
|
{
|
|
9908
9971
|
error: error ?? "",
|
|
@@ -9921,9 +9984,9 @@ var import_styled_components53 = __toESM(require("styled-components"));
|
|
|
9921
9984
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9922
9985
|
|
|
9923
9986
|
// src/components/Label/Label.tsx
|
|
9924
|
-
var
|
|
9925
|
-
var
|
|
9926
|
-
var requiredStyle =
|
|
9987
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9988
|
+
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9989
|
+
var requiredStyle = import_styled_components52.css`
|
|
9927
9990
|
&::after {
|
|
9928
9991
|
color: var(--wui-color-text-error);
|
|
9929
9992
|
display: inline;
|
|
@@ -9931,10 +9994,10 @@ var requiredStyle = import_styled_components51.css`
|
|
|
9931
9994
|
content: '*';
|
|
9932
9995
|
}
|
|
9933
9996
|
`;
|
|
9934
|
-
var disabledStyle3 =
|
|
9997
|
+
var disabledStyle3 = import_styled_components52.css`
|
|
9935
9998
|
color: var(--wui-color-text-disabled);
|
|
9936
9999
|
`;
|
|
9937
|
-
var StyledLabel3 =
|
|
10000
|
+
var StyledLabel3 = import_styled_components52.default.label`
|
|
9938
10001
|
display: block;
|
|
9939
10002
|
width: 100%;
|
|
9940
10003
|
color: var(--wui-color-text);
|
|
@@ -9966,7 +10029,7 @@ var Label = ({
|
|
|
9966
10029
|
screenReaderOnly = false,
|
|
9967
10030
|
...props
|
|
9968
10031
|
}) => {
|
|
9969
|
-
return /* @__PURE__ */ (0,
|
|
10032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9970
10033
|
StyledLabel3,
|
|
9971
10034
|
{
|
|
9972
10035
|
...props,
|
|
@@ -9980,63 +10043,6 @@ var Label = ({
|
|
|
9980
10043
|
};
|
|
9981
10044
|
Label.displayName = "Label";
|
|
9982
10045
|
|
|
9983
|
-
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9984
|
-
var import_react42 = require("react");
|
|
9985
|
-
|
|
9986
|
-
// src/components/FormGroup/FormGroup.tsx
|
|
9987
|
-
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9988
|
-
var import_react41 = require("react");
|
|
9989
|
-
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9990
|
-
var StyledFieldset = import_styled_components52.default.fieldset`
|
|
9991
|
-
border: 0;
|
|
9992
|
-
`;
|
|
9993
|
-
var StyledLegend = import_styled_components52.default.legend`
|
|
9994
|
-
margin-bottom: var(--space-01);
|
|
9995
|
-
`;
|
|
9996
|
-
var FormGroup = ({ children, label, ...props }) => {
|
|
9997
|
-
const ref = (0, import_react41.useRef)();
|
|
9998
|
-
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9999
|
-
Stack,
|
|
10000
|
-
{
|
|
10001
|
-
...props,
|
|
10002
|
-
ref,
|
|
10003
|
-
renderAs: StyledFieldset,
|
|
10004
|
-
children: [
|
|
10005
|
-
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
10006
|
-
Heading,
|
|
10007
|
-
{
|
|
10008
|
-
renderAs: StyledLegend,
|
|
10009
|
-
variant: "heading5",
|
|
10010
|
-
children: label
|
|
10011
|
-
}
|
|
10012
|
-
),
|
|
10013
|
-
children
|
|
10014
|
-
]
|
|
10015
|
-
}
|
|
10016
|
-
);
|
|
10017
|
-
};
|
|
10018
|
-
FormGroup.displayName = "FormGroup";
|
|
10019
|
-
|
|
10020
|
-
// src/components/FormGroup/CheckboxGroup.tsx
|
|
10021
|
-
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
10022
|
-
var CheckboxGroupContext = (0, import_react42.createContext)(null);
|
|
10023
|
-
var CheckboxGroup = ({
|
|
10024
|
-
children,
|
|
10025
|
-
name,
|
|
10026
|
-
onChange,
|
|
10027
|
-
value,
|
|
10028
|
-
...props
|
|
10029
|
-
}) => {
|
|
10030
|
-
const context = (0, import_react42.useMemo)(() => {
|
|
10031
|
-
return {
|
|
10032
|
-
name,
|
|
10033
|
-
onChange
|
|
10034
|
-
};
|
|
10035
|
-
}, [name, onChange]);
|
|
10036
|
-
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(FormGroup, { ...props, children }) });
|
|
10037
|
-
};
|
|
10038
|
-
CheckboxGroup.displayName = "CheckboxGroup";
|
|
10039
|
-
|
|
10040
10046
|
// src/components/FormField/FormField.tsx
|
|
10041
10047
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
10042
10048
|
var StyledFormField = import_styled_components53.default.div`
|
|
@@ -10181,6 +10187,9 @@ FormField.displayName = "FormField";
|
|
|
10181
10187
|
var import_react44 = require("react");
|
|
10182
10188
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
10183
10189
|
var RadioGroupContext = (0, import_react44.createContext)(null);
|
|
10190
|
+
var useRadioGroup = () => {
|
|
10191
|
+
return (0, import_react44.useContext)(RadioGroupContext);
|
|
10192
|
+
};
|
|
10184
10193
|
var RadioGroup = ({
|
|
10185
10194
|
children,
|
|
10186
10195
|
name,
|
|
@@ -11629,6 +11638,11 @@ var Radio = (0, import_react56.forwardRef)(
|
|
|
11629
11638
|
}, ref) => {
|
|
11630
11639
|
const generatedId = (0, import_react56.useId)();
|
|
11631
11640
|
const computedId = (0, import_type_guards45.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11641
|
+
const radioGroupContext = useRadioGroup();
|
|
11642
|
+
const contextName = radioGroupContext?.name;
|
|
11643
|
+
const contextOnChange = radioGroupContext?.onChange;
|
|
11644
|
+
const radioName = name ?? contextName;
|
|
11645
|
+
const handleOnChange = onChange ?? contextOnChange;
|
|
11632
11646
|
return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
11633
11647
|
StyledRadioWrapper,
|
|
11634
11648
|
{
|
|
@@ -11643,8 +11657,8 @@ var Radio = (0, import_react56.forwardRef)(
|
|
|
11643
11657
|
checked,
|
|
11644
11658
|
disabled,
|
|
11645
11659
|
id: computedId,
|
|
11646
|
-
name,
|
|
11647
|
-
onChange,
|
|
11660
|
+
name: radioName,
|
|
11661
|
+
onChange: handleOnChange,
|
|
11648
11662
|
required,
|
|
11649
11663
|
type: "radio",
|
|
11650
11664
|
value
|
|
@@ -11875,7 +11889,7 @@ var StyledSegmentedControlItem = (0, import_styled_components73.default)(import_
|
|
|
11875
11889
|
${segmentedControlItemStyles}
|
|
11876
11890
|
`;
|
|
11877
11891
|
var SegmentedControlItem = (0, import_react60.forwardRef)(
|
|
11878
|
-
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11892
|
+
({ disabled, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
11879
11893
|
const selectedValue = useSegmentedControlValue();
|
|
11880
11894
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11881
11895
|
const buttonRef = (0, import_react60.useRef)(null);
|
|
@@ -11916,6 +11930,7 @@ var SegmentedControlItem = (0, import_react60.forwardRef)(
|
|
|
11916
11930
|
StyledSegmentedControlItem,
|
|
11917
11931
|
{
|
|
11918
11932
|
ref: combinedRef,
|
|
11933
|
+
...otherProps,
|
|
11919
11934
|
$hasLabel: (0, import_type_guards47.isNotNil)(label),
|
|
11920
11935
|
"aria-label": (0, import_type_guards47.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11921
11936
|
disabled,
|