@wistia/ui 0.6.11 → 0.6.12
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 +98 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +96 -80
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2484,6 +2484,10 @@ type BaseTabsProps = {
|
|
|
2484
2484
|
* When true, the tabs will span the full width of the container.
|
|
2485
2485
|
*/
|
|
2486
2486
|
fullWidth?: boolean;
|
|
2487
|
+
/**
|
|
2488
|
+
* When true, the tab headers will remain fixed at the top while the content scrolls.
|
|
2489
|
+
*/
|
|
2490
|
+
stickyHeaders?: boolean;
|
|
2487
2491
|
};
|
|
2488
2492
|
type ControlledTabsProps = BaseTabsProps & {
|
|
2489
2493
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2484,6 +2484,10 @@ type BaseTabsProps = {
|
|
|
2484
2484
|
* When true, the tabs will span the full width of the container.
|
|
2485
2485
|
*/
|
|
2486
2486
|
fullWidth?: boolean;
|
|
2487
|
+
/**
|
|
2488
|
+
* When true, the tab headers will remain fixed at the top while the content scrolls.
|
|
2489
|
+
*/
|
|
2490
|
+
stickyHeaders?: boolean;
|
|
2487
2491
|
};
|
|
2488
2492
|
type ControlledTabsProps = BaseTabsProps & {
|
|
2489
2493
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.6.
|
|
3
|
+
* @license @wistia/ui v0.6.12
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -10734,6 +10734,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
10734
10734
|
import { forwardRef as forwardRef24, useState as useState10 } from "react";
|
|
10735
10735
|
import { Root as TabsRoot } from "@radix-ui/react-tabs";
|
|
10736
10736
|
import { isNotNil as isNotNil22, isNil as isNil14 } from "@wistia/type-guards";
|
|
10737
|
+
import styled64 from "styled-components";
|
|
10737
10738
|
|
|
10738
10739
|
// src/components/Tabs/TabPanel.tsx
|
|
10739
10740
|
import styled60 from "styled-components";
|
|
@@ -10763,6 +10764,8 @@ var StyledTabList = styled61(RadixTabList)`
|
|
|
10763
10764
|
${segmentedControlStyles}
|
|
10764
10765
|
|
|
10765
10766
|
margin-bottom: var(--wui-space-04);
|
|
10767
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
10768
|
+
align-self: ${({ $fullWidth }) => $fullWidth ? "auto" : "flex-start"};
|
|
10766
10769
|
`;
|
|
10767
10770
|
var TabList = ({
|
|
10768
10771
|
children,
|
|
@@ -10917,6 +10920,22 @@ var SelectedItemIndicator2 = () => {
|
|
|
10917
10920
|
|
|
10918
10921
|
// src/components/Tabs/Tabs.tsx
|
|
10919
10922
|
import { jsx as jsx255, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10923
|
+
var TabsContainer = styled64.div`
|
|
10924
|
+
display: flex;
|
|
10925
|
+
flex-direction: column;
|
|
10926
|
+
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
10927
|
+
overflow: ${({ $stickyHeaders }) => $stickyHeaders ? "hidden" : "visible"};
|
|
10928
|
+
`;
|
|
10929
|
+
var StickyTabContent = styled64.div`
|
|
10930
|
+
flex: ${({ $stickyHeaders }) => $stickyHeaders ? "1" : "initial"};
|
|
10931
|
+
overflow-y: ${({ $stickyHeaders }) => $stickyHeaders ? "auto" : "visible"};
|
|
10932
|
+
overflow-x: ${({ $stickyHeaders }) => $stickyHeaders ? "hidden" : "visible"};
|
|
10933
|
+
`;
|
|
10934
|
+
var StyledTabsRoot = styled64(TabsRoot)`
|
|
10935
|
+
display: flex;
|
|
10936
|
+
flex-direction: column;
|
|
10937
|
+
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
10938
|
+
`;
|
|
10920
10939
|
var Tabs = forwardRef24(
|
|
10921
10940
|
({
|
|
10922
10941
|
children,
|
|
@@ -10925,6 +10944,7 @@ var Tabs = forwardRef24(
|
|
|
10925
10944
|
defaultSelectedValue,
|
|
10926
10945
|
selectedValue,
|
|
10927
10946
|
onSelectedValueChange,
|
|
10947
|
+
stickyHeaders = true,
|
|
10928
10948
|
...otherProps
|
|
10929
10949
|
}, ref) => {
|
|
10930
10950
|
const tabItems = extractTabItems(children);
|
|
@@ -10933,86 +10953,82 @@ var Tabs = forwardRef24(
|
|
|
10933
10953
|
defaultValue: defaultSelectedValue,
|
|
10934
10954
|
onValueChange: setInternalSelectedValue
|
|
10935
10955
|
} : { value: selectedValue, onValueChange: onSelectedValueChange };
|
|
10936
|
-
|
|
10937
|
-
|
|
10956
|
+
const currentValue = defaultSelectedValue !== void 0 ? internalSelectedValue : selectedValue;
|
|
10957
|
+
return /* @__PURE__ */ jsx255(TabsContainer, { $stickyHeaders: stickyHeaders, children: /* @__PURE__ */ jsx255(
|
|
10958
|
+
StyledTabsRoot,
|
|
10938
10959
|
{
|
|
10939
10960
|
ref,
|
|
10961
|
+
$stickyHeaders: stickyHeaders,
|
|
10940
10962
|
activationMode: "automatic",
|
|
10941
10963
|
...otherProps,
|
|
10942
10964
|
...modeProps,
|
|
10943
|
-
children: /* @__PURE__ */ jsx255(
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
{
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10965
|
+
children: /* @__PURE__ */ jsx255(TabsValueProvider, { value: currentValue, children: /* @__PURE__ */ jsxs37(SelectedItemMeasurementsProvider, { children: [
|
|
10966
|
+
/* @__PURE__ */ jsxs37(
|
|
10967
|
+
TabList,
|
|
10968
|
+
{
|
|
10969
|
+
ariaLabel,
|
|
10970
|
+
fullWidth,
|
|
10971
|
+
children: [
|
|
10972
|
+
/* @__PURE__ */ jsx255(SelectedItemIndicator2, {}),
|
|
10973
|
+
tabItems.map((tab) => {
|
|
10974
|
+
const {
|
|
10975
|
+
value,
|
|
10976
|
+
disabled = false,
|
|
10977
|
+
icon,
|
|
10978
|
+
label,
|
|
10979
|
+
"aria-label": ariaLabelForTab
|
|
10980
|
+
} = tab.props;
|
|
10981
|
+
if (isNil14(icon)) {
|
|
10982
|
+
return /* @__PURE__ */ jsx255(
|
|
10983
|
+
TabItem,
|
|
10984
|
+
{
|
|
10985
|
+
disabled,
|
|
10986
|
+
label,
|
|
10987
|
+
value
|
|
10988
|
+
},
|
|
10989
|
+
value
|
|
10990
|
+
);
|
|
10991
|
+
}
|
|
10992
|
+
if (isNotNil22(label)) {
|
|
10993
|
+
return /* @__PURE__ */ jsx255(
|
|
10994
|
+
TabItem,
|
|
10995
|
+
{
|
|
10996
|
+
disabled,
|
|
10959
10997
|
icon,
|
|
10960
10998
|
label,
|
|
10961
|
-
|
|
10962
|
-
}
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
icon,
|
|
10993
|
-
value
|
|
10994
|
-
},
|
|
10995
|
-
value
|
|
10996
|
-
);
|
|
10997
|
-
}
|
|
10998
|
-
throw new Error("A `Tab` with an icon must have either label or aria-label");
|
|
10999
|
-
})
|
|
11000
|
-
]
|
|
11001
|
-
}
|
|
11002
|
-
),
|
|
11003
|
-
tabItems.map((tab) => /* @__PURE__ */ jsx255(
|
|
11004
|
-
TabPanel,
|
|
11005
|
-
{
|
|
11006
|
-
value: tab.props.value,
|
|
11007
|
-
children: tab.props.children
|
|
11008
|
-
},
|
|
11009
|
-
tab.props.value
|
|
11010
|
-
))
|
|
11011
|
-
] })
|
|
11012
|
-
}
|
|
11013
|
-
)
|
|
10999
|
+
value
|
|
11000
|
+
},
|
|
11001
|
+
value
|
|
11002
|
+
);
|
|
11003
|
+
}
|
|
11004
|
+
if (isNotNil22(ariaLabelForTab)) {
|
|
11005
|
+
return /* @__PURE__ */ jsx255(
|
|
11006
|
+
TabItem,
|
|
11007
|
+
{
|
|
11008
|
+
"aria-label": ariaLabelForTab,
|
|
11009
|
+
disabled,
|
|
11010
|
+
icon,
|
|
11011
|
+
value
|
|
11012
|
+
},
|
|
11013
|
+
value
|
|
11014
|
+
);
|
|
11015
|
+
}
|
|
11016
|
+
throw new Error("A `Tab` with an icon must have either label or aria-label");
|
|
11017
|
+
})
|
|
11018
|
+
]
|
|
11019
|
+
}
|
|
11020
|
+
),
|
|
11021
|
+
/* @__PURE__ */ jsx255(StickyTabContent, { $stickyHeaders: stickyHeaders, children: tabItems.map((tab) => /* @__PURE__ */ jsx255(
|
|
11022
|
+
TabPanel,
|
|
11023
|
+
{
|
|
11024
|
+
value: tab.props.value,
|
|
11025
|
+
children: tab.props.children
|
|
11026
|
+
},
|
|
11027
|
+
tab.props.value
|
|
11028
|
+
)) })
|
|
11029
|
+
] }) })
|
|
11014
11030
|
}
|
|
11015
|
-
);
|
|
11031
|
+
) });
|
|
11016
11032
|
}
|
|
11017
11033
|
);
|
|
11018
11034
|
Tabs.displayName = "Tabs";
|
|
@@ -11027,10 +11043,10 @@ Tab.displayName = "Tab";
|
|
|
11027
11043
|
|
|
11028
11044
|
// src/components/Tag/Tag.tsx
|
|
11029
11045
|
import { forwardRef as forwardRef26 } from "react";
|
|
11030
|
-
import
|
|
11046
|
+
import styled65 from "styled-components";
|
|
11031
11047
|
import { isNil as isNil15, isNotNil as isNotNil23, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
11032
11048
|
import { Fragment as Fragment8, jsx as jsx257, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
11033
|
-
var TagLabel =
|
|
11049
|
+
var TagLabel = styled65.a`
|
|
11034
11050
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11035
11051
|
font-size: var(--wui-typography-label-4-size);
|
|
11036
11052
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -11058,14 +11074,14 @@ var TagLabel = styled64.a`
|
|
|
11058
11074
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
11059
11075
|
}
|
|
11060
11076
|
`;
|
|
11061
|
-
var TagDivider =
|
|
11077
|
+
var TagDivider = styled65.div`
|
|
11062
11078
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11063
11079
|
border-left: 1px solid var(--wui-color-border);
|
|
11064
11080
|
display: flex;
|
|
11065
11081
|
height: 14px;
|
|
11066
11082
|
width: 1px;
|
|
11067
11083
|
`;
|
|
11068
|
-
var StyledRemoveButton =
|
|
11084
|
+
var StyledRemoveButton = styled65.button`
|
|
11069
11085
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11070
11086
|
all: unset;
|
|
11071
11087
|
cursor: pointer;
|
|
@@ -11093,7 +11109,7 @@ var StyledRemoveButton = styled64.button`
|
|
|
11093
11109
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
11094
11110
|
}
|
|
11095
11111
|
`;
|
|
11096
|
-
var StyledTag =
|
|
11112
|
+
var StyledTag = styled65.div`
|
|
11097
11113
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11098
11114
|
align-items: center;
|
|
11099
11115
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -11170,7 +11186,7 @@ var Tag = forwardRef26(
|
|
|
11170
11186
|
Tag.displayName = "Tag";
|
|
11171
11187
|
|
|
11172
11188
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
11173
|
-
import
|
|
11189
|
+
import styled66, { css as css30 } from "styled-components";
|
|
11174
11190
|
import { isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
11175
11191
|
import { jsx as jsx258, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
11176
11192
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
@@ -11212,7 +11228,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
11212
11228
|
}
|
|
11213
11229
|
return "0 0 144 31.47";
|
|
11214
11230
|
};
|
|
11215
|
-
var WistiaLogoComponent =
|
|
11231
|
+
var WistiaLogoComponent = styled66.svg`
|
|
11216
11232
|
height: ${({ height }) => `${height}px`};
|
|
11217
11233
|
|
|
11218
11234
|
/* ensure it will always fit on mobile */
|