@wistia/ui 0.5.6-beta.b018fac4.4285d92 → 0.5.6-beta.cccfda76.bed4cef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +238 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +216 -123
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.5.6-beta.
|
|
3
|
+
* @license @wistia/ui v0.5.6-beta.cccfda76.bed4cef
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -9503,13 +9503,10 @@ var SelectedItemIndicatorDiv = import_styled_components61.default.div`
|
|
|
9503
9503
|
left: 0;
|
|
9504
9504
|
position: absolute;
|
|
9505
9505
|
top: 0;
|
|
9506
|
+
transition:
|
|
9507
|
+
transform var(--wui-motion-duration-03) var(--wui-motion-ease-out),
|
|
9508
|
+
width var(--wui-motion-duration-02) var(--wui-motion-ease-out);
|
|
9506
9509
|
z-index: ${Z_INDEX_TO_SIT_BEHIND_SIBLINGS};
|
|
9507
|
-
|
|
9508
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
9509
|
-
transition:
|
|
9510
|
-
transform var(--wui-motion-duration-03) var(--wui-motion-ease-in),
|
|
9511
|
-
width var(--wui-motion-duration-02) var(--wui-motion-ease-in);
|
|
9512
|
-
}
|
|
9513
9510
|
`;
|
|
9514
9511
|
var SelectedItemIndicator = () => {
|
|
9515
9512
|
const selectedValue = useSegmentedControlValue();
|
|
@@ -9618,8 +9615,9 @@ var segmentedControlItemStyles = import_styled_components63.css`
|
|
|
9618
9615
|
flex-grow: 1;
|
|
9619
9616
|
flex-shrink: 1;
|
|
9620
9617
|
font-size: var(--wui-typography-label-3-size);
|
|
9618
|
+
font-weight: var(--wui-typography-label-3-weight);
|
|
9621
9619
|
justify-content: center;
|
|
9622
|
-
padding: 6px 8px;
|
|
9620
|
+
padding: 6px ${({ $hasLabel }) => $hasLabel ? "8px" : "6px"};
|
|
9623
9621
|
user-select: none;
|
|
9624
9622
|
|
|
9625
9623
|
/* Icon component */
|
|
@@ -9656,6 +9654,10 @@ var segmentedControlItemStyles = import_styled_components63.css`
|
|
|
9656
9654
|
|
|
9657
9655
|
&[data-disabled] {
|
|
9658
9656
|
cursor: not-allowed;
|
|
9657
|
+
color: var(--wui-color-text-disabled);
|
|
9658
|
+
svg path {
|
|
9659
|
+
fill: var(--wui-color-icon-disabled);
|
|
9660
|
+
}
|
|
9659
9661
|
|
|
9660
9662
|
&:hover {
|
|
9661
9663
|
background-color: inherit;
|
|
@@ -9723,7 +9725,7 @@ var SegmentedControlItem = (0, import_react47.forwardRef)(
|
|
|
9723
9725
|
SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
9724
9726
|
|
|
9725
9727
|
// src/components/Tabs/Tabs.tsx
|
|
9726
|
-
var
|
|
9728
|
+
var import_react52 = require("react");
|
|
9727
9729
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
9728
9730
|
var import_type_guards39 = require("@wistia/type-guards");
|
|
9729
9731
|
|
|
@@ -9775,24 +9777,67 @@ var TabList = ({
|
|
|
9775
9777
|
TabList.displayName = "TabList";
|
|
9776
9778
|
|
|
9777
9779
|
// src/components/Tabs/TabItem.tsx
|
|
9778
|
-
var
|
|
9780
|
+
var import_react49 = require("react");
|
|
9779
9781
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
9780
9782
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
9781
9783
|
var import_type_guards38 = require("@wistia/type-guards");
|
|
9784
|
+
|
|
9785
|
+
// src/components/Tabs/useTabsValue.tsx
|
|
9786
|
+
var import_react48 = require("react");
|
|
9787
|
+
var TabsValueContext = (0, import_react48.createContext)(null);
|
|
9788
|
+
var TabsValueProvider = TabsValueContext.Provider;
|
|
9789
|
+
var useTabsValue = () => {
|
|
9790
|
+
const context = (0, import_react48.useContext)(TabsValueContext);
|
|
9791
|
+
if (context === null) {
|
|
9792
|
+
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
9793
|
+
}
|
|
9794
|
+
return context;
|
|
9795
|
+
};
|
|
9796
|
+
|
|
9797
|
+
// src/components/Tabs/TabItem.tsx
|
|
9782
9798
|
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
9783
9799
|
var StyledTabItem = (0, import_styled_components66.default)(import_react_tabs3.Trigger)`
|
|
9784
9800
|
${segmentedControlItemStyles}
|
|
9785
9801
|
|
|
9786
|
-
|
|
9787
|
-
|
|
9802
|
+
&:focus-visible {
|
|
9803
|
+
outline: none;
|
|
9788
9804
|
}
|
|
9789
9805
|
`;
|
|
9790
|
-
var TabItem = (0,
|
|
9791
|
-
({ disabled = false, icon, label, "aria-label": ariaLabel, value },
|
|
9806
|
+
var TabItem = (0, import_react49.forwardRef)(
|
|
9807
|
+
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
9808
|
+
const selectedValue = useTabsValue();
|
|
9809
|
+
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
9810
|
+
const buttonRef = (0, import_react49.useRef)(null);
|
|
9811
|
+
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
9812
|
+
(0, import_react49.useEffect)(() => {
|
|
9813
|
+
const buttonElem = buttonRef.current;
|
|
9814
|
+
if (!buttonElem) {
|
|
9815
|
+
return void 0;
|
|
9816
|
+
}
|
|
9817
|
+
if (selectedValue !== value) {
|
|
9818
|
+
return void 0;
|
|
9819
|
+
}
|
|
9820
|
+
setSelectedItemMeasurements({
|
|
9821
|
+
offsetLeft: buttonElem.offsetLeft,
|
|
9822
|
+
offsetWidth: buttonElem.offsetWidth,
|
|
9823
|
+
offsetHeight: buttonElem.offsetHeight
|
|
9824
|
+
});
|
|
9825
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
9826
|
+
setSelectedItemMeasurements({
|
|
9827
|
+
offsetLeft: buttonElem.offsetLeft,
|
|
9828
|
+
offsetWidth: buttonElem.offsetWidth,
|
|
9829
|
+
offsetHeight: buttonElem.offsetHeight
|
|
9830
|
+
});
|
|
9831
|
+
});
|
|
9832
|
+
resizeObserver.observe(buttonElem);
|
|
9833
|
+
return () => {
|
|
9834
|
+
resizeObserver.disconnect();
|
|
9835
|
+
};
|
|
9836
|
+
}, [selectedValue, setSelectedItemMeasurements, value]);
|
|
9792
9837
|
return /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(
|
|
9793
9838
|
StyledTabItem,
|
|
9794
9839
|
{
|
|
9795
|
-
ref,
|
|
9840
|
+
ref: combinedRef,
|
|
9796
9841
|
$hasLabel: (0, import_type_guards38.isNotNil)(label),
|
|
9797
9842
|
"aria-label": (0, import_type_guards38.isNotNil)(label) ? void 0 : ariaLabel,
|
|
9798
9843
|
disabled,
|
|
@@ -9808,16 +9853,16 @@ var TabItem = (0, import_react48.forwardRef)(
|
|
|
9808
9853
|
TabItem.displayName = "TabItem";
|
|
9809
9854
|
|
|
9810
9855
|
// src/components/Tabs/extractTabItems.ts
|
|
9811
|
-
var
|
|
9856
|
+
var import_react50 = require("react");
|
|
9812
9857
|
var extractTabItems = (children) => {
|
|
9813
9858
|
const tabItems = [];
|
|
9814
|
-
|
|
9815
|
-
if (!(0,
|
|
9859
|
+
import_react50.Children.forEach(children, (child) => {
|
|
9860
|
+
if (!(0, import_react50.isValidElement)(child)) {
|
|
9816
9861
|
return;
|
|
9817
9862
|
}
|
|
9818
9863
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
9819
9864
|
tabItems.push(child);
|
|
9820
|
-
} else if (child.type ===
|
|
9865
|
+
} else if (child.type === import_react50.Fragment) {
|
|
9821
9866
|
const fragmentElement = child;
|
|
9822
9867
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
9823
9868
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -9829,9 +9874,44 @@ var extractTabItems = (children) => {
|
|
|
9829
9874
|
return tabItems;
|
|
9830
9875
|
};
|
|
9831
9876
|
|
|
9832
|
-
// src/components/Tabs/
|
|
9877
|
+
// src/components/Tabs/SelectedItemIndicator.tsx
|
|
9878
|
+
var import_react51 = require("react");
|
|
9879
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9833
9880
|
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
9834
|
-
var
|
|
9881
|
+
var TabsSelectedItemIndicatorDiv = (0, import_styled_components67.default)(SelectedItemIndicatorDiv)`
|
|
9882
|
+
&:has(~ ${StyledTabItem}:focus-visible) {
|
|
9883
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
9884
|
+
}
|
|
9885
|
+
`;
|
|
9886
|
+
var SelectedItemIndicator2 = () => {
|
|
9887
|
+
const { selectedItemMeasurements } = useSelectedItemMeasurements();
|
|
9888
|
+
const selectedValue = useTabsValue();
|
|
9889
|
+
const selectedItemIndicatorStyle = (0, import_react51.useMemo)(
|
|
9890
|
+
() => selectedItemMeasurements != null ? {
|
|
9891
|
+
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
9892
|
+
transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
|
|
9893
|
+
width: `${selectedItemMeasurements.offsetWidth}px`
|
|
9894
|
+
} : {},
|
|
9895
|
+
[selectedItemMeasurements]
|
|
9896
|
+
);
|
|
9897
|
+
if (selectedValue == null) {
|
|
9898
|
+
return null;
|
|
9899
|
+
}
|
|
9900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
9901
|
+
TabsSelectedItemIndicatorDiv,
|
|
9902
|
+
{
|
|
9903
|
+
style: {
|
|
9904
|
+
width: selectedItemIndicatorStyle.width,
|
|
9905
|
+
transform: selectedItemIndicatorStyle.transform,
|
|
9906
|
+
height: selectedItemIndicatorStyle.height
|
|
9907
|
+
}
|
|
9908
|
+
}
|
|
9909
|
+
);
|
|
9910
|
+
};
|
|
9911
|
+
|
|
9912
|
+
// src/components/Tabs/Tabs.tsx
|
|
9913
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
9914
|
+
var Tabs = (0, import_react52.forwardRef)(
|
|
9835
9915
|
({
|
|
9836
9916
|
children,
|
|
9837
9917
|
fullWidth = true,
|
|
@@ -9842,76 +9922,89 @@ var Tabs = (0, import_react50.forwardRef)(
|
|
|
9842
9922
|
...otherProps
|
|
9843
9923
|
}, ref) => {
|
|
9844
9924
|
const tabItems = extractTabItems(children);
|
|
9845
|
-
const
|
|
9846
|
-
|
|
9925
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react52.useState)(defaultSelectedValue);
|
|
9926
|
+
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
9927
|
+
defaultValue: defaultSelectedValue,
|
|
9928
|
+
onValueChange: setInternalSelectedValue
|
|
9929
|
+
} : { value: selectedValue, onValueChange: onSelectedValueChange };
|
|
9930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9847
9931
|
import_react_tabs4.Root,
|
|
9848
9932
|
{
|
|
9849
9933
|
ref,
|
|
9850
9934
|
activationMode: "automatic",
|
|
9851
9935
|
...otherProps,
|
|
9852
9936
|
...modeProps,
|
|
9853
|
-
children:
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
label
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9937
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9938
|
+
TabsValueProvider,
|
|
9939
|
+
{
|
|
9940
|
+
value: defaultSelectedValue !== void 0 ? internalSelectedValue : selectedValue,
|
|
9941
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(SelectedItemMeasurementsProvider, { children: [
|
|
9942
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(
|
|
9943
|
+
TabList,
|
|
9944
|
+
{
|
|
9945
|
+
ariaLabel,
|
|
9946
|
+
fullWidth,
|
|
9947
|
+
children: [
|
|
9948
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(SelectedItemIndicator2, {}),
|
|
9949
|
+
tabItems.map((tab) => {
|
|
9950
|
+
const {
|
|
9951
|
+
value,
|
|
9952
|
+
disabled = false,
|
|
9953
|
+
icon,
|
|
9954
|
+
label,
|
|
9955
|
+
"aria-label": ariaLabelForTab
|
|
9956
|
+
} = tab.props;
|
|
9957
|
+
if ((0, import_type_guards39.isNil)(icon)) {
|
|
9958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9959
|
+
TabItem,
|
|
9960
|
+
{
|
|
9961
|
+
disabled,
|
|
9962
|
+
label,
|
|
9963
|
+
value
|
|
9964
|
+
},
|
|
9965
|
+
value
|
|
9966
|
+
);
|
|
9967
|
+
}
|
|
9968
|
+
if ((0, import_type_guards39.isNotNil)(label)) {
|
|
9969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9970
|
+
TabItem,
|
|
9971
|
+
{
|
|
9972
|
+
disabled,
|
|
9973
|
+
icon,
|
|
9974
|
+
label,
|
|
9975
|
+
value
|
|
9976
|
+
},
|
|
9977
|
+
value
|
|
9978
|
+
);
|
|
9979
|
+
}
|
|
9980
|
+
if ((0, import_type_guards39.isNotNil)(ariaLabelForTab)) {
|
|
9981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9982
|
+
TabItem,
|
|
9983
|
+
{
|
|
9984
|
+
"aria-label": ariaLabelForTab,
|
|
9985
|
+
disabled,
|
|
9986
|
+
icon,
|
|
9987
|
+
value
|
|
9988
|
+
},
|
|
9989
|
+
value
|
|
9990
|
+
);
|
|
9991
|
+
}
|
|
9992
|
+
throw new Error("A `Tab` with an icon must have either label or aria-label");
|
|
9993
|
+
})
|
|
9994
|
+
]
|
|
9901
9995
|
}
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
}
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
]
|
|
9996
|
+
),
|
|
9997
|
+
tabItems.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9998
|
+
TabPanel,
|
|
9999
|
+
{
|
|
10000
|
+
value: tab.props.value,
|
|
10001
|
+
children: tab.props.children
|
|
10002
|
+
},
|
|
10003
|
+
tab.props.value
|
|
10004
|
+
))
|
|
10005
|
+
] })
|
|
10006
|
+
}
|
|
10007
|
+
)
|
|
9915
10008
|
}
|
|
9916
10009
|
);
|
|
9917
10010
|
}
|
|
@@ -9919,19 +10012,19 @@ var Tabs = (0, import_react50.forwardRef)(
|
|
|
9919
10012
|
Tabs.displayName = "Tabs";
|
|
9920
10013
|
|
|
9921
10014
|
// src/components/Tabs/Tab.tsx
|
|
9922
|
-
var
|
|
9923
|
-
var
|
|
9924
|
-
var Tab = (0,
|
|
9925
|
-
return /* @__PURE__ */ (0,
|
|
10015
|
+
var import_react53 = require("react");
|
|
10016
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
10017
|
+
var Tab = (0, import_react53.forwardRef)(({ children }, ref) => {
|
|
10018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { ref, children });
|
|
9926
10019
|
});
|
|
9927
10020
|
Tab.displayName = "Tab";
|
|
9928
10021
|
|
|
9929
10022
|
// src/components/Tag/Tag.tsx
|
|
9930
|
-
var
|
|
9931
|
-
var
|
|
10023
|
+
var import_react54 = require("react");
|
|
10024
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
9932
10025
|
var import_type_guards40 = require("@wistia/type-guards");
|
|
9933
|
-
var
|
|
9934
|
-
var TagLabel =
|
|
10026
|
+
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
10027
|
+
var TagLabel = import_styled_components68.default.a`
|
|
9935
10028
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9936
10029
|
font-size: var(--wui-typography-label-4-size);
|
|
9937
10030
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -9959,14 +10052,14 @@ var TagLabel = import_styled_components67.default.a`
|
|
|
9959
10052
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9960
10053
|
}
|
|
9961
10054
|
`;
|
|
9962
|
-
var TagDivider =
|
|
10055
|
+
var TagDivider = import_styled_components68.default.div`
|
|
9963
10056
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9964
10057
|
border-left: 1px solid var(--wui-color-border);
|
|
9965
10058
|
display: flex;
|
|
9966
10059
|
height: 14px;
|
|
9967
10060
|
width: 1px;
|
|
9968
10061
|
`;
|
|
9969
|
-
var StyledRemoveButton =
|
|
10062
|
+
var StyledRemoveButton = import_styled_components68.default.button`
|
|
9970
10063
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9971
10064
|
all: unset;
|
|
9972
10065
|
cursor: pointer;
|
|
@@ -9994,7 +10087,7 @@ var StyledRemoveButton = import_styled_components67.default.button`
|
|
|
9994
10087
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
9995
10088
|
}
|
|
9996
10089
|
`;
|
|
9997
|
-
var StyledTag =
|
|
10090
|
+
var StyledTag = import_styled_components68.default.div`
|
|
9998
10091
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9999
10092
|
align-items: center;
|
|
10000
10093
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -10015,39 +10108,39 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
10015
10108
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
10016
10109
|
);
|
|
10017
10110
|
}
|
|
10018
|
-
return /* @__PURE__ */ (0,
|
|
10019
|
-
/* @__PURE__ */ (0,
|
|
10020
|
-
/* @__PURE__ */ (0,
|
|
10111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(import_jsx_runtime221.Fragment, { children: [
|
|
10112
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
10113
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
|
|
10021
10114
|
StyledRemoveButton,
|
|
10022
10115
|
{
|
|
10023
10116
|
$colorScheme: colorScheme,
|
|
10024
10117
|
onClick: onClickRemove,
|
|
10025
10118
|
type: "button",
|
|
10026
10119
|
children: [
|
|
10027
|
-
/* @__PURE__ */ (0,
|
|
10120
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
10028
10121
|
Icon,
|
|
10029
10122
|
{
|
|
10030
10123
|
size: "sm",
|
|
10031
10124
|
type: "close"
|
|
10032
10125
|
}
|
|
10033
10126
|
),
|
|
10034
|
-
/* @__PURE__ */ (0,
|
|
10127
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
10035
10128
|
]
|
|
10036
10129
|
}
|
|
10037
10130
|
)
|
|
10038
10131
|
] });
|
|
10039
10132
|
};
|
|
10040
|
-
var Tag = (0,
|
|
10133
|
+
var Tag = (0, import_react54.forwardRef)(
|
|
10041
10134
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
10042
10135
|
const labelProps = (0, import_type_guards40.isNotNil)(href) && (0, import_type_guards40.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
10043
|
-
return /* @__PURE__ */ (0,
|
|
10136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
|
|
10044
10137
|
StyledTag,
|
|
10045
10138
|
{
|
|
10046
10139
|
ref,
|
|
10047
10140
|
$colorScheme: colorScheme,
|
|
10048
10141
|
...otherProps,
|
|
10049
10142
|
children: [
|
|
10050
|
-
/* @__PURE__ */ (0,
|
|
10143
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
10051
10144
|
TagLabel,
|
|
10052
10145
|
{
|
|
10053
10146
|
...labelProps,
|
|
@@ -10055,7 +10148,7 @@ var Tag = (0, import_react52.forwardRef)(
|
|
|
10055
10148
|
children: label
|
|
10056
10149
|
}
|
|
10057
10150
|
),
|
|
10058
|
-
/* @__PURE__ */ (0,
|
|
10151
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
10059
10152
|
RemoveButton,
|
|
10060
10153
|
{
|
|
10061
10154
|
colorScheme,
|
|
@@ -10071,26 +10164,26 @@ var Tag = (0, import_react52.forwardRef)(
|
|
|
10071
10164
|
Tag.displayName = "Tag";
|
|
10072
10165
|
|
|
10073
10166
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
10074
|
-
var
|
|
10167
|
+
var import_styled_components69 = __toESM(require("styled-components"));
|
|
10075
10168
|
var import_type_guards41 = require("@wistia/type-guards");
|
|
10076
|
-
var
|
|
10169
|
+
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
10077
10170
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
10078
10171
|
if (iconOnly) {
|
|
10079
|
-
return /* @__PURE__ */ (0,
|
|
10172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
10080
10173
|
"g",
|
|
10081
10174
|
{
|
|
10082
10175
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
10083
10176
|
fill: brandmarkColor,
|
|
10084
|
-
children: /* @__PURE__ */ (0,
|
|
10177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
10085
10178
|
}
|
|
10086
10179
|
);
|
|
10087
10180
|
}
|
|
10088
|
-
return /* @__PURE__ */ (0,
|
|
10181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
10089
10182
|
"g",
|
|
10090
10183
|
{
|
|
10091
10184
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
10092
10185
|
fill: brandmarkColor,
|
|
10093
|
-
children: /* @__PURE__ */ (0,
|
|
10186
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
10094
10187
|
}
|
|
10095
10188
|
);
|
|
10096
10189
|
};
|
|
@@ -10098,12 +10191,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
10098
10191
|
if (iconOnly) {
|
|
10099
10192
|
return null;
|
|
10100
10193
|
}
|
|
10101
|
-
return /* @__PURE__ */ (0,
|
|
10194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
10102
10195
|
"g",
|
|
10103
10196
|
{
|
|
10104
10197
|
"data-testid": "ui-wistia-logo-logotype",
|
|
10105
10198
|
fill: logotypeColor,
|
|
10106
|
-
children: /* @__PURE__ */ (0,
|
|
10199
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
|
|
10107
10200
|
}
|
|
10108
10201
|
);
|
|
10109
10202
|
};
|
|
@@ -10113,7 +10206,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
10113
10206
|
}
|
|
10114
10207
|
return "0 0 144 31.47";
|
|
10115
10208
|
};
|
|
10116
|
-
var WistiaLogoComponent =
|
|
10209
|
+
var WistiaLogoComponent = import_styled_components69.default.svg`
|
|
10117
10210
|
height: ${({ height }) => `${height}px`};
|
|
10118
10211
|
|
|
10119
10212
|
/* ensure it will always fit on mobile */
|
|
@@ -10155,7 +10248,7 @@ var WistiaLogo = ({
|
|
|
10155
10248
|
};
|
|
10156
10249
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
10157
10250
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
10158
|
-
const Logo = /* @__PURE__ */ (0,
|
|
10251
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
|
|
10159
10252
|
WistiaLogoComponent,
|
|
10160
10253
|
{
|
|
10161
10254
|
$hoverColor: hoverColor,
|
|
@@ -10165,23 +10258,23 @@ var WistiaLogo = ({
|
|
|
10165
10258
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10166
10259
|
...otherProps,
|
|
10167
10260
|
children: [
|
|
10168
|
-
/* @__PURE__ */ (0,
|
|
10169
|
-
(0, import_type_guards41.isNotNil)(description) ? /* @__PURE__ */ (0,
|
|
10261
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("title", { children: title }),
|
|
10262
|
+
(0, import_type_guards41.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("desc", { children: description }) : null,
|
|
10170
10263
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
10171
10264
|
renderLogotype(logotypeColor, iconOnly)
|
|
10172
10265
|
]
|
|
10173
10266
|
}
|
|
10174
10267
|
);
|
|
10175
|
-
return href !== void 0 ? /* @__PURE__ */ (0,
|
|
10268
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("a", { href, children: Logo }) : Logo;
|
|
10176
10269
|
};
|
|
10177
10270
|
WistiaLogo.displayName = "WistiaLogo";
|
|
10178
10271
|
|
|
10179
10272
|
// src/components/Select/Select.tsx
|
|
10180
10273
|
var import_react_select = require("@radix-ui/react-select");
|
|
10181
|
-
var
|
|
10182
|
-
var
|
|
10183
|
-
var
|
|
10184
|
-
var StyledTrigger = (0,
|
|
10274
|
+
var import_react55 = require("react");
|
|
10275
|
+
var import_styled_components70 = __toESM(require("styled-components"));
|
|
10276
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
10277
|
+
var StyledTrigger = (0, import_styled_components70.default)(import_react_select.Trigger)`
|
|
10185
10278
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
10186
10279
|
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
10187
10280
|
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -10222,7 +10315,7 @@ var StyledTrigger = (0, import_styled_components69.default)(import_react_select.
|
|
|
10222
10315
|
background-color: var(--wui-color-bg-surface-disabled);
|
|
10223
10316
|
}
|
|
10224
10317
|
`;
|
|
10225
|
-
var StyledContent2 = (0,
|
|
10318
|
+
var StyledContent2 = (0, import_styled_components70.default)(import_react_select.Content)`
|
|
10226
10319
|
--wui-select-content-border: var(--wui-color-border);
|
|
10227
10320
|
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
10228
10321
|
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -10238,7 +10331,7 @@ var StyledContent2 = (0, import_styled_components69.default)(import_react_select
|
|
|
10238
10331
|
padding: var(--wui-select-option-padding);
|
|
10239
10332
|
min-width: 200px;
|
|
10240
10333
|
`;
|
|
10241
|
-
var Select = (0,
|
|
10334
|
+
var Select = (0, import_react55.forwardRef)(
|
|
10242
10335
|
({
|
|
10243
10336
|
colorScheme = "inherit",
|
|
10244
10337
|
children,
|
|
@@ -10248,13 +10341,13 @@ var Select = (0, import_react53.forwardRef)(
|
|
|
10248
10341
|
...props
|
|
10249
10342
|
}, forwardedRef) => {
|
|
10250
10343
|
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
10251
|
-
return /* @__PURE__ */ (0,
|
|
10344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(
|
|
10252
10345
|
import_react_select.Root,
|
|
10253
10346
|
{
|
|
10254
10347
|
...props,
|
|
10255
10348
|
onValueChange: onChange,
|
|
10256
10349
|
children: [
|
|
10257
|
-
/* @__PURE__ */ (0,
|
|
10350
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(
|
|
10258
10351
|
StyledTrigger,
|
|
10259
10352
|
{
|
|
10260
10353
|
ref: forwardedRef,
|
|
@@ -10262,8 +10355,8 @@ var Select = (0, import_react53.forwardRef)(
|
|
|
10262
10355
|
$fullWidth: responsiveFullWidth,
|
|
10263
10356
|
...props,
|
|
10264
10357
|
children: [
|
|
10265
|
-
/* @__PURE__ */ (0,
|
|
10266
|
-
/* @__PURE__ */ (0,
|
|
10358
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_select.Value, { placeholder }),
|
|
10359
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
10267
10360
|
Icon,
|
|
10268
10361
|
{
|
|
10269
10362
|
size: "md",
|
|
@@ -10273,10 +10366,10 @@ var Select = (0, import_react53.forwardRef)(
|
|
|
10273
10366
|
]
|
|
10274
10367
|
}
|
|
10275
10368
|
),
|
|
10276
|
-
/* @__PURE__ */ (0,
|
|
10277
|
-
/* @__PURE__ */ (0,
|
|
10278
|
-
/* @__PURE__ */ (0,
|
|
10279
|
-
/* @__PURE__ */ (0,
|
|
10369
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(StyledContent2, { position: "popper", children: [
|
|
10370
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Icon, { type: "caret-up" }) }),
|
|
10371
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_select.Viewport, { children }),
|
|
10372
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Icon, { type: "caret-down" }) })
|
|
10280
10373
|
] }) })
|
|
10281
10374
|
]
|
|
10282
10375
|
}
|
|
@@ -10287,10 +10380,10 @@ Select.displayName = "Select";
|
|
|
10287
10380
|
|
|
10288
10381
|
// src/components/Select/SelectOption.tsx
|
|
10289
10382
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
10290
|
-
var
|
|
10291
|
-
var
|
|
10292
|
-
var
|
|
10293
|
-
var StyledItem = (0,
|
|
10383
|
+
var import_react56 = require("react");
|
|
10384
|
+
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10385
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
10386
|
+
var StyledItem = (0, import_styled_components71.default)(import_react_select2.Item)`
|
|
10294
10387
|
${variantStyleMap2.body3};
|
|
10295
10388
|
display: flex;
|
|
10296
10389
|
padding: var(--wui-select-option-padding);
|
|
@@ -10313,25 +10406,25 @@ var StyledItem = (0, import_styled_components70.default)(import_react_select2.It
|
|
|
10313
10406
|
background-color: transparent;
|
|
10314
10407
|
}
|
|
10315
10408
|
`;
|
|
10316
|
-
var StyledIconContainer =
|
|
10409
|
+
var StyledIconContainer = import_styled_components71.default.span`
|
|
10317
10410
|
width: 12px;
|
|
10318
10411
|
`;
|
|
10319
|
-
var SelectOption = (0,
|
|
10412
|
+
var SelectOption = (0, import_react56.forwardRef)(
|
|
10320
10413
|
({ children, ...props }, forwardedRef) => {
|
|
10321
|
-
return /* @__PURE__ */ (0,
|
|
10414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
|
|
10322
10415
|
StyledItem,
|
|
10323
10416
|
{
|
|
10324
10417
|
...props,
|
|
10325
10418
|
ref: forwardedRef,
|
|
10326
10419
|
children: [
|
|
10327
|
-
/* @__PURE__ */ (0,
|
|
10420
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(StyledIconContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_select2.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
10328
10421
|
Icon,
|
|
10329
10422
|
{
|
|
10330
10423
|
size: "sm",
|
|
10331
10424
|
type: "checkmark"
|
|
10332
10425
|
}
|
|
10333
10426
|
) }) }),
|
|
10334
|
-
/* @__PURE__ */ (0,
|
|
10427
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_select2.ItemText, { children })
|
|
10335
10428
|
]
|
|
10336
10429
|
}
|
|
10337
10430
|
);
|
|
@@ -10341,14 +10434,14 @@ SelectOption.displayName = "Option";
|
|
|
10341
10434
|
|
|
10342
10435
|
// src/components/Select/SelectOptionGroup.tsx
|
|
10343
10436
|
var import_react_select3 = require("@radix-ui/react-select");
|
|
10344
|
-
var
|
|
10345
|
-
var
|
|
10346
|
-
var StyledLabel4 = (0,
|
|
10437
|
+
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10438
|
+
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
10439
|
+
var StyledLabel4 = (0, import_styled_components72.default)(import_react_select3.Label)`
|
|
10347
10440
|
padding: var(--wui-select-option-padding);
|
|
10348
10441
|
`;
|
|
10349
10442
|
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
10350
|
-
return /* @__PURE__ */ (0,
|
|
10351
|
-
/* @__PURE__ */ (0,
|
|
10443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(import_react_select3.Group, { ...props, children: [
|
|
10444
|
+
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)(StyledLabel4, { children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
10352
10445
|
Text,
|
|
10353
10446
|
{
|
|
10354
10447
|
prominence: "secondary",
|