@wistia/ui 1.9.0 → 1.9.1-beta.491f6847.136e8d0
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.d.ts +86 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +417 -244
- package/dist/index.js.map +1 -1
- package/package.json +34 -34
- package/CHANGELOG.md +0 -2287
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v1.9.
|
|
3
|
+
* @license @wistia/ui v1.9.1-beta.491f6847.136e8d0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -72,8 +72,9 @@ const designTokens = css`
|
|
|
72
72
|
${"/*\n * Legacy typography sub-property aliases\n *\n * Terrazzo's plugin-css emits typography composite sub-properties using DTCG\n * names verbatim (kebab-cased):\n * --wui-typography-<style>-font-family\n * --wui-typography-<style>-font-size\n * --wui-typography-<style>-font-weight\n *\n * Prior versions of @wistia/ui exposed shortened legacy names:\n * --wui-typography-<style>-family\n * --wui-typography-<style>-size\n * --wui-typography-<style>-weight\n *\n * These aliases preserve that surface so downstream apps (notably wistia/wistia)\n * keep working unchanged after the Terrazzo migration. Once all known consumers\n * have migrated to the DTCG names, delete this file and remove the import from\n * designTokens/index.tsx.\n *\n * Note: `line-height` and `paragraph-spacing` sub-properties are unchanged\n * between DTCG and the prior surface, so no aliases are required for those.\n *\n * --------------------------------------------------------------------------\n * Migrating consumers in wistia/wistia (run from the VMA repo root):\n *\n * # 1. List every legacy reference site:\n * grep -rnE --include='*.ts' --include='*.tsx' --include='*.css' \\\n * '--wui-typography-(heading-hero|heading-[0-9]|body-[0-9]|label-[0-9])-(family|size|weight)' \\\n * frontend\n *\n * # 2. Apply the rename in-place (BSD sed on macOS):\n * grep -rlE --include='*.ts' --include='*.tsx' --include='*.css' \\\n * '--wui-typography-(heading-hero|heading-[0-9]|body-[0-9]|label-[0-9])-(family|size|weight)' \\\n * frontend \\\n * | xargs sed -i '' -E \\\n * 's/(--wui-typography-(heading-hero|heading-[0-9]|body-[0-9]|label-[0-9]))-(family|size|weight)/\\1-font-\\3/g'\n *\n * # 3. (GNU sed / Linux variant — drop the empty '' after -i):\n * # ... | xargs sed -i -E '...'\n *\n * Special case: frontend/authentication/css/redesign/wistia-ui/design-tokens/\n * typography.css *defines* the legacy names itself (not consumed from\n * @wistia/ui). It will keep working post-rename, but should be migrated for\n * consistency.\n * --------------------------------------------------------------------------\n */\n:root,\n[data-wui-theme='true'] {\n --wui-typography-heading-hero-family: var(--wui-typography-heading-hero-font-family);\n --wui-typography-heading-hero-size: var(--wui-typography-heading-hero-font-size);\n --wui-typography-heading-hero-weight: var(--wui-typography-heading-hero-font-weight);\n --wui-typography-heading-1-family: var(--wui-typography-heading-1-font-family);\n --wui-typography-heading-1-size: var(--wui-typography-heading-1-font-size);\n --wui-typography-heading-1-weight: var(--wui-typography-heading-1-font-weight);\n --wui-typography-heading-2-family: var(--wui-typography-heading-2-font-family);\n --wui-typography-heading-2-size: var(--wui-typography-heading-2-font-size);\n --wui-typography-heading-2-weight: var(--wui-typography-heading-2-font-weight);\n --wui-typography-heading-3-family: var(--wui-typography-heading-3-font-family);\n --wui-typography-heading-3-size: var(--wui-typography-heading-3-font-size);\n --wui-typography-heading-3-weight: var(--wui-typography-heading-3-font-weight);\n --wui-typography-heading-4-family: var(--wui-typography-heading-4-font-family);\n --wui-typography-heading-4-size: var(--wui-typography-heading-4-font-size);\n --wui-typography-heading-4-weight: var(--wui-typography-heading-4-font-weight);\n --wui-typography-heading-5-family: var(--wui-typography-heading-5-font-family);\n --wui-typography-heading-5-size: var(--wui-typography-heading-5-font-size);\n --wui-typography-heading-5-weight: var(--wui-typography-heading-5-font-weight);\n --wui-typography-heading-6-family: var(--wui-typography-heading-6-font-family);\n --wui-typography-heading-6-size: var(--wui-typography-heading-6-font-size);\n --wui-typography-heading-6-weight: var(--wui-typography-heading-6-font-weight);\n --wui-typography-body-1-family: var(--wui-typography-body-1-font-family);\n --wui-typography-body-1-size: var(--wui-typography-body-1-font-size);\n --wui-typography-body-1-weight: var(--wui-typography-body-1-font-weight);\n --wui-typography-body-2-family: var(--wui-typography-body-2-font-family);\n --wui-typography-body-2-size: var(--wui-typography-body-2-font-size);\n --wui-typography-body-2-weight: var(--wui-typography-body-2-font-weight);\n --wui-typography-body-3-family: var(--wui-typography-body-3-font-family);\n --wui-typography-body-3-size: var(--wui-typography-body-3-font-size);\n --wui-typography-body-3-weight: var(--wui-typography-body-3-font-weight);\n --wui-typography-body-4-family: var(--wui-typography-body-4-font-family);\n --wui-typography-body-4-size: var(--wui-typography-body-4-font-size);\n --wui-typography-body-4-weight: var(--wui-typography-body-4-font-weight);\n --wui-typography-label-1-family: var(--wui-typography-label-1-font-family);\n --wui-typography-label-1-size: var(--wui-typography-label-1-font-size);\n --wui-typography-label-1-weight: var(--wui-typography-label-1-font-weight);\n --wui-typography-label-2-family: var(--wui-typography-label-2-font-family);\n --wui-typography-label-2-size: var(--wui-typography-label-2-font-size);\n --wui-typography-label-2-weight: var(--wui-typography-label-2-font-weight);\n --wui-typography-label-3-family: var(--wui-typography-label-3-font-family);\n --wui-typography-label-3-size: var(--wui-typography-label-3-font-size);\n --wui-typography-label-3-weight: var(--wui-typography-label-3-font-weight);\n --wui-typography-label-4-family: var(--wui-typography-label-4-font-family);\n --wui-typography-label-4-size: var(--wui-typography-label-4-font-size);\n --wui-typography-label-4-weight: var(--wui-typography-label-4-font-weight);\n}\n"}
|
|
73
73
|
`;
|
|
74
74
|
//#endregion
|
|
75
|
-
//#region src/css/
|
|
76
|
-
const
|
|
75
|
+
//#region src/css/GlobalStyle.tsx
|
|
76
|
+
const GlobalStyle = createGlobalStyle`
|
|
77
|
+
${css`
|
|
77
78
|
/**
|
|
78
79
|
* 1. Change from 'content-box' so that 'width' calculations are unaffected by 'padding' or 'border'
|
|
79
80
|
See: https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
|
|
@@ -106,6 +107,9 @@ const globalStyleAdjustmentsCss = css`
|
|
|
106
107
|
so this becomes the default for all text. Guarded by '@supports' because
|
|
107
108
|
'pretty' is not Baseline yet; browsers without it keep the initial
|
|
108
109
|
'text-wrap: wrap' behavior, so no polyfill is needed.
|
|
110
|
+
5. Prefer dvh where supported so the body tracks the dynamic viewport on
|
|
111
|
+
mobile Safari; the 100vh line stays as a legacy fallback (declared first
|
|
112
|
+
so newer browsers override it with dvh).
|
|
109
113
|
*/
|
|
110
114
|
body {
|
|
111
115
|
/* Ensure background and text colors are wui default, not system default */
|
|
@@ -116,6 +120,7 @@ const globalStyleAdjustmentsCss = css`
|
|
|
116
120
|
line-height: 1.5; /* 2 */
|
|
117
121
|
min-height: 100vh; /* 3 */
|
|
118
122
|
min-height: -webkit-fill-available; /* 3 */
|
|
123
|
+
min-height: 100dvh; /* 5 */
|
|
119
124
|
|
|
120
125
|
@supports (text-wrap: pretty) {
|
|
121
126
|
text-wrap: pretty; /* 4 */
|
|
@@ -208,11 +213,7 @@ const globalStyleAdjustmentsCss = css`
|
|
|
208
213
|
scroll-behavior: auto !important;
|
|
209
214
|
}
|
|
210
215
|
}
|
|
211
|
-
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/css/GlobalStyle.tsx
|
|
214
|
-
const GlobalStyle = createGlobalStyle`
|
|
215
|
-
${globalStyleAdjustmentsCss}
|
|
216
|
+
`}
|
|
216
217
|
${designTokens}
|
|
217
218
|
${clickRegionGlobalStyles}
|
|
218
219
|
`;
|
|
@@ -269,9 +270,8 @@ const AriaLiveProvider = ({ children, debug = false }) => {
|
|
|
269
270
|
setTimeout(() => setMessage(null), 1e3);
|
|
270
271
|
}
|
|
271
272
|
}, []);
|
|
272
|
-
const value = useMemo(() => ({ announce }), [announce]);
|
|
273
273
|
return /* @__PURE__ */ jsx(AriaLiveContext, {
|
|
274
|
-
value,
|
|
274
|
+
value: useMemo(() => ({ announce }), [announce]),
|
|
275
275
|
children
|
|
276
276
|
});
|
|
277
277
|
};
|
|
@@ -353,7 +353,7 @@ const copyToClipboard = async (textToCopy) => {
|
|
|
353
353
|
const defaultLocales = ["en-US"];
|
|
354
354
|
const defaultTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
355
355
|
const milisecondsInSecond = 1e3;
|
|
356
|
-
const millisecondsInDay =
|
|
356
|
+
const millisecondsInDay = 1440 * 60 * milisecondsInSecond;
|
|
357
357
|
//#endregion
|
|
358
358
|
//#region src/helpers/dateTime/buildTimeDuration.ts
|
|
359
359
|
/**
|
|
@@ -1164,8 +1164,7 @@ const DEFAULT_GRADIENT = "defaultMidOne";
|
|
|
1164
1164
|
const getSemiRandomBackgroundGradient = (id) => {
|
|
1165
1165
|
if (!(typeof id === "string" && id)) return gradientMap[0] ?? DEFAULT_GRADIENT;
|
|
1166
1166
|
const hashCode = [...id].reduce((num, char) => Math.imul(MULTIPLIER, num) + (char.codePointAt(0) ?? 0) || 0, 0);
|
|
1167
|
-
|
|
1168
|
-
return gradientMap[index] ?? DEFAULT_GRADIENT;
|
|
1167
|
+
return gradientMap[Math.abs(hashCode) % gradientMap.length] ?? DEFAULT_GRADIENT;
|
|
1169
1168
|
};
|
|
1170
1169
|
//#endregion
|
|
1171
1170
|
//#region src/helpers/mergeRefs/mergeRefs.ts
|
|
@@ -1390,11 +1389,10 @@ const useElementObserver = () => {
|
|
|
1390
1389
|
* @param config Optional configuration for the file picker
|
|
1391
1390
|
*/
|
|
1392
1391
|
const useFilePicker = (config = {}) => {
|
|
1393
|
-
|
|
1392
|
+
return useFilePicker$1({
|
|
1394
1393
|
readFilesContent: false,
|
|
1395
1394
|
...config
|
|
1396
|
-
};
|
|
1397
|
-
return useFilePicker$1(finalConfig);
|
|
1395
|
+
});
|
|
1398
1396
|
};
|
|
1399
1397
|
/**
|
|
1400
1398
|
* Hook that wraps `useImperativeFilePicker` from the use-file-picker library
|
|
@@ -1402,11 +1400,10 @@ const useFilePicker = (config = {}) => {
|
|
|
1402
1400
|
* @param config Optional configuration for the imperative file picker
|
|
1403
1401
|
*/
|
|
1404
1402
|
const useImperativeFilePicker = (config = {}) => {
|
|
1405
|
-
|
|
1403
|
+
return useImperativeFilePicker$1({
|
|
1406
1404
|
readFilesContent: false,
|
|
1407
1405
|
...config
|
|
1408
|
-
};
|
|
1409
|
-
return useImperativeFilePicker$1(finalConfig);
|
|
1406
|
+
});
|
|
1410
1407
|
};
|
|
1411
1408
|
//#endregion
|
|
1412
1409
|
//#region src/hooks/useFocusTrap/helpers.ts
|
|
@@ -1642,7 +1639,7 @@ const useEvent = (eventName, eventHandler, eventTarget = typeof document !== "un
|
|
|
1642
1639
|
//#endregion
|
|
1643
1640
|
//#region src/hooks/useKey/useKey.ts
|
|
1644
1641
|
const useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOptions } = {}) => {
|
|
1645
|
-
|
|
1642
|
+
useEvent(eventName, useCallback((handlerEvent) => {
|
|
1646
1643
|
if ([
|
|
1647
1644
|
"INPUT",
|
|
1648
1645
|
"TEXTAREA",
|
|
@@ -1654,8 +1651,7 @@ const useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOp
|
|
|
1654
1651
|
else if (key) matchesKey = true;
|
|
1655
1652
|
else matchesKey = false;
|
|
1656
1653
|
if (matchesKey) eventHandler(handlerEvent);
|
|
1657
|
-
}, [key, eventHandler]);
|
|
1658
|
-
useEvent(eventName, memoizedEventHandler, eventTarget, eventOptions);
|
|
1654
|
+
}, [key, eventHandler]), eventTarget, eventOptions);
|
|
1659
1655
|
};
|
|
1660
1656
|
//#endregion
|
|
1661
1657
|
//#region src/private/hooks/useUpdateEffect/useUpdateEffect.ts
|
|
@@ -6323,8 +6319,7 @@ const chooseColorScheme = (name) => {
|
|
|
6323
6319
|
for (let i = 0; i < str.length; i += 1) sum = Math.trunc(Math.imul(multiplier, sum) + (str.codePointAt(i) ?? 0));
|
|
6324
6320
|
return sum;
|
|
6325
6321
|
};
|
|
6326
|
-
|
|
6327
|
-
return brandColorSchemeOptions[index] ?? "blue";
|
|
6322
|
+
return brandColorSchemeOptions[Math.abs(hashCode(name)) % brandColorSchemeOptions.length] ?? "blue";
|
|
6328
6323
|
};
|
|
6329
6324
|
/**
|
|
6330
6325
|
* An avatar uses a photo or initials to represent an identity.
|
|
@@ -6632,8 +6627,7 @@ const applyMaxCharsToChildren = (children, maxChars) => {
|
|
|
6632
6627
|
if (isNil(maxChars)) return children;
|
|
6633
6628
|
if (isString(children)) return truncateString(children, maxChars);
|
|
6634
6629
|
if (isNumber(children)) return truncateString(String(children), maxChars);
|
|
6635
|
-
|
|
6636
|
-
return truncateString(textContent, maxChars);
|
|
6630
|
+
return truncateString(typeof children === "object" ? JSON.stringify(children) : String(children), maxChars);
|
|
6637
6631
|
};
|
|
6638
6632
|
const variantStyleMap$1 = {
|
|
6639
6633
|
hero: css`
|
|
@@ -7075,7 +7069,6 @@ const Breadcrumbs = ({ children, ...props }) => {
|
|
|
7075
7069
|
const { isXsAndDown } = useMq();
|
|
7076
7070
|
let crumbs = Children.toArray(children);
|
|
7077
7071
|
if (isXsAndDown) crumbs = crumbs.slice(-1);
|
|
7078
|
-
const crumbMaxWidth = Math.floor(100 / crumbs.length) - BUFFER_WIDTH;
|
|
7079
7072
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", {
|
|
7080
7073
|
type: "text/css",
|
|
7081
7074
|
children: `
|
|
@@ -7086,7 +7079,7 @@ const Breadcrumbs = ({ children, ...props }) => {
|
|
|
7086
7079
|
|
|
7087
7080
|
@container breadcrumbs (width < 100vw) {
|
|
7088
7081
|
[data-wui-breadcrumb] {
|
|
7089
|
-
max-width: ${
|
|
7082
|
+
max-width: ${Math.floor(100 / crumbs.length) - BUFFER_WIDTH}cqw;
|
|
7090
7083
|
}
|
|
7091
7084
|
}
|
|
7092
7085
|
`
|
|
@@ -7490,7 +7483,7 @@ const CheckboxGroup = ({ children, name, onChange, value, ...props }) => {
|
|
|
7490
7483
|
CheckboxGroup.displayName = "CheckboxGroup_UI";
|
|
7491
7484
|
//#endregion
|
|
7492
7485
|
//#region src/components/Checkbox/Checkbox.tsx
|
|
7493
|
-
const CheckIcon = () => /* @__PURE__ */ jsx("svg", {
|
|
7486
|
+
const CheckIcon$1 = () => /* @__PURE__ */ jsx("svg", {
|
|
7494
7487
|
fill: "inherit",
|
|
7495
7488
|
height: "8",
|
|
7496
7489
|
viewBox: "0 0 10 8",
|
|
@@ -7618,7 +7611,7 @@ const Checkbox = ({ checked, disabled = false, id, label, description, name, onC
|
|
|
7618
7611
|
$disabled: disabled,
|
|
7619
7612
|
$size: size,
|
|
7620
7613
|
"data-wui-faux-input": "true",
|
|
7621
|
-
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
7614
|
+
children: /* @__PURE__ */ jsx(CheckIcon$1, {})
|
|
7622
7615
|
}),
|
|
7623
7616
|
description,
|
|
7624
7617
|
disabled,
|
|
@@ -7629,6 +7622,364 @@ const Checkbox = ({ checked, disabled = false, id, label, description, name, onC
|
|
|
7629
7622
|
});
|
|
7630
7623
|
};
|
|
7631
7624
|
//#endregion
|
|
7625
|
+
//#region src/components/CheckboxCard/CheckboxCardChildrenContainer.tsx
|
|
7626
|
+
const CheckboxCardChildrenContainer = styled.div`
|
|
7627
|
+
flex: 1 1 auto;
|
|
7628
|
+
`;
|
|
7629
|
+
//#endregion
|
|
7630
|
+
//#region src/components/FormGroup/RadioGroup.tsx
|
|
7631
|
+
const RadioGroupContext = createContext(null);
|
|
7632
|
+
/**
|
|
7633
|
+
* Connects Radio components with their parent RadioGroup; provides access to `name` and `onChange`
|
|
7634
|
+
*/
|
|
7635
|
+
const useRadioGroup = () => {
|
|
7636
|
+
return useContext(RadioGroupContext);
|
|
7637
|
+
};
|
|
7638
|
+
/**
|
|
7639
|
+
* For grouping like form elements together. Can serve as a checkbox
|
|
7640
|
+
*/
|
|
7641
|
+
const RadioGroup = ({ children, name, onChange, value, ...props }) => {
|
|
7642
|
+
const formState = useContext(FormContext);
|
|
7643
|
+
const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
|
|
7644
|
+
const context = useMemo(() => {
|
|
7645
|
+
return {
|
|
7646
|
+
name,
|
|
7647
|
+
onChange,
|
|
7648
|
+
value: derivedValue
|
|
7649
|
+
};
|
|
7650
|
+
}, [
|
|
7651
|
+
name,
|
|
7652
|
+
derivedValue,
|
|
7653
|
+
onChange
|
|
7654
|
+
]);
|
|
7655
|
+
return /* @__PURE__ */ jsx(RadioGroupContext, {
|
|
7656
|
+
value: context,
|
|
7657
|
+
children: /* @__PURE__ */ jsx(FormGroup, {
|
|
7658
|
+
...props,
|
|
7659
|
+
role: "radiogroup",
|
|
7660
|
+
children
|
|
7661
|
+
})
|
|
7662
|
+
});
|
|
7663
|
+
};
|
|
7664
|
+
RadioGroup.displayName = "RadioGroup_UI";
|
|
7665
|
+
//#endregion
|
|
7666
|
+
//#region src/components/RadioCard/RadioCardRoot.tsx
|
|
7667
|
+
const checkedStyles = css`
|
|
7668
|
+
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
7669
|
+
--wui-color-icon: var(--wui-color-icon-selected);
|
|
7670
|
+
--wui-radio-card-background-color: var(--wui-color-bg-surface-info);
|
|
7671
|
+
--wui-color-text: var(--wui-color-text-info);
|
|
7672
|
+
--wui-color-text-secondary: var(--wui-color-text-info);
|
|
7673
|
+
`;
|
|
7674
|
+
const disabledStyles = css`
|
|
7675
|
+
--wui-radio-card-border-color: var(--wui-color-border-disabled);
|
|
7676
|
+
--wui-radio-card-background-color: var(--wui-color-bg-surface-disabled);
|
|
7677
|
+
--wui-radio-card-cursor: not-allowed;
|
|
7678
|
+
--wui-color-icon: var(--wui-color-icon-disabled);
|
|
7679
|
+
--wui-color-text: var(--wui-color-text-disabled);
|
|
7680
|
+
--wui-color-text-secondary: var(--wui-color-text-disabled);
|
|
7681
|
+
`;
|
|
7682
|
+
const focusStyles = css`
|
|
7683
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
7684
|
+
`;
|
|
7685
|
+
const imageCoverStyles = css`
|
|
7686
|
+
--wui-radio-card-image-inset: 0px;
|
|
7687
|
+
--wui-radio-card-border-width: 0px;
|
|
7688
|
+
--wui-inset-shadow-width: 1px;
|
|
7689
|
+
--wui-radio-card-border-color: rgb(0 0 0 / 25%);
|
|
7690
|
+
|
|
7691
|
+
overflow: hidden;
|
|
7692
|
+
|
|
7693
|
+
&:has(input:checked) {
|
|
7694
|
+
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
7695
|
+
--wui-radio-card-image-inset: 2px;
|
|
7696
|
+
--wui-inset-shadow-width: 2px;
|
|
7697
|
+
}
|
|
7698
|
+
|
|
7699
|
+
&:hover:not(:has(input:disabled, input:checked)) {
|
|
7700
|
+
--wui-radio-card-border-color: rgb(0 0 0 / 50%);
|
|
7701
|
+
}
|
|
7702
|
+
|
|
7703
|
+
&::after {
|
|
7704
|
+
content: '';
|
|
7705
|
+
position: absolute;
|
|
7706
|
+
top: 0;
|
|
7707
|
+
width: 100%;
|
|
7708
|
+
height: 100%;
|
|
7709
|
+
border-radius: var(--wui-radio-card-border-radius);
|
|
7710
|
+
box-shadow:
|
|
7711
|
+
inset 0 0 0 var(--wui-inset-shadow-width) var(--wui-radio-card-border-color),
|
|
7712
|
+
inset 0 0 0 calc(var(--wui-radio-card-image-inset) * 2) var(--wui-radio-card-background-color);
|
|
7713
|
+
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease);
|
|
7714
|
+
}
|
|
7715
|
+
`;
|
|
7716
|
+
const StyledCard = styled.label`
|
|
7717
|
+
--wui-radio-card-border-color: var(--wui-color-border-secondary);
|
|
7718
|
+
--wui-radio-card-background-color: var(--wui-color-bg-surface);
|
|
7719
|
+
--wui-radio-card-cursor: pointer;
|
|
7720
|
+
--wui-radio-card-border-width: 1px;
|
|
7721
|
+
--wui-radio-card-border-radius: var(--wui-border-radius-02);
|
|
7722
|
+
|
|
7723
|
+
position: relative;
|
|
7724
|
+
display: inline-flex;
|
|
7725
|
+
padding: ${({ $padding }) => `var(--wui-${$padding})`};
|
|
7726
|
+
aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};
|
|
7727
|
+
border: var(--wui-radio-card-border-width) solid var(--wui-radio-card-border-color);
|
|
7728
|
+
border-radius: var(--wui-radio-card-border-radius);
|
|
7729
|
+
background-color: var(--wui-radio-card-background-color);
|
|
7730
|
+
cursor: var(--wui-radio-card-cursor);
|
|
7731
|
+
overflow: hidden;
|
|
7732
|
+
transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
7733
|
+
|
|
7734
|
+
svg {
|
|
7735
|
+
transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
7736
|
+
}
|
|
7737
|
+
|
|
7738
|
+
&:hover {
|
|
7739
|
+
--wui-radio-card-border-color: var(--wui-color-border-secondary-hover);
|
|
7740
|
+
}
|
|
7741
|
+
|
|
7742
|
+
&:active {
|
|
7743
|
+
--wui-radio-card-border-color: var(--wui-color-border-secondary-active);
|
|
7744
|
+
}
|
|
7745
|
+
|
|
7746
|
+
&:has(input:checked) {
|
|
7747
|
+
${({ $isGated }) => $isGated ? getColorScheme("purple") : checkedStyles}
|
|
7748
|
+
}
|
|
7749
|
+
|
|
7750
|
+
&:has(input:disabled) {
|
|
7751
|
+
${disabledStyles}
|
|
7752
|
+
}
|
|
7753
|
+
|
|
7754
|
+
&:has(input:focus-visible) {
|
|
7755
|
+
${focusStyles}
|
|
7756
|
+
}
|
|
7757
|
+
|
|
7758
|
+
&:has([data-wui-radio-card-image]) {
|
|
7759
|
+
&:has(input:disabled) {
|
|
7760
|
+
& [data-wui-radio-card-image] {
|
|
7761
|
+
filter: grayscale(100%);
|
|
7762
|
+
}
|
|
7763
|
+
}
|
|
7764
|
+
|
|
7765
|
+
&:has([data-wui-radio-card-image='cover']) {
|
|
7766
|
+
${imageCoverStyles}
|
|
7767
|
+
}
|
|
7768
|
+
}
|
|
7769
|
+
`;
|
|
7770
|
+
const StyledHiddenInput$1 = styled.input`
|
|
7771
|
+
${visuallyHiddenStyle}
|
|
7772
|
+
`;
|
|
7773
|
+
const RadioCardRoot = ({ children, disabled = false, id, isGated = false, name, onChange, value, aspectRatio = "initial", padding = "space-04", checked, ref, ...props }) => {
|
|
7774
|
+
const generatedId = useId();
|
|
7775
|
+
const computedId = isNonEmptyString(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
7776
|
+
const radioGroupContext = useRadioGroup();
|
|
7777
|
+
const contextName = radioGroupContext?.name;
|
|
7778
|
+
const contextOnChange = radioGroupContext?.onChange;
|
|
7779
|
+
const contextValue = radioGroupContext?.value;
|
|
7780
|
+
const radioName = name ?? contextName;
|
|
7781
|
+
const handleOnChange = onChange ?? contextOnChange;
|
|
7782
|
+
const isChecked = isNotUndefined(value) && isNotUndefined(contextValue) ? contextValue === value : checked;
|
|
7783
|
+
return /* @__PURE__ */ jsxs(StyledCard, {
|
|
7784
|
+
$aspectRatio: aspectRatio,
|
|
7785
|
+
$isGated: isGated,
|
|
7786
|
+
$padding: padding,
|
|
7787
|
+
htmlFor: computedId,
|
|
7788
|
+
children: [/* @__PURE__ */ jsx(StyledHiddenInput$1, {
|
|
7789
|
+
...props,
|
|
7790
|
+
ref,
|
|
7791
|
+
checked: isChecked,
|
|
7792
|
+
disabled,
|
|
7793
|
+
id: computedId,
|
|
7794
|
+
name: radioName,
|
|
7795
|
+
onChange: handleOnChange,
|
|
7796
|
+
type: "radio",
|
|
7797
|
+
value
|
|
7798
|
+
}), children]
|
|
7799
|
+
});
|
|
7800
|
+
};
|
|
7801
|
+
//#endregion
|
|
7802
|
+
//#region src/components/CheckboxCard/CheckboxCardIndicator.tsx
|
|
7803
|
+
const CheckIcon = () => /* @__PURE__ */ jsx("svg", {
|
|
7804
|
+
fill: "inherit",
|
|
7805
|
+
height: "8",
|
|
7806
|
+
viewBox: "0 0 10 8",
|
|
7807
|
+
width: "10",
|
|
7808
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7809
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
7810
|
+
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",
|
|
7811
|
+
fill: "var(--wui-checkbox-card-indicator-icon-color)"
|
|
7812
|
+
})
|
|
7813
|
+
});
|
|
7814
|
+
const StyledIndicator = styled.div`
|
|
7815
|
+
--wui-checkbox-card-indicator-size: 14px;
|
|
7816
|
+
--wui-checkbox-card-indicator-icon-size: 7px;
|
|
7817
|
+
--wui-checkbox-card-indicator-background-color: var(--wui-color-bg-surface);
|
|
7818
|
+
--wui-checkbox-card-indicator-icon-color: transparent;
|
|
7819
|
+
|
|
7820
|
+
/* TODO: figure out radio / checkbox / switch colors */
|
|
7821
|
+
--wui-checkbox-card-indicator-border-color: var(--wui-color-border-secondary-active);
|
|
7822
|
+
|
|
7823
|
+
width: var(--wui-checkbox-card-indicator-size);
|
|
7824
|
+
height: var(--wui-checkbox-card-indicator-size);
|
|
7825
|
+
min-width: var(--wui-checkbox-card-indicator-size);
|
|
7826
|
+
min-height: var(--wui-checkbox-card-indicator-size);
|
|
7827
|
+
display: grid;
|
|
7828
|
+
place-content: center;
|
|
7829
|
+
background-color: var(--wui-checkbox-card-indicator-background-color);
|
|
7830
|
+
box-shadow: inset 0 0 0 1px var(--wui-checkbox-card-indicator-border-color);
|
|
7831
|
+
border-radius: var(--wui-border-radius-01);
|
|
7832
|
+
cursor: pointer;
|
|
7833
|
+
transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
7834
|
+
|
|
7835
|
+
/* check icon */
|
|
7836
|
+
svg {
|
|
7837
|
+
width: var(--wui-checkbox-card-indicator-icon-size);
|
|
7838
|
+
height: var(--wui-checkbox-card-indicator-icon-size);
|
|
7839
|
+
}
|
|
7840
|
+
|
|
7841
|
+
${StyledCard}:has(input:checked) & {
|
|
7842
|
+
--wui-checkbox-card-indicator-background-color: var(--wui-color-bg-fill);
|
|
7843
|
+
--wui-checkbox-card-indicator-border-color: transparent;
|
|
7844
|
+
--wui-checkbox-card-indicator-icon-color: var(--wui-color-bg-fill-white);
|
|
7845
|
+
}
|
|
7846
|
+
|
|
7847
|
+
${StyledCard}:has(input:disabled) & {
|
|
7848
|
+
--wui-checkbox-card-indicator-border-color: var(--wui-color-border-secondary);
|
|
7849
|
+
--wui-checkbox-card-indicator-background-color: var(--wui-color-bg-surface-disabled);
|
|
7850
|
+
}
|
|
7851
|
+
|
|
7852
|
+
${StyledCard}:has(input:disabled:checked) & {
|
|
7853
|
+
--wui-checkbox-card-indicator-icon-color: var(--wui-color-icon-disabled);
|
|
7854
|
+
}
|
|
7855
|
+
`;
|
|
7856
|
+
const CheckboxCardIndicator = (props) => /* @__PURE__ */ jsx(StyledIndicator, {
|
|
7857
|
+
...props,
|
|
7858
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
7859
|
+
});
|
|
7860
|
+
CheckboxCardIndicator.displayName = "CheckboxCardIndicator_UI";
|
|
7861
|
+
//#endregion
|
|
7862
|
+
//#region src/components/CheckboxCard/CheckboxCardDefaultLayout.tsx
|
|
7863
|
+
const StyledCardContent$1 = styled.div`
|
|
7864
|
+
display: grid;
|
|
7865
|
+
grid-auto-flow: column;
|
|
7866
|
+
gap: var(--wui-space-02);
|
|
7867
|
+
`;
|
|
7868
|
+
const StyledCardIcon$1 = styled.div`
|
|
7869
|
+
display: contents;
|
|
7870
|
+
`;
|
|
7871
|
+
const StyledGatedIcon$1 = styled.div`
|
|
7872
|
+
position: absolute;
|
|
7873
|
+
right: 10px;
|
|
7874
|
+
top: 10px;
|
|
7875
|
+
z-index: 1;
|
|
7876
|
+
`;
|
|
7877
|
+
const StyledIndicatorContainer$1 = styled.div`
|
|
7878
|
+
height: ${({ $hasIcon }) => $hasIcon ? "24px" : "16px"};
|
|
7879
|
+
display: flex;
|
|
7880
|
+
align-items: center;
|
|
7881
|
+
`;
|
|
7882
|
+
const CheckboxCardDefaultLayout = ({ icon, label, description, showIndicator = true, isGated = false }) => {
|
|
7883
|
+
return /* @__PURE__ */ jsxs(StyledCardContent$1, { children: [
|
|
7884
|
+
showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer$1, {
|
|
7885
|
+
$hasIcon: isNotNil(icon),
|
|
7886
|
+
children: /* @__PURE__ */ jsx(CheckboxCardIndicator, { "data-testid": "wui-checkbox-card-indicator" })
|
|
7887
|
+
}) : null,
|
|
7888
|
+
isGated ? /* @__PURE__ */ jsx(StyledGatedIcon$1, {
|
|
7889
|
+
"data-testid": "wui-checkbox-gated-icon",
|
|
7890
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
7891
|
+
colorScheme: "purple",
|
|
7892
|
+
"data-testid": "wui-icon-sparkle",
|
|
7893
|
+
type: "sparkle"
|
|
7894
|
+
})
|
|
7895
|
+
}) : null,
|
|
7896
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
7897
|
+
gap: "space-02",
|
|
7898
|
+
children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon$1, {
|
|
7899
|
+
"data-wui-checkbox-card-icon": true,
|
|
7900
|
+
children: icon
|
|
7901
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
7902
|
+
gap: "space-01",
|
|
7903
|
+
style: isNotNil(icon) ? { paddingLeft: 2 } : void 0,
|
|
7904
|
+
children: [isNotNil(label) && /* @__PURE__ */ jsx(Text, {
|
|
7905
|
+
variant: "label3",
|
|
7906
|
+
children: /* @__PURE__ */ jsx("strong", { children: label })
|
|
7907
|
+
}), isNotNil(description) && /* @__PURE__ */ jsx(Text, {
|
|
7908
|
+
prominence: "secondary",
|
|
7909
|
+
variant: "body3",
|
|
7910
|
+
children: description
|
|
7911
|
+
})]
|
|
7912
|
+
})]
|
|
7913
|
+
})
|
|
7914
|
+
] });
|
|
7915
|
+
};
|
|
7916
|
+
CheckboxCardDefaultLayout.displayName = "CheckboxCardDefaultLayout_UI";
|
|
7917
|
+
//#endregion
|
|
7918
|
+
//#region src/components/CheckboxCard/CheckboxCardRoot.tsx
|
|
7919
|
+
const StyledHiddenInput = styled.input`
|
|
7920
|
+
${visuallyHiddenStyle}
|
|
7921
|
+
`;
|
|
7922
|
+
/**
|
|
7923
|
+
* `CheckboxCardRoot` renders the same card shell as `RadioCardRoot` (`StyledCard`) so
|
|
7924
|
+
* radio and checkbox cards stay visually identical — including the `--wui-radio-card-*`
|
|
7925
|
+
* custom properties consumers may override — but wires it to a hidden checkbox input
|
|
7926
|
+
* and the `CheckboxGroup` context instead.
|
|
7927
|
+
*/
|
|
7928
|
+
const CheckboxCardRoot = ({ children, disabled = false, id, isGated = false, name, onChange, value, aspectRatio = "initial", padding = "space-04", checked, ref, ...props }) => {
|
|
7929
|
+
const generatedId = useId();
|
|
7930
|
+
const computedId = isNonEmptyString(id) ? id : `wistia-ui-checkbox-card-${generatedId}`;
|
|
7931
|
+
const checkboxGroupContext = useCheckboxGroup();
|
|
7932
|
+
const contextName = checkboxGroupContext?.name;
|
|
7933
|
+
const contextOnChange = checkboxGroupContext?.onChange;
|
|
7934
|
+
const contextValue = checkboxGroupContext?.value;
|
|
7935
|
+
const checkboxName = name ?? contextName;
|
|
7936
|
+
const handleOnChange = onChange ?? contextOnChange;
|
|
7937
|
+
const isChecked = isNotUndefined(value) && isNotUndefined(contextValue) ? contextValue.includes(value) : checked;
|
|
7938
|
+
return /* @__PURE__ */ jsxs(StyledCard, {
|
|
7939
|
+
$aspectRatio: aspectRatio,
|
|
7940
|
+
$isGated: isGated,
|
|
7941
|
+
$padding: padding,
|
|
7942
|
+
htmlFor: computedId,
|
|
7943
|
+
children: [/* @__PURE__ */ jsx(StyledHiddenInput, {
|
|
7944
|
+
...props,
|
|
7945
|
+
ref,
|
|
7946
|
+
checked: isChecked,
|
|
7947
|
+
disabled,
|
|
7948
|
+
id: computedId,
|
|
7949
|
+
name: checkboxName,
|
|
7950
|
+
onChange: handleOnChange,
|
|
7951
|
+
type: "checkbox",
|
|
7952
|
+
value
|
|
7953
|
+
}), children]
|
|
7954
|
+
});
|
|
7955
|
+
};
|
|
7956
|
+
//#endregion
|
|
7957
|
+
//#region src/components/CheckboxCard/CheckboxCard.tsx
|
|
7958
|
+
/**
|
|
7959
|
+
* A `CheckboxCard` lets users select one or more options from a set of visually rich,
|
|
7960
|
+
* card-based choices. It shares its card styling with `RadioCard`, so the two can be
|
|
7961
|
+
* used side by side for single-select and multi-select questions. It supports both
|
|
7962
|
+
* standalone controlled usage and grouped usage via `CheckboxGroup`.
|
|
7963
|
+
*/
|
|
7964
|
+
const CheckboxCard = ({ icon, label, description, showIndicator, isGated, children, padding, ref, ...rootProps }) => {
|
|
7965
|
+
return /* @__PURE__ */ jsx(CheckboxCardRoot, {
|
|
7966
|
+
ref,
|
|
7967
|
+
isGated,
|
|
7968
|
+
padding: padding ?? (children != null ? "space-00" : "space-04"),
|
|
7969
|
+
...rootProps,
|
|
7970
|
+
children: children != null ? /* @__PURE__ */ jsx(CheckboxCardChildrenContainer, {
|
|
7971
|
+
"data-wui-radio-card-image": "cover",
|
|
7972
|
+
children
|
|
7973
|
+
}) : /* @__PURE__ */ jsx(CheckboxCardDefaultLayout, {
|
|
7974
|
+
description,
|
|
7975
|
+
icon,
|
|
7976
|
+
isGated,
|
|
7977
|
+
label,
|
|
7978
|
+
showIndicator
|
|
7979
|
+
})
|
|
7980
|
+
});
|
|
7981
|
+
};
|
|
7982
|
+
//#endregion
|
|
7632
7983
|
//#region src/components/ClickRegion/ClickRegion.tsx
|
|
7633
7984
|
const isClickableElement = (element) => {
|
|
7634
7985
|
if (!element) return false;
|
|
@@ -7855,11 +8206,10 @@ const compositeOverWhite = (color, alpha = 1) => {
|
|
|
7855
8206
|
const calculateContrast = ({ backgroundColor, foregroundColor = DEFAULT_COLOR_FOR_COMPARISON, backgroundOpacity = 1 }) => {
|
|
7856
8207
|
const backgroundColorAsRgb = convertToRgb(backgroundColor);
|
|
7857
8208
|
const foregroundColorAsRgb = convertToRgb(foregroundColor);
|
|
7858
|
-
|
|
7859
|
-
return wcagContrast(compositeBackground, foregroundColorAsRgb);
|
|
8209
|
+
return wcagContrast(compositeOverWhite(backgroundColorAsRgb, backgroundOpacity), foregroundColorAsRgb);
|
|
7860
8210
|
};
|
|
7861
8211
|
const snapValueToEdges = (value) => {
|
|
7862
|
-
if (value >
|
|
8212
|
+
if (value > 1 - VALUE_CHANNEL_SNAP_EPSILON) return 1;
|
|
7863
8213
|
if (value < VALUE_CHANNEL_SNAP_EPSILON) return 0;
|
|
7864
8214
|
return value;
|
|
7865
8215
|
};
|
|
@@ -9563,10 +9913,9 @@ const drawGradientBackground = (ctx, width, height, hue) => {
|
|
|
9563
9913
|
for (let y = 0; y < height; y++) {
|
|
9564
9914
|
const v = 1 - y / (height - 1);
|
|
9565
9915
|
for (let x = 0; x < width; x++) {
|
|
9566
|
-
const s = x / (width - 1);
|
|
9567
9916
|
const rgb = convertToRgb({
|
|
9568
9917
|
h: hue,
|
|
9569
|
-
s,
|
|
9918
|
+
s: x / (width - 1),
|
|
9570
9919
|
v,
|
|
9571
9920
|
mode: "hsv"
|
|
9572
9921
|
});
|
|
@@ -10131,16 +10480,16 @@ const Combobox = ({ placeholder, value, onChange, searchValue, onSearchValueChan
|
|
|
10131
10480
|
return matchSorter(Object.keys(options), searchValue);
|
|
10132
10481
|
}, [options, searchValue]);
|
|
10133
10482
|
return /* @__PURE__ */ jsxs(Ariakit.ComboboxProvider, {
|
|
10483
|
+
inputValue: !isOpen && !isMultiSelect ? value : searchValue,
|
|
10134
10484
|
open: isOpen,
|
|
10135
10485
|
selectedValue: value,
|
|
10136
|
-
|
|
10137
|
-
setSelectedValue: onChange,
|
|
10138
|
-
setValue: (nextValue) => {
|
|
10486
|
+
setInputValue: (nextValue) => {
|
|
10139
10487
|
startTransition(() => {
|
|
10140
10488
|
onSearchValueChange(nextValue);
|
|
10141
10489
|
});
|
|
10142
10490
|
},
|
|
10143
|
-
|
|
10491
|
+
setOpen: setIsOpen,
|
|
10492
|
+
setSelectedValue: onChange,
|
|
10144
10493
|
children: [/* @__PURE__ */ jsxs(ComboboxWrapper, {
|
|
10145
10494
|
ref: comboboxWrapperRef,
|
|
10146
10495
|
$fullWidth: fullWidth,
|
|
@@ -10936,11 +11285,10 @@ const useCreatePopoverAnchorRef = () => useRef(null);
|
|
|
10936
11285
|
*/
|
|
10937
11286
|
const PopoverAnchor = ({ children }) => {
|
|
10938
11287
|
const sharedRef = usePopoverAnchor();
|
|
10939
|
-
const callbackRef = useCallback((node) => {
|
|
10940
|
-
if (sharedRef) sharedRef.current = node;
|
|
10941
|
-
}, [sharedRef]);
|
|
10942
11288
|
return /* @__PURE__ */ jsx("div", {
|
|
10943
|
-
ref:
|
|
11289
|
+
ref: useCallback((node) => {
|
|
11290
|
+
if (sharedRef) sharedRef.current = node;
|
|
11291
|
+
}, [sharedRef]),
|
|
10944
11292
|
children
|
|
10945
11293
|
});
|
|
10946
11294
|
};
|
|
@@ -12747,42 +13095,6 @@ const FormField = ({ children, description, error, id, label, labelPosition, nam
|
|
|
12747
13095
|
};
|
|
12748
13096
|
FormField.displayName = "FormField_UI";
|
|
12749
13097
|
//#endregion
|
|
12750
|
-
//#region src/components/FormGroup/RadioGroup.tsx
|
|
12751
|
-
const RadioGroupContext = createContext(null);
|
|
12752
|
-
/**
|
|
12753
|
-
* Connects Radio components with their parent RadioGroup; provides access to `name` and `onChange`
|
|
12754
|
-
*/
|
|
12755
|
-
const useRadioGroup = () => {
|
|
12756
|
-
return useContext(RadioGroupContext);
|
|
12757
|
-
};
|
|
12758
|
-
/**
|
|
12759
|
-
* For grouping like form elements together. Can serve as a checkbox
|
|
12760
|
-
*/
|
|
12761
|
-
const RadioGroup = ({ children, name, onChange, value, ...props }) => {
|
|
12762
|
-
const formState = useContext(FormContext);
|
|
12763
|
-
const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
|
|
12764
|
-
const context = useMemo(() => {
|
|
12765
|
-
return {
|
|
12766
|
-
name,
|
|
12767
|
-
onChange,
|
|
12768
|
-
value: derivedValue
|
|
12769
|
-
};
|
|
12770
|
-
}, [
|
|
12771
|
-
name,
|
|
12772
|
-
derivedValue,
|
|
12773
|
-
onChange
|
|
12774
|
-
]);
|
|
12775
|
-
return /* @__PURE__ */ jsx(RadioGroupContext, {
|
|
12776
|
-
value: context,
|
|
12777
|
-
children: /* @__PURE__ */ jsx(FormGroup, {
|
|
12778
|
-
...props,
|
|
12779
|
-
role: "radiogroup",
|
|
12780
|
-
children
|
|
12781
|
-
})
|
|
12782
|
-
});
|
|
12783
|
-
};
|
|
12784
|
-
RadioGroup.displayName = "RadioGroup_UI";
|
|
12785
|
-
//#endregion
|
|
12786
13098
|
//#region src/components/Grid/Grid.tsx
|
|
12787
13099
|
const DEFAULT_ELEMENT = "div";
|
|
12788
13100
|
/**
|
|
@@ -12989,11 +13301,13 @@ const InputClickToCopy = ({ value, onCopy, disabled = false, ref, ...props }) =>
|
|
|
12989
13301
|
//#endregion
|
|
12990
13302
|
//#region src/components/InputDuration/constants.ts
|
|
12991
13303
|
const SECONDS_PER_MINUTE = 60;
|
|
12992
|
-
const
|
|
12993
|
-
const
|
|
12994
|
-
const
|
|
13304
|
+
const MINUTES_PER_HOUR = 60;
|
|
13305
|
+
const MAX_MINUTES_UNIT_VALUE = SECONDS_PER_MINUTE - 1;
|
|
13306
|
+
const SECONDS_PER_TEN_MINUTES = SECONDS_PER_MINUTE * 10;
|
|
13307
|
+
const SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;
|
|
13308
|
+
const TEN_HOURS = SECONDS_PER_HOUR * 10;
|
|
12995
13309
|
const ONE_HUNDREDTH_OF_A_SECOND = .01;
|
|
12996
|
-
const MAX_TIME =
|
|
13310
|
+
const MAX_TIME = TEN_HOURS - ONE_HUNDREDTH_OF_A_SECOND;
|
|
12997
13311
|
const NUMBER_STRING_SET = /* @__PURE__ */ new Set([
|
|
12998
13312
|
"0",
|
|
12999
13313
|
"1",
|
|
@@ -14315,8 +14629,7 @@ const StyledSubTrigger = styled(Menu$1.SubmenuTrigger)`
|
|
|
14315
14629
|
const SUBMENU_CLOSE_DELAY = 200;
|
|
14316
14630
|
const SubMenuTrigger = ({ icon, ...props }) => {
|
|
14317
14631
|
const { isSmAndUp } = useMq();
|
|
14318
|
-
|
|
14319
|
-
return /* @__PURE__ */ jsx(Trigger, {
|
|
14632
|
+
return /* @__PURE__ */ jsx(isSmAndUp ? StyledSubTrigger : Menu$1.Item, {
|
|
14320
14633
|
nativeButton: true,
|
|
14321
14634
|
...isSmAndUp ? { closeDelay: SUBMENU_CLOSE_DELAY } : { closeOnClick: false },
|
|
14322
14635
|
render: /* @__PURE__ */ jsx(MenuItemButton, {
|
|
@@ -14698,7 +15011,8 @@ const modalExit = keyframes`
|
|
|
14698
15011
|
transform: translateX(-50%) translateY(calc(var(--wui-modal-translate-y) + 24px));
|
|
14699
15012
|
}
|
|
14700
15013
|
`;
|
|
14701
|
-
const
|
|
15014
|
+
const positionStyleMap = {
|
|
15015
|
+
centered: css`
|
|
14702
15016
|
--wui-modal-screen-offset: var(--wui-space-05);
|
|
14703
15017
|
--wui-modal-translate-y: -50%;
|
|
14704
15018
|
|
|
@@ -14713,8 +15027,8 @@ const centeredModalStyles = css`
|
|
|
14713
15027
|
&[data-closed] {
|
|
14714
15028
|
animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out) forwards;
|
|
14715
15029
|
}
|
|
14716
|
-
|
|
14717
|
-
|
|
15030
|
+
`,
|
|
15031
|
+
"fixed-top": css`
|
|
14718
15032
|
--wui-modal-screen-offset-top: 15vh;
|
|
14719
15033
|
--wui-modal-screen-offset-bottom: 5vh;
|
|
14720
15034
|
--wui-modal-translate-y: 0%;
|
|
@@ -14732,8 +15046,14 @@ const fixedTopModalStyles = css`
|
|
|
14732
15046
|
&[data-closed] {
|
|
14733
15047
|
animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out) forwards;
|
|
14734
15048
|
}
|
|
14735
|
-
|
|
14736
|
-
|
|
15049
|
+
`,
|
|
15050
|
+
"right-side-panel": css`
|
|
15051
|
+
--wui-modal-screen-offset: var(--wui-space-05);
|
|
15052
|
+
|
|
15053
|
+
height: calc(100vh - var(--wui-modal-screen-offset) * 2);
|
|
15054
|
+
top: var(--wui-modal-screen-offset);
|
|
15055
|
+
right: var(--wui-modal-screen-offset);
|
|
15056
|
+
animation: ${keyframes`
|
|
14737
15057
|
from {
|
|
14738
15058
|
opacity: 0;
|
|
14739
15059
|
transform: translateX(100%);
|
|
@@ -14743,8 +15063,11 @@ const slideInRight = keyframes`
|
|
|
14743
15063
|
opacity: 1;
|
|
14744
15064
|
transform: translateX(0);
|
|
14745
15065
|
}
|
|
14746
|
-
|
|
14747
|
-
|
|
15066
|
+
`} var(--wui-motion-duration-05) var(--wui-motion-ease-out);
|
|
15067
|
+
transform-origin: right center;
|
|
15068
|
+
|
|
15069
|
+
&[data-closed] {
|
|
15070
|
+
animation: ${keyframes`
|
|
14748
15071
|
from {
|
|
14749
15072
|
opacity: 1;
|
|
14750
15073
|
transform: translateX(0);
|
|
@@ -14754,21 +15077,7 @@ const slideOutRight = keyframes`
|
|
|
14754
15077
|
opacity: 0;
|
|
14755
15078
|
transform: translateX(100%);
|
|
14756
15079
|
}
|
|
14757
|
-
|
|
14758
|
-
const positionStyleMap = {
|
|
14759
|
-
centered: centeredModalStyles,
|
|
14760
|
-
"fixed-top": fixedTopModalStyles,
|
|
14761
|
-
"right-side-panel": css`
|
|
14762
|
-
--wui-modal-screen-offset: var(--wui-space-05);
|
|
14763
|
-
|
|
14764
|
-
height: calc(100vh - var(--wui-modal-screen-offset) * 2);
|
|
14765
|
-
top: var(--wui-modal-screen-offset);
|
|
14766
|
-
right: var(--wui-modal-screen-offset);
|
|
14767
|
-
animation: ${slideInRight} var(--wui-motion-duration-05) var(--wui-motion-ease-out);
|
|
14768
|
-
transform-origin: right center;
|
|
14769
|
-
|
|
14770
|
-
&[data-closed] {
|
|
14771
|
-
animation: ${slideOutRight} var(--wui-motion-duration-03) var(--wui-motion-ease-in) forwards;
|
|
15080
|
+
`} var(--wui-motion-duration-03) var(--wui-motion-ease-in) forwards;
|
|
14772
15081
|
}
|
|
14773
15082
|
`
|
|
14774
15083
|
};
|
|
@@ -15146,142 +15455,6 @@ const RadioCardChildrenContainer = styled.div`
|
|
|
15146
15455
|
flex: 1 1 auto;
|
|
15147
15456
|
`;
|
|
15148
15457
|
//#endregion
|
|
15149
|
-
//#region src/components/RadioCard/RadioCardRoot.tsx
|
|
15150
|
-
const checkedStyles = css`
|
|
15151
|
-
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
15152
|
-
--wui-color-icon: var(--wui-color-icon-selected);
|
|
15153
|
-
--wui-radio-card-background-color: var(--wui-color-bg-surface-info);
|
|
15154
|
-
--wui-color-text: var(--wui-color-text-info);
|
|
15155
|
-
--wui-color-text-secondary: var(--wui-color-text-info);
|
|
15156
|
-
`;
|
|
15157
|
-
const disabledStyles = css`
|
|
15158
|
-
--wui-radio-card-border-color: var(--wui-color-border-disabled);
|
|
15159
|
-
--wui-radio-card-background-color: var(--wui-color-bg-surface-disabled);
|
|
15160
|
-
--wui-radio-card-cursor: not-allowed;
|
|
15161
|
-
--wui-color-icon: var(--wui-color-icon-disabled);
|
|
15162
|
-
--wui-color-text: var(--wui-color-text-disabled);
|
|
15163
|
-
--wui-color-text-secondary: var(--wui-color-text-disabled);
|
|
15164
|
-
`;
|
|
15165
|
-
const focusStyles = css`
|
|
15166
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
15167
|
-
`;
|
|
15168
|
-
const imageCoverStyles = css`
|
|
15169
|
-
--wui-radio-card-image-inset: 0px;
|
|
15170
|
-
--wui-radio-card-border-width: 0px;
|
|
15171
|
-
--wui-inset-shadow-width: 1px;
|
|
15172
|
-
--wui-radio-card-border-color: rgb(0 0 0 / 25%);
|
|
15173
|
-
|
|
15174
|
-
overflow: hidden;
|
|
15175
|
-
|
|
15176
|
-
&:has(input:checked) {
|
|
15177
|
-
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
15178
|
-
--wui-radio-card-image-inset: 2px;
|
|
15179
|
-
--wui-inset-shadow-width: 2px;
|
|
15180
|
-
}
|
|
15181
|
-
|
|
15182
|
-
&:hover:not(:has(input:disabled, input:checked)) {
|
|
15183
|
-
--wui-radio-card-border-color: rgb(0 0 0 / 50%);
|
|
15184
|
-
}
|
|
15185
|
-
|
|
15186
|
-
&::after {
|
|
15187
|
-
content: '';
|
|
15188
|
-
position: absolute;
|
|
15189
|
-
top: 0;
|
|
15190
|
-
width: 100%;
|
|
15191
|
-
height: 100%;
|
|
15192
|
-
border-radius: var(--wui-radio-card-border-radius);
|
|
15193
|
-
box-shadow:
|
|
15194
|
-
inset 0 0 0 var(--wui-inset-shadow-width) var(--wui-radio-card-border-color),
|
|
15195
|
-
inset 0 0 0 calc(var(--wui-radio-card-image-inset) * 2) var(--wui-radio-card-background-color);
|
|
15196
|
-
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease);
|
|
15197
|
-
}
|
|
15198
|
-
`;
|
|
15199
|
-
const StyledCard = styled.label`
|
|
15200
|
-
--wui-radio-card-border-color: var(--wui-color-border-secondary);
|
|
15201
|
-
--wui-radio-card-background-color: var(--wui-color-bg-surface);
|
|
15202
|
-
--wui-radio-card-cursor: pointer;
|
|
15203
|
-
--wui-radio-card-border-width: 1px;
|
|
15204
|
-
--wui-radio-card-border-radius: var(--wui-border-radius-02);
|
|
15205
|
-
|
|
15206
|
-
position: relative;
|
|
15207
|
-
display: inline-flex;
|
|
15208
|
-
padding: ${({ $padding }) => `var(--wui-${$padding})`};
|
|
15209
|
-
aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};
|
|
15210
|
-
border: var(--wui-radio-card-border-width) solid var(--wui-radio-card-border-color);
|
|
15211
|
-
border-radius: var(--wui-radio-card-border-radius);
|
|
15212
|
-
background-color: var(--wui-radio-card-background-color);
|
|
15213
|
-
cursor: var(--wui-radio-card-cursor);
|
|
15214
|
-
overflow: hidden;
|
|
15215
|
-
transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
15216
|
-
|
|
15217
|
-
svg {
|
|
15218
|
-
transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
15219
|
-
}
|
|
15220
|
-
|
|
15221
|
-
&:hover {
|
|
15222
|
-
--wui-radio-card-border-color: var(--wui-color-border-secondary-hover);
|
|
15223
|
-
}
|
|
15224
|
-
|
|
15225
|
-
&:active {
|
|
15226
|
-
--wui-radio-card-border-color: var(--wui-color-border-secondary-active);
|
|
15227
|
-
}
|
|
15228
|
-
|
|
15229
|
-
&:has(input:checked) {
|
|
15230
|
-
${({ $isGated }) => $isGated ? getColorScheme("purple") : checkedStyles}
|
|
15231
|
-
}
|
|
15232
|
-
|
|
15233
|
-
&:has(input:disabled) {
|
|
15234
|
-
${disabledStyles}
|
|
15235
|
-
}
|
|
15236
|
-
|
|
15237
|
-
&:has(input:focus-visible) {
|
|
15238
|
-
${focusStyles}
|
|
15239
|
-
}
|
|
15240
|
-
|
|
15241
|
-
&:has([data-wui-radio-card-image]) {
|
|
15242
|
-
&:has(input:disabled) {
|
|
15243
|
-
& [data-wui-radio-card-image] {
|
|
15244
|
-
filter: grayscale(100%);
|
|
15245
|
-
}
|
|
15246
|
-
}
|
|
15247
|
-
|
|
15248
|
-
&:has([data-wui-radio-card-image='cover']) {
|
|
15249
|
-
${imageCoverStyles}
|
|
15250
|
-
}
|
|
15251
|
-
}
|
|
15252
|
-
`;
|
|
15253
|
-
const StyledHiddenInput = styled.input`
|
|
15254
|
-
${visuallyHiddenStyle}
|
|
15255
|
-
`;
|
|
15256
|
-
const RadioCardRoot = ({ children, disabled = false, id, isGated = false, name, onChange, value, aspectRatio = "initial", padding = "space-04", checked, ref, ...props }) => {
|
|
15257
|
-
const generatedId = useId();
|
|
15258
|
-
const computedId = isNonEmptyString(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
15259
|
-
const radioGroupContext = useRadioGroup();
|
|
15260
|
-
const contextName = radioGroupContext?.name;
|
|
15261
|
-
const contextOnChange = radioGroupContext?.onChange;
|
|
15262
|
-
const contextValue = radioGroupContext?.value;
|
|
15263
|
-
const radioName = name ?? contextName;
|
|
15264
|
-
const handleOnChange = onChange ?? contextOnChange;
|
|
15265
|
-
const isChecked = isNotUndefined(value) && isNotUndefined(contextValue) ? contextValue === value : checked;
|
|
15266
|
-
return /* @__PURE__ */ jsxs(StyledCard, {
|
|
15267
|
-
$aspectRatio: aspectRatio,
|
|
15268
|
-
$isGated: isGated,
|
|
15269
|
-
$padding: padding,
|
|
15270
|
-
htmlFor: computedId,
|
|
15271
|
-
children: [/* @__PURE__ */ jsx(StyledHiddenInput, {
|
|
15272
|
-
...props,
|
|
15273
|
-
ref,
|
|
15274
|
-
checked: isChecked,
|
|
15275
|
-
disabled,
|
|
15276
|
-
id: computedId,
|
|
15277
|
-
name: radioName,
|
|
15278
|
-
onChange: handleOnChange,
|
|
15279
|
-
type: "radio",
|
|
15280
|
-
value
|
|
15281
|
-
}), children]
|
|
15282
|
-
});
|
|
15283
|
-
};
|
|
15284
|
-
//#endregion
|
|
15285
15458
|
//#region src/components/RadioCard/RadioCardIndicator.tsx
|
|
15286
15459
|
const RadioCardIndicator = styled.div`
|
|
15287
15460
|
--wui-radio-card-indicator-size: 14px;
|
|
@@ -17055,6 +17228,6 @@ const WistiaLogo = ({ description, height = 100, hoverColor, href, iconOnly = fa
|
|
|
17055
17228
|
};
|
|
17056
17229
|
WistiaLogo.displayName = "WistiaLogo_UI";
|
|
17057
17230
|
//#endregion
|
|
17058
|
-
export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, ContrastEnforcerSwitch, ContrastIndicator, ContrastPreview, CustomizableThemeWrapper, DOCUMENT_COLOR_MODE_ATTRIBUTE, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, DatePicker, Dimmer, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputDuration, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarSearchInput, SidebarTitle, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, buildTimeDuration, calculateContrast, coerceToBoolean, colorModeOptions, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, documentColorModeOptions, getBackgroundGradient, getDocumentColorMode, getSemiRandomBackgroundGradient, iconSizeMap, isKeyboardKey, isUrl, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, setDocumentColorMode, stripExtension, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useClipboard, useDocumentColorMode, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
|
|
17231
|
+
export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxCard, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, ContrastEnforcerSwitch, ContrastIndicator, ContrastPreview, CustomizableThemeWrapper, DOCUMENT_COLOR_MODE_ATTRIBUTE, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, DatePicker, Dimmer, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputDuration, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarSearchInput, SidebarTitle, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, buildTimeDuration, calculateContrast, coerceToBoolean, colorModeOptions, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, documentColorModeOptions, getBackgroundGradient, getDocumentColorMode, getSemiRandomBackgroundGradient, iconSizeMap, isKeyboardKey, isUrl, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, setDocumentColorMode, stripExtension, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useClipboard, useDocumentColorMode, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
|
|
17059
17232
|
|
|
17060
17233
|
//# sourceMappingURL=index.js.map
|