@wistia/ui 0.0.19 → 0.0.20
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 +180 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +88 -1
- package/dist/index.d.ts +88 -1
- package/dist/index.mjs +176 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
package/dist/index.d.mts
CHANGED
|
@@ -1392,6 +1392,93 @@ declare const CheckboxMenuItem: {
|
|
|
1392
1392
|
displayName: string;
|
|
1393
1393
|
};
|
|
1394
1394
|
|
|
1395
|
+
type RadioProps = ComponentPropsWithoutRef<'input'> & {
|
|
1396
|
+
/**
|
|
1397
|
+
* Indicates the state of the radio
|
|
1398
|
+
*/
|
|
1399
|
+
checked?: boolean;
|
|
1400
|
+
/**
|
|
1401
|
+
* Disables input
|
|
1402
|
+
*/
|
|
1403
|
+
disabled?: boolean;
|
|
1404
|
+
/**
|
|
1405
|
+
* Indicates that there is an error with the input
|
|
1406
|
+
*/
|
|
1407
|
+
hasError?: boolean;
|
|
1408
|
+
/**
|
|
1409
|
+
* Provides an ID for the input
|
|
1410
|
+
*/
|
|
1411
|
+
id?: string;
|
|
1412
|
+
/**
|
|
1413
|
+
* The label for the input
|
|
1414
|
+
*/
|
|
1415
|
+
label: JSX.Element | string;
|
|
1416
|
+
/**
|
|
1417
|
+
* The description for the radio
|
|
1418
|
+
*/
|
|
1419
|
+
description?: JSX.Element | string | undefined;
|
|
1420
|
+
/**
|
|
1421
|
+
* Should match the ID attribute of the radio.
|
|
1422
|
+
* Can be used to group together multiple radios
|
|
1423
|
+
*/
|
|
1424
|
+
name?: string;
|
|
1425
|
+
/**
|
|
1426
|
+
* Callback function invoked when the value changes
|
|
1427
|
+
*/
|
|
1428
|
+
onChange?: (event: ChangeEvent) => unknown;
|
|
1429
|
+
/**
|
|
1430
|
+
* Make Radio a required element
|
|
1431
|
+
*/
|
|
1432
|
+
required?: boolean;
|
|
1433
|
+
/**
|
|
1434
|
+
* The value attribute of the input
|
|
1435
|
+
*/
|
|
1436
|
+
value?: string;
|
|
1437
|
+
};
|
|
1438
|
+
declare const Radio: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
1439
|
+
/**
|
|
1440
|
+
* Indicates the state of the radio
|
|
1441
|
+
*/
|
|
1442
|
+
checked?: boolean;
|
|
1443
|
+
/**
|
|
1444
|
+
* Disables input
|
|
1445
|
+
*/
|
|
1446
|
+
disabled?: boolean;
|
|
1447
|
+
/**
|
|
1448
|
+
* Indicates that there is an error with the input
|
|
1449
|
+
*/
|
|
1450
|
+
hasError?: boolean;
|
|
1451
|
+
/**
|
|
1452
|
+
* Provides an ID for the input
|
|
1453
|
+
*/
|
|
1454
|
+
id?: string;
|
|
1455
|
+
/**
|
|
1456
|
+
* The label for the input
|
|
1457
|
+
*/
|
|
1458
|
+
label: JSX.Element | string;
|
|
1459
|
+
/**
|
|
1460
|
+
* The description for the radio
|
|
1461
|
+
*/
|
|
1462
|
+
description?: JSX.Element | string | undefined;
|
|
1463
|
+
/**
|
|
1464
|
+
* Should match the ID attribute of the radio.
|
|
1465
|
+
* Can be used to group together multiple radios
|
|
1466
|
+
*/
|
|
1467
|
+
name?: string;
|
|
1468
|
+
/**
|
|
1469
|
+
* Callback function invoked when the value changes
|
|
1470
|
+
*/
|
|
1471
|
+
onChange?: (event: ChangeEvent) => unknown;
|
|
1472
|
+
/**
|
|
1473
|
+
* Make Radio a required element
|
|
1474
|
+
*/
|
|
1475
|
+
required?: boolean;
|
|
1476
|
+
/**
|
|
1477
|
+
* The value attribute of the input
|
|
1478
|
+
*/
|
|
1479
|
+
value?: string;
|
|
1480
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
1481
|
+
|
|
1395
1482
|
type ScreenReaderOnlyProps = ComponentPropsWithoutRef<'div'> & {
|
|
1396
1483
|
/**
|
|
1397
1484
|
* Pass an arbitrary child node
|
|
@@ -1573,4 +1660,4 @@ declare const WistiaLogo: {
|
|
|
1573
1660
|
displayName: string;
|
|
1574
1661
|
};
|
|
1575
1662
|
|
|
1576
|
-
export { Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, ButtonGroup, type ButtonProps, Checkbox, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, RadioMenuItem, ScreenReaderOnly, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
|
|
1663
|
+
export { Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, ButtonGroup, type ButtonProps, Checkbox, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Radio, RadioMenuItem, type RadioProps, ScreenReaderOnly, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -1392,6 +1392,93 @@ declare const CheckboxMenuItem: {
|
|
|
1392
1392
|
displayName: string;
|
|
1393
1393
|
};
|
|
1394
1394
|
|
|
1395
|
+
type RadioProps = ComponentPropsWithoutRef<'input'> & {
|
|
1396
|
+
/**
|
|
1397
|
+
* Indicates the state of the radio
|
|
1398
|
+
*/
|
|
1399
|
+
checked?: boolean;
|
|
1400
|
+
/**
|
|
1401
|
+
* Disables input
|
|
1402
|
+
*/
|
|
1403
|
+
disabled?: boolean;
|
|
1404
|
+
/**
|
|
1405
|
+
* Indicates that there is an error with the input
|
|
1406
|
+
*/
|
|
1407
|
+
hasError?: boolean;
|
|
1408
|
+
/**
|
|
1409
|
+
* Provides an ID for the input
|
|
1410
|
+
*/
|
|
1411
|
+
id?: string;
|
|
1412
|
+
/**
|
|
1413
|
+
* The label for the input
|
|
1414
|
+
*/
|
|
1415
|
+
label: JSX.Element | string;
|
|
1416
|
+
/**
|
|
1417
|
+
* The description for the radio
|
|
1418
|
+
*/
|
|
1419
|
+
description?: JSX.Element | string | undefined;
|
|
1420
|
+
/**
|
|
1421
|
+
* Should match the ID attribute of the radio.
|
|
1422
|
+
* Can be used to group together multiple radios
|
|
1423
|
+
*/
|
|
1424
|
+
name?: string;
|
|
1425
|
+
/**
|
|
1426
|
+
* Callback function invoked when the value changes
|
|
1427
|
+
*/
|
|
1428
|
+
onChange?: (event: ChangeEvent) => unknown;
|
|
1429
|
+
/**
|
|
1430
|
+
* Make Radio a required element
|
|
1431
|
+
*/
|
|
1432
|
+
required?: boolean;
|
|
1433
|
+
/**
|
|
1434
|
+
* The value attribute of the input
|
|
1435
|
+
*/
|
|
1436
|
+
value?: string;
|
|
1437
|
+
};
|
|
1438
|
+
declare const Radio: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
1439
|
+
/**
|
|
1440
|
+
* Indicates the state of the radio
|
|
1441
|
+
*/
|
|
1442
|
+
checked?: boolean;
|
|
1443
|
+
/**
|
|
1444
|
+
* Disables input
|
|
1445
|
+
*/
|
|
1446
|
+
disabled?: boolean;
|
|
1447
|
+
/**
|
|
1448
|
+
* Indicates that there is an error with the input
|
|
1449
|
+
*/
|
|
1450
|
+
hasError?: boolean;
|
|
1451
|
+
/**
|
|
1452
|
+
* Provides an ID for the input
|
|
1453
|
+
*/
|
|
1454
|
+
id?: string;
|
|
1455
|
+
/**
|
|
1456
|
+
* The label for the input
|
|
1457
|
+
*/
|
|
1458
|
+
label: JSX.Element | string;
|
|
1459
|
+
/**
|
|
1460
|
+
* The description for the radio
|
|
1461
|
+
*/
|
|
1462
|
+
description?: JSX.Element | string | undefined;
|
|
1463
|
+
/**
|
|
1464
|
+
* Should match the ID attribute of the radio.
|
|
1465
|
+
* Can be used to group together multiple radios
|
|
1466
|
+
*/
|
|
1467
|
+
name?: string;
|
|
1468
|
+
/**
|
|
1469
|
+
* Callback function invoked when the value changes
|
|
1470
|
+
*/
|
|
1471
|
+
onChange?: (event: ChangeEvent) => unknown;
|
|
1472
|
+
/**
|
|
1473
|
+
* Make Radio a required element
|
|
1474
|
+
*/
|
|
1475
|
+
required?: boolean;
|
|
1476
|
+
/**
|
|
1477
|
+
* The value attribute of the input
|
|
1478
|
+
*/
|
|
1479
|
+
value?: string;
|
|
1480
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
1481
|
+
|
|
1395
1482
|
type ScreenReaderOnlyProps = ComponentPropsWithoutRef<'div'> & {
|
|
1396
1483
|
/**
|
|
1397
1484
|
* Pass an arbitrary child node
|
|
@@ -1573,4 +1660,4 @@ declare const WistiaLogo: {
|
|
|
1573
1660
|
displayName: string;
|
|
1574
1661
|
};
|
|
1575
1662
|
|
|
1576
|
-
export { Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, ButtonGroup, type ButtonProps, Checkbox, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, RadioMenuItem, ScreenReaderOnly, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
|
|
1663
|
+
export { Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, ButtonGroup, type ButtonProps, Checkbox, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Radio, RadioMenuItem, type RadioProps, ScreenReaderOnly, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.0.
|
|
3
|
+
* @license @wistia/ui v0.0.20
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2024, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -5851,7 +5851,7 @@ var Checkbox = forwardRef4(
|
|
|
5851
5851
|
...otherProps
|
|
5852
5852
|
}, ref) => {
|
|
5853
5853
|
const generatedId = useId();
|
|
5854
|
-
const computedId = isNonEmptyString2(id) ? id : `vhs-
|
|
5854
|
+
const computedId = isNonEmptyString2(id) ? id : `vhs-checkbox-${generatedId}`;
|
|
5855
5855
|
return /* @__PURE__ */ jsxs6(StyledCheckboxWrapper, { children: [
|
|
5856
5856
|
/* @__PURE__ */ jsx166(
|
|
5857
5857
|
StyledCheckboxRoot,
|
|
@@ -6873,12 +6873,142 @@ var CheckboxMenuItem = ({
|
|
|
6873
6873
|
};
|
|
6874
6874
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
6875
6875
|
|
|
6876
|
+
// src/components/Radio/Radio.tsx
|
|
6877
|
+
import { forwardRef as forwardRef10, useId as useId2 } from "react";
|
|
6878
|
+
import styled23, { css as css18 } from "styled-components";
|
|
6879
|
+
import { isNonEmptyString as isNonEmptyString3 } from "@wistia/type-guards";
|
|
6880
|
+
import { jsx as jsx182, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6881
|
+
var StyledLabelWrapper2 = styled23.div`
|
|
6882
|
+
display: flex;
|
|
6883
|
+
flex-direction: column;
|
|
6884
|
+
padding-left: var(--wui-space-02);
|
|
6885
|
+
`;
|
|
6886
|
+
var StyledRadio = styled23.input`
|
|
6887
|
+
align-self: flex-start;
|
|
6888
|
+
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
6889
|
+
appearance: none;
|
|
6890
|
+
margin: 0;
|
|
6891
|
+
color: currentcolor;
|
|
6892
|
+
width: 14px;
|
|
6893
|
+
min-width: 14px;
|
|
6894
|
+
height: 14px;
|
|
6895
|
+
border: 1px solid var(--wui-color-border);
|
|
6896
|
+
border-radius: 50%;
|
|
6897
|
+
transform: translateY(5px); /* visually center the radio button */
|
|
6898
|
+
display: grid;
|
|
6899
|
+
place-content: center;
|
|
6900
|
+
|
|
6901
|
+
&&::before {
|
|
6902
|
+
content: '';
|
|
6903
|
+
width: 10px;
|
|
6904
|
+
height: 10px;
|
|
6905
|
+
border-radius: 50%;
|
|
6906
|
+
transform: scale(0);
|
|
6907
|
+
box-shadow: inset 1em 1em var(--wui-color-bg-fill);
|
|
6908
|
+
}
|
|
6909
|
+
|
|
6910
|
+
&&:checked::before {
|
|
6911
|
+
transform: scale(1);
|
|
6912
|
+
}
|
|
6913
|
+
`;
|
|
6914
|
+
var disabledStyle2 = css18`
|
|
6915
|
+
cursor: not-allowed;
|
|
6916
|
+
opacity: 0.5;
|
|
6917
|
+
`;
|
|
6918
|
+
var errorStyle = css18`
|
|
6919
|
+
/* TODO Lamp to design error state */
|
|
6920
|
+
&:hover,
|
|
6921
|
+
&:focus,
|
|
6922
|
+
&:active {
|
|
6923
|
+
border-color: transparent !important;
|
|
6924
|
+
}
|
|
6925
|
+
`;
|
|
6926
|
+
var defaultHoverStyle = css18`
|
|
6927
|
+
/* TODO Lamp to design hover state */
|
|
6928
|
+
cursor: pointer;
|
|
6929
|
+
`;
|
|
6930
|
+
var StyledRadioWrapper = styled23.div`
|
|
6931
|
+
align-items: center;
|
|
6932
|
+
border: 1px solid transparent;
|
|
6933
|
+
border-radius: 4px;
|
|
6934
|
+
display: flex;
|
|
6935
|
+
gap: var(--wui-space-02);
|
|
6936
|
+
padding: var(--wui-space-02);
|
|
6937
|
+
|
|
6938
|
+
&:hover {
|
|
6939
|
+
${defaultHoverStyle}
|
|
6940
|
+
}
|
|
6941
|
+
|
|
6942
|
+
&:focus-within {
|
|
6943
|
+
/* TODO Lamp to design focus state */
|
|
6944
|
+
background-color: #efefef;
|
|
6945
|
+
}
|
|
6946
|
+
|
|
6947
|
+
${({ hasError }) => hasError && errorStyle};
|
|
6948
|
+
${({ disabled }) => disabled && disabledStyle2};
|
|
6949
|
+
`;
|
|
6950
|
+
var Radio = forwardRef10(
|
|
6951
|
+
({
|
|
6952
|
+
checked,
|
|
6953
|
+
disabled = false,
|
|
6954
|
+
hasError = false,
|
|
6955
|
+
id,
|
|
6956
|
+
label,
|
|
6957
|
+
description,
|
|
6958
|
+
name,
|
|
6959
|
+
onChange,
|
|
6960
|
+
required = false,
|
|
6961
|
+
value = "false",
|
|
6962
|
+
...otherProps
|
|
6963
|
+
}, ref) => {
|
|
6964
|
+
const generatedId = useId2();
|
|
6965
|
+
const computedId = isNonEmptyString3(id) ? id : `vhs-radio-${generatedId}`;
|
|
6966
|
+
return /* @__PURE__ */ jsxs12(
|
|
6967
|
+
StyledRadioWrapper,
|
|
6968
|
+
{
|
|
6969
|
+
disabled,
|
|
6970
|
+
hasError,
|
|
6971
|
+
children: [
|
|
6972
|
+
/* @__PURE__ */ jsx182(
|
|
6973
|
+
StyledRadio,
|
|
6974
|
+
{
|
|
6975
|
+
ref,
|
|
6976
|
+
"aria-checked": checked,
|
|
6977
|
+
checked,
|
|
6978
|
+
disabled,
|
|
6979
|
+
id,
|
|
6980
|
+
name,
|
|
6981
|
+
onChange,
|
|
6982
|
+
type: "radio",
|
|
6983
|
+
value,
|
|
6984
|
+
...otherProps
|
|
6985
|
+
}
|
|
6986
|
+
),
|
|
6987
|
+
/* @__PURE__ */ jsxs12(StyledLabelWrapper2, { children: [
|
|
6988
|
+
/* @__PURE__ */ jsx182(
|
|
6989
|
+
Label,
|
|
6990
|
+
{
|
|
6991
|
+
disabled,
|
|
6992
|
+
htmlFor: computedId,
|
|
6993
|
+
required,
|
|
6994
|
+
children: label
|
|
6995
|
+
}
|
|
6996
|
+
),
|
|
6997
|
+
/* @__PURE__ */ jsx182(LabelDescription, { children: description })
|
|
6998
|
+
] })
|
|
6999
|
+
]
|
|
7000
|
+
}
|
|
7001
|
+
);
|
|
7002
|
+
}
|
|
7003
|
+
);
|
|
7004
|
+
Radio.displayName = "Radio";
|
|
7005
|
+
|
|
6876
7006
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
6877
|
-
import
|
|
7007
|
+
import styled24 from "styled-components";
|
|
6878
7008
|
import { isNotNil as isNotNil8 } from "@wistia/type-guards";
|
|
6879
|
-
import { jsx as
|
|
6880
|
-
var VisuallyHidden =
|
|
6881
|
-
var VisuallyHiddenButFocusable =
|
|
7009
|
+
import { jsx as jsx183 } from "react/jsx-runtime";
|
|
7010
|
+
var VisuallyHidden = styled24.div({ ...visuallyHiddenStyle });
|
|
7011
|
+
var VisuallyHiddenButFocusable = styled24.div({
|
|
6882
7012
|
"&:not(:focus-within)": visuallyHiddenStyle
|
|
6883
7013
|
});
|
|
6884
7014
|
var ScreenReaderOnly = ({
|
|
@@ -6889,18 +7019,18 @@ var ScreenReaderOnly = ({
|
|
|
6889
7019
|
}) => {
|
|
6890
7020
|
const accessibleText = isNotNil8(text) ? text : children;
|
|
6891
7021
|
if (focusable) {
|
|
6892
|
-
return /* @__PURE__ */
|
|
7022
|
+
return /* @__PURE__ */ jsx183(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
6893
7023
|
}
|
|
6894
|
-
return /* @__PURE__ */
|
|
7024
|
+
return /* @__PURE__ */ jsx183(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
6895
7025
|
};
|
|
6896
7026
|
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
6897
7027
|
|
|
6898
7028
|
// src/components/Stack/Stack.tsx
|
|
6899
|
-
import { forwardRef as
|
|
6900
|
-
import
|
|
6901
|
-
import { jsx as
|
|
7029
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
7030
|
+
import styled25 from "styled-components";
|
|
7031
|
+
import { jsx as jsx184 } from "react/jsx-runtime";
|
|
6902
7032
|
var DEFAULT_ELEMENT3 = "div";
|
|
6903
|
-
var StyledStack =
|
|
7033
|
+
var StyledStack = styled25.div`
|
|
6904
7034
|
display: flex;
|
|
6905
7035
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
6906
7036
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
@@ -6909,11 +7039,11 @@ var StyledStack = styled24.div`
|
|
|
6909
7039
|
flex: 1;
|
|
6910
7040
|
}
|
|
6911
7041
|
`;
|
|
6912
|
-
var StackComponent =
|
|
7042
|
+
var StackComponent = forwardRef11(
|
|
6913
7043
|
({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
|
|
6914
7044
|
const responsiveGap = useResponsiveProp(gap);
|
|
6915
7045
|
const responsiveDirection = useResponsiveProp(direction);
|
|
6916
|
-
return /* @__PURE__ */
|
|
7046
|
+
return /* @__PURE__ */ jsx184(
|
|
6917
7047
|
StyledStack,
|
|
6918
7048
|
{
|
|
6919
7049
|
ref,
|
|
@@ -6929,11 +7059,11 @@ StackComponent.displayName = "Stack";
|
|
|
6929
7059
|
var Stack = makePolymorphic(StackComponent);
|
|
6930
7060
|
|
|
6931
7061
|
// src/components/Tag/Tag.tsx
|
|
6932
|
-
import { forwardRef as
|
|
6933
|
-
import
|
|
6934
|
-
import { isNil as isNil10, isNotNil as isNotNil9, isNonEmptyString as
|
|
6935
|
-
import { Fragment as Fragment2, jsx as
|
|
6936
|
-
var TagLabel =
|
|
7062
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
7063
|
+
import styled26 from "styled-components";
|
|
7064
|
+
import { isNil as isNil10, isNotNil as isNotNil9, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
7065
|
+
import { Fragment as Fragment2, jsx as jsx185, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
7066
|
+
var TagLabel = styled26.a`
|
|
6937
7067
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
6938
7068
|
font-size: var(--wui-typography-label-4-size);
|
|
6939
7069
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -6961,14 +7091,14 @@ var TagLabel = styled25.a`
|
|
|
6961
7091
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
6962
7092
|
}
|
|
6963
7093
|
`;
|
|
6964
|
-
var TagDivider =
|
|
7094
|
+
var TagDivider = styled26.div`
|
|
6965
7095
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
6966
7096
|
border-left: 1px solid var(--wui-color-border);
|
|
6967
7097
|
display: flex;
|
|
6968
7098
|
height: 14px;
|
|
6969
7099
|
width: 1px;
|
|
6970
7100
|
`;
|
|
6971
|
-
var StyledRemoveButton =
|
|
7101
|
+
var StyledRemoveButton = styled26.button`
|
|
6972
7102
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
6973
7103
|
all: unset;
|
|
6974
7104
|
cursor: pointer;
|
|
@@ -6996,7 +7126,7 @@ var StyledRemoveButton = styled25.button`
|
|
|
6996
7126
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
6997
7127
|
}
|
|
6998
7128
|
`;
|
|
6999
|
-
var StyledTag =
|
|
7129
|
+
var StyledTag = styled26.div`
|
|
7000
7130
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7001
7131
|
align-items: center;
|
|
7002
7132
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -7013,39 +7143,39 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
7013
7143
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
7014
7144
|
);
|
|
7015
7145
|
}
|
|
7016
|
-
return /* @__PURE__ */
|
|
7017
|
-
/* @__PURE__ */
|
|
7018
|
-
/* @__PURE__ */
|
|
7146
|
+
return /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
7147
|
+
/* @__PURE__ */ jsx185(TagDivider, { $colorScheme: colorScheme }),
|
|
7148
|
+
/* @__PURE__ */ jsxs13(
|
|
7019
7149
|
StyledRemoveButton,
|
|
7020
7150
|
{
|
|
7021
7151
|
$colorScheme: colorScheme,
|
|
7022
7152
|
onClick: onClickRemove,
|
|
7023
7153
|
type: "button",
|
|
7024
7154
|
children: [
|
|
7025
|
-
/* @__PURE__ */
|
|
7155
|
+
/* @__PURE__ */ jsx185(
|
|
7026
7156
|
Icon,
|
|
7027
7157
|
{
|
|
7028
7158
|
size: "sm",
|
|
7029
7159
|
type: "close"
|
|
7030
7160
|
}
|
|
7031
7161
|
),
|
|
7032
|
-
/* @__PURE__ */
|
|
7162
|
+
/* @__PURE__ */ jsx185(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
7033
7163
|
]
|
|
7034
7164
|
}
|
|
7035
7165
|
)
|
|
7036
7166
|
] });
|
|
7037
7167
|
};
|
|
7038
|
-
var Tag =
|
|
7168
|
+
var Tag = forwardRef12(
|
|
7039
7169
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
7040
|
-
const labelProps = isNotNil9(href) &&
|
|
7041
|
-
return /* @__PURE__ */
|
|
7170
|
+
const labelProps = isNotNil9(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
|
|
7171
|
+
return /* @__PURE__ */ jsxs13(
|
|
7042
7172
|
StyledTag,
|
|
7043
7173
|
{
|
|
7044
7174
|
ref,
|
|
7045
7175
|
$colorScheme: colorScheme,
|
|
7046
7176
|
...otherProps,
|
|
7047
7177
|
children: [
|
|
7048
|
-
/* @__PURE__ */
|
|
7178
|
+
/* @__PURE__ */ jsx185(
|
|
7049
7179
|
TagLabel,
|
|
7050
7180
|
{
|
|
7051
7181
|
...labelProps,
|
|
@@ -7053,7 +7183,7 @@ var Tag = forwardRef11(
|
|
|
7053
7183
|
children: label
|
|
7054
7184
|
}
|
|
7055
7185
|
),
|
|
7056
|
-
/* @__PURE__ */
|
|
7186
|
+
/* @__PURE__ */ jsx185(
|
|
7057
7187
|
RemoveButton,
|
|
7058
7188
|
{
|
|
7059
7189
|
colorScheme,
|
|
@@ -7069,26 +7199,26 @@ var Tag = forwardRef11(
|
|
|
7069
7199
|
Tag.displayName = "Tag";
|
|
7070
7200
|
|
|
7071
7201
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
7072
|
-
import
|
|
7202
|
+
import styled27 from "styled-components";
|
|
7073
7203
|
import { isNotNil as isNotNil10 } from "@wistia/type-guards";
|
|
7074
|
-
import { jsx as
|
|
7204
|
+
import { jsx as jsx186, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7075
7205
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
7076
7206
|
if (iconOnly) {
|
|
7077
|
-
return /* @__PURE__ */
|
|
7207
|
+
return /* @__PURE__ */ jsx186(
|
|
7078
7208
|
"g",
|
|
7079
7209
|
{
|
|
7080
7210
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
7081
7211
|
fill: brandmarkColor,
|
|
7082
|
-
children: /* @__PURE__ */
|
|
7212
|
+
children: /* @__PURE__ */ jsx186("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" })
|
|
7083
7213
|
}
|
|
7084
7214
|
);
|
|
7085
7215
|
}
|
|
7086
|
-
return /* @__PURE__ */
|
|
7216
|
+
return /* @__PURE__ */ jsx186(
|
|
7087
7217
|
"g",
|
|
7088
7218
|
{
|
|
7089
7219
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
7090
7220
|
fill: brandmarkColor,
|
|
7091
|
-
children: /* @__PURE__ */
|
|
7221
|
+
children: /* @__PURE__ */ jsx186("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" })
|
|
7092
7222
|
}
|
|
7093
7223
|
);
|
|
7094
7224
|
};
|
|
@@ -7096,12 +7226,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
7096
7226
|
if (iconOnly) {
|
|
7097
7227
|
return null;
|
|
7098
7228
|
}
|
|
7099
|
-
return /* @__PURE__ */
|
|
7229
|
+
return /* @__PURE__ */ jsx186(
|
|
7100
7230
|
"g",
|
|
7101
7231
|
{
|
|
7102
7232
|
"data-testid": "ui-wistia-logo-logotype",
|
|
7103
7233
|
fill: logotypeColor,
|
|
7104
|
-
children: /* @__PURE__ */
|
|
7234
|
+
children: /* @__PURE__ */ jsx186("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" })
|
|
7105
7235
|
}
|
|
7106
7236
|
);
|
|
7107
7237
|
};
|
|
@@ -7111,7 +7241,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
7111
7241
|
}
|
|
7112
7242
|
return "0 0 144 31.47";
|
|
7113
7243
|
};
|
|
7114
|
-
var WistiaLogoComponent =
|
|
7244
|
+
var WistiaLogoComponent = styled27.svg`
|
|
7115
7245
|
height: ${({ height }) => `${height}px`};
|
|
7116
7246
|
|
|
7117
7247
|
/* ensure it will always fit on mobile */
|
|
@@ -7153,7 +7283,7 @@ var WistiaLogo = ({
|
|
|
7153
7283
|
};
|
|
7154
7284
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
7155
7285
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
7156
|
-
const Logo = /* @__PURE__ */
|
|
7286
|
+
const Logo = /* @__PURE__ */ jsxs14(
|
|
7157
7287
|
WistiaLogoComponent,
|
|
7158
7288
|
{
|
|
7159
7289
|
$hoverColor: hoverColor,
|
|
@@ -7163,14 +7293,14 @@ var WistiaLogo = ({
|
|
|
7163
7293
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7164
7294
|
...otherProps,
|
|
7165
7295
|
children: [
|
|
7166
|
-
/* @__PURE__ */
|
|
7167
|
-
isNotNil10(description) ? /* @__PURE__ */
|
|
7296
|
+
/* @__PURE__ */ jsx186("title", { children: title }),
|
|
7297
|
+
isNotNil10(description) ? /* @__PURE__ */ jsx186("desc", { children: description }) : null,
|
|
7168
7298
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
7169
7299
|
renderLogotype(logotypeColor, iconOnly)
|
|
7170
7300
|
]
|
|
7171
7301
|
}
|
|
7172
7302
|
);
|
|
7173
|
-
return href !== void 0 ? /* @__PURE__ */
|
|
7303
|
+
return href !== void 0 ? /* @__PURE__ */ jsx186("a", { href, children: Logo }) : Logo;
|
|
7174
7304
|
};
|
|
7175
7305
|
WistiaLogo.displayName = "WistiaLogo";
|
|
7176
7306
|
export {
|
|
@@ -7195,6 +7325,7 @@ export {
|
|
|
7195
7325
|
MenuItemLabel,
|
|
7196
7326
|
MenuLabel,
|
|
7197
7327
|
MenuRadioGroup,
|
|
7328
|
+
Radio,
|
|
7198
7329
|
RadioMenuItem,
|
|
7199
7330
|
ScreenReaderOnly,
|
|
7200
7331
|
Stack,
|