@wistia/ui 0.18.0-beta.613e8e53.b4159b2 → 0.18.0-beta.6d32b1a6.7a80f3d
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 +20 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +20 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.0-beta.
|
|
3
|
+
* @license @wistia/ui v0.18.0-beta.6d32b1a6.7a80f3d
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -14380,6 +14380,7 @@ var EditableTextRoot = ({
|
|
|
14380
14380
|
typographicVariant = "body2",
|
|
14381
14381
|
submitMode = "both",
|
|
14382
14382
|
readOnly = false,
|
|
14383
|
+
disabled = false,
|
|
14383
14384
|
id,
|
|
14384
14385
|
label,
|
|
14385
14386
|
placeholder = "Click to edit this text",
|
|
@@ -14397,13 +14398,14 @@ var EditableTextRoot = ({
|
|
|
14397
14398
|
const computedId = (0, import_type_guards45.isNonEmptyString)(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
14398
14399
|
const handleSetIsEditing = (0, import_react64.useCallback)(
|
|
14399
14400
|
(editing) => {
|
|
14401
|
+
if (disabled) return;
|
|
14400
14402
|
if (editing && !isEditing) {
|
|
14401
14403
|
setOriginalValue(value);
|
|
14402
14404
|
}
|
|
14403
14405
|
setIsEditing(editing);
|
|
14404
14406
|
onEditingChange?.(editing);
|
|
14405
14407
|
},
|
|
14406
|
-
[isEditing, value, onEditingChange]
|
|
14408
|
+
[disabled, isEditing, value, onEditingChange]
|
|
14407
14409
|
);
|
|
14408
14410
|
const setValue = (0, import_react64.useCallback)(
|
|
14409
14411
|
(newValue) => {
|
|
@@ -14426,6 +14428,7 @@ var EditableTextRoot = ({
|
|
|
14426
14428
|
typographicVariant,
|
|
14427
14429
|
submitMode,
|
|
14428
14430
|
readOnly,
|
|
14431
|
+
disabled,
|
|
14429
14432
|
id: computedId,
|
|
14430
14433
|
label,
|
|
14431
14434
|
placeholder,
|
|
@@ -14444,6 +14447,7 @@ var EditableTextRoot = ({
|
|
|
14444
14447
|
typographicVariant,
|
|
14445
14448
|
submitMode,
|
|
14446
14449
|
readOnly,
|
|
14450
|
+
disabled,
|
|
14447
14451
|
computedId,
|
|
14448
14452
|
label,
|
|
14449
14453
|
placeholder,
|
|
@@ -14455,6 +14459,9 @@ var EditableTextRoot = ({
|
|
|
14455
14459
|
if (readOnly) {
|
|
14456
14460
|
return "read-only";
|
|
14457
14461
|
}
|
|
14462
|
+
if (disabled) {
|
|
14463
|
+
return "disabled";
|
|
14464
|
+
}
|
|
14458
14465
|
if (isEditing) {
|
|
14459
14466
|
return "editing";
|
|
14460
14467
|
}
|
|
@@ -14515,7 +14522,16 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
|
|
|
14515
14522
|
if (!context) {
|
|
14516
14523
|
throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
14517
14524
|
}
|
|
14518
|
-
const {
|
|
14525
|
+
const {
|
|
14526
|
+
value,
|
|
14527
|
+
typographicVariant,
|
|
14528
|
+
setIsEditing,
|
|
14529
|
+
placeholder,
|
|
14530
|
+
maxLines,
|
|
14531
|
+
isEditing,
|
|
14532
|
+
minLines,
|
|
14533
|
+
disabled
|
|
14534
|
+
} = context;
|
|
14519
14535
|
const triggerButtonRef = (0, import_react65.useRef)(null);
|
|
14520
14536
|
const handleTriggerClick = () => {
|
|
14521
14537
|
setIsEditing(true);
|
|
@@ -14526,7 +14542,7 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
|
|
|
14526
14542
|
if (isEditing) {
|
|
14527
14543
|
return null;
|
|
14528
14544
|
}
|
|
14529
|
-
if (asTrigger && !context.readOnly) {
|
|
14545
|
+
if (asTrigger && !context.readOnly && !disabled) {
|
|
14530
14546
|
return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(ClickRegion, { targetRef: triggerButtonRef, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)(
|
|
14531
14547
|
StyledEditableTextDisplay,
|
|
14532
14548
|
{
|
|
@@ -15020,9 +15036,7 @@ var FormField = ({
|
|
|
15020
15036
|
StyledFormField,
|
|
15021
15037
|
{
|
|
15022
15038
|
...props,
|
|
15023
|
-
"aria-labelledby": computedId,
|
|
15024
15039
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
15025
|
-
role: "group",
|
|
15026
15040
|
children: [
|
|
15027
15041
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
15028
15042
|
Label,
|