@wistia/ui 0.0.23 → 0.0.25
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 +219 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +82 -19
- package/dist/index.d.ts +82 -19
- package/dist/index.mjs +215 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -19
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.0.
|
|
3
|
+
* @license @wistia/ui v0.0.25
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2024-
|
|
5
|
+
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is unlicensed, all rights reserved.
|
|
8
8
|
*/
|
|
@@ -37,8 +37,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
37
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
38
|
|
|
39
39
|
// src/index.ts
|
|
40
|
-
var
|
|
41
|
-
__export(
|
|
40
|
+
var index_exports = {};
|
|
41
|
+
__export(index_exports, {
|
|
42
42
|
Avatar: () => Avatar,
|
|
43
43
|
Badge: () => Badge,
|
|
44
44
|
Box: () => Box,
|
|
@@ -57,6 +57,7 @@ __export(src_exports, {
|
|
|
57
57
|
Heading: () => Heading,
|
|
58
58
|
Icon: () => Icon,
|
|
59
59
|
IconButton: () => IconButton,
|
|
60
|
+
Input: () => Input,
|
|
60
61
|
Label: () => Label,
|
|
61
62
|
Link: () => Link,
|
|
62
63
|
Menu: () => Menu,
|
|
@@ -89,7 +90,7 @@ __export(src_exports, {
|
|
|
89
90
|
useToast: () => useToast,
|
|
90
91
|
useWindowSize: () => useWindowSize
|
|
91
92
|
});
|
|
92
|
-
module.exports = __toCommonJS(
|
|
93
|
+
module.exports = __toCommonJS(index_exports);
|
|
93
94
|
|
|
94
95
|
// src/providers/UIProvider/UIProvider.tsx
|
|
95
96
|
var import_react_tooltip = require("@radix-ui/react-tooltip");
|
|
@@ -903,11 +904,11 @@ var import_styled_components4 = require("styled-components");
|
|
|
903
904
|
var colorAliasTokens = import_styled_components4.css`
|
|
904
905
|
--wui-color-bg-app: var(--wui-app-background);
|
|
905
906
|
|
|
906
|
-
/* ---
|
|
907
|
+
/* --- default --- */
|
|
907
908
|
--wui-color-bg-fill: var(--wui-blue-9);
|
|
908
909
|
--wui-color-bg-fill-active: var(--wui-blue-11);
|
|
909
910
|
--wui-color-bg-fill-hover: var(--wui-blue-10);
|
|
910
|
-
--wui-color-bg-surface: var(--wui-gray-
|
|
911
|
+
--wui-color-bg-surface: var(--wui-gray-1);
|
|
911
912
|
--wui-color-bg-surface-active: var(--wui-gray-4);
|
|
912
913
|
--wui-color-bg-surface-hover: var(--wui-gray-3);
|
|
913
914
|
--wui-color-bg-surface-secondary: var(--wui-gray-3);
|
|
@@ -936,7 +937,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
936
937
|
--wui-color-bg-fill-error: var(--wui-error-9);
|
|
937
938
|
--wui-color-bg-fill-hover-error: var(--wui-error-10);
|
|
938
939
|
--wui-color-bg-surface-active-error: var(--wui-error-4);
|
|
939
|
-
--wui-color-bg-surface-error: var(--wui-error-
|
|
940
|
+
--wui-color-bg-surface-error: var(--wui-error-2);
|
|
940
941
|
--wui-color-bg-surface-hover-error: var(--wui-error-3);
|
|
941
942
|
--wui-color-bg-surface-secondary-active-error: var(--wui-error-5);
|
|
942
943
|
--wui-color-bg-surface-secondary-error: var(--wui-error-3);
|
|
@@ -963,7 +964,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
963
964
|
--wui-color-bg-fill-info: var(--wui-blue-9);
|
|
964
965
|
--wui-color-bg-surface-active-info: var(--wui-blue-4);
|
|
965
966
|
--wui-color-bg-surface-hover-info: var(--wui-blue-3);
|
|
966
|
-
--wui-color-bg-surface-info: var(--wui-blue-
|
|
967
|
+
--wui-color-bg-surface-info: var(--wui-blue-2);
|
|
967
968
|
--wui-color-bg-surface-secondary-active-info: var(--wui-blue-5);
|
|
968
969
|
--wui-color-bg-surface-secondary-hover-info: var(--wui-blue-4);
|
|
969
970
|
--wui-color-bg-surface-secondary-info: var(--wui-blue-3);
|
|
@@ -992,7 +993,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
992
993
|
--wui-color-bg-surface-secondary-active-success: var(--wui-success-5);
|
|
993
994
|
--wui-color-bg-surface-secondary-hover-success: var(--wui-success-4);
|
|
994
995
|
--wui-color-bg-surface-secondary-success: var(--wui-success-3);
|
|
995
|
-
--wui-color-bg-surface-success: var(--wui-success-
|
|
996
|
+
--wui-color-bg-surface-success: var(--wui-success-2);
|
|
996
997
|
--wui-color-bg-surface-tertiary-success: var(--wui-success-5);
|
|
997
998
|
--wui-color-border-success: var(--wui-success-6);
|
|
998
999
|
--wui-color-border-hover-success: var(--wui-success-8);
|
|
@@ -1019,14 +1020,14 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1019
1020
|
--wui-color-bg-surface-secondary-hover-warning: var(--wui-warning-4);
|
|
1020
1021
|
--wui-color-bg-surface-secondary-warning: var(--wui-warning-3);
|
|
1021
1022
|
--wui-color-bg-surface-tertiary-warning: var(--wui-warning-5);
|
|
1022
|
-
--wui-color-bg-surface-warning: var(--wui-warning-
|
|
1023
|
+
--wui-color-bg-surface-warning: var(--wui-warning-2);
|
|
1023
1024
|
--wui-color-border-warning: var(--wui-warning-6);
|
|
1024
1025
|
--wui-color-border-hover-warning: var(--wui-warning-8);
|
|
1025
1026
|
--wui-color-border-active-warning: var(--wui-warning-9);
|
|
1026
1027
|
--wui-color-border-secondary-warning: var(--wui-warning-8);
|
|
1027
1028
|
--wui-color-border-secondary-hover-warning: var(--wui-warning-10);
|
|
1028
1029
|
--wui-color-border-secondary-active-warning: var(--wui-warning-11);
|
|
1029
|
-
--wui-color-icon-on-fill-warning: var(--wui-warning-
|
|
1030
|
+
--wui-color-icon-on-fill-warning: var(--wui-warning-2);
|
|
1030
1031
|
--wui-color-icon-warning: var(--wui-warning-11);
|
|
1031
1032
|
--wui-color-text-high-contrast-warning: var(--wui-warning-12);
|
|
1032
1033
|
--wui-color-text-link-warning: var(--wui-warning-11);
|
|
@@ -1042,7 +1043,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1042
1043
|
--wui-color-bg-fill-blue: var(--wui-blue-9);
|
|
1043
1044
|
--wui-color-bg-fill-hover-blue: var(--wui-blue-10);
|
|
1044
1045
|
--wui-color-bg-surface-active-blue: var(--wui-blue-4);
|
|
1045
|
-
--wui-color-bg-surface-blue: var(--wui-blue-
|
|
1046
|
+
--wui-color-bg-surface-blue: var(--wui-blue-2);
|
|
1046
1047
|
--wui-color-bg-surface-hover-blue: var(--wui-blue-3);
|
|
1047
1048
|
--wui-color-bg-surface-secondary-active-blue: var(--wui-blue-5);
|
|
1048
1049
|
--wui-color-bg-surface-secondary-blue: var(--wui-blue-3);
|
|
@@ -1059,7 +1060,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1059
1060
|
--wui-color-text-blue: var(--wui-blue-11);
|
|
1060
1061
|
--wui-color-text-high-contrast-blue: var(--wui-blue-12);
|
|
1061
1062
|
--wui-color-text-link-blue: var(--wui-blue-9);
|
|
1062
|
-
--wui-color-text-on-fill-blue: var(--wui-blue-
|
|
1063
|
+
--wui-color-text-on-fill-blue: var(--wui-blue-2);
|
|
1063
1064
|
--wui-color-text-secondary-blue: var(--wui-blue-5);
|
|
1064
1065
|
--wui-color-focus-ring-blue: var(--wui-blue-9);
|
|
1065
1066
|
|
|
@@ -1068,7 +1069,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1068
1069
|
--wui-color-bg-fill-green: var(--wui-green-9);
|
|
1069
1070
|
--wui-color-bg-fill-hover-green: var(--wui-green-10);
|
|
1070
1071
|
--wui-color-bg-surface-active-green: var(--wui-green-4);
|
|
1071
|
-
--wui-color-bg-surface-green: var(--wui-green-
|
|
1072
|
+
--wui-color-bg-surface-green: var(--wui-green-2);
|
|
1072
1073
|
--wui-color-bg-surface-hover-green: var(--wui-green-3);
|
|
1073
1074
|
--wui-color-bg-surface-secondary-active-green: var(--wui-green-5);
|
|
1074
1075
|
--wui-color-bg-surface-secondary-green: var(--wui-green-3);
|
|
@@ -1095,7 +1096,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1095
1096
|
--wui-color-bg-fill-orange: var(--wui-orange-9);
|
|
1096
1097
|
--wui-color-bg-surface-active-orange: var(--wui-orange-4);
|
|
1097
1098
|
--wui-color-bg-surface-hover-orange: var(--wui-orange-3);
|
|
1098
|
-
--wui-color-bg-surface-orange: var(--wui-orange-
|
|
1099
|
+
--wui-color-bg-surface-orange: var(--wui-orange-2);
|
|
1099
1100
|
--wui-color-bg-surface-secondary-active-orange: var(--wui-orange-5);
|
|
1100
1101
|
--wui-color-bg-surface-secondary-hover-orange: var(--wui-orange-4);
|
|
1101
1102
|
--wui-color-bg-surface-secondary-orange: var(--wui-orange-3);
|
|
@@ -1121,7 +1122,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1121
1122
|
--wui-color-bg-fill-pink: var(--wui-pink-9);
|
|
1122
1123
|
--wui-color-bg-surface-active-pink: var(--wui-pink-4);
|
|
1123
1124
|
--wui-color-bg-surface-hover-pink: var(--wui-pink-3);
|
|
1124
|
-
--wui-color-bg-surface-pink: var(--wui-pink-
|
|
1125
|
+
--wui-color-bg-surface-pink: var(--wui-pink-2);
|
|
1125
1126
|
--wui-color-bg-surface-secondary-active-pink: var(--wui-pink-5);
|
|
1126
1127
|
--wui-color-bg-surface-secondary-hover-pink: var(--wui-pink-4);
|
|
1127
1128
|
--wui-color-bg-surface-secondary-pink: var(--wui-pink-3);
|
|
@@ -1147,7 +1148,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1147
1148
|
--wui-color-bg-fill-purple: var(--wui-purple-9);
|
|
1148
1149
|
--wui-color-bg-surface-active-purple: var(--wui-purple-4);
|
|
1149
1150
|
--wui-color-bg-surface-hover-purple: var(--wui-purple-3);
|
|
1150
|
-
--wui-color-bg-surface-purple: var(--wui-purple-
|
|
1151
|
+
--wui-color-bg-surface-purple: var(--wui-purple-2);
|
|
1151
1152
|
--wui-color-bg-surface-secondary-active-purple: var(--wui-purple-5);
|
|
1152
1153
|
--wui-color-bg-surface-secondary-hover-purple: var(--wui-purple-4);
|
|
1153
1154
|
--wui-color-bg-surface-secondary-purple: var(--wui-purple-3);
|
|
@@ -1177,7 +1178,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1177
1178
|
--wui-color-bg-surface-secondary-hover-yellow: var(--wui-yellow-4);
|
|
1178
1179
|
--wui-color-bg-surface-secondary-yellow: var(--wui-yellow-3);
|
|
1179
1180
|
--wui-color-bg-surface-tertiary-yellow: var(--wui-yellow-5);
|
|
1180
|
-
--wui-color-bg-surface-yellow: var(--wui-yellow-
|
|
1181
|
+
--wui-color-bg-surface-yellow: var(--wui-yellow-2);
|
|
1181
1182
|
--wui-color-border-yellow: var(--wui-yellow-6);
|
|
1182
1183
|
--wui-color-border-hover-yellow: var(--wui-yellow-8);
|
|
1183
1184
|
--wui-color-border-active-yellow: var(--wui-yellow-9);
|
|
@@ -1195,10 +1196,9 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1195
1196
|
|
|
1196
1197
|
/* --- Misc --- */
|
|
1197
1198
|
--wui-color-bg-fill-white: #ffffff;
|
|
1198
|
-
--wui-color-bg-nav: #1f3399;
|
|
1199
1199
|
--wui-color-focus-color: var(--wui-blue-9);
|
|
1200
1200
|
--wui-color-notification-pill-color: var(--wui-pink-9);
|
|
1201
|
-
--wui-color-
|
|
1201
|
+
--wui-color-backdrop: var(--wui-gray-alpha-9);
|
|
1202
1202
|
--wui-color-segmented-control-checked-background: var(--wui-bg-app);
|
|
1203
1203
|
--wui-color-text-on-fill-white-selected: var(--wui-blue-9);
|
|
1204
1204
|
--wui-color-bg-tooltip: #242528;
|
|
@@ -1724,7 +1724,51 @@ var defaultScheme = import_styled_components11.css`
|
|
|
1724
1724
|
--wui-color-icon-on-fill: var(--wui-gray-contrast);
|
|
1725
1725
|
--wui-color-focus-ring: var(--wui-blue-9);
|
|
1726
1726
|
`;
|
|
1727
|
+
var navScheme = import_styled_components11.css`
|
|
1728
|
+
--wui-color-bg-fill-active: var(--wui-blue-5);
|
|
1729
|
+
--wui-color-bg-fill-hover: var(--wui-blue-4);
|
|
1730
|
+
--wui-color-bg-fill: var(--wui-blue-1);
|
|
1731
|
+
--wui-color-bg-surface-active: #15246b;
|
|
1732
|
+
--wui-color-bg-surface-hover: #18297a;
|
|
1733
|
+
--wui-color-bg-surface-secondary-active: #121f5c;
|
|
1734
|
+
--wui-color-bg-surface-secondary-hover: #15246b;
|
|
1735
|
+
--wui-color-bg-surface-secondary: #18297a;
|
|
1736
|
+
--wui-color-bg-surface-tertiary: #3547a3;
|
|
1737
|
+
--wui-color-bg-surface: #1e3399;
|
|
1738
|
+
--wui-color-border: var(--wui-blue-1);
|
|
1739
|
+
--wui-color-border-hover: var(--wui-blue-2);
|
|
1740
|
+
--wui-color-border-active: var(--wui-blue-3);
|
|
1741
|
+
--wui-color-border-secondary: var(--wui-blue-9);
|
|
1742
|
+
--wui-color-border-secondary-hover: var(--wui-blue-10);
|
|
1743
|
+
--wui-color-border-secondary-active: var(--wui-blue-12);
|
|
1744
|
+
--wui-color-icon-on-fill: var(--wui-blue-9);
|
|
1745
|
+
--wui-color-icon: var(--wui-blue-4);
|
|
1746
|
+
--wui-color-text-high-contrast: var(--wui-blue-1);
|
|
1747
|
+
--wui-color-text-link: var(--wui-blue-4);
|
|
1748
|
+
--wui-color-text-on-fill: var(--wui-blue-9);
|
|
1749
|
+
--wui-color-text-secondary: var(--wui-blue-4);
|
|
1750
|
+
--wui-color-text: var(--wui-blue-1);
|
|
1751
|
+
--wui-color-focus-ring: var(--wui-blue-1);
|
|
1752
|
+
|
|
1753
|
+
/* Nav - Disabled */
|
|
1754
|
+
--wui-color-bg-surface-disabled: var(--wui-blue-12);
|
|
1755
|
+
--wui-color-icon-disabled: var(--wui-blue-8);
|
|
1756
|
+
--wui-color-text-disabled: var(--wui-blue-8);
|
|
1757
|
+
|
|
1758
|
+
/* Nav - Selected */
|
|
1759
|
+
--wui-color-bg-surface-selected: var(--wui-blue-3);
|
|
1760
|
+
--wui-color-bg-surface-selected-active: var(--wui-blue-5);
|
|
1761
|
+
--wui-color-bg-surface-selected-hover: var(--wui-blue-4);
|
|
1762
|
+
--wui-color-icon-selected: var(--wui-blue-9);
|
|
1763
|
+
--wui-color-text-selected: var(--wui-blue-9);
|
|
1764
|
+
--wui-color-border-selected: rgba(0, 0, 0, 0);
|
|
1765
|
+
--wui-color-border-hover-selected: rgba(0, 0, 0, 0);
|
|
1766
|
+
--wui-color-border-active-selected: rgba(0, 0, 0, 0);
|
|
1767
|
+
`;
|
|
1727
1768
|
var getColorScheme = (colorScheme) => {
|
|
1769
|
+
if (colorScheme === "nav") {
|
|
1770
|
+
return navScheme;
|
|
1771
|
+
}
|
|
1728
1772
|
if (colorScheme === "inherit") {
|
|
1729
1773
|
return null;
|
|
1730
1774
|
}
|
|
@@ -1734,7 +1778,7 @@ var getColorScheme = (colorScheme) => {
|
|
|
1734
1778
|
return import_styled_components11.css`
|
|
1735
1779
|
${colorSchemeSchema.map(({ token, step }) => {
|
|
1736
1780
|
return `--wui-color-${token}: var(--wui-${colorScheme === "info" ? "blue" : colorScheme}-${step});`;
|
|
1737
|
-
})}
|
|
1781
|
+
}).join("")}
|
|
1738
1782
|
`;
|
|
1739
1783
|
};
|
|
1740
1784
|
|
|
@@ -1884,16 +1928,18 @@ var colorSchemeOptions = [
|
|
|
1884
1928
|
"vendor-pardot"
|
|
1885
1929
|
];
|
|
1886
1930
|
var StyledColorSchemeWrapper = import_styled_components13.default.div`
|
|
1887
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
1931
|
+
${({ $colorScheme, $nav }) => getColorScheme($nav ? "nav" : $colorScheme)};
|
|
1888
1932
|
`;
|
|
1889
1933
|
var ColorSchemeWrapper = ({
|
|
1890
|
-
|
|
1934
|
+
__nav = false,
|
|
1935
|
+
colorScheme = "inherit",
|
|
1891
1936
|
children,
|
|
1892
1937
|
...otherProps
|
|
1893
1938
|
}) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1894
1939
|
StyledColorSchemeWrapper,
|
|
1895
1940
|
{
|
|
1896
1941
|
$colorScheme: colorScheme,
|
|
1942
|
+
$nav: __nav,
|
|
1897
1943
|
...otherProps,
|
|
1898
1944
|
children
|
|
1899
1945
|
}
|
|
@@ -6361,8 +6407,8 @@ var import_jsx_runtime174 = require("react/jsx-runtime");
|
|
|
6361
6407
|
var StyledForm = import_styled_components29.default.form`
|
|
6362
6408
|
--form-default-width: 690px;
|
|
6363
6409
|
|
|
6364
|
-
max-width: ${({ fullWidth }) => fullWidth ? "auto" : "var(--form-default-width)"};
|
|
6365
|
-
align-items: ${({ fullWidth }) => fullWidth ? "stretch" : "flex-start"};
|
|
6410
|
+
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
6411
|
+
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
6366
6412
|
`;
|
|
6367
6413
|
var FormContext = (0, import_react16.createContext)({
|
|
6368
6414
|
values: {},
|
|
@@ -6433,8 +6479,8 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
6433
6479
|
gap: "space-05",
|
|
6434
6480
|
...props,
|
|
6435
6481
|
ref,
|
|
6482
|
+
$fullWidth: fullWidth,
|
|
6436
6483
|
as: StyledForm,
|
|
6437
|
-
fullWidth,
|
|
6438
6484
|
id,
|
|
6439
6485
|
onBlur: handleBlur,
|
|
6440
6486
|
onReset: handleReset,
|
|
@@ -7887,6 +7933,151 @@ var WistiaLogo = ({
|
|
|
7887
7933
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("a", { href, children: Logo }) : Logo;
|
|
7888
7934
|
};
|
|
7889
7935
|
WistiaLogo.displayName = "WistiaLogo";
|
|
7936
|
+
|
|
7937
|
+
// src/components/Input/Input.tsx
|
|
7938
|
+
var import_react30 = require("react");
|
|
7939
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
7940
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
7941
|
+
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
7942
|
+
var inputStyles = import_styled_components44.css`
|
|
7943
|
+
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7944
|
+
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
7945
|
+
--wui-input-color-border: var(--wui-color-border);
|
|
7946
|
+
--wui-input-color-border-focus: var(--wui-color-border-active);
|
|
7947
|
+
--wui-input-color-border-error: var(--wui-color-border-error);
|
|
7948
|
+
--wui-input-color-border-disabled: var(--wui-color-border-disabled);
|
|
7949
|
+
--wui-input-border-radius: var(--wui-border-radius-rounded);
|
|
7950
|
+
--wui-input-multiline-border-radius: var(--wui-border-radius-02);
|
|
7951
|
+
--wui-input-vertical-padding: var(--wui-space-02);
|
|
7952
|
+
--wui-input-horizontal-padding: var(--wui-space-03);
|
|
7953
|
+
--wui-input-placeholder: var(--wui-gray-10);
|
|
7954
|
+
--wui-input-color-text-error: var(--wui-color-text-error);
|
|
7955
|
+
|
|
7956
|
+
input,
|
|
7957
|
+
textarea {
|
|
7958
|
+
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
7959
|
+
background-color: var(--wui-input-color-bg);
|
|
7960
|
+
border: 1px solid var(--wui-input-color-border);
|
|
7961
|
+
border-radius: var(--wui-input-border-radius);
|
|
7962
|
+
|
|
7963
|
+
&::placeholder {
|
|
7964
|
+
color: var(--wui-input-placeholder);
|
|
7965
|
+
opacity: 1; /* Firefox */
|
|
7966
|
+
}
|
|
7967
|
+
|
|
7968
|
+
&:focus {
|
|
7969
|
+
border-color: var(--wui-input-color-border-focus);
|
|
7970
|
+
}
|
|
7971
|
+
|
|
7972
|
+
&[aria-invalid='true'] {
|
|
7973
|
+
border-color: var(--wui-input-color-border-error);
|
|
7974
|
+
color: var(--wui-input-color-text-error);
|
|
7975
|
+
}
|
|
7976
|
+
|
|
7977
|
+
&:disabled {
|
|
7978
|
+
border-color: var(--wui-color-bg-surface-disabled);
|
|
7979
|
+
background-color: var(--wui-color-bg-surface-disabled);
|
|
7980
|
+
}
|
|
7981
|
+
}
|
|
7982
|
+
`;
|
|
7983
|
+
var StyledInputContainer = import_styled_components44.default.div`
|
|
7984
|
+
display: inline-flex;
|
|
7985
|
+
position: relative;
|
|
7986
|
+
${inputStyles};
|
|
7987
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7988
|
+
|
|
7989
|
+
input,
|
|
7990
|
+
textarea {
|
|
7991
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7992
|
+
${({ $monospace }) => $monospace && "font-family: var(--wui-typography-family-mono);"}
|
|
7993
|
+
}
|
|
7994
|
+
|
|
7995
|
+
textarea {
|
|
7996
|
+
border-radius: var(--wui-input-multiline-border-radius);
|
|
7997
|
+
}
|
|
7998
|
+
|
|
7999
|
+
.wui-input-left-icon {
|
|
8000
|
+
display: flex;
|
|
8001
|
+
align-items: center;
|
|
8002
|
+
position: absolute;
|
|
8003
|
+
top: 50%;
|
|
8004
|
+
left: var(--wui-input-horizontal-padding);
|
|
8005
|
+
transform: translateY(-50%);
|
|
8006
|
+
}
|
|
8007
|
+
|
|
8008
|
+
:has(.wui-input-left-icon) input,
|
|
8009
|
+
:has(.wui-input-left-icon) textarea {
|
|
8010
|
+
padding-left: 32px;
|
|
8011
|
+
}
|
|
8012
|
+
|
|
8013
|
+
.wui-input-right-icon {
|
|
8014
|
+
display: flex;
|
|
8015
|
+
align-items: center;
|
|
8016
|
+
position: absolute;
|
|
8017
|
+
top: 50%;
|
|
8018
|
+
right: var(--wui-input-horizontal-padding);
|
|
8019
|
+
transform: translateY(-50%);
|
|
8020
|
+
}
|
|
8021
|
+
|
|
8022
|
+
:has(.wui-input-right-icon) input,
|
|
8023
|
+
:has(.wui-input-right-icon) textarea {
|
|
8024
|
+
padding-right: 32px;
|
|
8025
|
+
}
|
|
8026
|
+
`;
|
|
8027
|
+
var Input = (0, import_react30.forwardRef)(
|
|
8028
|
+
({
|
|
8029
|
+
fullWidth = false,
|
|
8030
|
+
monospace = false,
|
|
8031
|
+
type = "text",
|
|
8032
|
+
leftIcon,
|
|
8033
|
+
rightIcon,
|
|
8034
|
+
...props
|
|
8035
|
+
}, ref) => {
|
|
8036
|
+
let leftIconToDisplay = leftIcon;
|
|
8037
|
+
if ((0, import_type_guards27.isNil)(leftIcon) && type === "search") {
|
|
8038
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(Icon, { type: "search" });
|
|
8039
|
+
}
|
|
8040
|
+
if ((0, import_type_guards27.isNotNil)(leftIconToDisplay)) {
|
|
8041
|
+
leftIconToDisplay = (0, import_react30.cloneElement)(leftIconToDisplay, {
|
|
8042
|
+
size: "md",
|
|
8043
|
+
className: "wui-input-left-icon"
|
|
8044
|
+
});
|
|
8045
|
+
}
|
|
8046
|
+
let rightIconToDisplay = rightIcon;
|
|
8047
|
+
if ((0, import_type_guards27.isNotNil)(rightIconToDisplay)) {
|
|
8048
|
+
rightIconToDisplay = (0, import_react30.cloneElement)(rightIconToDisplay, {
|
|
8049
|
+
size: "md",
|
|
8050
|
+
className: "wui-input-right-icon"
|
|
8051
|
+
});
|
|
8052
|
+
}
|
|
8053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)(
|
|
8054
|
+
StyledInputContainer,
|
|
8055
|
+
{
|
|
8056
|
+
$fullWidth: fullWidth,
|
|
8057
|
+
$monospace: monospace,
|
|
8058
|
+
children: [
|
|
8059
|
+
leftIconToDisplay ?? null,
|
|
8060
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
8061
|
+
"textarea",
|
|
8062
|
+
{
|
|
8063
|
+
...props,
|
|
8064
|
+
ref
|
|
8065
|
+
}
|
|
8066
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
8067
|
+
"input",
|
|
8068
|
+
{
|
|
8069
|
+
...props,
|
|
8070
|
+
ref,
|
|
8071
|
+
type
|
|
8072
|
+
}
|
|
8073
|
+
),
|
|
8074
|
+
rightIconToDisplay ?? null
|
|
8075
|
+
]
|
|
8076
|
+
}
|
|
8077
|
+
);
|
|
8078
|
+
}
|
|
8079
|
+
);
|
|
8080
|
+
Input.displayName = "Input";
|
|
7890
8081
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7891
8082
|
0 && (module.exports = {
|
|
7892
8083
|
Avatar,
|
|
@@ -7907,6 +8098,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
7907
8098
|
Heading,
|
|
7908
8099
|
Icon,
|
|
7909
8100
|
IconButton,
|
|
8101
|
+
Input,
|
|
7910
8102
|
Label,
|
|
7911
8103
|
Link,
|
|
7912
8104
|
Menu,
|