@wistia/ui 0.0.24 → 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 +156 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +76 -17
- package/dist/index.d.ts +76 -17
- package/dist/index.mjs +152 -6
- 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");
|
|
@@ -1197,7 +1198,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1197
1198
|
--wui-color-bg-fill-white: #ffffff;
|
|
1198
1199
|
--wui-color-focus-color: var(--wui-blue-9);
|
|
1199
1200
|
--wui-color-notification-pill-color: var(--wui-pink-9);
|
|
1200
|
-
--wui-color-
|
|
1201
|
+
--wui-color-backdrop: var(--wui-gray-alpha-9);
|
|
1201
1202
|
--wui-color-segmented-control-checked-background: var(--wui-bg-app);
|
|
1202
1203
|
--wui-color-text-on-fill-white-selected: var(--wui-blue-9);
|
|
1203
1204
|
--wui-color-bg-tooltip: #242528;
|
|
@@ -6406,8 +6407,8 @@ var import_jsx_runtime174 = require("react/jsx-runtime");
|
|
|
6406
6407
|
var StyledForm = import_styled_components29.default.form`
|
|
6407
6408
|
--form-default-width: 690px;
|
|
6408
6409
|
|
|
6409
|
-
max-width: ${({ fullWidth }) => fullWidth ? "auto" : "var(--form-default-width)"};
|
|
6410
|
-
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"};
|
|
6411
6412
|
`;
|
|
6412
6413
|
var FormContext = (0, import_react16.createContext)({
|
|
6413
6414
|
values: {},
|
|
@@ -6478,8 +6479,8 @@ var FormComponent = ({ children, action, values = {}, validate, fullWidth = fals
|
|
|
6478
6479
|
gap: "space-05",
|
|
6479
6480
|
...props,
|
|
6480
6481
|
ref,
|
|
6482
|
+
$fullWidth: fullWidth,
|
|
6481
6483
|
as: StyledForm,
|
|
6482
|
-
fullWidth,
|
|
6483
6484
|
id,
|
|
6484
6485
|
onBlur: handleBlur,
|
|
6485
6486
|
onReset: handleReset,
|
|
@@ -7932,6 +7933,151 @@ var WistiaLogo = ({
|
|
|
7932
7933
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("a", { href, children: Logo }) : Logo;
|
|
7933
7934
|
};
|
|
7934
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";
|
|
7935
8081
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7936
8082
|
0 && (module.exports = {
|
|
7937
8083
|
Avatar,
|
|
@@ -7952,6 +8098,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
7952
8098
|
Heading,
|
|
7953
8099
|
Icon,
|
|
7954
8100
|
IconButton,
|
|
8101
|
+
Input,
|
|
7955
8102
|
Label,
|
|
7956
8103
|
Link,
|
|
7957
8104
|
Menu,
|