@wistia/ui 0.8.1 → 0.8.2-beta.16b605aa.d0ead36
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 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +20 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1160,9 +1160,9 @@ type EditableHeadingProps = {
|
|
|
1160
1160
|
ariaLabel?: string;
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Force editing state for testing purposes
|
|
1163
|
-
*
|
|
1163
|
+
* @ignore
|
|
1164
1164
|
*/
|
|
1165
|
-
|
|
1165
|
+
__forceEditing?: boolean;
|
|
1166
1166
|
/**
|
|
1167
1167
|
* When true, prevents the heading from entering edit mode
|
|
1168
1168
|
* @default false
|
|
@@ -1175,7 +1175,7 @@ type EditableHeadingProps = {
|
|
|
1175
1175
|
* an accessible button that enables editing mode. The component handles empty values, keyboard
|
|
1176
1176
|
* navigation (Enter to save, Escape to cancel), and provides callbacks for value and state changes.
|
|
1177
1177
|
*/
|
|
1178
|
-
declare const EditableHeading: ({ children, onValueChange, onEditingChange, tooltipText, ariaLabel,
|
|
1178
|
+
declare const EditableHeading: ({ children, onValueChange, onEditingChange, tooltipText, ariaLabel, __forceEditing, editingDisabled, }: EditableHeadingProps) => JSX.Element;
|
|
1179
1179
|
|
|
1180
1180
|
type EllipsisProps = ComponentPropsWithoutRef<'span'> & {
|
|
1181
1181
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1160,9 +1160,9 @@ type EditableHeadingProps = {
|
|
|
1160
1160
|
ariaLabel?: string;
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Force editing state for testing purposes
|
|
1163
|
-
*
|
|
1163
|
+
* @ignore
|
|
1164
1164
|
*/
|
|
1165
|
-
|
|
1165
|
+
__forceEditing?: boolean;
|
|
1166
1166
|
/**
|
|
1167
1167
|
* When true, prevents the heading from entering edit mode
|
|
1168
1168
|
* @default false
|
|
@@ -1175,7 +1175,7 @@ type EditableHeadingProps = {
|
|
|
1175
1175
|
* an accessible button that enables editing mode. The component handles empty values, keyboard
|
|
1176
1176
|
* navigation (Enter to save, Escape to cancel), and provides callbacks for value and state changes.
|
|
1177
1177
|
*/
|
|
1178
|
-
declare const EditableHeading: ({ children, onValueChange, onEditingChange, tooltipText, ariaLabel,
|
|
1178
|
+
declare const EditableHeading: ({ children, onValueChange, onEditingChange, tooltipText, ariaLabel, __forceEditing, editingDisabled, }: EditableHeadingProps) => JSX.Element;
|
|
1179
1179
|
|
|
1180
1180
|
type EllipsisProps = ComponentPropsWithoutRef<'span'> & {
|
|
1181
1181
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.
|
|
3
|
+
* @license @wistia/ui v0.8.2-beta.16b605aa.d0ead36
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -6908,11 +6908,14 @@ var Link = forwardRef(
|
|
|
6908
6908
|
}, ref) => {
|
|
6909
6909
|
const inRouterContext = useInRouterContext();
|
|
6910
6910
|
const to = generateHref(props.href, type, disabled);
|
|
6911
|
+
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
6911
6912
|
const handleClick = async (event) => {
|
|
6912
6913
|
if (disabled) {
|
|
6913
6914
|
event.preventDefault();
|
|
6914
6915
|
} else if (beforeAction) {
|
|
6915
|
-
|
|
6916
|
+
if (!shouldUseReactRouterLink) {
|
|
6917
|
+
event.preventDefault();
|
|
6918
|
+
}
|
|
6916
6919
|
try {
|
|
6917
6920
|
await beforeAction();
|
|
6918
6921
|
} catch (error) {
|
|
@@ -6956,7 +6959,6 @@ var Link = forwardRef(
|
|
|
6956
6959
|
...commonProps,
|
|
6957
6960
|
...externalLinkProps
|
|
6958
6961
|
};
|
|
6959
|
-
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
6960
6962
|
return shouldUseReactRouterLink ? /* @__PURE__ */ jsx192(
|
|
6961
6963
|
StyledLink,
|
|
6962
6964
|
{
|
|
@@ -9020,6 +9022,7 @@ import { isNil as isNil13, isNotNil as isNotNil16, isRecord as isRecord4 } from
|
|
|
9020
9022
|
// src/css/sharedStyles/inputCssVariables.ts
|
|
9021
9023
|
import { css as css24 } from "styled-components";
|
|
9022
9024
|
var inputCssVariables = css24`
|
|
9025
|
+
/* Colors */
|
|
9023
9026
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
9024
9027
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
9025
9028
|
--wui-input-color-border: var(--wui-color-border-secondary);
|
|
@@ -9027,13 +9030,20 @@ var inputCssVariables = css24`
|
|
|
9027
9030
|
--wui-input-color-border-error: var(--wui-color-invalid-indicator);
|
|
9028
9031
|
--wui-input-color-border-disabled: var(--wui-color-border-disabled);
|
|
9029
9032
|
--wui-input-color-text: var(--wui-color-text);
|
|
9033
|
+
|
|
9034
|
+
/* Border */
|
|
9030
9035
|
--wui-input-border-radius: var(--wui-border-radius-03);
|
|
9031
9036
|
--wui-input-multiline-border-radius: var(--wui-border-radius-02);
|
|
9037
|
+
|
|
9038
|
+
/* Padding */
|
|
9032
9039
|
--wui-input-vertical-padding: var(--wui-space-02);
|
|
9033
9040
|
--wui-input-horizontal-padding: var(--wui-space-03);
|
|
9041
|
+
|
|
9042
|
+
/* Typography */
|
|
9034
9043
|
--wui-input-placeholder: var(--wui-gray-10);
|
|
9035
9044
|
--wui-input-font-size: var(--wui-typography-body-3-size);
|
|
9036
9045
|
--wui-input-line-height: 16px;
|
|
9046
|
+
--wui-input-font-weight: var(--wui-typography-weight-body);
|
|
9037
9047
|
`;
|
|
9038
9048
|
|
|
9039
9049
|
// src/components/Input/Input.tsx
|
|
@@ -9050,7 +9060,7 @@ var inputStyles = css25`
|
|
|
9050
9060
|
border-radius: var(--wui-input-border-radius);
|
|
9051
9061
|
font-size: var(--wui-input-font-size);
|
|
9052
9062
|
line-height: var(--wui-input-line-height);
|
|
9053
|
-
font-weight: var(--wui-
|
|
9063
|
+
font-weight: var(--wui-input-font-weight);
|
|
9054
9064
|
color: var(--wui-input-color-text);
|
|
9055
9065
|
|
|
9056
9066
|
&::placeholder {
|
|
@@ -9220,15 +9230,11 @@ var StyledInput = styled31(Input)`
|
|
|
9220
9230
|
min-height: unset;
|
|
9221
9231
|
}
|
|
9222
9232
|
|
|
9223
|
-
resize: vertical;
|
|
9224
|
-
font-size: var(--wui-typography-heading-1-size);
|
|
9225
|
-
font-weight: var(--wui-typography-heading-1-weight);
|
|
9226
|
-
line-height: var(--wui-typography-heading-1-line-height);
|
|
9227
|
-
font-family: var(--wui-typography-heading-1-family);
|
|
9228
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
9229
|
-
outline-offset: -2px;
|
|
9230
|
-
|
|
9231
9233
|
&& {
|
|
9234
|
+
--wui-input-font-size: var(--wui-typography-heading-1-size);
|
|
9235
|
+
--wui-input-font-weight: var(--wui-typography-heading-1-weight);
|
|
9236
|
+
--wui-input-line-height: var(--wui-typography-heading-1-line-height);
|
|
9237
|
+
font-family: var(--wui-typography-heading-1-family);
|
|
9232
9238
|
width: 100%;
|
|
9233
9239
|
padding: var(--wui-space-02);
|
|
9234
9240
|
border: none;
|
|
@@ -9259,7 +9265,7 @@ var EditableHeading = ({
|
|
|
9259
9265
|
onEditingChange,
|
|
9260
9266
|
tooltipText = "Click to edit title",
|
|
9261
9267
|
ariaLabel = "Edit title",
|
|
9262
|
-
|
|
9268
|
+
__forceEditing = false,
|
|
9263
9269
|
editingDisabled = false
|
|
9264
9270
|
}) => {
|
|
9265
9271
|
const [isEditing, setIsEditing] = useState6(false);
|
|
@@ -9312,7 +9318,7 @@ var EditableHeading = ({
|
|
|
9312
9318
|
if (editingDisabled) {
|
|
9313
9319
|
return HeadingComponent2;
|
|
9314
9320
|
}
|
|
9315
|
-
if (isEditing ||
|
|
9321
|
+
if (isEditing || __forceEditing) {
|
|
9316
9322
|
return /* @__PURE__ */ jsx220(
|
|
9317
9323
|
StyledInput,
|
|
9318
9324
|
{
|