@wistia/ui 0.26.6 → 0.26.7
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 +418 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +100 -149
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.26.
|
|
3
|
+
* @license @wistia/ui v0.26.7
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
11
|
-
import { Children, cloneElement, createContext,
|
|
11
|
+
import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
|
|
12
12
|
import { createGlobalStyle, css, keyframes, styled } from "styled-components";
|
|
13
|
-
import { isArray, isBoolean, isEmptyString, isFunction, isNil, isNonEmptyArray, isNonEmptyString, isNotNil, isNotUndefined, isNumber, isRecord, isString, isUndefined } from "@wistia/type-guards";
|
|
13
|
+
import { isArray, isBoolean, isDate, isEmptyString, isFunction, isNil, isNonEmptyArray, isNonEmptyString, isNotNil, isNotUndefined, isNumber, isRecord, isString, isUndefined } from "@wistia/type-guards";
|
|
14
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { Toaster, toast } from "sonner";
|
|
16
16
|
import { isValid } from "date-fns/isValid";
|
|
@@ -519,13 +519,6 @@ const buildTimeDuration = (numberOfMilliseconds) => {
|
|
|
519
519
|
};
|
|
520
520
|
};
|
|
521
521
|
//#endregion
|
|
522
|
-
//#region src/helpers/dateTime/isDate.ts
|
|
523
|
-
/**
|
|
524
|
-
* @param {*} date - possible date value - unknown type
|
|
525
|
-
* @returns {boolean} - whether it is a date object
|
|
526
|
-
*/
|
|
527
|
-
const isDate = (date) => date instanceof Date;
|
|
528
|
-
//#endregion
|
|
529
522
|
//#region src/helpers/dateTime/isInvalidDate.ts
|
|
530
523
|
/**
|
|
531
524
|
* @param {*} date - a Date object - could be unknown though
|
|
@@ -5596,7 +5589,7 @@ const StyledLink = styled.a`
|
|
|
5596
5589
|
* This means in addition to its own props, `Link` can use props from `react-router`'s `Link` component. View their documentation [here](https://reactrouter.com/en/main/components/link).
|
|
5597
5590
|
* The one prop we ignore from react-router is `to`. We use `href` instead and map it under the hood.
|
|
5598
5591
|
*/
|
|
5599
|
-
const Link =
|
|
5592
|
+
const Link = ({ beforeAction, children, type, disabled = false, colorScheme = "inherit", underline = "none", inheritColor = false, leftIcon, rightIcon, "aria-disabled": ariaDisabled, role, ref, ...props }) => {
|
|
5600
5593
|
const inRouterContext = useInRouterContext();
|
|
5601
5594
|
const to = generateHref(props.href, type, disabled);
|
|
5602
5595
|
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
@@ -5659,8 +5652,7 @@ const Link = forwardRef(({ beforeAction, children, type, disabled = false, color
|
|
|
5659
5652
|
});
|
|
5660
5653
|
}
|
|
5661
5654
|
return null;
|
|
5662
|
-
}
|
|
5663
|
-
Link.displayName = "Link_UI";
|
|
5655
|
+
};
|
|
5664
5656
|
//#endregion
|
|
5665
5657
|
//#region src/components/Button/Button.tsx
|
|
5666
5658
|
const isLink = (props) => isNotUndefined(props.href);
|
|
@@ -5713,7 +5705,7 @@ const ButtonContent = ({ isLoading = false, leftIcon, rightIcon, children, fullW
|
|
|
5713
5705
|
* action, or performing a delete operation. It replaces the HTML `<button>` element,
|
|
5714
5706
|
* unless an `href` attribute is passed, in which it will render an `<a>` element.
|
|
5715
5707
|
*/
|
|
5716
|
-
const Button =
|
|
5708
|
+
const Button = ({ children, forceState, className, leftIcon, rightIcon, colorScheme = "inherit", disabled = false, isLoading = false, unstyled = false, onClick, fullWidth = false, size = "md", variant = "solid", ref, ...props }) => {
|
|
5717
5709
|
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
5718
5710
|
const responsiveSize = useResponsiveProp(size);
|
|
5719
5711
|
const isAriaDisabled = () => isLoading || disabled;
|
|
@@ -5763,8 +5755,7 @@ const Button = forwardRef(({ children, forceState, className, leftIcon, rightIco
|
|
|
5763
5755
|
children
|
|
5764
5756
|
})
|
|
5765
5757
|
});
|
|
5766
|
-
}
|
|
5767
|
-
Button.displayName = "Button_UI";
|
|
5758
|
+
};
|
|
5768
5759
|
//#endregion
|
|
5769
5760
|
//#region src/components/ActionButton/ActionButton.tsx
|
|
5770
5761
|
const StyledActionButton = styled(Button)`
|
|
@@ -5876,7 +5867,7 @@ const StyledLabel$3 = styled.span`
|
|
|
5876
5867
|
/**
|
|
5877
5868
|
* Action Button component is used as one of a group of main actions on the page. It composes [Button](/components/Button).
|
|
5878
5869
|
*/
|
|
5879
|
-
const ActionButton =
|
|
5870
|
+
const ActionButton = ({ icon, colorScheme = "standard", disabled = false, forceState, hoverColorScheme, variant = "default", children, ref, ...props }) => {
|
|
5880
5871
|
const resolvedHoverColorScheme = hoverColorScheme ?? (variant === "gated" ? "purple" : "inherit");
|
|
5881
5872
|
const secondaryIconMap = {
|
|
5882
5873
|
default: "arrow-right",
|
|
@@ -5907,8 +5898,7 @@ const ActionButton = forwardRef(({ icon, colorScheme = "standard", disabled = fa
|
|
|
5907
5898
|
})
|
|
5908
5899
|
]
|
|
5909
5900
|
});
|
|
5910
|
-
}
|
|
5911
|
-
ActionButton.displayName = "ActionButton_UI";
|
|
5901
|
+
};
|
|
5912
5902
|
//#endregion
|
|
5913
5903
|
//#region src/components/Avatar/formatNameForDisplay.tsx
|
|
5914
5904
|
const containsEmojiCharacter = (char) => {
|
|
@@ -6139,7 +6129,7 @@ const StyledBadge = styled.div`
|
|
|
6139
6129
|
/**
|
|
6140
6130
|
* A `Badge` is a compact label, with optional icon, to convey status or context.
|
|
6141
6131
|
*/
|
|
6142
|
-
const Badge =
|
|
6132
|
+
const Badge = ({ colorScheme = "inherit", label, icon, variant = "default", ref, ...props }) => {
|
|
6143
6133
|
const hasIcon = isNotNil(icon);
|
|
6144
6134
|
return /* @__PURE__ */ jsxs(StyledBadge, {
|
|
6145
6135
|
ref,
|
|
@@ -6149,12 +6139,11 @@ const Badge = forwardRef(({ colorScheme = "inherit", label, icon, variant = "def
|
|
|
6149
6139
|
$variant: variant,
|
|
6150
6140
|
children: [hasIcon ? icon : null, isNotNil(label) ? /* @__PURE__ */ jsx("span", { children: label }) : null]
|
|
6151
6141
|
});
|
|
6152
|
-
}
|
|
6153
|
-
Badge.displayName = "Badge_UI";
|
|
6142
|
+
};
|
|
6154
6143
|
//#endregion
|
|
6155
6144
|
//#region src/private/helpers/makePolymorphic/makePolymorphic.tsx
|
|
6156
6145
|
/**
|
|
6157
|
-
* makePolymorphic takes a component
|
|
6146
|
+
* makePolymorphic takes a component and returns a new version
|
|
6158
6147
|
* that supports polymorphism via a `renderAs` prop. The returned component's types automatically
|
|
6159
6148
|
* merge the intrinsic props of the rendered element with the custom props of the original
|
|
6160
6149
|
* component, while including support for children and refs.
|
|
@@ -6236,7 +6225,7 @@ const StyledBoxComponent = styled.div`
|
|
|
6236
6225
|
order: ${({ $order }) => isNotNil($order) ? $order : null};
|
|
6237
6226
|
`;
|
|
6238
6227
|
const DEFAULT_ELEMENT$4 = "div";
|
|
6239
|
-
const BoxComponent =
|
|
6228
|
+
const BoxComponent = ({ ref, alignContent = "stretch", alignItems = "flex-start", alignSelf, basis, children, direction = "row", fill = false, fillViewport = false, gap, grow, height, inline = false, justifyContent = "flex-start", order, renderAs, shrink, width, wrapItems = false, flexMode, ...props }) => {
|
|
6240
6229
|
const responsiveAlignContent = useResponsiveProp(alignContent);
|
|
6241
6230
|
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
6242
6231
|
const responsiveAlignSelf = useResponsiveProp(alignSelf);
|
|
@@ -6283,8 +6272,7 @@ const BoxComponent = forwardRef(({ alignContent = "stretch", alignItems = "flex-
|
|
|
6283
6272
|
...props,
|
|
6284
6273
|
children
|
|
6285
6274
|
});
|
|
6286
|
-
}
|
|
6287
|
-
BoxComponent.displayName = "Box_UI";
|
|
6275
|
+
};
|
|
6288
6276
|
/**
|
|
6289
6277
|
* Box is a layout container using [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox).
|
|
6290
6278
|
*/
|
|
@@ -6403,7 +6391,7 @@ const variantElementMap$1 = {
|
|
|
6403
6391
|
heading5: "h5",
|
|
6404
6392
|
heading6: "h6"
|
|
6405
6393
|
};
|
|
6406
|
-
const HeadingComponent =
|
|
6394
|
+
const HeadingComponent = ({ ref, align = "left", children, colorScheme = "inherit", disabled = false, inline = false, maxChars, preventUserSelect = false, prominence = "primary", maxLines, variant = "heading1", renderAs, ...props }) => {
|
|
6407
6395
|
const processedChildren = applyMaxCharsToChildren(children, maxChars);
|
|
6408
6396
|
return /* @__PURE__ */ jsx(StyledHeading$1, {
|
|
6409
6397
|
ref,
|
|
@@ -6419,8 +6407,7 @@ const HeadingComponent = forwardRef(({ align = "left", children, colorScheme = "
|
|
|
6419
6407
|
...props,
|
|
6420
6408
|
children: processedChildren
|
|
6421
6409
|
});
|
|
6422
|
-
}
|
|
6423
|
-
HeadingComponent.displayName = "Heading_UI";
|
|
6410
|
+
};
|
|
6424
6411
|
/**
|
|
6425
6412
|
* Displaying heading text, both visually and semantically
|
|
6426
6413
|
*/
|
|
@@ -6594,7 +6581,7 @@ const StyledText = styled.div`
|
|
|
6594
6581
|
}
|
|
6595
6582
|
`}
|
|
6596
6583
|
`;
|
|
6597
|
-
const TextComponent =
|
|
6584
|
+
const TextComponent = ({ ref, align = "left", children, colorScheme = "inherit", disabled = false, inline = false, maxChars, preventUserSelect = false, prominence = "primary", maxLines, variant = "body2", renderAs, ...props }) => {
|
|
6598
6585
|
const processedChildren = applyMaxCharsToChildren(children, maxChars);
|
|
6599
6586
|
return /* @__PURE__ */ jsx(StyledText, {
|
|
6600
6587
|
ref,
|
|
@@ -6610,8 +6597,7 @@ const TextComponent = forwardRef(({ align = "left", children, colorScheme = "inh
|
|
|
6610
6597
|
...props,
|
|
6611
6598
|
children: processedChildren
|
|
6612
6599
|
});
|
|
6613
|
-
}
|
|
6614
|
-
TextComponent.displayName = "Text_UI";
|
|
6600
|
+
};
|
|
6615
6601
|
/**
|
|
6616
6602
|
* Used for rending paragraphs and inline text.
|
|
6617
6603
|
*/
|
|
@@ -6696,7 +6682,7 @@ const StyledButton$1 = styled(Button)`
|
|
|
6696
6682
|
* IconButton behaves like a [Button](/components/Button),
|
|
6697
6683
|
* but only accepts an [Icon](/components/Icon) as a child.
|
|
6698
6684
|
*/
|
|
6699
|
-
const IconButton =
|
|
6685
|
+
const IconButton = ({ children, label, size = "md", ref, ...props }) => {
|
|
6700
6686
|
const responsiveSize = useResponsiveProp(size);
|
|
6701
6687
|
return /* @__PURE__ */ jsx(StyledButton$1, {
|
|
6702
6688
|
...props,
|
|
@@ -6706,8 +6692,7 @@ const IconButton = forwardRef(({ children, label, size = "md", ...props }, ref)
|
|
|
6706
6692
|
size: responsiveSize,
|
|
6707
6693
|
children: cloneElement(Children.only(children), { size: responsiveSize })
|
|
6708
6694
|
});
|
|
6709
|
-
}
|
|
6710
|
-
IconButton.displayName = "IconButton_UI";
|
|
6695
|
+
};
|
|
6711
6696
|
//#endregion
|
|
6712
6697
|
//#region src/components/Banner/Banner.tsx
|
|
6713
6698
|
const StyledBanner = styled.div`
|
|
@@ -6933,15 +6918,14 @@ const StyledCenter = styled.div`
|
|
|
6933
6918
|
* Center component provides various ways to center content horizontally within a container.
|
|
6934
6919
|
* It supports max-width constraints, text alignment, gutters, and intrinsic content centering.
|
|
6935
6920
|
*/
|
|
6936
|
-
const Center =
|
|
6921
|
+
const Center = ({ maxWidth = "100%", gutterWidth = "space-00", intrinsic = false, children, ref, ...props }) => /* @__PURE__ */ jsx(StyledCenter, {
|
|
6937
6922
|
ref,
|
|
6938
6923
|
$gutterWidth: gutterWidth,
|
|
6939
6924
|
$intrinsic: intrinsic,
|
|
6940
6925
|
$maxWidth: maxWidth,
|
|
6941
6926
|
...props,
|
|
6942
6927
|
children
|
|
6943
|
-
})
|
|
6944
|
-
Center.displayName = "Center_UI";
|
|
6928
|
+
});
|
|
6945
6929
|
//#endregion
|
|
6946
6930
|
//#region src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
6947
6931
|
const VisuallyHidden = styled.div({ ...visuallyHiddenStyle });
|
|
@@ -7038,7 +7022,7 @@ const StyledStack = styled.div`
|
|
|
7038
7022
|
${({ $paddingX }) => $paddingX && `padding-left: var(--wui-${$paddingX}); padding-right: var(--wui-${$paddingX});`}
|
|
7039
7023
|
${({ $paddingY }) => $paddingY && `padding-top: var(--wui-${$paddingY}); padding-bottom: var(--wui-${$paddingY});`}
|
|
7040
7024
|
`;
|
|
7041
|
-
const StackComponent =
|
|
7025
|
+
const StackComponent = ({ ref, renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", padding, ...props }) => {
|
|
7042
7026
|
const responsiveGap = useResponsiveProp(gap);
|
|
7043
7027
|
const responsiveDirection = useResponsiveProp(direction);
|
|
7044
7028
|
return /* @__PURE__ */ jsx(StyledStack, {
|
|
@@ -7051,8 +7035,7 @@ const StackComponent = forwardRef(({ renderAs, direction = "vertical", gap = "sp
|
|
|
7051
7035
|
as: renderAs ?? DEFAULT_ELEMENT$1,
|
|
7052
7036
|
...props
|
|
7053
7037
|
});
|
|
7054
|
-
}
|
|
7055
|
-
StackComponent.displayName = "Stack_UI";
|
|
7038
|
+
};
|
|
7056
7039
|
/**
|
|
7057
7040
|
* Used to layout its children in a vertical or horizontal stack. The gap between each item in the stack can be customized.
|
|
7058
7041
|
* This allows for layouting children in a consistent way without needing to manually add margins or padding.
|
|
@@ -7128,7 +7111,7 @@ const FormContext = createContext({
|
|
|
7128
7111
|
* For creating forms. It provides a context for the form fields to access the form state and validation.
|
|
7129
7112
|
* It also provides a way to handle form submission and validation. It is built around [React 19's form APIs](https://react.dev/reference/react-dom/components/form).
|
|
7130
7113
|
*/
|
|
7131
|
-
const Form =
|
|
7114
|
+
const Form = ({ children, action, values = {}, labelPosition = "block", validate, fullWidth = false, ref: forwardedRef, ...props }) => {
|
|
7132
7115
|
const [errors, setErrors] = useState({});
|
|
7133
7116
|
const [hasSubmitted, setHasSubmitted] = useState(false);
|
|
7134
7117
|
const innerRef = useRef(null);
|
|
@@ -7192,7 +7175,7 @@ const Form = forwardRef(({ children, action, values = {}, labelPosition = "block
|
|
|
7192
7175
|
children
|
|
7193
7176
|
})
|
|
7194
7177
|
});
|
|
7195
|
-
}
|
|
7178
|
+
};
|
|
7196
7179
|
//#endregion
|
|
7197
7180
|
//#region src/components/FormGroup/CheckboxGroup.tsx
|
|
7198
7181
|
const CheckboxGroupContext = createContext(null);
|
|
@@ -7326,7 +7309,7 @@ const StyledHiddenCheckboxInput = styled.input`
|
|
|
7326
7309
|
${visuallyHiddenStyle}
|
|
7327
7310
|
position: relative;
|
|
7328
7311
|
`;
|
|
7329
|
-
const Checkbox =
|
|
7312
|
+
const Checkbox = ({ checked, disabled = false, id, label, description, name, onChange, size = "md", value, required = false, hideLabel = false, ref, ...props }) => {
|
|
7330
7313
|
const generatedId = useId();
|
|
7331
7314
|
const computedId = isNonEmptyString(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
7332
7315
|
const checkboxGroupContext = useCheckboxGroup();
|
|
@@ -7364,8 +7347,7 @@ const Checkbox = forwardRef(({ checked, disabled = false, id, label, description
|
|
|
7364
7347
|
label
|
|
7365
7348
|
})]
|
|
7366
7349
|
});
|
|
7367
|
-
}
|
|
7368
|
-
Checkbox.displayName = "Checkbox_UI";
|
|
7350
|
+
};
|
|
7369
7351
|
//#endregion
|
|
7370
7352
|
//#region src/components/ClickRegion/ClickRegion.tsx
|
|
7371
7353
|
const isClickableElement = (element) => {
|
|
@@ -8507,14 +8489,13 @@ const DefaultTriggerContent = () => {
|
|
|
8507
8489
|
* it renders a swatch and hex label for the current color; pass custom children
|
|
8508
8490
|
* to replace that content.
|
|
8509
8491
|
*/
|
|
8510
|
-
const ColorPickerTrigger =
|
|
8492
|
+
const ColorPickerTrigger = ({ children, ref, ...props }) => {
|
|
8511
8493
|
return /* @__PURE__ */ jsx(StyledPopoverTrigger, {
|
|
8512
|
-
ref
|
|
8494
|
+
ref,
|
|
8513
8495
|
...props,
|
|
8514
8496
|
children: children ?? /* @__PURE__ */ jsx(DefaultTriggerContent, {})
|
|
8515
8497
|
});
|
|
8516
|
-
}
|
|
8517
|
-
ColorPickerTrigger.displayName = "ColorPickerTrigger_UI";
|
|
8498
|
+
};
|
|
8518
8499
|
//#endregion
|
|
8519
8500
|
//#region src/components/ColorPicker/ContrastIndicator.tsx
|
|
8520
8501
|
const Container$3 = styled.div`
|
|
@@ -8630,7 +8611,7 @@ const StyledSwitchThumb = styled.div`
|
|
|
8630
8611
|
const StyledHiddenSwitchInput = styled.input`
|
|
8631
8612
|
${visuallyHiddenStyle}
|
|
8632
8613
|
`;
|
|
8633
|
-
const Switch =
|
|
8614
|
+
const Switch = ({ align = "left", checked, disabled = false, id, label, description, name, onChange, size = "md", value, required = false, hideLabel = false, ref, ...props }) => {
|
|
8634
8615
|
const generatedId = useId();
|
|
8635
8616
|
const computedId = isNonEmptyString(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
8636
8617
|
return /* @__PURE__ */ jsxs(StyledSwitchWrapper, {
|
|
@@ -8662,8 +8643,7 @@ const Switch = forwardRef(({ align = "left", checked, disabled = false, id, labe
|
|
|
8662
8643
|
label
|
|
8663
8644
|
})]
|
|
8664
8645
|
});
|
|
8665
|
-
}
|
|
8666
|
-
Switch.displayName = "Switch_UI";
|
|
8646
|
+
};
|
|
8667
8647
|
//#endregion
|
|
8668
8648
|
//#region src/components/ColorPicker/ContrastEnforcerSwitch.tsx
|
|
8669
8649
|
/**
|
|
@@ -8909,7 +8889,7 @@ const StyledInputContainer = styled.div`
|
|
|
8909
8889
|
/**
|
|
8910
8890
|
* Capture user input with a text field. Should be used within a [Form](/components/Form) and [FormField](/components/FormField).
|
|
8911
8891
|
*/
|
|
8912
|
-
const Input =
|
|
8892
|
+
const Input = ({ fullWidth = true, fullHeight = false, monospace = false, type = "text", autoSelect = false, leftIcon, rightIcon, ref: externalRef, ...props }) => {
|
|
8913
8893
|
const internalRef = useRef(null);
|
|
8914
8894
|
const ref = isNotNil(externalRef) && isRecord(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
8915
8895
|
let leftIconToDisplay = leftIcon;
|
|
@@ -8950,8 +8930,7 @@ const Input = forwardRef(({ fullWidth = true, fullHeight = false, monospace = fa
|
|
|
8950
8930
|
rightIconToDisplay ?? null
|
|
8951
8931
|
]
|
|
8952
8932
|
});
|
|
8953
|
-
}
|
|
8954
|
-
Input.displayName = "Input_UI";
|
|
8933
|
+
};
|
|
8955
8934
|
//#endregion
|
|
8956
8935
|
//#region src/components/ColorPicker/HexColorInput.tsx
|
|
8957
8936
|
const SIX_DIGIT_HEX_CODE_LENGTH = 7;
|
|
@@ -9598,7 +9577,7 @@ const RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9598
9577
|
/**
|
|
9599
9578
|
* A `Tag` is an optionally linked label, with an optional action button, to categorize content.
|
|
9600
9579
|
*/
|
|
9601
|
-
const Tag =
|
|
9580
|
+
const Tag = ({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ref, ...props }) => {
|
|
9602
9581
|
const hasIcon = isNotNil(icon);
|
|
9603
9582
|
const labelProps = isNotNil(href) && isNonEmptyString(href) ? {
|
|
9604
9583
|
href,
|
|
@@ -9618,8 +9597,7 @@ const Tag = forwardRef(({ onClickRemove, colorScheme = "inherit", href, icon, la
|
|
|
9618
9597
|
onClickRemoveLabel
|
|
9619
9598
|
})]
|
|
9620
9599
|
});
|
|
9621
|
-
}
|
|
9622
|
-
Tag.displayName = "Tag_UI";
|
|
9600
|
+
};
|
|
9623
9601
|
//#endregion
|
|
9624
9602
|
//#region src/private/helpers/getTypographicStyles/getTypographicStyles.ts
|
|
9625
9603
|
const typographicVariantStyleMap = {
|
|
@@ -9955,7 +9933,7 @@ const MenuPopup = styled(Menu$1.Popup)`
|
|
|
9955
9933
|
/**
|
|
9956
9934
|
* Displays a menu to the users with a set of actions.
|
|
9957
9935
|
*/
|
|
9958
|
-
const Menu =
|
|
9936
|
+
const Menu = ({ align = "start", children, disabled = false, compact = false, trigger, label, isOpen, side = "bottom", triggerProps = {}, onOpenChange, ref, ...props }) => {
|
|
9959
9937
|
const contextValue = useMemo(() => ({ compact }), [compact]);
|
|
9960
9938
|
const handleOpenChange = useCallback((nextOpen, eventDetails) => {
|
|
9961
9939
|
if (nextOpen !== isOpen) {
|
|
@@ -9997,8 +9975,7 @@ const Menu = forwardRef(({ align = "start", children, disabled = false, compact
|
|
|
9997
9975
|
}) })]
|
|
9998
9976
|
})
|
|
9999
9977
|
});
|
|
10000
|
-
}
|
|
10001
|
-
Menu.displayName = "Menu_UI";
|
|
9978
|
+
};
|
|
10002
9979
|
//#endregion
|
|
10003
9980
|
//#region src/components/ContextMenu/ContextMenu.tsx
|
|
10004
9981
|
const ContextMenuPopup = styled(Menu$1.Popup)`
|
|
@@ -10725,7 +10702,7 @@ const StyledEditableTextDisplay = styled.div`
|
|
|
10725
10702
|
}
|
|
10726
10703
|
}
|
|
10727
10704
|
`;
|
|
10728
|
-
const EditableTextDisplayComponent =
|
|
10705
|
+
const EditableTextDisplayComponent = ({ ref, asTrigger, renderAs, ...props }) => {
|
|
10729
10706
|
const context = useContext(EditableTextContext);
|
|
10730
10707
|
if (!context) throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
10731
10708
|
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines } = context;
|
|
@@ -10767,8 +10744,7 @@ const EditableTextDisplayComponent = forwardRef(({ asTrigger, renderAs, ...props
|
|
|
10767
10744
|
...props,
|
|
10768
10745
|
children: displayText
|
|
10769
10746
|
});
|
|
10770
|
-
}
|
|
10771
|
-
EditableTextDisplayComponent.displayName = "EditableTextDisplay_UI";
|
|
10747
|
+
};
|
|
10772
10748
|
const EditableTextDisplay = makePolymorphic(EditableTextDisplayComponent);
|
|
10773
10749
|
//#endregion
|
|
10774
10750
|
//#region src/components/EditableText/EditableTextInput.tsx
|
|
@@ -11464,7 +11440,7 @@ const StyledGrid = styled.div`
|
|
|
11464
11440
|
* A flexible grid component that can either create a fixed number of columns
|
|
11465
11441
|
* or an auto-filling grid based on the minimum child width.
|
|
11466
11442
|
*/
|
|
11467
|
-
const GridComponent =
|
|
11443
|
+
const GridComponent = ({ ref, children, columns = "auto", minChildWidth = "auto", gap = "space-02", expandItems = false, renderAs, ...props }) => {
|
|
11468
11444
|
const responsiveGap = useResponsiveProp(gap);
|
|
11469
11445
|
const { column, row } = isRecord(responsiveGap) ? responsiveGap : {
|
|
11470
11446
|
column: responsiveGap,
|
|
@@ -11481,8 +11457,7 @@ const GridComponent = forwardRef(({ children, columns = "auto", minChildWidth =
|
|
|
11481
11457
|
...props,
|
|
11482
11458
|
children
|
|
11483
11459
|
});
|
|
11484
|
-
}
|
|
11485
|
-
GridComponent.displayName = "Grid_UI";
|
|
11460
|
+
};
|
|
11486
11461
|
const Grid = makePolymorphic(GridComponent);
|
|
11487
11462
|
//#endregion
|
|
11488
11463
|
//#region src/components/PreviewCard/PreviewCard.tsx
|
|
@@ -11582,7 +11557,7 @@ const COPY_SUCCESS_DURATION = 2e3;
|
|
|
11582
11557
|
/**
|
|
11583
11558
|
* Provides a readonly input that copies the text to the clipboard when clicked.
|
|
11584
11559
|
*/
|
|
11585
|
-
const InputClickToCopy =
|
|
11560
|
+
const InputClickToCopy = ({ value, onCopy, disabled = false, ref, ...props }) => {
|
|
11586
11561
|
const [isCopied, setIsCopied] = useState(false);
|
|
11587
11562
|
useEffect(() => {
|
|
11588
11563
|
if (isCopied) {
|
|
@@ -11621,8 +11596,7 @@ const InputClickToCopy = forwardRef(({ value, onCopy, disabled = false, ...props
|
|
|
11621
11596
|
}),
|
|
11622
11597
|
value
|
|
11623
11598
|
});
|
|
11624
|
-
}
|
|
11625
|
-
InputClickToCopy.displayName = "InputClickToCopy_UI";
|
|
11599
|
+
};
|
|
11626
11600
|
//#endregion
|
|
11627
11601
|
//#region src/components/InputDuration/constants.ts
|
|
11628
11602
|
const SECONDS_PER_MINUTE = 60;
|
|
@@ -12291,7 +12265,7 @@ const getInputWidth = (inputValue) => {
|
|
|
12291
12265
|
/**
|
|
12292
12266
|
* InputDuration lets users edit a duration value using a keyboard-friendly time input.
|
|
12293
12267
|
*/
|
|
12294
|
-
const InputDuration =
|
|
12268
|
+
const InputDuration = ({ decimalUnitLength = 2, disabled = false, fullWidth = false, maxSeconds = MAX_TIME, minSeconds = 0, onChangeValueInSeconds, valueInSeconds, onFocus, style, ref: externalRef, ...props }) => {
|
|
12295
12269
|
const { inputRef, inputValue, onFocus: onInputFocus, onInputSelect, onKeyDown, onKeyUp } = useInputDuration({
|
|
12296
12270
|
decimalUnitLength,
|
|
12297
12271
|
maxSeconds,
|
|
@@ -12326,8 +12300,7 @@ const InputDuration = forwardRef(({ decimalUnitLength = 2, disabled = false, ful
|
|
|
12326
12300
|
type: "text",
|
|
12327
12301
|
value: inputValue
|
|
12328
12302
|
});
|
|
12329
|
-
}
|
|
12330
|
-
InputDuration.displayName = "InputDuration_UI";
|
|
12303
|
+
};
|
|
12331
12304
|
//#endregion
|
|
12332
12305
|
//#region src/components/InputPassword/InputPassword.tsx
|
|
12333
12306
|
const StyledIconButton = styled(IconButton)`
|
|
@@ -12341,7 +12314,7 @@ const StyledIconButton = styled(IconButton)`
|
|
|
12341
12314
|
/**
|
|
12342
12315
|
* A password input component with a toggle button to show or hide the password text.
|
|
12343
12316
|
*/
|
|
12344
|
-
const InputPassword =
|
|
12317
|
+
const InputPassword = ({ onVisibilityToggle, disabled = false, ref, ...props }) => {
|
|
12345
12318
|
const [isVisible, setIsVisible] = useState(false);
|
|
12346
12319
|
const handleClick = () => {
|
|
12347
12320
|
const newVisibility = !isVisible;
|
|
@@ -12362,8 +12335,7 @@ const InputPassword = forwardRef(({ onVisibilityToggle, disabled = false, ...pro
|
|
|
12362
12335
|
}),
|
|
12363
12336
|
type: isVisible ? "text" : "password"
|
|
12364
12337
|
});
|
|
12365
|
-
}
|
|
12366
|
-
InputPassword.displayName = "InputPassword_UI";
|
|
12338
|
+
};
|
|
12367
12339
|
//#endregion
|
|
12368
12340
|
//#region src/components/KeyboardShortcut/isKeyboardKey.ts
|
|
12369
12341
|
const KEYBOARD_KEY_MAP = {
|
|
@@ -12875,7 +12847,7 @@ const StyledBadgeContainer = styled.div`
|
|
|
12875
12847
|
font-size: var(--wui-typography-label-4-size);
|
|
12876
12848
|
color: var(--wui-color-text-secondary);
|
|
12877
12849
|
`;
|
|
12878
|
-
const MenuItemButton =
|
|
12850
|
+
const MenuItemButton = ({ children, appearance, command, icon, ref, ...props }) => {
|
|
12879
12851
|
let { colorScheme, badge } = props;
|
|
12880
12852
|
if (appearance === "dangerous") {
|
|
12881
12853
|
if (isNotUndefined(colorScheme)) console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
@@ -12903,8 +12875,7 @@ const MenuItemButton = forwardRef(({ children, appearance, command, icon, ...pro
|
|
|
12903
12875
|
isNotNil(props.rightIcon) ? /* @__PURE__ */ jsx(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
12904
12876
|
]
|
|
12905
12877
|
});
|
|
12906
|
-
}
|
|
12907
|
-
MenuItemButton.displayName = "MenuItemButton_UI";
|
|
12878
|
+
};
|
|
12908
12879
|
//#endregion
|
|
12909
12880
|
//#region src/components/Menu/MenuItemLabel.tsx
|
|
12910
12881
|
const StyledMenuItemLabel = styled.span`
|
|
@@ -12983,7 +12954,7 @@ const SubMenu = ({ label, description, children, onOpenChange = () => null, ...p
|
|
|
12983
12954
|
SubMenu.displayName = "SubMenu_UI";
|
|
12984
12955
|
//#endregion
|
|
12985
12956
|
//#region src/components/Menu/MenuItem.tsx
|
|
12986
|
-
const MenuItem =
|
|
12957
|
+
const MenuItem = ({ onSelect = () => null, closeOnClick = true, ref, ...props }) => {
|
|
12987
12958
|
return /* @__PURE__ */ jsx(Menu$1.Item, {
|
|
12988
12959
|
closeOnClick,
|
|
12989
12960
|
nativeButton: isNil(props.href),
|
|
@@ -12994,8 +12965,7 @@ const MenuItem = forwardRef(({ onSelect = () => null, closeOnClick = true, ...pr
|
|
|
12994
12965
|
leftIcon: props.icon
|
|
12995
12966
|
})
|
|
12996
12967
|
});
|
|
12997
|
-
}
|
|
12998
|
-
MenuItem.displayName = "MenuItem_UI";
|
|
12968
|
+
};
|
|
12999
12969
|
//#endregion
|
|
13000
12970
|
//#region src/components/Menu/MenuRadioGroup.tsx
|
|
13001
12971
|
const MenuRadioGroup = ({ children, ...props }) => {
|
|
@@ -13075,7 +13045,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem_UI";
|
|
|
13075
13045
|
//#endregion
|
|
13076
13046
|
//#region src/components/Menu/FilterMenu.tsx
|
|
13077
13047
|
const FilterMenuItem = CheckboxMenuItem;
|
|
13078
|
-
const FilterMenu =
|
|
13048
|
+
const FilterMenu = ({ value, onChange, searchValue, onSearchValueChange, children, ref, ...props }) => {
|
|
13079
13049
|
return /* @__PURE__ */ jsxs(Menu, {
|
|
13080
13050
|
...props,
|
|
13081
13051
|
ref,
|
|
@@ -13146,8 +13116,7 @@ const FilterMenu = forwardRef(({ value, onChange, searchValue, onSearchValueChan
|
|
|
13146
13116
|
})
|
|
13147
13117
|
]
|
|
13148
13118
|
});
|
|
13149
|
-
}
|
|
13150
|
-
FilterMenu.displayName = "FilterMenu_UI";
|
|
13119
|
+
};
|
|
13151
13120
|
//#endregion
|
|
13152
13121
|
//#region src/components/Meter/Meter.tsx
|
|
13153
13122
|
const MeterWrapper = styled.div`
|
|
@@ -13250,11 +13219,12 @@ const Meter = ({ segments, label, labelMeta, description, hideKey = false, max =
|
|
|
13250
13219
|
const segmentsWithOffsets = segments.reduce((acc, segment) => {
|
|
13251
13220
|
const offset = acc.reduce((sum, prev) => sum + prev.widthPercent, 0);
|
|
13252
13221
|
const widthPercent = segment.value / max * 100;
|
|
13253
|
-
|
|
13222
|
+
acc.push({
|
|
13254
13223
|
...segment,
|
|
13255
13224
|
offset,
|
|
13256
13225
|
widthPercent
|
|
13257
|
-
}
|
|
13226
|
+
});
|
|
13227
|
+
return acc;
|
|
13258
13228
|
}, []);
|
|
13259
13229
|
const keySegments = segmentsWithOffsets.filter((segment) => isNotNil(segment.label));
|
|
13260
13230
|
const totalValue = segments.reduce((sum, segment) => sum + segment.value, 0);
|
|
@@ -13477,7 +13447,7 @@ const StyledModalContent = styled(Dialog.Popup)`
|
|
|
13477
13447
|
${({ $positionVariant }) => positionStyleMap[$positionVariant]}
|
|
13478
13448
|
}
|
|
13479
13449
|
`;
|
|
13480
|
-
const ModalContent =
|
|
13450
|
+
const ModalContent = ({ width, positionVariant, initialFocusRef, children, ref, ...props }) => {
|
|
13481
13451
|
return /* @__PURE__ */ jsx(StyledModalContent, {
|
|
13482
13452
|
ref,
|
|
13483
13453
|
$positionVariant: positionVariant,
|
|
@@ -13486,8 +13456,7 @@ const ModalContent = forwardRef(({ width, positionVariant, initialFocusRef, chil
|
|
|
13486
13456
|
...props,
|
|
13487
13457
|
children
|
|
13488
13458
|
});
|
|
13489
|
-
}
|
|
13490
|
-
ModalContent.displayName = "ModalContent_UI";
|
|
13459
|
+
};
|
|
13491
13460
|
//#endregion
|
|
13492
13461
|
//#region src/components/Modal/ModalOverlay.tsx
|
|
13493
13462
|
const backdropShow = keyframes`
|
|
@@ -13542,7 +13511,7 @@ const ModalFooter = styled.footer`
|
|
|
13542
13511
|
* A Modal is a focused UI element that appears atop the main interface, requiring
|
|
13543
13512
|
* user interaction or dismissal before returning to the underlying content.
|
|
13544
13513
|
*/
|
|
13545
|
-
const Modal =
|
|
13514
|
+
const Modal = ({ children, footer, hideCloseButton = false, hideTitle = false, initialFocusRef, isOpen, onRequestClose, positionVariant = "centered", title, width = DEFAULT_MODAL_WIDTH, ref, ...props }) => {
|
|
13546
13515
|
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
13547
13516
|
onOpenChange: (open) => {
|
|
13548
13517
|
if (!open && isNotNil(onRequestClose)) onRequestClose();
|
|
@@ -13566,8 +13535,7 @@ const Modal = forwardRef(({ children, footer, hideCloseButton = false, hideTitle
|
|
|
13566
13535
|
]
|
|
13567
13536
|
})] })
|
|
13568
13537
|
});
|
|
13569
|
-
}
|
|
13570
|
-
Modal.displayName = "Modal_UI";
|
|
13538
|
+
};
|
|
13571
13539
|
//#endregion
|
|
13572
13540
|
//#region src/components/Modal/ModalCallouts.tsx
|
|
13573
13541
|
const ModalCallouts = ({ children }) => {
|
|
@@ -13804,11 +13772,10 @@ PopoverAnchor.displayName = "PopoverAnchor_UI";
|
|
|
13804
13772
|
* pass `render` to merge the close behavior onto a single child element. For
|
|
13805
13773
|
* a pre-styled icon close button, use `PopoverCloseButton`.
|
|
13806
13774
|
*/
|
|
13807
|
-
const PopoverClose =
|
|
13808
|
-
ref
|
|
13775
|
+
const PopoverClose = ({ ref, ...props }) => /* @__PURE__ */ jsx(Popover$1.Close, {
|
|
13776
|
+
ref,
|
|
13809
13777
|
...props
|
|
13810
|
-
})
|
|
13811
|
-
PopoverClose.displayName = "PopoverClose_UI";
|
|
13778
|
+
});
|
|
13812
13779
|
//#endregion
|
|
13813
13780
|
//#region src/components/Popover/PopoverCloseButton.tsx
|
|
13814
13781
|
/**
|
|
@@ -13850,7 +13817,7 @@ const DEFAULT_MAX_HEIGHT = "auto";
|
|
|
13850
13817
|
* The styled popover surface. Place inside a `PopoverRoot` (typically wrapped
|
|
13851
13818
|
* in a `PopoverPortal`). Wraps a `Positioner` and `Popup` internally.
|
|
13852
13819
|
*/
|
|
13853
|
-
const PopoverContent =
|
|
13820
|
+
const PopoverContent = ({ colorScheme = "inherit", unstyled = false, maxWidth = DEFAULT_MAX_WIDTH, maxHeight = DEFAULT_MAX_HEIGHT, sideOffset = DEFAULT_SIDE_OFFSET, side, align, style, role = "dialog", children, ref, ...props }) => {
|
|
13854
13821
|
const sharedAnchorRef = usePopoverAnchor();
|
|
13855
13822
|
const hasAnchor = sharedAnchorRef?.current != null;
|
|
13856
13823
|
const mergedStyle = {
|
|
@@ -13870,7 +13837,7 @@ const PopoverContent = forwardRef(({ colorScheme = "inherit", unstyled = false,
|
|
|
13870
13837
|
style: { zIndex: "var(--wui-zindex-popover)" },
|
|
13871
13838
|
...hasAnchor ? { anchor: sharedAnchorRef } : {},
|
|
13872
13839
|
children: /* @__PURE__ */ jsx(StyledPopup$1, {
|
|
13873
|
-
ref
|
|
13840
|
+
ref,
|
|
13874
13841
|
$colorScheme: colorScheme,
|
|
13875
13842
|
$unstyled: unstyled,
|
|
13876
13843
|
role,
|
|
@@ -13879,8 +13846,7 @@ const PopoverContent = forwardRef(({ colorScheme = "inherit", unstyled = false,
|
|
|
13879
13846
|
children
|
|
13880
13847
|
})
|
|
13881
13848
|
});
|
|
13882
|
-
}
|
|
13883
|
-
PopoverContent.displayName = "PopoverContent_UI";
|
|
13849
|
+
};
|
|
13884
13850
|
//#endregion
|
|
13885
13851
|
//#region src/components/Popover/PopoverPortal.tsx
|
|
13886
13852
|
/**
|
|
@@ -13915,12 +13881,11 @@ PopoverRoot.displayName = "PopoverRoot_UI";
|
|
|
13915
13881
|
* `<button>` wrapping its children; pass `render` to merge the trigger
|
|
13916
13882
|
* behavior onto a single child element (e.g. a `Button` or `IconButton`).
|
|
13917
13883
|
*/
|
|
13918
|
-
const PopoverTrigger =
|
|
13919
|
-
ref
|
|
13884
|
+
const PopoverTrigger = ({ nativeButton = true, ref, ...props }) => /* @__PURE__ */ jsx(Popover$1.Trigger, {
|
|
13885
|
+
ref,
|
|
13920
13886
|
nativeButton,
|
|
13921
13887
|
...props
|
|
13922
|
-
})
|
|
13923
|
-
PopoverTrigger.displayName = "PopoverTrigger_UI";
|
|
13888
|
+
});
|
|
13924
13889
|
//#endregion
|
|
13925
13890
|
//#region src/components/ProgressBar/ProgressBar.tsx
|
|
13926
13891
|
const ProgressBarWrapper = styled.div`
|
|
@@ -14062,7 +14027,7 @@ const StyledRadioInput = styled.div`
|
|
|
14062
14027
|
const StyledHiddenRadioInput = styled.input`
|
|
14063
14028
|
${visuallyHiddenStyle}
|
|
14064
14029
|
`;
|
|
14065
|
-
const Radio =
|
|
14030
|
+
const Radio = ({ checked, disabled = false, id, label, description, name, onChange, size = "md", value = "false", required = false, hideLabel = false, ref, ...props }) => {
|
|
14066
14031
|
const generatedId = useId();
|
|
14067
14032
|
const computedId = isNonEmptyString(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
14068
14033
|
const radioGroupContext = useRadioGroup();
|
|
@@ -14096,8 +14061,7 @@ const Radio = forwardRef(({ checked, disabled = false, id, label, description, n
|
|
|
14096
14061
|
label
|
|
14097
14062
|
})]
|
|
14098
14063
|
});
|
|
14099
|
-
}
|
|
14100
|
-
Radio.displayName = "Radio_UI";
|
|
14064
|
+
};
|
|
14101
14065
|
//#endregion
|
|
14102
14066
|
//#region src/components/RadioCard/RadioCardRoot.tsx
|
|
14103
14067
|
const checkedStyles = css`
|
|
@@ -14206,7 +14170,7 @@ const StyledCard = styled.label`
|
|
|
14206
14170
|
const StyledHiddenInput = styled.input`
|
|
14207
14171
|
${visuallyHiddenStyle}
|
|
14208
14172
|
`;
|
|
14209
|
-
const RadioCardRoot =
|
|
14173
|
+
const RadioCardRoot = ({ children, disabled = false, id, isGated = false, name, onChange, value, aspectRatio = "initial", padding = "space-04", checked, ref, ...props }) => {
|
|
14210
14174
|
const generatedId = useId();
|
|
14211
14175
|
const computedId = isNonEmptyString(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
14212
14176
|
const radioGroupContext = useRadioGroup();
|
|
@@ -14233,8 +14197,7 @@ const RadioCardRoot = forwardRef(({ children, disabled = false, id, isGated = fa
|
|
|
14233
14197
|
value
|
|
14234
14198
|
}), children]
|
|
14235
14199
|
});
|
|
14236
|
-
}
|
|
14237
|
-
RadioCardRoot.displayName = "RadioCardRoot_UI";
|
|
14200
|
+
};
|
|
14238
14201
|
//#endregion
|
|
14239
14202
|
//#region src/components/RadioCard/RadioCardIndicator.tsx
|
|
14240
14203
|
const RadioCardIndicator = styled.div`
|
|
@@ -14347,7 +14310,7 @@ const RadioCardChildrenContainer = styled.div`
|
|
|
14347
14310
|
`;
|
|
14348
14311
|
//#endregion
|
|
14349
14312
|
//#region src/components/RadioCard/RadioCard.tsx
|
|
14350
|
-
const RadioCard =
|
|
14313
|
+
const RadioCard = ({ icon, label, description, showIndicator, isGated, children, ref, ...rootProps }) => {
|
|
14351
14314
|
return /* @__PURE__ */ jsx(RadioCardRoot, {
|
|
14352
14315
|
ref,
|
|
14353
14316
|
isGated,
|
|
@@ -14364,11 +14327,10 @@ const RadioCard = forwardRef(({ icon, label, description, showIndicator, isGated
|
|
|
14364
14327
|
showIndicator
|
|
14365
14328
|
})
|
|
14366
14329
|
});
|
|
14367
|
-
}
|
|
14368
|
-
RadioCard.displayName = "RadioCard_UI";
|
|
14330
|
+
};
|
|
14369
14331
|
//#endregion
|
|
14370
14332
|
//#region src/components/RadioCard/RadioCardImage.tsx
|
|
14371
|
-
const RadioCardImage =
|
|
14333
|
+
const RadioCardImage = ({ label, imageSrc, aspectRatio, padding = "space-04", ref, ...rootProps }) => {
|
|
14372
14334
|
return /* @__PURE__ */ jsx(RadioCardRoot, {
|
|
14373
14335
|
ref,
|
|
14374
14336
|
...rootProps,
|
|
@@ -14382,8 +14344,7 @@ const RadioCardImage = forwardRef(({ label, imageSrc, aspectRatio, padding = "sp
|
|
|
14382
14344
|
src: imageSrc
|
|
14383
14345
|
})
|
|
14384
14346
|
});
|
|
14385
|
-
}
|
|
14386
|
-
RadioCardImage.displayName = "RadioCardImage_UI";
|
|
14347
|
+
};
|
|
14387
14348
|
//#endregion
|
|
14388
14349
|
//#region src/components/ScrollArea/ScrollArea.tsx
|
|
14389
14350
|
const SHADOW_SIZE_PX = 8;
|
|
@@ -14436,7 +14397,7 @@ const ShadowAtRight = styled(Shadow)`
|
|
|
14436
14397
|
* ScrollArea is a simple scrollable container with shadow effects to indicate
|
|
14437
14398
|
* scrollability.
|
|
14438
14399
|
*/
|
|
14439
|
-
const ScrollArea =
|
|
14400
|
+
const ScrollArea = ({ children, onScroll, style, locked = false, ref: forwardedRef, ...props }) => {
|
|
14440
14401
|
const scrollContainerRefInternal = useRef(null);
|
|
14441
14402
|
const [shadowState, setShadowState] = useState({
|
|
14442
14403
|
canScrollUp: false,
|
|
@@ -14479,8 +14440,7 @@ const ScrollArea = forwardRef(({ children, onScroll, style, locked = false, ...p
|
|
|
14479
14440
|
})
|
|
14480
14441
|
]
|
|
14481
14442
|
});
|
|
14482
|
-
}
|
|
14483
|
-
ScrollArea.displayName = "ScrollArea_UI";
|
|
14443
|
+
};
|
|
14484
14444
|
//#endregion
|
|
14485
14445
|
//#region src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
14486
14446
|
const SelectedItemStyleContext = createContext(null);
|
|
@@ -14562,7 +14522,7 @@ const StyledSegmentedControl = styled(ToggleGroup)`
|
|
|
14562
14522
|
/**
|
|
14563
14523
|
* Provides a horizontal set of segments for switching between different values
|
|
14564
14524
|
*/
|
|
14565
|
-
const SegmentedControl =
|
|
14525
|
+
const SegmentedControl = ({ children, colorScheme = "inherit", disabled = false, fullWidth = false, selectedValue, onSelectedValueChange, ref, ...props }) => {
|
|
14566
14526
|
if (isNil(children)) return null;
|
|
14567
14527
|
return /* @__PURE__ */ jsx(StyledSegmentedControl, {
|
|
14568
14528
|
ref,
|
|
@@ -14580,8 +14540,7 @@ const SegmentedControl = forwardRef(({ children, colorScheme = "inherit", disabl
|
|
|
14580
14540
|
children: /* @__PURE__ */ jsxs(SelectedItemStyleProvider, { children: [children, /* @__PURE__ */ jsx(SelectedItemIndicator, {})] })
|
|
14581
14541
|
})
|
|
14582
14542
|
});
|
|
14583
|
-
}
|
|
14584
|
-
SegmentedControl.displayName = "SegmentedControl_UI";
|
|
14543
|
+
};
|
|
14585
14544
|
//#endregion
|
|
14586
14545
|
//#region src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
14587
14546
|
const segmentedControlItemStyles = css`
|
|
@@ -14656,7 +14615,7 @@ const segmentedControlItemStyles = css`
|
|
|
14656
14615
|
const StyledSegmentedControlItem = styled(Toggle)`
|
|
14657
14616
|
${segmentedControlItemStyles}
|
|
14658
14617
|
`;
|
|
14659
|
-
const SegmentedControlItem =
|
|
14618
|
+
const SegmentedControlItem = ({ disabled, icon, label, "aria-label": ariaLabel, value, ref: forwardedRef, ...otherProps }) => {
|
|
14660
14619
|
const selectedValue = useSegmentedControlValue();
|
|
14661
14620
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
14662
14621
|
const buttonRef = useRef(null);
|
|
@@ -14699,8 +14658,7 @@ const SegmentedControlItem = forwardRef(({ disabled, icon, label, "aria-label":
|
|
|
14699
14658
|
value,
|
|
14700
14659
|
children: [icon, label]
|
|
14701
14660
|
});
|
|
14702
|
-
}
|
|
14703
|
-
SegmentedControlItem.displayName = "SegmentedControlItem_UI";
|
|
14661
|
+
};
|
|
14704
14662
|
//#endregion
|
|
14705
14663
|
//#region src/components/Select/Select.tsx
|
|
14706
14664
|
const StyledTrigger = styled(Select$1.Trigger)`
|
|
@@ -14841,7 +14799,7 @@ const collectItemLabels = (children) => Children.toArray(children).flatMap((chil
|
|
|
14841
14799
|
/**
|
|
14842
14800
|
* Display a list of options and choose one of them. Replacement for the native Select HTML element.
|
|
14843
14801
|
*/
|
|
14844
|
-
const Select =
|
|
14802
|
+
const Select = ({ colorScheme = "inherit", children, onOpenChange = () => null, onChange = () => null, placeholder = "Select...", fullWidth = false, forceOpen = false, showScrollArrows = false, disabled, name, value, "aria-invalid": ariaInvalid, ref: forwardedRef, ...props }) => {
|
|
14845
14803
|
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
14846
14804
|
const rootProps = {
|
|
14847
14805
|
disabled,
|
|
@@ -14882,8 +14840,7 @@ const Select = forwardRef(({ colorScheme = "inherit", children, onOpenChange = (
|
|
|
14882
14840
|
] })
|
|
14883
14841
|
}) })]
|
|
14884
14842
|
});
|
|
14885
|
-
}
|
|
14886
|
-
Select.displayName = "Select_UI";
|
|
14843
|
+
};
|
|
14887
14844
|
//#endregion
|
|
14888
14845
|
//#region src/components/Select/SelectOption.tsx
|
|
14889
14846
|
const StyledItem = styled(Select$1.Item)`
|
|
@@ -14912,7 +14869,7 @@ const StyledItem = styled(Select$1.Item)`
|
|
|
14912
14869
|
background-color: transparent;
|
|
14913
14870
|
}
|
|
14914
14871
|
`;
|
|
14915
|
-
const SelectOption =
|
|
14872
|
+
const SelectOption = ({ children, selectedDisplayValue, checkmarkVerticalAlign = "center", textValue, ref: forwardedRef, ...props }) => {
|
|
14916
14873
|
const label = typeof children === "string" ? children : textValue;
|
|
14917
14874
|
return /* @__PURE__ */ jsxs(StyledItem, {
|
|
14918
14875
|
...props,
|
|
@@ -14927,8 +14884,7 @@ const SelectOption = forwardRef(({ children, selectedDisplayValue, checkmarkVert
|
|
|
14927
14884
|
type: "checkmark"
|
|
14928
14885
|
}) })]
|
|
14929
14886
|
});
|
|
14930
|
-
}
|
|
14931
|
-
SelectOption.displayName = "SelectOption_UI";
|
|
14887
|
+
};
|
|
14932
14888
|
//#endregion
|
|
14933
14889
|
//#region src/components/Select/SelectOptionGroup.tsx
|
|
14934
14890
|
const StyledLabel = styled(Select$1.GroupLabel)`
|
|
@@ -14974,14 +14930,13 @@ const StyledSidebar = styled.nav`
|
|
|
14974
14930
|
overflow: hidden;
|
|
14975
14931
|
border-right: 1px solid var(--wui-color-border);
|
|
14976
14932
|
`;
|
|
14977
|
-
const Sidebar =
|
|
14933
|
+
const Sidebar = ({ children, ref, ...props }) => {
|
|
14978
14934
|
return /* @__PURE__ */ jsx(StyledSidebar, {
|
|
14979
14935
|
ref,
|
|
14980
14936
|
...props,
|
|
14981
14937
|
children
|
|
14982
14938
|
});
|
|
14983
|
-
}
|
|
14984
|
-
Sidebar.displayName = "Sidebar_UI";
|
|
14939
|
+
};
|
|
14985
14940
|
//#endregion
|
|
14986
14941
|
//#region src/components/Sidebar/SidebarHeader.tsx
|
|
14987
14942
|
const StyledSidebarHeader = styled.div`
|
|
@@ -15121,7 +15076,7 @@ const StyledSidebarButton = styled(Button)`
|
|
|
15121
15076
|
${pressedButtonVariant};
|
|
15122
15077
|
}
|
|
15123
15078
|
`;
|
|
15124
|
-
const SidebarButton =
|
|
15079
|
+
const SidebarButton = ({ selected = false, ref, ...props }) => {
|
|
15125
15080
|
return /* @__PURE__ */ jsx(StyledSidebarButton, {
|
|
15126
15081
|
ref,
|
|
15127
15082
|
"aria-current": selected ? "page" : void 0,
|
|
@@ -15129,14 +15084,13 @@ const SidebarButton = forwardRef(({ selected = false, ...props }, ref) => {
|
|
|
15129
15084
|
"data-wui-sidebar-button": true,
|
|
15130
15085
|
...props
|
|
15131
15086
|
});
|
|
15132
|
-
}
|
|
15133
|
-
SidebarButton.displayName = "SidebarButton_UI";
|
|
15087
|
+
};
|
|
15134
15088
|
//#endregion
|
|
15135
15089
|
//#region src/components/Sidebar/SidebarSearchInput.tsx
|
|
15136
15090
|
const StyledSidebarSearchInputContainer = styled.div`
|
|
15137
15091
|
padding-inline: var(--wui-space-01);
|
|
15138
15092
|
`;
|
|
15139
|
-
const SidebarSearchInput =
|
|
15093
|
+
const SidebarSearchInput = ({ id, label = "Search navigation", ref, ...props }) => {
|
|
15140
15094
|
const generatedId = useId();
|
|
15141
15095
|
const inputId = id ?? generatedId;
|
|
15142
15096
|
return /* @__PURE__ */ jsxs(StyledSidebarSearchInputContainer, { children: [/* @__PURE__ */ jsx(Label, {
|
|
@@ -15149,8 +15103,7 @@ const SidebarSearchInput = forwardRef(({ id, label = "Search navigation", ...pro
|
|
|
15149
15103
|
type: "search",
|
|
15150
15104
|
...props
|
|
15151
15105
|
})] });
|
|
15152
|
-
}
|
|
15153
|
-
SidebarSearchInput.displayName = "SidebarSearchInput_UI";
|
|
15106
|
+
};
|
|
15154
15107
|
//#endregion
|
|
15155
15108
|
//#region src/components/Slider/Slider.tsx
|
|
15156
15109
|
const SliderContainer = styled.div`
|
|
@@ -15519,11 +15472,11 @@ const StyledTabsTrigger = styled(Tabs$1.Tab)`
|
|
|
15519
15472
|
`;
|
|
15520
15473
|
//#endregion
|
|
15521
15474
|
//#region src/components/Tabs/TabsTrigger.tsx
|
|
15522
|
-
const TabsTrigger =
|
|
15475
|
+
const TabsTrigger = ({ disabled = false, icon, label, "aria-label": ariaLabel, value, ref, ...otherProps }) => {
|
|
15523
15476
|
const selectedValue = useTabsValue();
|
|
15524
15477
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
15525
15478
|
const buttonRef = useRef(null);
|
|
15526
|
-
const combinedRef = mergeRefs([buttonRef,
|
|
15479
|
+
const combinedRef = mergeRefs([buttonRef, ref]);
|
|
15527
15480
|
useEffect(() => {
|
|
15528
15481
|
const buttonElem = buttonRef.current;
|
|
15529
15482
|
if (!buttonElem) return;
|
|
@@ -15558,8 +15511,7 @@ const TabsTrigger = forwardRef(({ disabled = false, icon, label, "aria-label": a
|
|
|
15558
15511
|
value,
|
|
15559
15512
|
children: [icon, label]
|
|
15560
15513
|
});
|
|
15561
|
-
}
|
|
15562
|
-
TabsTrigger.displayName = "TabsTrigger_UI";
|
|
15514
|
+
};
|
|
15563
15515
|
//#endregion
|
|
15564
15516
|
//#region src/components/Thumbnail/ThumbnailBadge.tsx
|
|
15565
15517
|
const StyledThumbnailBadge = styled.div`
|
|
@@ -15758,7 +15710,7 @@ const hasValidThumbnailUrl = (thumbnailUrl) => {
|
|
|
15758
15710
|
/**
|
|
15759
15711
|
* A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
|
|
15760
15712
|
*/
|
|
15761
|
-
const Thumbnail =
|
|
15713
|
+
const Thumbnail = ({ gradientBackground = "defaultMidOne", thumbnailImageType = "wide", thumbnailUrl, width = "100%", children, storyboard, height, aspectRatio = "wide", ref, ...props }) => {
|
|
15762
15714
|
const [percent, setPercent] = useState(0);
|
|
15763
15715
|
const [isMouseOver, setIsMouseOver] = useState(false);
|
|
15764
15716
|
const [isStoryboardReady, setIsStoryboardReady] = useState(false);
|
|
@@ -15831,8 +15783,7 @@ const Thumbnail = forwardRef(({ gradientBackground = "defaultMidOne", thumbnailI
|
|
|
15831
15783
|
children: [isNotNil(children) ? children : null, thumbnailContent]
|
|
15832
15784
|
})
|
|
15833
15785
|
});
|
|
15834
|
-
}
|
|
15835
|
-
Thumbnail.displayName = "Thumbnail_UI";
|
|
15786
|
+
};
|
|
15836
15787
|
//#endregion
|
|
15837
15788
|
//#region src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
15838
15789
|
const ThumbnailCollageContainer = styled.div`
|