@wistia/ui 0.10.10 → 0.10.11
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 +441 -411
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +314 -284
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.10.
|
|
3
|
+
* @license @wistia/ui v0.10.11
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7331,7 +7331,7 @@ var StyledActionButton = styled6(Button)`
|
|
|
7331
7331
|
}
|
|
7332
7332
|
|
|
7333
7333
|
&:hover,
|
|
7334
|
-
|
|
7334
|
+
&:focus-visible {
|
|
7335
7335
|
--wui-color-text: var(--wui-color-text-button);
|
|
7336
7336
|
|
|
7337
7337
|
${({ $hoverColorScheme }) => getColorScheme($hoverColorScheme)};
|
|
@@ -7839,24 +7839,25 @@ var getFlexStyle = (flexMode) => {
|
|
|
7839
7839
|
}
|
|
7840
7840
|
};
|
|
7841
7841
|
var StyledBoxComponent = styled11.div`
|
|
7842
|
+
/* properties meant for Box parent (flex container) */
|
|
7842
7843
|
align-content: ${({ $alignContent }) => $alignContent};
|
|
7843
7844
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
7844
|
-
align-self: ${({ $alignSelf }) => $alignSelf ?? null};
|
|
7845
7845
|
display: ${({ $inline }) => isNotNil10($inline) && $inline ? "inline-flex" : "flex"};
|
|
7846
|
-
flex-basis: ${({ $basis }) => isNotNil10($basis) ? $basis : null};
|
|
7847
7846
|
flex-direction: ${({ $flexDirection }) => $flexDirection};
|
|
7847
|
+
flex-wrap: ${({ $wrapItems }) => $wrapItems ? "wrap" : "nowrap"};
|
|
7848
|
+
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7849
|
+
height: ${({ $height }) => $height ?? null};
|
|
7850
|
+
width: ${({ $width }) => $width ?? null};
|
|
7848
7851
|
${({ $fillBox: fill }) => getFillStyle2(fill)};
|
|
7849
7852
|
${({ $fillViewport }) => getFillViewportStyle($fillViewport)};
|
|
7850
7853
|
${({ $flexMode }) => getFlexStyle($flexMode)};
|
|
7851
7854
|
${({ $gap }) => getGapStyle($gap)};
|
|
7852
|
-
height: ${({ $height }) => $height ?? null};
|
|
7853
|
-
width: ${({ $width }) => $width ?? null};
|
|
7854
7855
|
|
|
7855
|
-
/* Box children
|
|
7856
|
+
/* properties meant for Box children (flex items) */
|
|
7857
|
+
align-self: ${({ $alignSelf }) => $alignSelf ?? null};
|
|
7858
|
+
flex-basis: ${({ $basis }) => isNotNil10($basis) ? $basis : null};
|
|
7856
7859
|
flex-grow: ${({ $grow }) => isNotNil10($grow) ? $grow : null};
|
|
7857
7860
|
flex-shrink: ${({ $shrink }) => isNotNil10($shrink) ? $shrink : null};
|
|
7858
|
-
flex-wrap: ${({ $wrapItems }) => $wrapItems ? "wrap" : "nowrap"};
|
|
7859
|
-
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7860
7861
|
order: ${({ $order }) => isNotNil10($order) ? $order : null};
|
|
7861
7862
|
`;
|
|
7862
7863
|
var DEFAULT_ELEMENT = "div";
|
|
@@ -8743,9 +8744,9 @@ var Center = forwardRef9(
|
|
|
8743
8744
|
Center.displayName = "Center";
|
|
8744
8745
|
|
|
8745
8746
|
// src/components/Checkbox/Checkbox.tsx
|
|
8746
|
-
import { forwardRef as
|
|
8747
|
-
import
|
|
8748
|
-
import { isNonEmptyString as isNonEmptyString2 } from "@wistia/type-guards";
|
|
8747
|
+
import { forwardRef as forwardRef12, useId as useId2 } from "react";
|
|
8748
|
+
import styled27, { css as css25 } from "styled-components";
|
|
8749
|
+
import { isNonEmptyString as isNonEmptyString2, isNotUndefined as isNotUndefined7 } from "@wistia/type-guards";
|
|
8749
8750
|
|
|
8750
8751
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
8751
8752
|
import styled23, { css as css24 } from "styled-components";
|
|
@@ -8864,7 +8865,8 @@ var FormControlLabel = ({
|
|
|
8864
8865
|
FormControlLabel.displayName = "FormControlLabel";
|
|
8865
8866
|
|
|
8866
8867
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
8867
|
-
import { createContext as
|
|
8868
|
+
import { createContext as createContext4, useMemo as useMemo7, useContext as useContext3 } from "react";
|
|
8869
|
+
import { isArray } from "@wistia/type-guards";
|
|
8868
8870
|
|
|
8869
8871
|
// src/components/FormGroup/FormGroup.tsx
|
|
8870
8872
|
import styled25 from "styled-components";
|
|
@@ -8934,9 +8936,130 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
8934
8936
|
};
|
|
8935
8937
|
FormGroup.displayName = "FormGroup";
|
|
8936
8938
|
|
|
8937
|
-
// src/components/
|
|
8939
|
+
// src/components/Form/Form.tsx
|
|
8940
|
+
import { forwardRef as forwardRef11, useRef as useRef8, useMemo as useMemo6, createContext as createContext3, useState as useState11, useId } from "react";
|
|
8941
|
+
import styled26 from "styled-components";
|
|
8942
|
+
import { isNotUndefined as isNotUndefined6, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
8943
|
+
|
|
8944
|
+
// src/components/Form/serializeFormData.tsx
|
|
8945
|
+
var ARRAY_SUFFIX = "[]";
|
|
8946
|
+
var serializeFormData = (formData) => {
|
|
8947
|
+
const data = {};
|
|
8948
|
+
formData.forEach((value, key) => {
|
|
8949
|
+
if (key.endsWith(ARRAY_SUFFIX)) {
|
|
8950
|
+
const newKey = key.slice(0, -ARRAY_SUFFIX.length);
|
|
8951
|
+
data[newKey] = formData.getAll(key);
|
|
8952
|
+
} else {
|
|
8953
|
+
data[key] = value;
|
|
8954
|
+
}
|
|
8955
|
+
});
|
|
8956
|
+
return data;
|
|
8957
|
+
};
|
|
8958
|
+
|
|
8959
|
+
// src/components/Form/Form.tsx
|
|
8938
8960
|
import { jsx as jsx216 } from "react/jsx-runtime";
|
|
8939
|
-
var
|
|
8961
|
+
var StyledForm = styled26.form`
|
|
8962
|
+
--form-default-width: 690px;
|
|
8963
|
+
|
|
8964
|
+
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
8965
|
+
`;
|
|
8966
|
+
var FormContext = createContext3({
|
|
8967
|
+
values: {},
|
|
8968
|
+
errors: {},
|
|
8969
|
+
hasSubmitted: false,
|
|
8970
|
+
formId: "NO_FORM",
|
|
8971
|
+
labelPosition: "block"
|
|
8972
|
+
});
|
|
8973
|
+
var FormComponent = ({
|
|
8974
|
+
children,
|
|
8975
|
+
action,
|
|
8976
|
+
values = {},
|
|
8977
|
+
labelPosition = "block",
|
|
8978
|
+
validate,
|
|
8979
|
+
fullWidth = false,
|
|
8980
|
+
...props
|
|
8981
|
+
}, forwardedRef) => {
|
|
8982
|
+
const [errors, setErrors] = useState11({});
|
|
8983
|
+
const [hasSubmitted, setHasSubmitted] = useState11(false);
|
|
8984
|
+
const innerRef = useRef8();
|
|
8985
|
+
const ref = forwardedRef ?? innerRef;
|
|
8986
|
+
const autoId = useId();
|
|
8987
|
+
const id = props.id ?? autoId;
|
|
8988
|
+
const handleValidate = (nextFormData) => {
|
|
8989
|
+
const nextData = serializeFormData(nextFormData);
|
|
8990
|
+
if (isUndefined3(validate)) {
|
|
8991
|
+
return {};
|
|
8992
|
+
}
|
|
8993
|
+
return validate(nextData);
|
|
8994
|
+
};
|
|
8995
|
+
const handleBlur2 = (event) => {
|
|
8996
|
+
if (props.onBlur) {
|
|
8997
|
+
props.onBlur(event);
|
|
8998
|
+
}
|
|
8999
|
+
const formData = new FormData(event.currentTarget);
|
|
9000
|
+
if (isNotUndefined6(validate)) {
|
|
9001
|
+
handleValidate(formData);
|
|
9002
|
+
}
|
|
9003
|
+
};
|
|
9004
|
+
const handleSubmit = (event) => {
|
|
9005
|
+
event.preventDefault();
|
|
9006
|
+
const formData = new FormData(event.currentTarget);
|
|
9007
|
+
const nextErrors = handleValidate(formData);
|
|
9008
|
+
const isValid = Object.keys(nextErrors).length === 0;
|
|
9009
|
+
setErrors(nextErrors);
|
|
9010
|
+
setHasSubmitted(true);
|
|
9011
|
+
if (isValid && props.onSubmit) {
|
|
9012
|
+
props.onSubmit(event);
|
|
9013
|
+
}
|
|
9014
|
+
if (isValid && action) {
|
|
9015
|
+
void action(formData);
|
|
9016
|
+
}
|
|
9017
|
+
};
|
|
9018
|
+
const handleReset = (event) => {
|
|
9019
|
+
setErrors({});
|
|
9020
|
+
setHasSubmitted(false);
|
|
9021
|
+
if (props.onReset) {
|
|
9022
|
+
props.onReset(event);
|
|
9023
|
+
}
|
|
9024
|
+
if (action) {
|
|
9025
|
+
void action(null);
|
|
9026
|
+
}
|
|
9027
|
+
};
|
|
9028
|
+
const context = useMemo6(() => {
|
|
9029
|
+
return {
|
|
9030
|
+
values,
|
|
9031
|
+
errors,
|
|
9032
|
+
hasSubmitted,
|
|
9033
|
+
formId: id,
|
|
9034
|
+
labelPosition
|
|
9035
|
+
};
|
|
9036
|
+
}, [labelPosition, values, errors, id, hasSubmitted]);
|
|
9037
|
+
return (
|
|
9038
|
+
// @ts-expect-error - generic context providers are a giant pain
|
|
9039
|
+
/* @__PURE__ */ jsx216(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx216(
|
|
9040
|
+
Stack,
|
|
9041
|
+
{
|
|
9042
|
+
...props,
|
|
9043
|
+
ref,
|
|
9044
|
+
$fullWidth: fullWidth,
|
|
9045
|
+
alignItems: fullWidth ? "stretch" : "flex-start",
|
|
9046
|
+
as: StyledForm,
|
|
9047
|
+
gap: "space-05",
|
|
9048
|
+
id,
|
|
9049
|
+
onBlur: handleBlur2,
|
|
9050
|
+
onReset: handleReset,
|
|
9051
|
+
onSubmit: handleSubmit,
|
|
9052
|
+
children
|
|
9053
|
+
}
|
|
9054
|
+
) })
|
|
9055
|
+
);
|
|
9056
|
+
};
|
|
9057
|
+
FormComponent.displayName = "Form";
|
|
9058
|
+
var Form = forwardRef11(FormComponent);
|
|
9059
|
+
|
|
9060
|
+
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9061
|
+
import { jsx as jsx217 } from "react/jsx-runtime";
|
|
9062
|
+
var CheckboxGroupContext = createContext4(null);
|
|
8940
9063
|
var useCheckboxGroup = () => {
|
|
8941
9064
|
return useContext3(CheckboxGroupContext);
|
|
8942
9065
|
};
|
|
@@ -8947,19 +9070,22 @@ var CheckboxGroup = ({
|
|
|
8947
9070
|
value,
|
|
8948
9071
|
...props
|
|
8949
9072
|
}) => {
|
|
8950
|
-
const
|
|
9073
|
+
const formState = useContext3(FormContext);
|
|
9074
|
+
const derivedValue = isArray(formState.values[name]) ? formState.values[name] : value;
|
|
9075
|
+
const context = useMemo7(() => {
|
|
8951
9076
|
return {
|
|
8952
|
-
name
|
|
8953
|
-
onChange
|
|
9077
|
+
name: `${name}[]`,
|
|
9078
|
+
onChange,
|
|
9079
|
+
value: derivedValue
|
|
8954
9080
|
};
|
|
8955
|
-
}, [name, onChange]);
|
|
8956
|
-
return /* @__PURE__ */
|
|
9081
|
+
}, [name, derivedValue, onChange]);
|
|
9082
|
+
return /* @__PURE__ */ jsx217(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx217(FormGroup, { ...props, children }) });
|
|
8957
9083
|
};
|
|
8958
9084
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
8959
9085
|
|
|
8960
9086
|
// src/components/Checkbox/Checkbox.tsx
|
|
8961
|
-
import { jsx as
|
|
8962
|
-
var CheckIcon = () => /* @__PURE__ */
|
|
9087
|
+
import { jsx as jsx218, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
9088
|
+
var CheckIcon = () => /* @__PURE__ */ jsx218(
|
|
8963
9089
|
"svg",
|
|
8964
9090
|
{
|
|
8965
9091
|
fill: "inherit",
|
|
@@ -8967,7 +9093,7 @@ var CheckIcon = () => /* @__PURE__ */ jsx217(
|
|
|
8967
9093
|
viewBox: "0 0 10 8",
|
|
8968
9094
|
width: "10",
|
|
8969
9095
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8970
|
-
children: /* @__PURE__ */
|
|
9096
|
+
children: /* @__PURE__ */ jsx218(
|
|
8971
9097
|
"path",
|
|
8972
9098
|
{
|
|
8973
9099
|
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",
|
|
@@ -9014,14 +9140,14 @@ var getSizeCss = (size) => {
|
|
|
9014
9140
|
if (size === "lg") return sizeLarge;
|
|
9015
9141
|
return sizeMedium;
|
|
9016
9142
|
};
|
|
9017
|
-
var StyledCheckboxWrapper =
|
|
9143
|
+
var StyledCheckboxWrapper = styled27.div`
|
|
9018
9144
|
display: flex;
|
|
9019
9145
|
margin: 0;
|
|
9020
9146
|
|
|
9021
9147
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
9022
9148
|
user-select: none;
|
|
9023
9149
|
`;
|
|
9024
|
-
var StyledCheckboxInput =
|
|
9150
|
+
var StyledCheckboxInput = styled27.div`
|
|
9025
9151
|
${({ $size }) => getSizeCss($size)}
|
|
9026
9152
|
line-height: 0;
|
|
9027
9153
|
margin: 0;
|
|
@@ -9043,7 +9169,7 @@ var StyledCheckboxInput = styled26.div`
|
|
|
9043
9169
|
}
|
|
9044
9170
|
}
|
|
9045
9171
|
`;
|
|
9046
|
-
var StyledHiddenCheckboxInput =
|
|
9172
|
+
var StyledHiddenCheckboxInput = styled27.input`
|
|
9047
9173
|
${visuallyHiddenStyle}
|
|
9048
9174
|
|
|
9049
9175
|
/* toggles display of faux-input background-color */
|
|
@@ -9057,7 +9183,7 @@ var StyledHiddenCheckboxInput = styled26.input`
|
|
|
9057
9183
|
display: block;
|
|
9058
9184
|
}
|
|
9059
9185
|
`;
|
|
9060
|
-
var Checkbox =
|
|
9186
|
+
var Checkbox = forwardRef12(
|
|
9061
9187
|
({
|
|
9062
9188
|
checked,
|
|
9063
9189
|
disabled = false,
|
|
@@ -9072,20 +9198,22 @@ var Checkbox = forwardRef11(
|
|
|
9072
9198
|
hideLabel = false,
|
|
9073
9199
|
...props
|
|
9074
9200
|
}, ref) => {
|
|
9075
|
-
const generatedId =
|
|
9201
|
+
const generatedId = useId2();
|
|
9076
9202
|
const computedId = isNonEmptyString2(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
9077
9203
|
const checkboxGroupContext = useCheckboxGroup();
|
|
9078
9204
|
const contextName = checkboxGroupContext?.name;
|
|
9079
9205
|
const contextOnChange = checkboxGroupContext?.onChange;
|
|
9206
|
+
const contextValue = checkboxGroupContext?.value;
|
|
9080
9207
|
const checkboxName = name ?? contextName;
|
|
9081
9208
|
const handleOnChange = onChange ?? contextOnChange;
|
|
9209
|
+
const defaultChecked = isNotUndefined7(value) && contextValue ? contextValue.includes(value) : void 0;
|
|
9082
9210
|
return /* @__PURE__ */ jsxs17(StyledCheckboxWrapper, { disabled, children: [
|
|
9083
|
-
/* @__PURE__ */
|
|
9211
|
+
/* @__PURE__ */ jsx218(
|
|
9084
9212
|
StyledHiddenCheckboxInput,
|
|
9085
9213
|
{
|
|
9086
9214
|
...props,
|
|
9087
9215
|
ref,
|
|
9088
|
-
checked,
|
|
9216
|
+
...isNotUndefined7(defaultChecked) ? { defaultChecked } : { checked },
|
|
9089
9217
|
disabled,
|
|
9090
9218
|
id: computedId,
|
|
9091
9219
|
name: checkboxName,
|
|
@@ -9095,16 +9223,16 @@ var Checkbox = forwardRef11(
|
|
|
9095
9223
|
value
|
|
9096
9224
|
}
|
|
9097
9225
|
),
|
|
9098
|
-
/* @__PURE__ */
|
|
9226
|
+
/* @__PURE__ */ jsx218(
|
|
9099
9227
|
FormControlLabel,
|
|
9100
9228
|
{
|
|
9101
|
-
controlSlot: /* @__PURE__ */
|
|
9229
|
+
controlSlot: /* @__PURE__ */ jsx218(
|
|
9102
9230
|
StyledCheckboxInput,
|
|
9103
9231
|
{
|
|
9104
9232
|
$disabled: disabled,
|
|
9105
9233
|
$size: size,
|
|
9106
9234
|
"data-wui-faux-input": "true",
|
|
9107
|
-
children: /* @__PURE__ */
|
|
9235
|
+
children: /* @__PURE__ */ jsx218(CheckIcon, {})
|
|
9108
9236
|
}
|
|
9109
9237
|
),
|
|
9110
9238
|
description,
|
|
@@ -9165,9 +9293,9 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
9165
9293
|
// src/components/Collapsible/Collapsible.tsx
|
|
9166
9294
|
import { Root as CollapsibleRoot } from "@radix-ui/react-collapsible";
|
|
9167
9295
|
import { isNotNil as isNotNil16 } from "@wistia/type-guards";
|
|
9168
|
-
import
|
|
9169
|
-
import { jsx as
|
|
9170
|
-
var StyledRoot =
|
|
9296
|
+
import styled28 from "styled-components";
|
|
9297
|
+
import { jsx as jsx219 } from "react/jsx-runtime";
|
|
9298
|
+
var StyledRoot = styled28(CollapsibleRoot)`
|
|
9171
9299
|
&[data-state='closed'] [data-wui-collapsible-content] {
|
|
9172
9300
|
display: -webkit-box;
|
|
9173
9301
|
-webkit-box-orient: vertical;
|
|
@@ -9183,16 +9311,16 @@ var Collapsible = ({
|
|
|
9183
9311
|
const controlProps = {
|
|
9184
9312
|
...isNotNil16(onOpenChange) && isNotNil16(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
9185
9313
|
};
|
|
9186
|
-
return /* @__PURE__ */
|
|
9314
|
+
return /* @__PURE__ */ jsx219(StyledRoot, { ...controlProps, children });
|
|
9187
9315
|
};
|
|
9188
9316
|
Collapsible.displayName = "Collapsible";
|
|
9189
9317
|
|
|
9190
9318
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
9191
9319
|
import { Children as Children4 } from "react";
|
|
9192
9320
|
import { Trigger } from "@radix-ui/react-collapsible";
|
|
9193
|
-
import
|
|
9194
|
-
import { jsx as
|
|
9195
|
-
var StyledTrigger =
|
|
9321
|
+
import styled29 from "styled-components";
|
|
9322
|
+
import { jsx as jsx220 } from "react/jsx-runtime";
|
|
9323
|
+
var StyledTrigger = styled29(Trigger)`
|
|
9196
9324
|
[data-wui-collapsible-icon] {
|
|
9197
9325
|
transition: transform var(--wui-motion-duration-03) ease-in-out;
|
|
9198
9326
|
}
|
|
@@ -9215,11 +9343,11 @@ var StyledTrigger = styled28(Trigger)`
|
|
|
9215
9343
|
`;
|
|
9216
9344
|
var CollapsibleTrigger = ({ children }) => {
|
|
9217
9345
|
Children4.only(children);
|
|
9218
|
-
return /* @__PURE__ */
|
|
9346
|
+
return /* @__PURE__ */ jsx220(StyledTrigger, { asChild: true, children });
|
|
9219
9347
|
};
|
|
9220
9348
|
|
|
9221
9349
|
// src/components/Collapsible/CollapsibleTriggerIcon.tsx
|
|
9222
|
-
import { jsx as
|
|
9350
|
+
import { jsx as jsx221 } from "react/jsx-runtime";
|
|
9223
9351
|
var iconRotationMap = {
|
|
9224
9352
|
"caret-left-strong": "-90",
|
|
9225
9353
|
"caret-left": "-90",
|
|
@@ -9228,7 +9356,7 @@ var iconRotationMap = {
|
|
|
9228
9356
|
plus: "45"
|
|
9229
9357
|
};
|
|
9230
9358
|
var CollapsibleTriggerIcon = ({ type, ...props }) => {
|
|
9231
|
-
return /* @__PURE__ */
|
|
9359
|
+
return /* @__PURE__ */ jsx221(
|
|
9232
9360
|
Icon,
|
|
9233
9361
|
{
|
|
9234
9362
|
...props,
|
|
@@ -9241,16 +9369,16 @@ var CollapsibleTriggerIcon = ({ type, ...props }) => {
|
|
|
9241
9369
|
CollapsibleTriggerIcon.displayName = "CollapsibleTriggerIcon";
|
|
9242
9370
|
|
|
9243
9371
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
9244
|
-
import
|
|
9372
|
+
import styled30 from "styled-components";
|
|
9245
9373
|
import { Content } from "@radix-ui/react-collapsible";
|
|
9246
|
-
import { isNotUndefined as
|
|
9247
|
-
import { Fragment as Fragment4, jsx as
|
|
9248
|
-
var ClampedContent =
|
|
9374
|
+
import { isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
9375
|
+
import { Fragment as Fragment4, jsx as jsx222, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
9376
|
+
var ClampedContent = styled30.div`
|
|
9249
9377
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
9250
9378
|
`;
|
|
9251
9379
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
9252
|
-
if (
|
|
9253
|
-
return /* @__PURE__ */
|
|
9380
|
+
if (isNotUndefined8(clamp)) {
|
|
9381
|
+
return /* @__PURE__ */ jsx222(
|
|
9254
9382
|
ClampedContent,
|
|
9255
9383
|
{
|
|
9256
9384
|
$clamp: clamp,
|
|
@@ -9259,7 +9387,7 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
9259
9387
|
}
|
|
9260
9388
|
);
|
|
9261
9389
|
}
|
|
9262
|
-
return /* @__PURE__ */
|
|
9390
|
+
return /* @__PURE__ */ jsx222(Content, { children: /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
9263
9391
|
children,
|
|
9264
9392
|
" "
|
|
9265
9393
|
] }) });
|
|
@@ -9268,23 +9396,23 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
9268
9396
|
// src/components/Combobox/Combobox.tsx
|
|
9269
9397
|
import * as Ariakit from "@ariakit/react";
|
|
9270
9398
|
import {
|
|
9271
|
-
useMemo as
|
|
9272
|
-
useRef as
|
|
9273
|
-
useState as
|
|
9399
|
+
useMemo as useMemo8,
|
|
9400
|
+
useRef as useRef9,
|
|
9401
|
+
useState as useState12,
|
|
9274
9402
|
useTransition,
|
|
9275
9403
|
useEffect as useEffect10,
|
|
9276
9404
|
Children as Children5,
|
|
9277
9405
|
isValidElement as isValidElement2
|
|
9278
9406
|
} from "react";
|
|
9279
9407
|
import { matchSorter } from "match-sorter";
|
|
9280
|
-
import
|
|
9408
|
+
import styled32 from "styled-components";
|
|
9281
9409
|
|
|
9282
9410
|
// src/components/Tag/Tag.tsx
|
|
9283
|
-
import { forwardRef as
|
|
9284
|
-
import
|
|
9411
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
9412
|
+
import styled31 from "styled-components";
|
|
9285
9413
|
import { isNil as isNil13, isNotNil as isNotNil17, isNonEmptyString as isNonEmptyString3 } from "@wistia/type-guards";
|
|
9286
|
-
import { Fragment as Fragment5, jsx as
|
|
9287
|
-
var TagLabel =
|
|
9414
|
+
import { Fragment as Fragment5, jsx as jsx223, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
9415
|
+
var TagLabel = styled31.a`
|
|
9288
9416
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9289
9417
|
font-size: var(--wui-typography-label-4-size);
|
|
9290
9418
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -9302,31 +9430,31 @@ var TagLabel = styled30.a`
|
|
|
9302
9430
|
width: 12px;
|
|
9303
9431
|
}
|
|
9304
9432
|
|
|
9305
|
-
|
|
9433
|
+
&:focus-visible {
|
|
9434
|
+
outline: unset;
|
|
9435
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9436
|
+
}
|
|
9437
|
+
|
|
9438
|
+
&:not(:only-child) {
|
|
9306
9439
|
padding-right: var(--wui-space-01);
|
|
9307
9440
|
}
|
|
9308
9441
|
|
|
9309
|
-
|
|
9442
|
+
&:is(a):hover {
|
|
9310
9443
|
background: var(--wui-color-bg-surface-secondary-hover);
|
|
9311
9444
|
}
|
|
9312
9445
|
|
|
9313
|
-
|
|
9446
|
+
&:is(a):active {
|
|
9314
9447
|
background: var(--wui-color-bg-surface-secondary-active);
|
|
9315
9448
|
}
|
|
9316
|
-
|
|
9317
|
-
:focus-visible {
|
|
9318
|
-
outline: unset;
|
|
9319
|
-
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9320
|
-
}
|
|
9321
9449
|
`;
|
|
9322
|
-
var TagDivider =
|
|
9450
|
+
var TagDivider = styled31.div`
|
|
9323
9451
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9324
9452
|
border-left: 1px solid var(--wui-color-border);
|
|
9325
9453
|
display: flex;
|
|
9326
9454
|
height: 14px;
|
|
9327
9455
|
width: 1px;
|
|
9328
9456
|
`;
|
|
9329
|
-
var StyledRemoveButton =
|
|
9457
|
+
var StyledRemoveButton = styled31.button`
|
|
9330
9458
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9331
9459
|
all: unset;
|
|
9332
9460
|
cursor: pointer;
|
|
@@ -9341,20 +9469,20 @@ var StyledRemoveButton = styled30.button`
|
|
|
9341
9469
|
fill: var(--wui-color-icon);
|
|
9342
9470
|
}
|
|
9343
9471
|
|
|
9344
|
-
|
|
9472
|
+
&:hover {
|
|
9345
9473
|
background: var(--wui-color-bg-surface-secondary-hover);
|
|
9346
9474
|
}
|
|
9347
9475
|
|
|
9348
|
-
|
|
9476
|
+
&:active {
|
|
9349
9477
|
background: var(--wui-color-bg-surface-secondary-active);
|
|
9350
9478
|
}
|
|
9351
9479
|
|
|
9352
|
-
|
|
9480
|
+
&:focus-visible {
|
|
9353
9481
|
outline: unset;
|
|
9354
9482
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9355
9483
|
}
|
|
9356
9484
|
`;
|
|
9357
|
-
var StyledTag =
|
|
9485
|
+
var StyledTag = styled31.div`
|
|
9358
9486
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9359
9487
|
align-items: center;
|
|
9360
9488
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -9376,7 +9504,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9376
9504
|
);
|
|
9377
9505
|
}
|
|
9378
9506
|
return /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
9379
|
-
/* @__PURE__ */
|
|
9507
|
+
/* @__PURE__ */ jsx223(TagDivider, { $colorScheme: colorScheme }),
|
|
9380
9508
|
/* @__PURE__ */ jsxs19(
|
|
9381
9509
|
StyledRemoveButton,
|
|
9382
9510
|
{
|
|
@@ -9384,20 +9512,20 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9384
9512
|
onClick: onClickRemove,
|
|
9385
9513
|
type: "button",
|
|
9386
9514
|
children: [
|
|
9387
|
-
/* @__PURE__ */
|
|
9515
|
+
/* @__PURE__ */ jsx223(
|
|
9388
9516
|
Icon,
|
|
9389
9517
|
{
|
|
9390
9518
|
size: "sm",
|
|
9391
9519
|
type: "close"
|
|
9392
9520
|
}
|
|
9393
9521
|
),
|
|
9394
|
-
/* @__PURE__ */
|
|
9522
|
+
/* @__PURE__ */ jsx223(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
9395
9523
|
]
|
|
9396
9524
|
}
|
|
9397
9525
|
)
|
|
9398
9526
|
] });
|
|
9399
9527
|
};
|
|
9400
|
-
var Tag =
|
|
9528
|
+
var Tag = forwardRef13(
|
|
9401
9529
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
9402
9530
|
const hasIcon = isNotNil17(icon);
|
|
9403
9531
|
const labelProps = isNotNil17(href) && isNonEmptyString3(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -9419,7 +9547,7 @@ var Tag = forwardRef12(
|
|
|
9419
9547
|
]
|
|
9420
9548
|
}
|
|
9421
9549
|
),
|
|
9422
|
-
/* @__PURE__ */
|
|
9550
|
+
/* @__PURE__ */ jsx223(
|
|
9423
9551
|
RemoveButton,
|
|
9424
9552
|
{
|
|
9425
9553
|
colorScheme,
|
|
@@ -9462,8 +9590,8 @@ var inputCss = css26`
|
|
|
9462
9590
|
`;
|
|
9463
9591
|
|
|
9464
9592
|
// src/components/Combobox/Combobox.tsx
|
|
9465
|
-
import { jsx as
|
|
9466
|
-
var ComboboxWapper =
|
|
9593
|
+
import { jsx as jsx224, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
9594
|
+
var ComboboxWapper = styled32.div`
|
|
9467
9595
|
${inputCss};
|
|
9468
9596
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
9469
9597
|
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
@@ -9512,7 +9640,7 @@ var ComboboxWapper = styled31.div`
|
|
|
9512
9640
|
}
|
|
9513
9641
|
}
|
|
9514
9642
|
`;
|
|
9515
|
-
var ComboboxInput =
|
|
9643
|
+
var ComboboxInput = styled32(Ariakit.Combobox)`
|
|
9516
9644
|
appearance: none;
|
|
9517
9645
|
padding: 0;
|
|
9518
9646
|
width: 100%;
|
|
@@ -9527,7 +9655,7 @@ var ComboboxInput = styled31(Ariakit.Combobox)`
|
|
|
9527
9655
|
outline-width: 2px;
|
|
9528
9656
|
}
|
|
9529
9657
|
`;
|
|
9530
|
-
var ComboboxPopover =
|
|
9658
|
+
var ComboboxPopover = styled32(Ariakit.Popover)`
|
|
9531
9659
|
--wui-combobox-content-border: var(--wui-color-border);
|
|
9532
9660
|
--wui-combobox-content-bg: var(--wui-color-bg-surface);
|
|
9533
9661
|
--wui-combobox-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -9552,7 +9680,7 @@ var ComboboxPopover = styled31(Ariakit.Popover)`
|
|
|
9552
9680
|
--item-opacity: 0.5;
|
|
9553
9681
|
}
|
|
9554
9682
|
`;
|
|
9555
|
-
var ComboboxItem2 =
|
|
9683
|
+
var ComboboxItem2 = styled32(Ariakit.ComboboxItem)`
|
|
9556
9684
|
${variantStyleMap2.body3};
|
|
9557
9685
|
display: flex;
|
|
9558
9686
|
padding: var(--wui-combobox-option-padding);
|
|
@@ -9577,12 +9705,12 @@ var ComboboxItem2 = styled31(Ariakit.ComboboxItem)`
|
|
|
9577
9705
|
background-color: transparent;
|
|
9578
9706
|
}
|
|
9579
9707
|
`;
|
|
9580
|
-
var NoResults =
|
|
9708
|
+
var NoResults = styled32.div`
|
|
9581
9709
|
gap: var(--wui-space-02);
|
|
9582
9710
|
`;
|
|
9583
9711
|
var POPOVER_WIDTH_OFFSET = 20;
|
|
9584
9712
|
var ComboboxOption = ({ value, children }) => {
|
|
9585
|
-
return /* @__PURE__ */
|
|
9713
|
+
return /* @__PURE__ */ jsx224(
|
|
9586
9714
|
ComboboxItem2,
|
|
9587
9715
|
{
|
|
9588
9716
|
className: "combobox-item",
|
|
@@ -9611,9 +9739,9 @@ var Combobox2 = ({
|
|
|
9611
9739
|
fullWidth = true
|
|
9612
9740
|
}) => {
|
|
9613
9741
|
const [isPending, startTransition] = useTransition();
|
|
9614
|
-
const [wrapperWidth, setWrapperWidth] =
|
|
9615
|
-
const comboboxWrapperRef =
|
|
9616
|
-
const options =
|
|
9742
|
+
const [wrapperWidth, setWrapperWidth] = useState12("auto");
|
|
9743
|
+
const comboboxWrapperRef = useRef9(null);
|
|
9744
|
+
const options = useMemo8(() => extractOptions(children), [children]);
|
|
9617
9745
|
useEffect10(() => {
|
|
9618
9746
|
const comboboxWrapper = comboboxWrapperRef.current;
|
|
9619
9747
|
if (comboboxWrapper) {
|
|
@@ -9632,7 +9760,7 @@ var Combobox2 = ({
|
|
|
9632
9760
|
const handleRemoveValue = (valueToRemove) => {
|
|
9633
9761
|
onChange(value.filter((val) => val !== valueToRemove));
|
|
9634
9762
|
};
|
|
9635
|
-
const matches =
|
|
9763
|
+
const matches = useMemo8(() => {
|
|
9636
9764
|
return matchSorter(Object.keys(options), searchValue);
|
|
9637
9765
|
}, [options, searchValue]);
|
|
9638
9766
|
return /* @__PURE__ */ jsxs20(
|
|
@@ -9652,7 +9780,7 @@ var Combobox2 = ({
|
|
|
9652
9780
|
ref: comboboxWrapperRef,
|
|
9653
9781
|
$fullWidth: fullWidth,
|
|
9654
9782
|
children: [
|
|
9655
|
-
value.map((selectedValue) => /* @__PURE__ */
|
|
9783
|
+
value.map((selectedValue) => /* @__PURE__ */ jsx224(
|
|
9656
9784
|
Tag,
|
|
9657
9785
|
{
|
|
9658
9786
|
href: "https://example.com",
|
|
@@ -9662,7 +9790,7 @@ var Combobox2 = ({
|
|
|
9662
9790
|
},
|
|
9663
9791
|
selectedValue
|
|
9664
9792
|
)),
|
|
9665
|
-
/* @__PURE__ */
|
|
9793
|
+
/* @__PURE__ */ jsx224(ComboboxInput, { placeholder })
|
|
9666
9794
|
]
|
|
9667
9795
|
}
|
|
9668
9796
|
),
|
|
@@ -9683,7 +9811,7 @@ var Combobox2 = ({
|
|
|
9683
9811
|
focusOnHover: true,
|
|
9684
9812
|
value: match,
|
|
9685
9813
|
children: [
|
|
9686
|
-
/* @__PURE__ */
|
|
9814
|
+
/* @__PURE__ */ jsx224(
|
|
9687
9815
|
Icon,
|
|
9688
9816
|
{
|
|
9689
9817
|
size: "sm",
|
|
@@ -9698,7 +9826,7 @@ var Combobox2 = ({
|
|
|
9698
9826
|
},
|
|
9699
9827
|
match
|
|
9700
9828
|
)),
|
|
9701
|
-
!matches.length && /* @__PURE__ */
|
|
9829
|
+
!matches.length && /* @__PURE__ */ jsx224(NoResults, { children: "No results found" })
|
|
9702
9830
|
]
|
|
9703
9831
|
}
|
|
9704
9832
|
)
|
|
@@ -9708,11 +9836,11 @@ var Combobox2 = ({
|
|
|
9708
9836
|
};
|
|
9709
9837
|
|
|
9710
9838
|
// src/components/DataCards/DataCard.tsx
|
|
9711
|
-
import { useRef as
|
|
9712
|
-
import
|
|
9839
|
+
import { useRef as useRef10 } from "react";
|
|
9840
|
+
import styled33, { keyframes } from "styled-components";
|
|
9713
9841
|
import { isNotNil as isNotNil18, isNotNull } from "@wistia/type-guards";
|
|
9714
|
-
import { jsx as
|
|
9715
|
-
var StyledDataCard =
|
|
9842
|
+
import { jsx as jsx225, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
9843
|
+
var StyledDataCard = styled33.div`
|
|
9716
9844
|
display: grid;
|
|
9717
9845
|
grid-template-areas: 'label slot' 'value value';
|
|
9718
9846
|
grid-template-rows: auto auto;
|
|
@@ -9775,7 +9903,7 @@ var shimmer = keyframes`
|
|
|
9775
9903
|
background-position: -200% 0;
|
|
9776
9904
|
}
|
|
9777
9905
|
`;
|
|
9778
|
-
var LoadingBackground =
|
|
9906
|
+
var LoadingBackground = styled33.div`
|
|
9779
9907
|
background: linear-gradient(
|
|
9780
9908
|
90deg,
|
|
9781
9909
|
var(--wui-color-bg-surface-tertiary) 25%,
|
|
@@ -9786,27 +9914,27 @@ var LoadingBackground = styled32.div`
|
|
|
9786
9914
|
animation: ${shimmer} 1.5s infinite;
|
|
9787
9915
|
border-radius: var(--wui-border-radius-01);
|
|
9788
9916
|
`;
|
|
9789
|
-
var StyledLoadingLabel =
|
|
9917
|
+
var StyledLoadingLabel = styled33(LoadingBackground)`
|
|
9790
9918
|
width: 80px;
|
|
9791
9919
|
height: var(--wui-typography-heading-6-line-height);
|
|
9792
9920
|
`;
|
|
9793
|
-
var StyledLoadingValue =
|
|
9921
|
+
var StyledLoadingValue = styled33(LoadingBackground)`
|
|
9794
9922
|
width: 90%;
|
|
9795
9923
|
height: var(--wui-typography-heading-3-line-height);
|
|
9796
9924
|
`;
|
|
9797
|
-
var StyledLabel2 =
|
|
9925
|
+
var StyledLabel2 = styled33(Heading)`
|
|
9798
9926
|
grid-area: label;
|
|
9799
9927
|
`;
|
|
9800
|
-
var StyledValue =
|
|
9928
|
+
var StyledValue = styled33(Heading)`
|
|
9801
9929
|
grid-area: value;
|
|
9802
9930
|
`;
|
|
9803
|
-
var StyledSlot =
|
|
9931
|
+
var StyledSlot = styled33.div`
|
|
9804
9932
|
display: flex;
|
|
9805
9933
|
justify-content: flex-end;
|
|
9806
9934
|
grid-area: slot;
|
|
9807
9935
|
align-self: center;
|
|
9808
9936
|
`;
|
|
9809
|
-
var StyledDataCardTrendContainer =
|
|
9937
|
+
var StyledDataCardTrendContainer = styled33.div`
|
|
9810
9938
|
position: absolute;
|
|
9811
9939
|
bottom: var(--wui-space-01);
|
|
9812
9940
|
right: var(--wui-space-01);
|
|
@@ -9825,28 +9953,28 @@ var DataCardInner = ({
|
|
|
9825
9953
|
$colorScheme: colorScheme,
|
|
9826
9954
|
...props,
|
|
9827
9955
|
children: [
|
|
9828
|
-
/* @__PURE__ */
|
|
9956
|
+
/* @__PURE__ */ jsx225(
|
|
9829
9957
|
StyledLabel2,
|
|
9830
9958
|
{
|
|
9831
9959
|
renderAs: "dt",
|
|
9832
9960
|
variant: "heading6",
|
|
9833
|
-
children: isLoading ? /* @__PURE__ */
|
|
9961
|
+
children: isLoading ? /* @__PURE__ */ jsx225(StyledLoadingLabel, {}) : label
|
|
9834
9962
|
}
|
|
9835
9963
|
),
|
|
9836
|
-
/* @__PURE__ */
|
|
9964
|
+
/* @__PURE__ */ jsx225(
|
|
9837
9965
|
StyledValue,
|
|
9838
9966
|
{
|
|
9839
9967
|
renderAs: "dd",
|
|
9840
9968
|
variant: "heading3",
|
|
9841
|
-
children: isLoading ? /* @__PURE__ */
|
|
9969
|
+
children: isLoading ? /* @__PURE__ */ jsx225(StyledLoadingValue, {}) : value
|
|
9842
9970
|
}
|
|
9843
9971
|
),
|
|
9844
|
-
isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */
|
|
9845
|
-
isNotNull(trend) && !isLoading && /* @__PURE__ */
|
|
9972
|
+
isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */ jsx225(StyledSlot, { children: upperRightSlot }),
|
|
9973
|
+
isNotNull(trend) && !isLoading && /* @__PURE__ */ jsx225(StyledDataCardTrendContainer, { children: trend })
|
|
9846
9974
|
]
|
|
9847
9975
|
}
|
|
9848
9976
|
);
|
|
9849
|
-
var DataCardArrowIcon = /* @__PURE__ */
|
|
9977
|
+
var DataCardArrowIcon = /* @__PURE__ */ jsx225(
|
|
9850
9978
|
Icon,
|
|
9851
9979
|
{
|
|
9852
9980
|
"data-wui-data-card-hover-icon": true,
|
|
@@ -9854,14 +9982,14 @@ var DataCardArrowIcon = /* @__PURE__ */ jsx224(
|
|
|
9854
9982
|
}
|
|
9855
9983
|
);
|
|
9856
9984
|
var DataCard = (props) => {
|
|
9857
|
-
const ref =
|
|
9985
|
+
const ref = useRef10(null);
|
|
9858
9986
|
if (isNotNil18(props.href) || isNotNil18(props.onClick)) {
|
|
9859
|
-
return /* @__PURE__ */
|
|
9987
|
+
return /* @__PURE__ */ jsx225(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ jsx225(
|
|
9860
9988
|
DataCardInner,
|
|
9861
9989
|
{
|
|
9862
9990
|
upperRightSlot: props.upperRightSlot ?? DataCardArrowIcon,
|
|
9863
9991
|
...props,
|
|
9864
|
-
label: /* @__PURE__ */
|
|
9992
|
+
label: /* @__PURE__ */ jsx225(
|
|
9865
9993
|
Button,
|
|
9866
9994
|
{
|
|
9867
9995
|
ref,
|
|
@@ -9876,14 +10004,14 @@ var DataCard = (props) => {
|
|
|
9876
10004
|
}
|
|
9877
10005
|
) });
|
|
9878
10006
|
}
|
|
9879
|
-
return /* @__PURE__ */
|
|
10007
|
+
return /* @__PURE__ */ jsx225(DataCardInner, { ...props });
|
|
9880
10008
|
};
|
|
9881
10009
|
DataCard.displayName = "DataCard";
|
|
9882
10010
|
|
|
9883
10011
|
// src/components/DataCards/DataCards.tsx
|
|
9884
|
-
import
|
|
9885
|
-
import { jsx as
|
|
9886
|
-
var StyledDataCards =
|
|
10012
|
+
import styled34 from "styled-components";
|
|
10013
|
+
import { jsx as jsx226 } from "react/jsx-runtime";
|
|
10014
|
+
var StyledDataCards = styled34(Box)`
|
|
9887
10015
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9888
10016
|
margin-top: 0; /* Remove default <dl> style */
|
|
9889
10017
|
> * {
|
|
@@ -9897,7 +10025,7 @@ var DataCards = ({
|
|
|
9897
10025
|
colorScheme = "inherit",
|
|
9898
10026
|
...props
|
|
9899
10027
|
}) => {
|
|
9900
|
-
return /* @__PURE__ */
|
|
10028
|
+
return /* @__PURE__ */ jsx226(
|
|
9901
10029
|
StyledDataCards,
|
|
9902
10030
|
{
|
|
9903
10031
|
...props,
|
|
@@ -9915,9 +10043,9 @@ var DataCards = ({
|
|
|
9915
10043
|
DataCards.displayName = "DataCards";
|
|
9916
10044
|
|
|
9917
10045
|
// src/components/DataCards/DataCardTrend.tsx
|
|
9918
|
-
import
|
|
9919
|
-
import { jsx as
|
|
9920
|
-
var StyledDataCardTrend =
|
|
10046
|
+
import styled35 from "styled-components";
|
|
10047
|
+
import { jsx as jsx227, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
10048
|
+
var StyledDataCardTrend = styled35.div`
|
|
9921
10049
|
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
9922
10050
|
background: var(--wui-color-bg-app);
|
|
9923
10051
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -9933,7 +10061,7 @@ var DataCardTrend = ({
|
|
|
9933
10061
|
...props
|
|
9934
10062
|
}) => {
|
|
9935
10063
|
return /* @__PURE__ */ jsxs22(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
9936
|
-
/* @__PURE__ */
|
|
10064
|
+
/* @__PURE__ */ jsx227(
|
|
9937
10065
|
Icon,
|
|
9938
10066
|
{
|
|
9939
10067
|
size: "md",
|
|
@@ -9941,7 +10069,7 @@ var DataCardTrend = ({
|
|
|
9941
10069
|
...props
|
|
9942
10070
|
}
|
|
9943
10071
|
),
|
|
9944
|
-
/* @__PURE__ */
|
|
10072
|
+
/* @__PURE__ */ jsx227(
|
|
9945
10073
|
Text,
|
|
9946
10074
|
{
|
|
9947
10075
|
prominence: "secondary",
|
|
@@ -9953,8 +10081,8 @@ var DataCardTrend = ({
|
|
|
9953
10081
|
};
|
|
9954
10082
|
|
|
9955
10083
|
// src/components/Divider/Divider.tsx
|
|
9956
|
-
import
|
|
9957
|
-
import { jsx as
|
|
10084
|
+
import styled36, { css as css27 } from "styled-components";
|
|
10085
|
+
import { jsx as jsx228 } from "react/jsx-runtime";
|
|
9958
10086
|
var horizontalBorderCss = css27`
|
|
9959
10087
|
border-top-color: var(--wui-color-border);
|
|
9960
10088
|
border-top-style: solid;
|
|
@@ -9968,7 +10096,7 @@ var verticalBorderCss = css27`
|
|
|
9968
10096
|
min-height: 100%;
|
|
9969
10097
|
width: 1px;
|
|
9970
10098
|
`;
|
|
9971
|
-
var DividerComponent =
|
|
10099
|
+
var DividerComponent = styled36.div`
|
|
9972
10100
|
${({ $orientation }) => {
|
|
9973
10101
|
switch ($orientation) {
|
|
9974
10102
|
case "vertical":
|
|
@@ -9980,7 +10108,7 @@ var DividerComponent = styled35.div`
|
|
|
9980
10108
|
}}
|
|
9981
10109
|
`;
|
|
9982
10110
|
var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
9983
|
-
return /* @__PURE__ */
|
|
10111
|
+
return /* @__PURE__ */ jsx228(
|
|
9984
10112
|
DividerComponent,
|
|
9985
10113
|
{
|
|
9986
10114
|
$orientation: orientation,
|
|
@@ -9993,8 +10121,8 @@ var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
|
9993
10121
|
Divider.displayName = "Divider";
|
|
9994
10122
|
|
|
9995
10123
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9996
|
-
import
|
|
9997
|
-
import { useState as
|
|
10124
|
+
import styled39, { css as css29 } from "styled-components";
|
|
10125
|
+
import { useState as useState13, useRef as useRef12 } from "react";
|
|
9998
10126
|
|
|
9999
10127
|
// src/components/Tooltip/Tooltip.tsx
|
|
10000
10128
|
import {
|
|
@@ -10004,8 +10132,8 @@ import {
|
|
|
10004
10132
|
Portal as TooltipPortal,
|
|
10005
10133
|
Arrow as TooltipArrow
|
|
10006
10134
|
} from "@radix-ui/react-tooltip";
|
|
10007
|
-
import
|
|
10008
|
-
import { jsx as
|
|
10135
|
+
import styled37, { keyframes as keyframes2 } from "styled-components";
|
|
10136
|
+
import { jsx as jsx229, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
10009
10137
|
var hide = keyframes2`
|
|
10010
10138
|
from {
|
|
10011
10139
|
opacity: 1;
|
|
@@ -10054,7 +10182,7 @@ var slideRightAndFade = keyframes2`
|
|
|
10054
10182
|
transform: translateX(0);
|
|
10055
10183
|
}
|
|
10056
10184
|
`;
|
|
10057
|
-
var StyledContent =
|
|
10185
|
+
var StyledContent = styled37(TooltipContent)`
|
|
10058
10186
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
10059
10187
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
10060
10188
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -10122,15 +10250,15 @@ var Tooltip = ({
|
|
|
10122
10250
|
delayDuration: delay,
|
|
10123
10251
|
...rootProps,
|
|
10124
10252
|
children: [
|
|
10125
|
-
/* @__PURE__ */
|
|
10126
|
-
/* @__PURE__ */
|
|
10253
|
+
/* @__PURE__ */ jsx229(TooltipTrigger, { asChild: true, children }),
|
|
10254
|
+
/* @__PURE__ */ jsx229(TooltipPortal, { children: /* @__PURE__ */ jsxs23(
|
|
10127
10255
|
StyledContent,
|
|
10128
10256
|
{
|
|
10129
10257
|
side: direction,
|
|
10130
10258
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
10131
10259
|
children: [
|
|
10132
10260
|
content,
|
|
10133
|
-
!hideArrow ? /* @__PURE__ */
|
|
10261
|
+
!hideArrow ? /* @__PURE__ */ jsx229(TooltipArrow, { asChild: true, children: /* @__PURE__ */ jsx229(
|
|
10134
10262
|
"svg",
|
|
10135
10263
|
{
|
|
10136
10264
|
fill: "var(--tooltip-bg)",
|
|
@@ -10139,7 +10267,7 @@ var Tooltip = ({
|
|
|
10139
10267
|
viewBox: "0 0 12 8",
|
|
10140
10268
|
width: "12",
|
|
10141
10269
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10142
|
-
children: /* @__PURE__ */
|
|
10270
|
+
children: /* @__PURE__ */ jsx229("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" })
|
|
10143
10271
|
}
|
|
10144
10272
|
) }) : null
|
|
10145
10273
|
]
|
|
@@ -10152,10 +10280,10 @@ var Tooltip = ({
|
|
|
10152
10280
|
Tooltip.displayName = "Tooltip";
|
|
10153
10281
|
|
|
10154
10282
|
// src/components/Input/Input.tsx
|
|
10155
|
-
import { forwardRef as
|
|
10156
|
-
import
|
|
10283
|
+
import { forwardRef as forwardRef14, cloneElement as cloneElement4, useRef as useRef11 } from "react";
|
|
10284
|
+
import styled38, { css as css28 } from "styled-components";
|
|
10157
10285
|
import { isNil as isNil14, isNotNil as isNotNil19, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
10158
|
-
import { jsx as
|
|
10286
|
+
import { jsx as jsx230, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10159
10287
|
var inputStyles = css28`
|
|
10160
10288
|
${inputCss}
|
|
10161
10289
|
input,
|
|
@@ -10191,7 +10319,7 @@ var inputStyles = css28`
|
|
|
10191
10319
|
}
|
|
10192
10320
|
}
|
|
10193
10321
|
`;
|
|
10194
|
-
var StyledInputContainer =
|
|
10322
|
+
var StyledInputContainer = styled38.div`
|
|
10195
10323
|
display: inline-flex;
|
|
10196
10324
|
position: relative;
|
|
10197
10325
|
${inputStyles};
|
|
@@ -10239,8 +10367,8 @@ var StyledInputContainer = styled37.div`
|
|
|
10239
10367
|
transform: translateY(-50%);
|
|
10240
10368
|
}
|
|
10241
10369
|
|
|
10242
|
-
|
|
10243
|
-
|
|
10370
|
+
&:has(.wui-input-left-icon) input,
|
|
10371
|
+
&:has(.wui-input-left-icon) textarea {
|
|
10244
10372
|
padding-left: 32px;
|
|
10245
10373
|
}
|
|
10246
10374
|
|
|
@@ -10253,12 +10381,12 @@ var StyledInputContainer = styled37.div`
|
|
|
10253
10381
|
transform: translateY(-50%);
|
|
10254
10382
|
}
|
|
10255
10383
|
|
|
10256
|
-
|
|
10257
|
-
|
|
10384
|
+
&:has(.wui-input-right-icon) input,
|
|
10385
|
+
&:has(.wui-input-right-icon) textarea {
|
|
10258
10386
|
padding-right: 32px;
|
|
10259
10387
|
}
|
|
10260
10388
|
`;
|
|
10261
|
-
var Input =
|
|
10389
|
+
var Input = forwardRef14(
|
|
10262
10390
|
({
|
|
10263
10391
|
fullWidth = true,
|
|
10264
10392
|
monospace = false,
|
|
@@ -10268,14 +10396,14 @@ var Input = forwardRef13(
|
|
|
10268
10396
|
rightIcon,
|
|
10269
10397
|
...props
|
|
10270
10398
|
}, externalRef) => {
|
|
10271
|
-
const internalRef =
|
|
10399
|
+
const internalRef = useRef11();
|
|
10272
10400
|
const ref = (
|
|
10273
10401
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
10274
10402
|
isNotNil19(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
10275
10403
|
);
|
|
10276
10404
|
let leftIconToDisplay = leftIcon;
|
|
10277
10405
|
if (isNil14(leftIcon) && type === "search") {
|
|
10278
|
-
leftIconToDisplay = /* @__PURE__ */
|
|
10406
|
+
leftIconToDisplay = /* @__PURE__ */ jsx230(Icon, { type: "search" });
|
|
10279
10407
|
}
|
|
10280
10408
|
if (isNotNil19(leftIconToDisplay)) {
|
|
10281
10409
|
leftIconToDisplay = cloneElement4(leftIconToDisplay, {
|
|
@@ -10307,14 +10435,14 @@ var Input = forwardRef13(
|
|
|
10307
10435
|
$monospace: monospace,
|
|
10308
10436
|
children: [
|
|
10309
10437
|
leftIconToDisplay ?? null,
|
|
10310
|
-
type === "multiline" ? /* @__PURE__ */
|
|
10438
|
+
type === "multiline" ? /* @__PURE__ */ jsx230(
|
|
10311
10439
|
"textarea",
|
|
10312
10440
|
{
|
|
10313
10441
|
...props,
|
|
10314
10442
|
ref,
|
|
10315
10443
|
onFocus: handleFocus2
|
|
10316
10444
|
}
|
|
10317
|
-
) : /* @__PURE__ */
|
|
10445
|
+
) : /* @__PURE__ */ jsx230(
|
|
10318
10446
|
"input",
|
|
10319
10447
|
{
|
|
10320
10448
|
...props,
|
|
@@ -10332,8 +10460,8 @@ var Input = forwardRef13(
|
|
|
10332
10460
|
Input.displayName = "Input";
|
|
10333
10461
|
|
|
10334
10462
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
10335
|
-
import { Fragment as Fragment6, jsx as
|
|
10336
|
-
var StyledInput =
|
|
10463
|
+
import { Fragment as Fragment6, jsx as jsx231, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10464
|
+
var StyledInput = styled39(Input)`
|
|
10337
10465
|
:not([rows]) {
|
|
10338
10466
|
min-height: unset;
|
|
10339
10467
|
}
|
|
@@ -10348,6 +10476,7 @@ var StyledInput = styled38(Input)`
|
|
|
10348
10476
|
padding: var(--wui-space-02);
|
|
10349
10477
|
border: none;
|
|
10350
10478
|
height: ${({ $height }) => `${$height}px`};
|
|
10479
|
+
min-height: ${({ $height }) => `${$height}px`};
|
|
10351
10480
|
}
|
|
10352
10481
|
`;
|
|
10353
10482
|
var editableStyles = css29`
|
|
@@ -10360,7 +10489,7 @@ var editableStyles = css29`
|
|
|
10360
10489
|
cursor: pointer;
|
|
10361
10490
|
}
|
|
10362
10491
|
`;
|
|
10363
|
-
var StyledHeading2 =
|
|
10492
|
+
var StyledHeading2 = styled39(Heading)`
|
|
10364
10493
|
width: 100%;
|
|
10365
10494
|
border-radius: var(--wui-border-radius-02);
|
|
10366
10495
|
padding: var(--wui-space-02);
|
|
@@ -10377,11 +10506,11 @@ var EditableHeading = ({
|
|
|
10377
10506
|
__forceEditing = false,
|
|
10378
10507
|
editingDisabled = false
|
|
10379
10508
|
}) => {
|
|
10380
|
-
const [isEditing, setIsEditing] =
|
|
10381
|
-
const [value, setValue] =
|
|
10382
|
-
const [previousValue, setPreviousValue] =
|
|
10383
|
-
const [headingHeight, setHeadingHeight] =
|
|
10384
|
-
const headingRef =
|
|
10509
|
+
const [isEditing, setIsEditing] = useState13(false);
|
|
10510
|
+
const [value, setValue] = useState13(children);
|
|
10511
|
+
const [previousValue, setPreviousValue] = useState13(children);
|
|
10512
|
+
const [headingHeight, setHeadingHeight] = useState13("60");
|
|
10513
|
+
const headingRef = useRef12(null);
|
|
10385
10514
|
const handleSetEditing = (editing) => {
|
|
10386
10515
|
if (editingDisabled) return;
|
|
10387
10516
|
if (editing && headingRef.current) {
|
|
@@ -10414,7 +10543,7 @@ var EditableHeading = ({
|
|
|
10414
10543
|
handleSetEditing(false);
|
|
10415
10544
|
}
|
|
10416
10545
|
};
|
|
10417
|
-
const HeadingComponent2 = /* @__PURE__ */
|
|
10546
|
+
const HeadingComponent2 = /* @__PURE__ */ jsx231(
|
|
10418
10547
|
StyledHeading2,
|
|
10419
10548
|
{
|
|
10420
10549
|
ref: headingRef,
|
|
@@ -10428,7 +10557,7 @@ var EditableHeading = ({
|
|
|
10428
10557
|
return HeadingComponent2;
|
|
10429
10558
|
}
|
|
10430
10559
|
if (isEditing || __forceEditing) {
|
|
10431
|
-
return /* @__PURE__ */
|
|
10560
|
+
return /* @__PURE__ */ jsx231(
|
|
10432
10561
|
StyledInput,
|
|
10433
10562
|
{
|
|
10434
10563
|
$height: headingHeight,
|
|
@@ -10447,8 +10576,8 @@ var EditableHeading = ({
|
|
|
10447
10576
|
);
|
|
10448
10577
|
}
|
|
10449
10578
|
return /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
10450
|
-
/* @__PURE__ */
|
|
10451
|
-
/* @__PURE__ */
|
|
10579
|
+
/* @__PURE__ */ jsx231(Tooltip, { content: tooltipText, children: HeadingComponent2 }),
|
|
10580
|
+
/* @__PURE__ */ jsx231(ScreenReaderOnly, { children: /* @__PURE__ */ jsx231(
|
|
10452
10581
|
"button",
|
|
10453
10582
|
{
|
|
10454
10583
|
"aria-label": ariaLabel,
|
|
@@ -10459,110 +10588,6 @@ var EditableHeading = ({
|
|
|
10459
10588
|
] });
|
|
10460
10589
|
};
|
|
10461
10590
|
|
|
10462
|
-
// src/components/Form/Form.tsx
|
|
10463
|
-
import { forwardRef as forwardRef14, useRef as useRef12, useMemo as useMemo8, createContext as createContext4, useState as useState13, useId as useId2 } from "react";
|
|
10464
|
-
import styled39 from "styled-components";
|
|
10465
|
-
import { isNotUndefined as isNotUndefined7, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
10466
|
-
import { jsx as jsx231 } from "react/jsx-runtime";
|
|
10467
|
-
var StyledForm = styled39.form`
|
|
10468
|
-
--form-default-width: 690px;
|
|
10469
|
-
|
|
10470
|
-
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
10471
|
-
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
10472
|
-
`;
|
|
10473
|
-
var FormContext = createContext4({
|
|
10474
|
-
values: {},
|
|
10475
|
-
errors: {},
|
|
10476
|
-
hasSubmitted: false,
|
|
10477
|
-
formId: "NO_FORM",
|
|
10478
|
-
labelPosition: "block"
|
|
10479
|
-
});
|
|
10480
|
-
var FormComponent = ({
|
|
10481
|
-
children,
|
|
10482
|
-
action,
|
|
10483
|
-
values = {},
|
|
10484
|
-
labelPosition = "block",
|
|
10485
|
-
validate,
|
|
10486
|
-
fullWidth = false,
|
|
10487
|
-
...props
|
|
10488
|
-
}, forwardedRef) => {
|
|
10489
|
-
const [errors, setErrors] = useState13({});
|
|
10490
|
-
const [hasSubmitted, setHasSubmitted] = useState13(false);
|
|
10491
|
-
const innerRef = useRef12();
|
|
10492
|
-
const ref = forwardedRef ?? innerRef;
|
|
10493
|
-
const autoId = useId2();
|
|
10494
|
-
const id = props.id ?? autoId;
|
|
10495
|
-
const handleValidate = (nextFormData) => {
|
|
10496
|
-
const nextData = Object.fromEntries(nextFormData.entries());
|
|
10497
|
-
if (isUndefined3(validate)) {
|
|
10498
|
-
return {};
|
|
10499
|
-
}
|
|
10500
|
-
return validate(nextData);
|
|
10501
|
-
};
|
|
10502
|
-
const handleBlur2 = (event) => {
|
|
10503
|
-
if (props.onBlur) {
|
|
10504
|
-
props.onBlur(event);
|
|
10505
|
-
}
|
|
10506
|
-
const formData = new FormData(event.currentTarget);
|
|
10507
|
-
if (isNotUndefined7(validate)) {
|
|
10508
|
-
handleValidate(formData);
|
|
10509
|
-
}
|
|
10510
|
-
};
|
|
10511
|
-
const handleSubmit = (event) => {
|
|
10512
|
-
event.preventDefault();
|
|
10513
|
-
const formData = new FormData(event.currentTarget);
|
|
10514
|
-
const nextErrors = handleValidate(formData);
|
|
10515
|
-
const isValid = Object.keys(nextErrors).length === 0;
|
|
10516
|
-
setErrors(nextErrors);
|
|
10517
|
-
setHasSubmitted(true);
|
|
10518
|
-
if (isValid && props.onSubmit) {
|
|
10519
|
-
props.onSubmit(event);
|
|
10520
|
-
}
|
|
10521
|
-
if (isValid && action) {
|
|
10522
|
-
void action(formData);
|
|
10523
|
-
}
|
|
10524
|
-
};
|
|
10525
|
-
const handleReset = (event) => {
|
|
10526
|
-
setErrors({});
|
|
10527
|
-
setHasSubmitted(false);
|
|
10528
|
-
if (props.onReset) {
|
|
10529
|
-
props.onReset(event);
|
|
10530
|
-
}
|
|
10531
|
-
if (action) {
|
|
10532
|
-
void action(null);
|
|
10533
|
-
}
|
|
10534
|
-
};
|
|
10535
|
-
const context = useMemo8(() => {
|
|
10536
|
-
return {
|
|
10537
|
-
values,
|
|
10538
|
-
errors,
|
|
10539
|
-
hasSubmitted,
|
|
10540
|
-
formId: id,
|
|
10541
|
-
labelPosition
|
|
10542
|
-
};
|
|
10543
|
-
}, [labelPosition, values, errors, id, hasSubmitted]);
|
|
10544
|
-
return (
|
|
10545
|
-
// @ts-expect-error - generic context providers are a giant pain
|
|
10546
|
-
/* @__PURE__ */ jsx231(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx231(
|
|
10547
|
-
Stack,
|
|
10548
|
-
{
|
|
10549
|
-
...props,
|
|
10550
|
-
ref,
|
|
10551
|
-
$fullWidth: fullWidth,
|
|
10552
|
-
as: StyledForm,
|
|
10553
|
-
gap: "space-05",
|
|
10554
|
-
id,
|
|
10555
|
-
onBlur: handleBlur2,
|
|
10556
|
-
onReset: handleReset,
|
|
10557
|
-
onSubmit: handleSubmit,
|
|
10558
|
-
children
|
|
10559
|
-
}
|
|
10560
|
-
) })
|
|
10561
|
-
);
|
|
10562
|
-
};
|
|
10563
|
-
FormComponent.displayName = "Form";
|
|
10564
|
-
var Form = forwardRef14(FormComponent);
|
|
10565
|
-
|
|
10566
10591
|
// src/components/Form/useFormState.tsx
|
|
10567
10592
|
import { useCallback as useCallback9, useState as useState14 } from "react";
|
|
10568
10593
|
var useFormState = (action, initialData = {}) => {
|
|
@@ -10576,7 +10601,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
10576
10601
|
setError(null);
|
|
10577
10602
|
return;
|
|
10578
10603
|
}
|
|
10579
|
-
const nextData =
|
|
10604
|
+
const nextData = serializeFormData(nextFormData);
|
|
10580
10605
|
setIsPending(true);
|
|
10581
10606
|
try {
|
|
10582
10607
|
const result = await action(data, nextData);
|
|
@@ -10601,7 +10626,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
10601
10626
|
|
|
10602
10627
|
// src/components/Form/FormErrorSummary.tsx
|
|
10603
10628
|
import { useContext as useContext4, useRef as useRef13 } from "react";
|
|
10604
|
-
import { isArray, isNotUndefined as
|
|
10629
|
+
import { isArray as isArray2, isNotUndefined as isNotUndefined9 } from "@wistia/type-guards";
|
|
10605
10630
|
import { jsx as jsx232, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10606
10631
|
var ErrorItem = ({ name, error, formId }) => {
|
|
10607
10632
|
return /* @__PURE__ */ jsx232("li", { children: /* @__PURE__ */ jsx232(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
@@ -10615,8 +10640,8 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10615
10640
|
}
|
|
10616
10641
|
return /* @__PURE__ */ jsxs26("div", { ref, children: [
|
|
10617
10642
|
/* @__PURE__ */ jsx232("p", { children: description }),
|
|
10618
|
-
/* @__PURE__ */ jsx232("ul", { children: Object.entries(errors).filter(([, error]) =>
|
|
10619
|
-
([name, error]) =>
|
|
10643
|
+
/* @__PURE__ */ jsx232("ul", { children: Object.entries(errors).filter(([, error]) => isNotUndefined9(error)).map(
|
|
10644
|
+
([name, error]) => isArray2(error) ? error.map((err) => /* @__PURE__ */ jsx232(
|
|
10620
10645
|
ErrorItem,
|
|
10621
10646
|
{
|
|
10622
10647
|
error: err,
|
|
@@ -10640,7 +10665,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10640
10665
|
// src/components/FormField/FormField.tsx
|
|
10641
10666
|
import { Children as Children6, cloneElement as cloneElement5, useContext as useContext5 } from "react";
|
|
10642
10667
|
import styled41 from "styled-components";
|
|
10643
|
-
import { isArray as
|
|
10668
|
+
import { isArray as isArray3, isNotNil as isNotNil20, isNotUndefined as isNotUndefined10, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
10644
10669
|
|
|
10645
10670
|
// src/components/Label/Label.tsx
|
|
10646
10671
|
import styled40, { css as css30 } from "styled-components";
|
|
@@ -10743,7 +10768,7 @@ var StyledErrorList = styled41.ul`
|
|
|
10743
10768
|
gap: var(--wui-space-01);
|
|
10744
10769
|
`;
|
|
10745
10770
|
var ErrorMessages = ({ errors, id }) => {
|
|
10746
|
-
const isMultipleErrors =
|
|
10771
|
+
const isMultipleErrors = isArray3(errors);
|
|
10747
10772
|
return isMultipleErrors ? /* @__PURE__ */ jsx234(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ jsx234(
|
|
10748
10773
|
Text,
|
|
10749
10774
|
{
|
|
@@ -10793,7 +10818,7 @@ var FormField = ({
|
|
|
10793
10818
|
"aria-describedby": ariaDescribedby,
|
|
10794
10819
|
...props
|
|
10795
10820
|
};
|
|
10796
|
-
if (isUndefined4(value) &&
|
|
10821
|
+
if (isUndefined4(value) && isNotUndefined10(defaultValue)) {
|
|
10797
10822
|
childProps = {
|
|
10798
10823
|
...childProps,
|
|
10799
10824
|
defaultValue
|
|
@@ -10802,10 +10827,10 @@ var FormField = ({
|
|
|
10802
10827
|
if (isNotNil20(checkboxGroup)) {
|
|
10803
10828
|
const computedName = isNotNil20(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
10804
10829
|
const handleChange = (event) => {
|
|
10805
|
-
if (
|
|
10830
|
+
if (isNotUndefined10(props.onChange)) {
|
|
10806
10831
|
props.onChange(event);
|
|
10807
10832
|
}
|
|
10808
|
-
if (
|
|
10833
|
+
if (isNotUndefined10(checkboxGroup.onChange)) {
|
|
10809
10834
|
checkboxGroup.onChange(event);
|
|
10810
10835
|
}
|
|
10811
10836
|
};
|
|
@@ -10856,12 +10881,15 @@ var RadioGroup = ({
|
|
|
10856
10881
|
value,
|
|
10857
10882
|
...props
|
|
10858
10883
|
}) => {
|
|
10884
|
+
const formState = useContext6(FormContext);
|
|
10885
|
+
const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
|
|
10859
10886
|
const context = useMemo9(() => {
|
|
10860
10887
|
return {
|
|
10861
10888
|
name,
|
|
10862
|
-
onChange
|
|
10889
|
+
onChange,
|
|
10890
|
+
value: derivedValue
|
|
10863
10891
|
};
|
|
10864
|
-
}, [name, onChange]);
|
|
10892
|
+
}, [name, derivedValue, onChange]);
|
|
10865
10893
|
return /* @__PURE__ */ jsx235(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx235(FormGroup, { ...props, children }) });
|
|
10866
10894
|
};
|
|
10867
10895
|
RadioGroup.displayName = "RadioGroup";
|
|
@@ -11205,7 +11233,7 @@ import {
|
|
|
11205
11233
|
DropdownMenuPortal,
|
|
11206
11234
|
DropdownMenuContent
|
|
11207
11235
|
} from "@radix-ui/react-dropdown-menu";
|
|
11208
|
-
import { isNotNil as isNotNil23, isNotUndefined as
|
|
11236
|
+
import { isNotNil as isNotNil23, isNotUndefined as isNotUndefined11 } from "@wistia/type-guards";
|
|
11209
11237
|
import { useMemo as useMemo10 } from "react";
|
|
11210
11238
|
|
|
11211
11239
|
// src/components/Menu/MenuContext.tsx
|
|
@@ -11331,7 +11359,7 @@ var Menu = ({
|
|
|
11331
11359
|
modal: false,
|
|
11332
11360
|
...controlProps,
|
|
11333
11361
|
children: [
|
|
11334
|
-
/* @__PURE__ */ jsx240(DropdownMenuTrigger, { asChild: true, children:
|
|
11362
|
+
/* @__PURE__ */ jsx240(DropdownMenuTrigger, { asChild: true, children: isNotUndefined11(trigger) ? trigger : /* @__PURE__ */ jsx240(
|
|
11335
11363
|
Button,
|
|
11336
11364
|
{
|
|
11337
11365
|
"aria-expanded": isOpen,
|
|
@@ -11405,7 +11433,7 @@ import { isNotNil as isNotNil25 } from "@wistia/type-guards";
|
|
|
11405
11433
|
// src/components/Menu/MenuItemButton.tsx
|
|
11406
11434
|
import { forwardRef as forwardRef16 } from "react";
|
|
11407
11435
|
import styled48 from "styled-components";
|
|
11408
|
-
import { isNotNil as isNotNil24, isNotUndefined as
|
|
11436
|
+
import { isNotNil as isNotNil24, isNotUndefined as isNotUndefined12 } from "@wistia/type-guards";
|
|
11409
11437
|
import { jsx as jsx242, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11410
11438
|
var StyledButton3 = styled48(Button)`
|
|
11411
11439
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -11422,7 +11450,7 @@ var StyledButton3 = styled48(Button)`
|
|
|
11422
11450
|
line-height: var(--menu-label-line-height);
|
|
11423
11451
|
transition: background-color var(--wui-motion-duration-01) var(--wui-motion-ease);
|
|
11424
11452
|
|
|
11425
|
-
|
|
11453
|
+
&:active {
|
|
11426
11454
|
background-color: var(--wui-color-bg-surface-active);
|
|
11427
11455
|
}
|
|
11428
11456
|
|
|
@@ -11483,7 +11511,7 @@ var StyledBadgeContainer = styled48.div`
|
|
|
11483
11511
|
var MenuItemButton = forwardRef16(({ children, appearance, command, icon, ...props }, ref) => {
|
|
11484
11512
|
let { colorScheme, badge } = props;
|
|
11485
11513
|
if (appearance === "dangerous") {
|
|
11486
|
-
if (
|
|
11514
|
+
if (isNotUndefined12(colorScheme)) {
|
|
11487
11515
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
11488
11516
|
}
|
|
11489
11517
|
colorScheme = "error";
|
|
@@ -12319,7 +12347,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
12319
12347
|
// src/components/Radio/Radio.tsx
|
|
12320
12348
|
import { forwardRef as forwardRef21, useId as useId3 } from "react";
|
|
12321
12349
|
import styled59, { css as css36 } from "styled-components";
|
|
12322
|
-
import { isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
12350
|
+
import { isNonEmptyString as isNonEmptyString4, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
|
|
12323
12351
|
import { jsx as jsx257, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
12324
12352
|
var RadioIcon = () => /* @__PURE__ */ jsx257(
|
|
12325
12353
|
"svg",
|
|
@@ -12440,8 +12468,10 @@ var Radio = forwardRef21(
|
|
|
12440
12468
|
const radioGroupContext = useRadioGroup();
|
|
12441
12469
|
const contextName = radioGroupContext?.name;
|
|
12442
12470
|
const contextOnChange = radioGroupContext?.onChange;
|
|
12471
|
+
const contextValue = radioGroupContext?.value;
|
|
12443
12472
|
const radioName = name ?? contextName;
|
|
12444
12473
|
const handleOnChange = onChange ?? contextOnChange;
|
|
12474
|
+
const defaultChecked = isNotUndefined13(value) && isNotUndefined13(contextValue) ? contextValue.includes(value) : void 0;
|
|
12445
12475
|
return /* @__PURE__ */ jsxs39(
|
|
12446
12476
|
StyledRadioWrapper,
|
|
12447
12477
|
{
|
|
@@ -12453,14 +12483,14 @@ var Radio = forwardRef21(
|
|
|
12453
12483
|
{
|
|
12454
12484
|
...props,
|
|
12455
12485
|
ref,
|
|
12456
|
-
checked,
|
|
12457
12486
|
disabled,
|
|
12458
12487
|
id: computedId,
|
|
12459
12488
|
name: radioName,
|
|
12460
12489
|
onChange: handleOnChange,
|
|
12461
12490
|
required,
|
|
12462
12491
|
type: "radio",
|
|
12463
|
-
value
|
|
12492
|
+
value,
|
|
12493
|
+
...isNotUndefined13(defaultChecked) ? { defaultChecked } : { checked }
|
|
12464
12494
|
}
|
|
12465
12495
|
),
|
|
12466
12496
|
/* @__PURE__ */ jsx257(
|