@wistia/ui 0.0.18 → 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 +326 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +137 -2
- package/dist/index.d.ts +137 -2
- package/dist/index.mjs +324 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -24
package/dist/index.cjs
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
|
*
|
|
@@ -60,10 +60,12 @@ __export(src_exports, {
|
|
|
60
60
|
MenuItemLabel: () => MenuItemLabel,
|
|
61
61
|
MenuLabel: () => MenuLabel,
|
|
62
62
|
MenuRadioGroup: () => MenuRadioGroup,
|
|
63
|
+
Radio: () => Radio,
|
|
63
64
|
RadioMenuItem: () => RadioMenuItem,
|
|
64
65
|
ScreenReaderOnly: () => ScreenReaderOnly,
|
|
65
66
|
Stack: () => Stack,
|
|
66
67
|
SubMenu: () => SubMenu,
|
|
68
|
+
Tag: () => Tag,
|
|
67
69
|
Text: () => Text,
|
|
68
70
|
Tooltip: () => Tooltip,
|
|
69
71
|
UIProvider: () => UIProvider,
|
|
@@ -895,7 +897,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
895
897
|
|
|
896
898
|
/* --- Default --- */
|
|
897
899
|
--wui-color-bg-fill: var(--wui-blue-9);
|
|
898
|
-
--wui-color-bg-fill-active: var(--wui-blue-
|
|
900
|
+
--wui-color-bg-fill-active: var(--wui-blue-11);
|
|
899
901
|
--wui-color-bg-fill-hover: var(--wui-blue-10);
|
|
900
902
|
--wui-color-bg-surface: var(--wui-gray-surface);
|
|
901
903
|
--wui-color-bg-surface-active: var(--wui-gray-4);
|
|
@@ -917,6 +919,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
917
919
|
--wui-color-text-link: var(--wui-blue-9);
|
|
918
920
|
--wui-color-text-on-fill: var(--wui-gray-contrast);
|
|
919
921
|
--wui-color-text-secondary: var(--wui-gray-11);
|
|
922
|
+
--wui-color-focus-ring: var(--wui-blue-9);
|
|
920
923
|
|
|
921
924
|
/* --- Semantic --- */
|
|
922
925
|
|
|
@@ -944,6 +947,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
944
947
|
--wui-color-text-link-error: var(--wui-error-11);
|
|
945
948
|
--wui-color-text-on-fill-error: var(--wui-error-contrast);
|
|
946
949
|
--wui-color-text-secondary-error: var(--wui-error-11);
|
|
950
|
+
--wui-color-focus-ring-error: var(--wui-error-9);
|
|
947
951
|
|
|
948
952
|
/* Info */
|
|
949
953
|
--wui-color-bg-fill-active-info: var(--wui-blue-11);
|
|
@@ -969,6 +973,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
969
973
|
--wui-color-text-link-info: var(--wui-blue-9);
|
|
970
974
|
--wui-color-text-on-fill-info: var(--wui-blue-contrast);
|
|
971
975
|
--wui-color-text-secondary-info: var(--wui-blue-11);
|
|
976
|
+
--wui-color-focus-ring-info: var(--wui-blue-9);
|
|
972
977
|
|
|
973
978
|
/* Success */
|
|
974
979
|
--wui-color-bg-fill-active-success: var(--wui-success-11);
|
|
@@ -994,6 +999,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
994
999
|
--wui-color-text-on-fill-success: var(--wui-success-contrast);
|
|
995
1000
|
--wui-color-text-secondary-success: var(--wui-success-11);
|
|
996
1001
|
--wui-color-text-success: var(--wui-success-11);
|
|
1002
|
+
--wui-color-focus-ring-success: var(--wui-success-9);
|
|
997
1003
|
|
|
998
1004
|
/* Warning */
|
|
999
1005
|
--wui-color-bg-fill-active-warning: var(--wui-warning-11);
|
|
@@ -1019,6 +1025,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1019
1025
|
--wui-color-text-on-fill-warning: var(--wui-warning-contrast);
|
|
1020
1026
|
--wui-color-text-secondary-warning: var(--wui-warning-11);
|
|
1021
1027
|
--wui-color-text-warning: var(--wui-warning-11);
|
|
1028
|
+
--wui-color-focus-ring-warning: var(--wui-warning-9);
|
|
1022
1029
|
|
|
1023
1030
|
/* --- Accent --- */
|
|
1024
1031
|
|
|
@@ -1046,6 +1053,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1046
1053
|
--wui-color-text-link-blue: var(--wui-blue-9);
|
|
1047
1054
|
--wui-color-text-on-fill-blue: var(--wui-blue-contrast);
|
|
1048
1055
|
--wui-color-text-secondary-blue: var(--wui-blue-5);
|
|
1056
|
+
--wui-color-focus-ring-blue: var(--wui-blue-9);
|
|
1049
1057
|
|
|
1050
1058
|
/* Green */
|
|
1051
1059
|
--wui-color-bg-fill-active-green: var(--wui-green-11);
|
|
@@ -1071,6 +1079,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1071
1079
|
--wui-color-text-link-green: var(--wui-green-11);
|
|
1072
1080
|
--wui-color-text-on-fill-green: var(--wui-green-contrast);
|
|
1073
1081
|
--wui-color-text-secondary-green: var(--wui-green-10);
|
|
1082
|
+
--wui-color-focus-ring-green: var(--wui-green-9);
|
|
1074
1083
|
|
|
1075
1084
|
/* Orange */
|
|
1076
1085
|
--wui-color-bg-fill-active-orange: var(--wui-orange-11);
|
|
@@ -1096,6 +1105,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1096
1105
|
--wui-color-text-on-fill-orange: var(--wui-orange-contrast);
|
|
1097
1106
|
--wui-color-text-orange: var(--wui-orange-11);
|
|
1098
1107
|
--wui-color-text-secondary-orange: var(--wui-orange-10);
|
|
1108
|
+
--wui-color-focus-ring-orange: var(--wui-orange-9);
|
|
1099
1109
|
|
|
1100
1110
|
/* Pink */
|
|
1101
1111
|
--wui-color-bg-fill-active-pink: var(--wui-pink-11);
|
|
@@ -1121,6 +1131,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1121
1131
|
--wui-color-text-on-fill-pink: var(--wui-pink-contrast);
|
|
1122
1132
|
--wui-color-text-pink: var(--wui-pink-11);
|
|
1123
1133
|
--wui-color-text-secondary-pink: var(--wui-pink-10);
|
|
1134
|
+
--wui-color-focus-ring-pink: var(--wui-pink-9);
|
|
1124
1135
|
|
|
1125
1136
|
/* Purple */
|
|
1126
1137
|
--wui-color-bg-fill-active-purple: var(--wui-purple-11);
|
|
@@ -1146,6 +1157,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1146
1157
|
--wui-color-text-on-fill-purple: var(--wui-purple-contrast);
|
|
1147
1158
|
--wui-color-text-purple: var(--wui-purple-11);
|
|
1148
1159
|
--wui-color-text-secondary-purple: var(--wui-purple-11);
|
|
1160
|
+
--wui-color-focus-ring-purple: var(--wui-purple-9);
|
|
1149
1161
|
|
|
1150
1162
|
/* Yellow */
|
|
1151
1163
|
--wui-color-bg-fill-active-yellow: var(--wui-yellow-11);
|
|
@@ -1171,6 +1183,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1171
1183
|
--wui-color-text-on-fill-yellow: var(--wui-yellow-contrast);
|
|
1172
1184
|
--wui-color-text-secondary-yellow: var(--wui-yellow-10);
|
|
1173
1185
|
--wui-color-text-yellow: var(--wui-yellow-11);
|
|
1186
|
+
--wui-color-focus-ring-yellow: var(--wui-yellow-9);
|
|
1174
1187
|
|
|
1175
1188
|
/* --- Misc --- */
|
|
1176
1189
|
--wui-color-bg-fill-white: #ffffff;
|
|
@@ -1614,7 +1627,8 @@ var colorSchemeSchema = [
|
|
|
1614
1627
|
{ token: "border-secondary-hover", step: "10" },
|
|
1615
1628
|
{ token: "border-secondary-active", step: "11" },
|
|
1616
1629
|
{ token: "icon", step: "11" },
|
|
1617
|
-
{ token: "icon-on-fill", step: "contrast" }
|
|
1630
|
+
{ token: "icon-on-fill", step: "contrast" },
|
|
1631
|
+
{ token: "focus-ring", step: "9" }
|
|
1618
1632
|
];
|
|
1619
1633
|
var defaultScheme = import_styled_components10.css`
|
|
1620
1634
|
--wui-color-bg-surface: var(--wui-gray-surface);
|
|
@@ -1626,7 +1640,7 @@ var defaultScheme = import_styled_components10.css`
|
|
|
1626
1640
|
--wui-color-bg-surface-tertiary: var(--wui-gray-5);
|
|
1627
1641
|
--wui-color-bg-fill: var(--wui-blue-9);
|
|
1628
1642
|
--wui-color-bg-fill-hover: var(--wui-blue-10);
|
|
1629
|
-
--wui-color-bg-fill-active: var(--wui-blue-
|
|
1643
|
+
--wui-color-bg-fill-active: var(--wui-blue-11);
|
|
1630
1644
|
--wui-color-text: var(--wui-gray-12);
|
|
1631
1645
|
--wui-color-text-high-contrast: var(--wui-gray-12);
|
|
1632
1646
|
--wui-color-text-link: var(--wui-blue-9);
|
|
@@ -1640,6 +1654,7 @@ var defaultScheme = import_styled_components10.css`
|
|
|
1640
1654
|
--wui-color-border-secondary-active: var(--wui-gray-11);
|
|
1641
1655
|
--wui-color-icon: var(--wui-gray-11);
|
|
1642
1656
|
--wui-color-icon-on-fill: var(--wui-gray-contrast);
|
|
1657
|
+
--wui-color-focus-ring: var(--wui-blue-9);
|
|
1643
1658
|
`;
|
|
1644
1659
|
var getColorScheme = (colorScheme) => {
|
|
1645
1660
|
if (colorScheme === "inherit") {
|
|
@@ -2153,19 +2168,18 @@ var buttonBaseStyles = import_styled_components16.css`
|
|
|
2153
2168
|
background: var(--button-color-bg-active);
|
|
2154
2169
|
}
|
|
2155
2170
|
|
|
2156
|
-
&:focus
|
|
2157
|
-
&.force-state-focus {
|
|
2171
|
+
&:focus {
|
|
2158
2172
|
outline: none;
|
|
2159
2173
|
}
|
|
2160
2174
|
|
|
2161
|
-
&:focus-visible
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2175
|
+
&:focus-visible,
|
|
2176
|
+
&.force-state-focus {
|
|
2177
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
2178
|
+
outline-offset: 2px;
|
|
2179
|
+
background: var(--button-color-bg-hover);
|
|
2166
2180
|
|
|
2167
2181
|
&[aria-disabled='true'] {
|
|
2168
|
-
outline:
|
|
2182
|
+
outline-color: var(--wui-color-border-disabled);
|
|
2169
2183
|
}
|
|
2170
2184
|
}
|
|
2171
2185
|
|
|
@@ -5620,9 +5634,7 @@ var Button = (0, import_react10.forwardRef)(
|
|
|
5620
5634
|
$size: responsiveSize,
|
|
5621
5635
|
$unstyled: unstyled,
|
|
5622
5636
|
$variant: variant,
|
|
5623
|
-
className
|
|
5624
|
-
forceState,
|
|
5625
|
-
isLoading
|
|
5637
|
+
className
|
|
5626
5638
|
};
|
|
5627
5639
|
if (forceState) {
|
|
5628
5640
|
commonProps.className = `${className ?? ""} force-state-${forceState}`;
|
|
@@ -5914,7 +5926,7 @@ var Checkbox = (0, import_react11.forwardRef)(
|
|
|
5914
5926
|
...otherProps
|
|
5915
5927
|
}, ref) => {
|
|
5916
5928
|
const generatedId = (0, import_react11.useId)();
|
|
5917
|
-
const computedId = (0, import_type_guards15.isNonEmptyString)(id) ? id : `vhs-
|
|
5929
|
+
const computedId = (0, import_type_guards15.isNonEmptyString)(id) ? id : `vhs-checkbox-${generatedId}`;
|
|
5918
5930
|
return /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(StyledCheckboxWrapper, { children: [
|
|
5919
5931
|
/* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
|
|
5920
5932
|
StyledCheckboxRoot,
|
|
@@ -6910,12 +6922,142 @@ var CheckboxMenuItem = ({
|
|
|
6910
6922
|
};
|
|
6911
6923
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
6912
6924
|
|
|
6913
|
-
// src/components/
|
|
6925
|
+
// src/components/Radio/Radio.tsx
|
|
6926
|
+
var import_react18 = require("react");
|
|
6914
6927
|
var import_styled_components35 = __toESM(require("styled-components"));
|
|
6915
6928
|
var import_type_guards19 = require("@wistia/type-guards");
|
|
6916
6929
|
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
6917
|
-
var
|
|
6918
|
-
|
|
6930
|
+
var StyledLabelWrapper2 = import_styled_components35.default.div`
|
|
6931
|
+
display: flex;
|
|
6932
|
+
flex-direction: column;
|
|
6933
|
+
padding-left: var(--wui-space-02);
|
|
6934
|
+
`;
|
|
6935
|
+
var StyledRadio = import_styled_components35.default.input`
|
|
6936
|
+
align-self: flex-start;
|
|
6937
|
+
box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
|
|
6938
|
+
appearance: none;
|
|
6939
|
+
margin: 0;
|
|
6940
|
+
color: currentcolor;
|
|
6941
|
+
width: 14px;
|
|
6942
|
+
min-width: 14px;
|
|
6943
|
+
height: 14px;
|
|
6944
|
+
border: 1px solid var(--wui-color-border);
|
|
6945
|
+
border-radius: 50%;
|
|
6946
|
+
transform: translateY(5px); /* visually center the radio button */
|
|
6947
|
+
display: grid;
|
|
6948
|
+
place-content: center;
|
|
6949
|
+
|
|
6950
|
+
&&::before {
|
|
6951
|
+
content: '';
|
|
6952
|
+
width: 10px;
|
|
6953
|
+
height: 10px;
|
|
6954
|
+
border-radius: 50%;
|
|
6955
|
+
transform: scale(0);
|
|
6956
|
+
box-shadow: inset 1em 1em var(--wui-color-bg-fill);
|
|
6957
|
+
}
|
|
6958
|
+
|
|
6959
|
+
&&:checked::before {
|
|
6960
|
+
transform: scale(1);
|
|
6961
|
+
}
|
|
6962
|
+
`;
|
|
6963
|
+
var disabledStyle2 = import_styled_components35.css`
|
|
6964
|
+
cursor: not-allowed;
|
|
6965
|
+
opacity: 0.5;
|
|
6966
|
+
`;
|
|
6967
|
+
var errorStyle = import_styled_components35.css`
|
|
6968
|
+
/* TODO Lamp to design error state */
|
|
6969
|
+
&:hover,
|
|
6970
|
+
&:focus,
|
|
6971
|
+
&:active {
|
|
6972
|
+
border-color: transparent !important;
|
|
6973
|
+
}
|
|
6974
|
+
`;
|
|
6975
|
+
var defaultHoverStyle = import_styled_components35.css`
|
|
6976
|
+
/* TODO Lamp to design hover state */
|
|
6977
|
+
cursor: pointer;
|
|
6978
|
+
`;
|
|
6979
|
+
var StyledRadioWrapper = import_styled_components35.default.div`
|
|
6980
|
+
align-items: center;
|
|
6981
|
+
border: 1px solid transparent;
|
|
6982
|
+
border-radius: 4px;
|
|
6983
|
+
display: flex;
|
|
6984
|
+
gap: var(--wui-space-02);
|
|
6985
|
+
padding: var(--wui-space-02);
|
|
6986
|
+
|
|
6987
|
+
&:hover {
|
|
6988
|
+
${defaultHoverStyle}
|
|
6989
|
+
}
|
|
6990
|
+
|
|
6991
|
+
&:focus-within {
|
|
6992
|
+
/* TODO Lamp to design focus state */
|
|
6993
|
+
background-color: #efefef;
|
|
6994
|
+
}
|
|
6995
|
+
|
|
6996
|
+
${({ hasError }) => hasError && errorStyle};
|
|
6997
|
+
${({ disabled }) => disabled && disabledStyle2};
|
|
6998
|
+
`;
|
|
6999
|
+
var Radio = (0, import_react18.forwardRef)(
|
|
7000
|
+
({
|
|
7001
|
+
checked,
|
|
7002
|
+
disabled = false,
|
|
7003
|
+
hasError = false,
|
|
7004
|
+
id,
|
|
7005
|
+
label,
|
|
7006
|
+
description,
|
|
7007
|
+
name,
|
|
7008
|
+
onChange,
|
|
7009
|
+
required = false,
|
|
7010
|
+
value = "false",
|
|
7011
|
+
...otherProps
|
|
7012
|
+
}, ref) => {
|
|
7013
|
+
const generatedId = (0, import_react18.useId)();
|
|
7014
|
+
const computedId = (0, import_type_guards19.isNonEmptyString)(id) ? id : `vhs-radio-${generatedId}`;
|
|
7015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(
|
|
7016
|
+
StyledRadioWrapper,
|
|
7017
|
+
{
|
|
7018
|
+
disabled,
|
|
7019
|
+
hasError,
|
|
7020
|
+
children: [
|
|
7021
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
7022
|
+
StyledRadio,
|
|
7023
|
+
{
|
|
7024
|
+
ref,
|
|
7025
|
+
"aria-checked": checked,
|
|
7026
|
+
checked,
|
|
7027
|
+
disabled,
|
|
7028
|
+
id,
|
|
7029
|
+
name,
|
|
7030
|
+
onChange,
|
|
7031
|
+
type: "radio",
|
|
7032
|
+
value,
|
|
7033
|
+
...otherProps
|
|
7034
|
+
}
|
|
7035
|
+
),
|
|
7036
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(StyledLabelWrapper2, { children: [
|
|
7037
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
7038
|
+
Label,
|
|
7039
|
+
{
|
|
7040
|
+
disabled,
|
|
7041
|
+
htmlFor: computedId,
|
|
7042
|
+
required,
|
|
7043
|
+
children: label
|
|
7044
|
+
}
|
|
7045
|
+
),
|
|
7046
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(LabelDescription, { children: description })
|
|
7047
|
+
] })
|
|
7048
|
+
]
|
|
7049
|
+
}
|
|
7050
|
+
);
|
|
7051
|
+
}
|
|
7052
|
+
);
|
|
7053
|
+
Radio.displayName = "Radio";
|
|
7054
|
+
|
|
7055
|
+
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7056
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
7057
|
+
var import_type_guards20 = require("@wistia/type-guards");
|
|
7058
|
+
var import_jsx_runtime183 = require("react/jsx-runtime");
|
|
7059
|
+
var VisuallyHidden = import_styled_components36.default.div({ ...visuallyHiddenStyle });
|
|
7060
|
+
var VisuallyHiddenButFocusable = import_styled_components36.default.div({
|
|
6919
7061
|
"&:not(:focus-within)": visuallyHiddenStyle
|
|
6920
7062
|
});
|
|
6921
7063
|
var ScreenReaderOnly = ({
|
|
@@ -6924,20 +7066,20 @@ var ScreenReaderOnly = ({
|
|
|
6924
7066
|
focusable = false,
|
|
6925
7067
|
...otherProps
|
|
6926
7068
|
}) => {
|
|
6927
|
-
const accessibleText = (0,
|
|
7069
|
+
const accessibleText = (0, import_type_guards20.isNotNil)(text) ? text : children;
|
|
6928
7070
|
if (focusable) {
|
|
6929
|
-
return /* @__PURE__ */ (0,
|
|
7071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
6930
7072
|
}
|
|
6931
|
-
return /* @__PURE__ */ (0,
|
|
7073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
6932
7074
|
};
|
|
6933
7075
|
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
6934
7076
|
|
|
6935
7077
|
// src/components/Stack/Stack.tsx
|
|
6936
|
-
var
|
|
6937
|
-
var
|
|
6938
|
-
var
|
|
7078
|
+
var import_react19 = require("react");
|
|
7079
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
7080
|
+
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
6939
7081
|
var DEFAULT_ELEMENT3 = "div";
|
|
6940
|
-
var StyledStack =
|
|
7082
|
+
var StyledStack = import_styled_components37.default.div`
|
|
6941
7083
|
display: flex;
|
|
6942
7084
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
6943
7085
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
@@ -6946,11 +7088,11 @@ var StyledStack = import_styled_components36.default.div`
|
|
|
6946
7088
|
flex: 1;
|
|
6947
7089
|
}
|
|
6948
7090
|
`;
|
|
6949
|
-
var StackComponent = (0,
|
|
7091
|
+
var StackComponent = (0, import_react19.forwardRef)(
|
|
6950
7092
|
({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
|
|
6951
7093
|
const responsiveGap = useResponsiveProp(gap);
|
|
6952
7094
|
const responsiveDirection = useResponsiveProp(direction);
|
|
6953
|
-
return /* @__PURE__ */ (0,
|
|
7095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
6954
7096
|
StyledStack,
|
|
6955
7097
|
{
|
|
6956
7098
|
ref,
|
|
@@ -6965,27 +7107,167 @@ var StackComponent = (0, import_react18.forwardRef)(
|
|
|
6965
7107
|
StackComponent.displayName = "Stack";
|
|
6966
7108
|
var Stack = makePolymorphic(StackComponent);
|
|
6967
7109
|
|
|
7110
|
+
// src/components/Tag/Tag.tsx
|
|
7111
|
+
var import_react20 = require("react");
|
|
7112
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
7113
|
+
var import_type_guards21 = require("@wistia/type-guards");
|
|
7114
|
+
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
7115
|
+
var TagLabel = import_styled_components38.default.a`
|
|
7116
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7117
|
+
font-size: var(--wui-typography-label-4-size);
|
|
7118
|
+
font-weight: var(--wui-typography-label-4-weight);
|
|
7119
|
+
line-height: var(--wui-typography-label-4-line-height);
|
|
7120
|
+
border-radius: var(--wui-border-radius-01);
|
|
7121
|
+
align-items: center;
|
|
7122
|
+
color: var(--wui-color-text-high-contrast);
|
|
7123
|
+
text-decoration: none;
|
|
7124
|
+
padding: var(--wui-space-01);
|
|
7125
|
+
|
|
7126
|
+
:not(:only-child) {
|
|
7127
|
+
padding-right: var(--wui-space-01);
|
|
7128
|
+
}
|
|
7129
|
+
|
|
7130
|
+
:is(a):hover {
|
|
7131
|
+
background: var(--wui-color-bg-surface-secondary-hover);
|
|
7132
|
+
}
|
|
7133
|
+
|
|
7134
|
+
:is(a):active {
|
|
7135
|
+
background: var(--wui-color-bg-surface-secondary-active);
|
|
7136
|
+
}
|
|
7137
|
+
|
|
7138
|
+
:focus-visible {
|
|
7139
|
+
outline: unset;
|
|
7140
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
7141
|
+
}
|
|
7142
|
+
`;
|
|
7143
|
+
var TagDivider = import_styled_components38.default.div`
|
|
7144
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7145
|
+
border-left: 1px solid var(--wui-color-border);
|
|
7146
|
+
display: flex;
|
|
7147
|
+
height: 14px;
|
|
7148
|
+
width: 1px;
|
|
7149
|
+
`;
|
|
7150
|
+
var StyledRemoveButton = import_styled_components38.default.button`
|
|
7151
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7152
|
+
all: unset;
|
|
7153
|
+
cursor: pointer;
|
|
7154
|
+
display: flex;
|
|
7155
|
+
height: 22px;
|
|
7156
|
+
width: 12px;
|
|
7157
|
+
align-items: center;
|
|
7158
|
+
padding: 0 var(--wui-space-01);
|
|
7159
|
+
border-radius: var(--wui-border-radius-01);
|
|
7160
|
+
|
|
7161
|
+
svg path {
|
|
7162
|
+
fill: var(--wui-color-icon);
|
|
7163
|
+
}
|
|
7164
|
+
|
|
7165
|
+
:hover {
|
|
7166
|
+
background: var(--wui-color-bg-surface-secondary-hover);
|
|
7167
|
+
}
|
|
7168
|
+
|
|
7169
|
+
:active {
|
|
7170
|
+
background: var(--wui-color-bg-surface-secondary-active);
|
|
7171
|
+
}
|
|
7172
|
+
|
|
7173
|
+
:focus-visible {
|
|
7174
|
+
outline: unset;
|
|
7175
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
7176
|
+
}
|
|
7177
|
+
`;
|
|
7178
|
+
var StyledTag = import_styled_components38.default.div`
|
|
7179
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
7180
|
+
align-items: center;
|
|
7181
|
+
background-color: var(--wui-color-bg-surface-secondary);
|
|
7182
|
+
border-radius: var(--wui-border-radius-01);
|
|
7183
|
+
display: inline-flex;
|
|
7184
|
+
overflow: hidden;
|
|
7185
|
+
`;
|
|
7186
|
+
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
7187
|
+
if ((0, import_type_guards21.isNil)(onClickRemove)) {
|
|
7188
|
+
return null;
|
|
7189
|
+
}
|
|
7190
|
+
if ((0, import_type_guards21.isNil)(onClickRemoveLabel)) {
|
|
7191
|
+
throw new Error(
|
|
7192
|
+
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
7193
|
+
);
|
|
7194
|
+
}
|
|
7195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(import_jsx_runtime185.Fragment, { children: [
|
|
7196
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
7197
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
|
|
7198
|
+
StyledRemoveButton,
|
|
7199
|
+
{
|
|
7200
|
+
$colorScheme: colorScheme,
|
|
7201
|
+
onClick: onClickRemove,
|
|
7202
|
+
type: "button",
|
|
7203
|
+
children: [
|
|
7204
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7205
|
+
Icon,
|
|
7206
|
+
{
|
|
7207
|
+
size: "sm",
|
|
7208
|
+
type: "close"
|
|
7209
|
+
}
|
|
7210
|
+
),
|
|
7211
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
7212
|
+
]
|
|
7213
|
+
}
|
|
7214
|
+
)
|
|
7215
|
+
] });
|
|
7216
|
+
};
|
|
7217
|
+
var Tag = (0, import_react20.forwardRef)(
|
|
7218
|
+
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
7219
|
+
const labelProps = (0, import_type_guards21.isNotNil)(href) && (0, import_type_guards21.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
7220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
|
|
7221
|
+
StyledTag,
|
|
7222
|
+
{
|
|
7223
|
+
ref,
|
|
7224
|
+
$colorScheme: colorScheme,
|
|
7225
|
+
...otherProps,
|
|
7226
|
+
children: [
|
|
7227
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7228
|
+
TagLabel,
|
|
7229
|
+
{
|
|
7230
|
+
...labelProps,
|
|
7231
|
+
$colorScheme: colorScheme,
|
|
7232
|
+
children: label
|
|
7233
|
+
}
|
|
7234
|
+
),
|
|
7235
|
+
/* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
|
|
7236
|
+
RemoveButton,
|
|
7237
|
+
{
|
|
7238
|
+
colorScheme,
|
|
7239
|
+
onClickRemove,
|
|
7240
|
+
onClickRemoveLabel
|
|
7241
|
+
}
|
|
7242
|
+
)
|
|
7243
|
+
]
|
|
7244
|
+
}
|
|
7245
|
+
);
|
|
7246
|
+
}
|
|
7247
|
+
);
|
|
7248
|
+
Tag.displayName = "Tag";
|
|
7249
|
+
|
|
6968
7250
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
6969
|
-
var
|
|
6970
|
-
var
|
|
6971
|
-
var
|
|
7251
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7252
|
+
var import_type_guards22 = require("@wistia/type-guards");
|
|
7253
|
+
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
6972
7254
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
6973
7255
|
if (iconOnly) {
|
|
6974
|
-
return /* @__PURE__ */ (0,
|
|
7256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
6975
7257
|
"g",
|
|
6976
7258
|
{
|
|
6977
7259
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
6978
7260
|
fill: brandmarkColor,
|
|
6979
|
-
children: /* @__PURE__ */ (0,
|
|
7261
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime186.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" })
|
|
6980
7262
|
}
|
|
6981
7263
|
);
|
|
6982
7264
|
}
|
|
6983
|
-
return /* @__PURE__ */ (0,
|
|
7265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
6984
7266
|
"g",
|
|
6985
7267
|
{
|
|
6986
7268
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
6987
7269
|
fill: brandmarkColor,
|
|
6988
|
-
children: /* @__PURE__ */ (0,
|
|
7270
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime186.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" })
|
|
6989
7271
|
}
|
|
6990
7272
|
);
|
|
6991
7273
|
};
|
|
@@ -6993,12 +7275,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
6993
7275
|
if (iconOnly) {
|
|
6994
7276
|
return null;
|
|
6995
7277
|
}
|
|
6996
|
-
return /* @__PURE__ */ (0,
|
|
7278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
6997
7279
|
"g",
|
|
6998
7280
|
{
|
|
6999
7281
|
"data-testid": "ui-wistia-logo-logotype",
|
|
7000
7282
|
fill: logotypeColor,
|
|
7001
|
-
children: /* @__PURE__ */ (0,
|
|
7283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime186.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" })
|
|
7002
7284
|
}
|
|
7003
7285
|
);
|
|
7004
7286
|
};
|
|
@@ -7008,7 +7290,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
7008
7290
|
}
|
|
7009
7291
|
return "0 0 144 31.47";
|
|
7010
7292
|
};
|
|
7011
|
-
var WistiaLogoComponent =
|
|
7293
|
+
var WistiaLogoComponent = import_styled_components39.default.svg`
|
|
7012
7294
|
height: ${({ height }) => `${height}px`};
|
|
7013
7295
|
|
|
7014
7296
|
/* ensure it will always fit on mobile */
|
|
@@ -7050,7 +7332,7 @@ var WistiaLogo = ({
|
|
|
7050
7332
|
};
|
|
7051
7333
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
7052
7334
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
7053
|
-
const Logo = /* @__PURE__ */ (0,
|
|
7335
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(
|
|
7054
7336
|
WistiaLogoComponent,
|
|
7055
7337
|
{
|
|
7056
7338
|
$hoverColor: hoverColor,
|
|
@@ -7060,14 +7342,14 @@ var WistiaLogo = ({
|
|
|
7060
7342
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7061
7343
|
...otherProps,
|
|
7062
7344
|
children: [
|
|
7063
|
-
/* @__PURE__ */ (0,
|
|
7064
|
-
(0,
|
|
7345
|
+
/* @__PURE__ */ (0, import_jsx_runtime186.jsx)("title", { children: title }),
|
|
7346
|
+
(0, import_type_guards22.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("desc", { children: description }) : null,
|
|
7065
7347
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
7066
7348
|
renderLogotype(logotypeColor, iconOnly)
|
|
7067
7349
|
]
|
|
7068
7350
|
}
|
|
7069
7351
|
);
|
|
7070
|
-
return href !== void 0 ? /* @__PURE__ */ (0,
|
|
7352
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("a", { href, children: Logo }) : Logo;
|
|
7071
7353
|
};
|
|
7072
7354
|
WistiaLogo.displayName = "WistiaLogo";
|
|
7073
7355
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -7093,10 +7375,12 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
7093
7375
|
MenuItemLabel,
|
|
7094
7376
|
MenuLabel,
|
|
7095
7377
|
MenuRadioGroup,
|
|
7378
|
+
Radio,
|
|
7096
7379
|
RadioMenuItem,
|
|
7097
7380
|
ScreenReaderOnly,
|
|
7098
7381
|
Stack,
|
|
7099
7382
|
SubMenu,
|
|
7383
|
+
Tag,
|
|
7100
7384
|
Text,
|
|
7101
7385
|
Tooltip,
|
|
7102
7386
|
UIProvider,
|