@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.mjs
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
|
*/
|
|
@@ -820,11 +820,11 @@ import { css as css4 } from "styled-components";
|
|
|
820
820
|
var colorAliasTokens = css4`
|
|
821
821
|
--wui-color-bg-app: var(--wui-app-background);
|
|
822
822
|
|
|
823
|
-
/* ---
|
|
823
|
+
/* --- default --- */
|
|
824
824
|
--wui-color-bg-fill: var(--wui-blue-9);
|
|
825
825
|
--wui-color-bg-fill-active: var(--wui-blue-11);
|
|
826
826
|
--wui-color-bg-fill-hover: var(--wui-blue-10);
|
|
827
|
-
--wui-color-bg-surface: var(--wui-gray-
|
|
827
|
+
--wui-color-bg-surface: var(--wui-gray-1);
|
|
828
828
|
--wui-color-bg-surface-active: var(--wui-gray-4);
|
|
829
829
|
--wui-color-bg-surface-hover: var(--wui-gray-3);
|
|
830
830
|
--wui-color-bg-surface-secondary: var(--wui-gray-3);
|
|
@@ -853,7 +853,7 @@ var colorAliasTokens = css4`
|
|
|
853
853
|
--wui-color-bg-fill-error: var(--wui-error-9);
|
|
854
854
|
--wui-color-bg-fill-hover-error: var(--wui-error-10);
|
|
855
855
|
--wui-color-bg-surface-active-error: var(--wui-error-4);
|
|
856
|
-
--wui-color-bg-surface-error: var(--wui-error-
|
|
856
|
+
--wui-color-bg-surface-error: var(--wui-error-2);
|
|
857
857
|
--wui-color-bg-surface-hover-error: var(--wui-error-3);
|
|
858
858
|
--wui-color-bg-surface-secondary-active-error: var(--wui-error-5);
|
|
859
859
|
--wui-color-bg-surface-secondary-error: var(--wui-error-3);
|
|
@@ -880,7 +880,7 @@ var colorAliasTokens = css4`
|
|
|
880
880
|
--wui-color-bg-fill-info: var(--wui-blue-9);
|
|
881
881
|
--wui-color-bg-surface-active-info: var(--wui-blue-4);
|
|
882
882
|
--wui-color-bg-surface-hover-info: var(--wui-blue-3);
|
|
883
|
-
--wui-color-bg-surface-info: var(--wui-blue-
|
|
883
|
+
--wui-color-bg-surface-info: var(--wui-blue-2);
|
|
884
884
|
--wui-color-bg-surface-secondary-active-info: var(--wui-blue-5);
|
|
885
885
|
--wui-color-bg-surface-secondary-hover-info: var(--wui-blue-4);
|
|
886
886
|
--wui-color-bg-surface-secondary-info: var(--wui-blue-3);
|
|
@@ -909,7 +909,7 @@ var colorAliasTokens = css4`
|
|
|
909
909
|
--wui-color-bg-surface-secondary-active-success: var(--wui-success-5);
|
|
910
910
|
--wui-color-bg-surface-secondary-hover-success: var(--wui-success-4);
|
|
911
911
|
--wui-color-bg-surface-secondary-success: var(--wui-success-3);
|
|
912
|
-
--wui-color-bg-surface-success: var(--wui-success-
|
|
912
|
+
--wui-color-bg-surface-success: var(--wui-success-2);
|
|
913
913
|
--wui-color-bg-surface-tertiary-success: var(--wui-success-5);
|
|
914
914
|
--wui-color-border-success: var(--wui-success-6);
|
|
915
915
|
--wui-color-border-hover-success: var(--wui-success-8);
|
|
@@ -936,14 +936,14 @@ var colorAliasTokens = css4`
|
|
|
936
936
|
--wui-color-bg-surface-secondary-hover-warning: var(--wui-warning-4);
|
|
937
937
|
--wui-color-bg-surface-secondary-warning: var(--wui-warning-3);
|
|
938
938
|
--wui-color-bg-surface-tertiary-warning: var(--wui-warning-5);
|
|
939
|
-
--wui-color-bg-surface-warning: var(--wui-warning-
|
|
939
|
+
--wui-color-bg-surface-warning: var(--wui-warning-2);
|
|
940
940
|
--wui-color-border-warning: var(--wui-warning-6);
|
|
941
941
|
--wui-color-border-hover-warning: var(--wui-warning-8);
|
|
942
942
|
--wui-color-border-active-warning: var(--wui-warning-9);
|
|
943
943
|
--wui-color-border-secondary-warning: var(--wui-warning-8);
|
|
944
944
|
--wui-color-border-secondary-hover-warning: var(--wui-warning-10);
|
|
945
945
|
--wui-color-border-secondary-active-warning: var(--wui-warning-11);
|
|
946
|
-
--wui-color-icon-on-fill-warning: var(--wui-warning-
|
|
946
|
+
--wui-color-icon-on-fill-warning: var(--wui-warning-2);
|
|
947
947
|
--wui-color-icon-warning: var(--wui-warning-11);
|
|
948
948
|
--wui-color-text-high-contrast-warning: var(--wui-warning-12);
|
|
949
949
|
--wui-color-text-link-warning: var(--wui-warning-11);
|
|
@@ -959,7 +959,7 @@ var colorAliasTokens = css4`
|
|
|
959
959
|
--wui-color-bg-fill-blue: var(--wui-blue-9);
|
|
960
960
|
--wui-color-bg-fill-hover-blue: var(--wui-blue-10);
|
|
961
961
|
--wui-color-bg-surface-active-blue: var(--wui-blue-4);
|
|
962
|
-
--wui-color-bg-surface-blue: var(--wui-blue-
|
|
962
|
+
--wui-color-bg-surface-blue: var(--wui-blue-2);
|
|
963
963
|
--wui-color-bg-surface-hover-blue: var(--wui-blue-3);
|
|
964
964
|
--wui-color-bg-surface-secondary-active-blue: var(--wui-blue-5);
|
|
965
965
|
--wui-color-bg-surface-secondary-blue: var(--wui-blue-3);
|
|
@@ -976,7 +976,7 @@ var colorAliasTokens = css4`
|
|
|
976
976
|
--wui-color-text-blue: var(--wui-blue-11);
|
|
977
977
|
--wui-color-text-high-contrast-blue: var(--wui-blue-12);
|
|
978
978
|
--wui-color-text-link-blue: var(--wui-blue-9);
|
|
979
|
-
--wui-color-text-on-fill-blue: var(--wui-blue-
|
|
979
|
+
--wui-color-text-on-fill-blue: var(--wui-blue-2);
|
|
980
980
|
--wui-color-text-secondary-blue: var(--wui-blue-5);
|
|
981
981
|
--wui-color-focus-ring-blue: var(--wui-blue-9);
|
|
982
982
|
|
|
@@ -985,7 +985,7 @@ var colorAliasTokens = css4`
|
|
|
985
985
|
--wui-color-bg-fill-green: var(--wui-green-9);
|
|
986
986
|
--wui-color-bg-fill-hover-green: var(--wui-green-10);
|
|
987
987
|
--wui-color-bg-surface-active-green: var(--wui-green-4);
|
|
988
|
-
--wui-color-bg-surface-green: var(--wui-green-
|
|
988
|
+
--wui-color-bg-surface-green: var(--wui-green-2);
|
|
989
989
|
--wui-color-bg-surface-hover-green: var(--wui-green-3);
|
|
990
990
|
--wui-color-bg-surface-secondary-active-green: var(--wui-green-5);
|
|
991
991
|
--wui-color-bg-surface-secondary-green: var(--wui-green-3);
|
|
@@ -1012,7 +1012,7 @@ var colorAliasTokens = css4`
|
|
|
1012
1012
|
--wui-color-bg-fill-orange: var(--wui-orange-9);
|
|
1013
1013
|
--wui-color-bg-surface-active-orange: var(--wui-orange-4);
|
|
1014
1014
|
--wui-color-bg-surface-hover-orange: var(--wui-orange-3);
|
|
1015
|
-
--wui-color-bg-surface-orange: var(--wui-orange-
|
|
1015
|
+
--wui-color-bg-surface-orange: var(--wui-orange-2);
|
|
1016
1016
|
--wui-color-bg-surface-secondary-active-orange: var(--wui-orange-5);
|
|
1017
1017
|
--wui-color-bg-surface-secondary-hover-orange: var(--wui-orange-4);
|
|
1018
1018
|
--wui-color-bg-surface-secondary-orange: var(--wui-orange-3);
|
|
@@ -1038,7 +1038,7 @@ var colorAliasTokens = css4`
|
|
|
1038
1038
|
--wui-color-bg-fill-pink: var(--wui-pink-9);
|
|
1039
1039
|
--wui-color-bg-surface-active-pink: var(--wui-pink-4);
|
|
1040
1040
|
--wui-color-bg-surface-hover-pink: var(--wui-pink-3);
|
|
1041
|
-
--wui-color-bg-surface-pink: var(--wui-pink-
|
|
1041
|
+
--wui-color-bg-surface-pink: var(--wui-pink-2);
|
|
1042
1042
|
--wui-color-bg-surface-secondary-active-pink: var(--wui-pink-5);
|
|
1043
1043
|
--wui-color-bg-surface-secondary-hover-pink: var(--wui-pink-4);
|
|
1044
1044
|
--wui-color-bg-surface-secondary-pink: var(--wui-pink-3);
|
|
@@ -1064,7 +1064,7 @@ var colorAliasTokens = css4`
|
|
|
1064
1064
|
--wui-color-bg-fill-purple: var(--wui-purple-9);
|
|
1065
1065
|
--wui-color-bg-surface-active-purple: var(--wui-purple-4);
|
|
1066
1066
|
--wui-color-bg-surface-hover-purple: var(--wui-purple-3);
|
|
1067
|
-
--wui-color-bg-surface-purple: var(--wui-purple-
|
|
1067
|
+
--wui-color-bg-surface-purple: var(--wui-purple-2);
|
|
1068
1068
|
--wui-color-bg-surface-secondary-active-purple: var(--wui-purple-5);
|
|
1069
1069
|
--wui-color-bg-surface-secondary-hover-purple: var(--wui-purple-4);
|
|
1070
1070
|
--wui-color-bg-surface-secondary-purple: var(--wui-purple-3);
|
|
@@ -1094,7 +1094,7 @@ var colorAliasTokens = css4`
|
|
|
1094
1094
|
--wui-color-bg-surface-secondary-hover-yellow: var(--wui-yellow-4);
|
|
1095
1095
|
--wui-color-bg-surface-secondary-yellow: var(--wui-yellow-3);
|
|
1096
1096
|
--wui-color-bg-surface-tertiary-yellow: var(--wui-yellow-5);
|
|
1097
|
-
--wui-color-bg-surface-yellow: var(--wui-yellow-
|
|
1097
|
+
--wui-color-bg-surface-yellow: var(--wui-yellow-2);
|
|
1098
1098
|
--wui-color-border-yellow: var(--wui-yellow-6);
|
|
1099
1099
|
--wui-color-border-hover-yellow: var(--wui-yellow-8);
|
|
1100
1100
|
--wui-color-border-active-yellow: var(--wui-yellow-9);
|
|
@@ -1112,10 +1112,9 @@ var colorAliasTokens = css4`
|
|
|
1112
1112
|
|
|
1113
1113
|
/* --- Misc --- */
|
|
1114
1114
|
--wui-color-bg-fill-white: #ffffff;
|
|
1115
|
-
--wui-color-bg-nav: #1f3399;
|
|
1116
1115
|
--wui-color-focus-color: var(--wui-blue-9);
|
|
1117
1116
|
--wui-color-notification-pill-color: var(--wui-pink-9);
|
|
1118
|
-
--wui-color-
|
|
1117
|
+
--wui-color-backdrop: var(--wui-gray-alpha-9);
|
|
1119
1118
|
--wui-color-segmented-control-checked-background: var(--wui-bg-app);
|
|
1120
1119
|
--wui-color-text-on-fill-white-selected: var(--wui-blue-9);
|
|
1121
1120
|
--wui-color-bg-tooltip: #242528;
|
|
@@ -1641,7 +1640,51 @@ var defaultScheme = css10`
|
|
|
1641
1640
|
--wui-color-icon-on-fill: var(--wui-gray-contrast);
|
|
1642
1641
|
--wui-color-focus-ring: var(--wui-blue-9);
|
|
1643
1642
|
`;
|
|
1643
|
+
var navScheme = css10`
|
|
1644
|
+
--wui-color-bg-fill-active: var(--wui-blue-5);
|
|
1645
|
+
--wui-color-bg-fill-hover: var(--wui-blue-4);
|
|
1646
|
+
--wui-color-bg-fill: var(--wui-blue-1);
|
|
1647
|
+
--wui-color-bg-surface-active: #15246b;
|
|
1648
|
+
--wui-color-bg-surface-hover: #18297a;
|
|
1649
|
+
--wui-color-bg-surface-secondary-active: #121f5c;
|
|
1650
|
+
--wui-color-bg-surface-secondary-hover: #15246b;
|
|
1651
|
+
--wui-color-bg-surface-secondary: #18297a;
|
|
1652
|
+
--wui-color-bg-surface-tertiary: #3547a3;
|
|
1653
|
+
--wui-color-bg-surface: #1e3399;
|
|
1654
|
+
--wui-color-border: var(--wui-blue-1);
|
|
1655
|
+
--wui-color-border-hover: var(--wui-blue-2);
|
|
1656
|
+
--wui-color-border-active: var(--wui-blue-3);
|
|
1657
|
+
--wui-color-border-secondary: var(--wui-blue-9);
|
|
1658
|
+
--wui-color-border-secondary-hover: var(--wui-blue-10);
|
|
1659
|
+
--wui-color-border-secondary-active: var(--wui-blue-12);
|
|
1660
|
+
--wui-color-icon-on-fill: var(--wui-blue-9);
|
|
1661
|
+
--wui-color-icon: var(--wui-blue-4);
|
|
1662
|
+
--wui-color-text-high-contrast: var(--wui-blue-1);
|
|
1663
|
+
--wui-color-text-link: var(--wui-blue-4);
|
|
1664
|
+
--wui-color-text-on-fill: var(--wui-blue-9);
|
|
1665
|
+
--wui-color-text-secondary: var(--wui-blue-4);
|
|
1666
|
+
--wui-color-text: var(--wui-blue-1);
|
|
1667
|
+
--wui-color-focus-ring: var(--wui-blue-1);
|
|
1668
|
+
|
|
1669
|
+
/* Nav - Disabled */
|
|
1670
|
+
--wui-color-bg-surface-disabled: var(--wui-blue-12);
|
|
1671
|
+
--wui-color-icon-disabled: var(--wui-blue-8);
|
|
1672
|
+
--wui-color-text-disabled: var(--wui-blue-8);
|
|
1673
|
+
|
|
1674
|
+
/* Nav - Selected */
|
|
1675
|
+
--wui-color-bg-surface-selected: var(--wui-blue-3);
|
|
1676
|
+
--wui-color-bg-surface-selected-active: var(--wui-blue-5);
|
|
1677
|
+
--wui-color-bg-surface-selected-hover: var(--wui-blue-4);
|
|
1678
|
+
--wui-color-icon-selected: var(--wui-blue-9);
|
|
1679
|
+
--wui-color-text-selected: var(--wui-blue-9);
|
|
1680
|
+
--wui-color-border-selected: rgba(0, 0, 0, 0);
|
|
1681
|
+
--wui-color-border-hover-selected: rgba(0, 0, 0, 0);
|
|
1682
|
+
--wui-color-border-active-selected: rgba(0, 0, 0, 0);
|
|
1683
|
+
`;
|
|
1644
1684
|
var getColorScheme = (colorScheme) => {
|
|
1685
|
+
if (colorScheme === "nav") {
|
|
1686
|
+
return navScheme;
|
|
1687
|
+
}
|
|
1645
1688
|
if (colorScheme === "inherit") {
|
|
1646
1689
|
return null;
|
|
1647
1690
|
}
|
|
@@ -1651,7 +1694,7 @@ var getColorScheme = (colorScheme) => {
|
|
|
1651
1694
|
return css10`
|
|
1652
1695
|
${colorSchemeSchema.map(({ token, step }) => {
|
|
1653
1696
|
return `--wui-color-${token}: var(--wui-${colorScheme === "info" ? "blue" : colorScheme}-${step});`;
|
|
1654
|
-
})}
|
|
1697
|
+
}).join("")}
|
|
1655
1698
|
`;
|
|
1656
1699
|
};
|
|
1657
1700
|
|
|
@@ -1801,16 +1844,18 @@ var colorSchemeOptions = [
|
|
|
1801
1844
|
"vendor-pardot"
|
|
1802
1845
|
];
|
|
1803
1846
|
var StyledColorSchemeWrapper = styled3.div`
|
|
1804
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
1847
|
+
${({ $colorScheme, $nav }) => getColorScheme($nav ? "nav" : $colorScheme)};
|
|
1805
1848
|
`;
|
|
1806
1849
|
var ColorSchemeWrapper = ({
|
|
1807
|
-
|
|
1850
|
+
__nav = false,
|
|
1851
|
+
colorScheme = "inherit",
|
|
1808
1852
|
children,
|
|
1809
1853
|
...otherProps
|
|
1810
1854
|
}) => /* @__PURE__ */ jsx7(
|
|
1811
1855
|
StyledColorSchemeWrapper,
|
|
1812
1856
|
{
|
|
1813
1857
|
$colorScheme: colorScheme,
|
|
1858
|
+
$nav: __nav,
|
|
1814
1859
|
...otherProps,
|
|
1815
1860
|
children
|
|
1816
1861
|
}
|
|
@@ -6278,8 +6323,8 @@ import { jsx as jsx174 } from "react/jsx-runtime";
|
|
|
6278
6323
|
var StyledForm = styled17.form`
|
|
6279
6324
|
--form-default-width: 690px;
|
|
6280
6325
|
|
|
6281
|
-
max-width: ${({ fullWidth }) => fullWidth ? "auto" : "var(--form-default-width)"};
|
|
6282
|
-
align-items: ${({ fullWidth }) => fullWidth ? "stretch" : "flex-start"};
|
|
6326
|
+
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
6327
|
+
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
6283
6328
|
`;
|
|
6284
6329
|
var FormContext = createContext2({
|
|
6285
6330
|
values: {},
|
|
@@ -6350,8 +6395,8 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
6350
6395
|
gap: "space-05",
|
|
6351
6396
|
...props,
|
|
6352
6397
|
ref,
|
|
6398
|
+
$fullWidth: fullWidth,
|
|
6353
6399
|
as: StyledForm,
|
|
6354
|
-
fullWidth,
|
|
6355
6400
|
id,
|
|
6356
6401
|
onBlur: handleBlur,
|
|
6357
6402
|
onReset: handleReset,
|
|
@@ -7829,6 +7874,151 @@ var WistiaLogo = ({
|
|
|
7829
7874
|
return href !== void 0 ? /* @__PURE__ */ jsx195("a", { href, children: Logo }) : Logo;
|
|
7830
7875
|
};
|
|
7831
7876
|
WistiaLogo.displayName = "WistiaLogo";
|
|
7877
|
+
|
|
7878
|
+
// src/components/Input/Input.tsx
|
|
7879
|
+
import { forwardRef as forwardRef14, cloneElement as cloneElement5 } from "react";
|
|
7880
|
+
import styled32, { css as css19 } from "styled-components";
|
|
7881
|
+
import { isNil as isNil11, isNotNil as isNotNil13 } from "@wistia/type-guards";
|
|
7882
|
+
import { jsx as jsx196, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
7883
|
+
var inputStyles = css19`
|
|
7884
|
+
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
7885
|
+
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
7886
|
+
--wui-input-color-border: var(--wui-color-border);
|
|
7887
|
+
--wui-input-color-border-focus: var(--wui-color-border-active);
|
|
7888
|
+
--wui-input-color-border-error: var(--wui-color-border-error);
|
|
7889
|
+
--wui-input-color-border-disabled: var(--wui-color-border-disabled);
|
|
7890
|
+
--wui-input-border-radius: var(--wui-border-radius-rounded);
|
|
7891
|
+
--wui-input-multiline-border-radius: var(--wui-border-radius-02);
|
|
7892
|
+
--wui-input-vertical-padding: var(--wui-space-02);
|
|
7893
|
+
--wui-input-horizontal-padding: var(--wui-space-03);
|
|
7894
|
+
--wui-input-placeholder: var(--wui-gray-10);
|
|
7895
|
+
--wui-input-color-text-error: var(--wui-color-text-error);
|
|
7896
|
+
|
|
7897
|
+
input,
|
|
7898
|
+
textarea {
|
|
7899
|
+
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
7900
|
+
background-color: var(--wui-input-color-bg);
|
|
7901
|
+
border: 1px solid var(--wui-input-color-border);
|
|
7902
|
+
border-radius: var(--wui-input-border-radius);
|
|
7903
|
+
|
|
7904
|
+
&::placeholder {
|
|
7905
|
+
color: var(--wui-input-placeholder);
|
|
7906
|
+
opacity: 1; /* Firefox */
|
|
7907
|
+
}
|
|
7908
|
+
|
|
7909
|
+
&:focus {
|
|
7910
|
+
border-color: var(--wui-input-color-border-focus);
|
|
7911
|
+
}
|
|
7912
|
+
|
|
7913
|
+
&[aria-invalid='true'] {
|
|
7914
|
+
border-color: var(--wui-input-color-border-error);
|
|
7915
|
+
color: var(--wui-input-color-text-error);
|
|
7916
|
+
}
|
|
7917
|
+
|
|
7918
|
+
&:disabled {
|
|
7919
|
+
border-color: var(--wui-color-bg-surface-disabled);
|
|
7920
|
+
background-color: var(--wui-color-bg-surface-disabled);
|
|
7921
|
+
}
|
|
7922
|
+
}
|
|
7923
|
+
`;
|
|
7924
|
+
var StyledInputContainer = styled32.div`
|
|
7925
|
+
display: inline-flex;
|
|
7926
|
+
position: relative;
|
|
7927
|
+
${inputStyles};
|
|
7928
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7929
|
+
|
|
7930
|
+
input,
|
|
7931
|
+
textarea {
|
|
7932
|
+
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
7933
|
+
${({ $monospace }) => $monospace && "font-family: var(--wui-typography-family-mono);"}
|
|
7934
|
+
}
|
|
7935
|
+
|
|
7936
|
+
textarea {
|
|
7937
|
+
border-radius: var(--wui-input-multiline-border-radius);
|
|
7938
|
+
}
|
|
7939
|
+
|
|
7940
|
+
.wui-input-left-icon {
|
|
7941
|
+
display: flex;
|
|
7942
|
+
align-items: center;
|
|
7943
|
+
position: absolute;
|
|
7944
|
+
top: 50%;
|
|
7945
|
+
left: var(--wui-input-horizontal-padding);
|
|
7946
|
+
transform: translateY(-50%);
|
|
7947
|
+
}
|
|
7948
|
+
|
|
7949
|
+
:has(.wui-input-left-icon) input,
|
|
7950
|
+
:has(.wui-input-left-icon) textarea {
|
|
7951
|
+
padding-left: 32px;
|
|
7952
|
+
}
|
|
7953
|
+
|
|
7954
|
+
.wui-input-right-icon {
|
|
7955
|
+
display: flex;
|
|
7956
|
+
align-items: center;
|
|
7957
|
+
position: absolute;
|
|
7958
|
+
top: 50%;
|
|
7959
|
+
right: var(--wui-input-horizontal-padding);
|
|
7960
|
+
transform: translateY(-50%);
|
|
7961
|
+
}
|
|
7962
|
+
|
|
7963
|
+
:has(.wui-input-right-icon) input,
|
|
7964
|
+
:has(.wui-input-right-icon) textarea {
|
|
7965
|
+
padding-right: 32px;
|
|
7966
|
+
}
|
|
7967
|
+
`;
|
|
7968
|
+
var Input = forwardRef14(
|
|
7969
|
+
({
|
|
7970
|
+
fullWidth = false,
|
|
7971
|
+
monospace = false,
|
|
7972
|
+
type = "text",
|
|
7973
|
+
leftIcon,
|
|
7974
|
+
rightIcon,
|
|
7975
|
+
...props
|
|
7976
|
+
}, ref) => {
|
|
7977
|
+
let leftIconToDisplay = leftIcon;
|
|
7978
|
+
if (isNil11(leftIcon) && type === "search") {
|
|
7979
|
+
leftIconToDisplay = /* @__PURE__ */ jsx196(Icon, { type: "search" });
|
|
7980
|
+
}
|
|
7981
|
+
if (isNotNil13(leftIconToDisplay)) {
|
|
7982
|
+
leftIconToDisplay = cloneElement5(leftIconToDisplay, {
|
|
7983
|
+
size: "md",
|
|
7984
|
+
className: "wui-input-left-icon"
|
|
7985
|
+
});
|
|
7986
|
+
}
|
|
7987
|
+
let rightIconToDisplay = rightIcon;
|
|
7988
|
+
if (isNotNil13(rightIconToDisplay)) {
|
|
7989
|
+
rightIconToDisplay = cloneElement5(rightIconToDisplay, {
|
|
7990
|
+
size: "md",
|
|
7991
|
+
className: "wui-input-right-icon"
|
|
7992
|
+
});
|
|
7993
|
+
}
|
|
7994
|
+
return /* @__PURE__ */ jsxs20(
|
|
7995
|
+
StyledInputContainer,
|
|
7996
|
+
{
|
|
7997
|
+
$fullWidth: fullWidth,
|
|
7998
|
+
$monospace: monospace,
|
|
7999
|
+
children: [
|
|
8000
|
+
leftIconToDisplay ?? null,
|
|
8001
|
+
type === "multiline" ? /* @__PURE__ */ jsx196(
|
|
8002
|
+
"textarea",
|
|
8003
|
+
{
|
|
8004
|
+
...props,
|
|
8005
|
+
ref
|
|
8006
|
+
}
|
|
8007
|
+
) : /* @__PURE__ */ jsx196(
|
|
8008
|
+
"input",
|
|
8009
|
+
{
|
|
8010
|
+
...props,
|
|
8011
|
+
ref,
|
|
8012
|
+
type
|
|
8013
|
+
}
|
|
8014
|
+
),
|
|
8015
|
+
rightIconToDisplay ?? null
|
|
8016
|
+
]
|
|
8017
|
+
}
|
|
8018
|
+
);
|
|
8019
|
+
}
|
|
8020
|
+
);
|
|
8021
|
+
Input.displayName = "Input";
|
|
7832
8022
|
export {
|
|
7833
8023
|
Avatar,
|
|
7834
8024
|
Badge,
|
|
@@ -7848,6 +8038,7 @@ export {
|
|
|
7848
8038
|
Heading,
|
|
7849
8039
|
Icon,
|
|
7850
8040
|
IconButton,
|
|
8041
|
+
Input,
|
|
7851
8042
|
Label,
|
|
7852
8043
|
Link,
|
|
7853
8044
|
Menu,
|