@wistia/ui 0.14.30 → 0.14.31-beta.784dab94.9445c39
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 +15 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +15 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.
|
|
3
|
+
* @license @wistia/ui v0.14.31-beta.784dab94.9445c39
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -13627,6 +13627,7 @@ var StyledInput = (0, import_styled_components79.default)(Input)`
|
|
|
13627
13627
|
border: none;
|
|
13628
13628
|
height: ${({ $height }) => `${$height}px`};
|
|
13629
13629
|
min-height: ${({ $height }) => `${$height}px`};
|
|
13630
|
+
resize: none;
|
|
13630
13631
|
}
|
|
13631
13632
|
`;
|
|
13632
13633
|
var editableStyles = import_styled_components79.css`
|
|
@@ -13768,6 +13769,7 @@ var EditableTextRoot = ({
|
|
|
13768
13769
|
typographicVariant = "body2",
|
|
13769
13770
|
submitMode = "both",
|
|
13770
13771
|
readOnly = false,
|
|
13772
|
+
disabled = false,
|
|
13771
13773
|
id,
|
|
13772
13774
|
label,
|
|
13773
13775
|
placeholder = "Click to edit this text",
|
|
@@ -13785,13 +13787,14 @@ var EditableTextRoot = ({
|
|
|
13785
13787
|
const computedId = (0, import_type_guards43.isNonEmptyString)(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
13786
13788
|
const handleSetIsEditing = (0, import_react64.useCallback)(
|
|
13787
13789
|
(editing) => {
|
|
13790
|
+
if (disabled) return;
|
|
13788
13791
|
if (editing && !isEditing) {
|
|
13789
13792
|
setOriginalValue(value);
|
|
13790
13793
|
}
|
|
13791
13794
|
setIsEditing(editing);
|
|
13792
13795
|
onEditingChange?.(editing);
|
|
13793
13796
|
},
|
|
13794
|
-
[isEditing, value, onEditingChange]
|
|
13797
|
+
[disabled, isEditing, value, onEditingChange]
|
|
13795
13798
|
);
|
|
13796
13799
|
const setValue = (0, import_react64.useCallback)(
|
|
13797
13800
|
(newValue) => {
|
|
@@ -13814,6 +13817,7 @@ var EditableTextRoot = ({
|
|
|
13814
13817
|
typographicVariant,
|
|
13815
13818
|
submitMode,
|
|
13816
13819
|
readOnly,
|
|
13820
|
+
disabled,
|
|
13817
13821
|
id: computedId,
|
|
13818
13822
|
label,
|
|
13819
13823
|
placeholder,
|
|
@@ -13832,6 +13836,7 @@ var EditableTextRoot = ({
|
|
|
13832
13836
|
typographicVariant,
|
|
13833
13837
|
submitMode,
|
|
13834
13838
|
readOnly,
|
|
13839
|
+
disabled,
|
|
13835
13840
|
computedId,
|
|
13836
13841
|
label,
|
|
13837
13842
|
placeholder,
|
|
@@ -13843,6 +13848,9 @@ var EditableTextRoot = ({
|
|
|
13843
13848
|
if (readOnly) {
|
|
13844
13849
|
return "read-only";
|
|
13845
13850
|
}
|
|
13851
|
+
if (disabled) {
|
|
13852
|
+
return "disabled";
|
|
13853
|
+
}
|
|
13846
13854
|
if (isEditing) {
|
|
13847
13855
|
return "editing";
|
|
13848
13856
|
}
|
|
@@ -13919,7 +13927,7 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
|
|
|
13919
13927
|
if (!context) {
|
|
13920
13928
|
throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
13921
13929
|
}
|
|
13922
|
-
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines } = context;
|
|
13930
|
+
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines, disabled } = context;
|
|
13923
13931
|
const triggerButtonRef = (0, import_react65.useRef)(null);
|
|
13924
13932
|
const handleTriggerClick = () => {
|
|
13925
13933
|
setIsEditing(true);
|
|
@@ -13930,7 +13938,7 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
|
|
|
13930
13938
|
if (isEditing) {
|
|
13931
13939
|
return null;
|
|
13932
13940
|
}
|
|
13933
|
-
if (asTrigger && !context.readOnly) {
|
|
13941
|
+
if (asTrigger && !context.readOnly && !disabled) {
|
|
13934
13942
|
return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(ClickRegion, { targetRef: triggerButtonRef, children: /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(
|
|
13935
13943
|
StyledEditableTextDisplay,
|
|
13936
13944
|
{
|
|
@@ -13988,9 +13996,10 @@ var StyledInput2 = (0, import_styled_components83.default)(Input)`
|
|
|
13988
13996
|
${({ $minLines }) => (0, import_type_guards45.isNotNil)($minLines) && `min-height: calc(${$minLines}lh + calc(var(--wui-editable-text-padding) * 2));`}
|
|
13989
13997
|
${({ $maxLines }) => (0, import_type_guards45.isNotNil)($maxLines) && `max-height: calc(${$maxLines}lh + calc(var(--wui-editable-text-padding) * 2));`}
|
|
13990
13998
|
${({ $typographicVariant }) => getTypographicStyles($typographicVariant)}
|
|
13991
|
-
padding: var(--wui-editable-text-padding);
|
|
13992
|
-
border-radius: var(--wui-editable-text-border-radius);
|
|
13993
13999
|
background-color: var(--wui-color-bg-surface);
|
|
14000
|
+
border-radius: var(--wui-editable-text-border-radius);
|
|
14001
|
+
padding: var(--wui-editable-text-padding);
|
|
14002
|
+
resize: none;
|
|
13994
14003
|
}
|
|
13995
14004
|
`;
|
|
13996
14005
|
var EditableTextInput = (props) => {
|