@wistia/ui 0.18.0-beta.6d32b1a6.7a80f3d → 0.18.0-beta.782f3b36.e196b15
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 +7 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.mjs +7 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -711,11 +711,18 @@ type AlignContentType =
|
|
|
711
711
|
| 'center'
|
|
712
712
|
| 'flex-end'
|
|
713
713
|
| 'flex-start'
|
|
714
|
+
| 'normal'
|
|
714
715
|
| 'space-around'
|
|
715
716
|
| 'space-between'
|
|
716
717
|
| 'stretch';
|
|
717
718
|
|
|
718
|
-
type AlignItemsType =
|
|
719
|
+
type AlignItemsType =
|
|
720
|
+
| 'baseline'
|
|
721
|
+
| 'center'
|
|
722
|
+
| 'flex-end'
|
|
723
|
+
| 'flex-start'
|
|
724
|
+
| 'normal'
|
|
725
|
+
| 'stretch';
|
|
719
726
|
|
|
720
727
|
type AlignSelfType = 'auto' | 'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch';
|
|
721
728
|
|
|
@@ -1041,7 +1048,7 @@ type CardProps = BoxProps & ComponentPropsWithoutRef<'div'> & {
|
|
|
1041
1048
|
* Cards can be used to visually distinguish content sections. Extends the [Box component.](https://wistia.github.io/vhs/storybook-ui/?path=/docs/components-box--docs)
|
|
1042
1049
|
*/
|
|
1043
1050
|
declare const Card: {
|
|
1044
|
-
({ children, border, borderRadius, colorScheme, direction, gap, height, paddingSize, prominence, width, ...props }: CardProps): JSX$1.Element;
|
|
1051
|
+
({ children, alignItems, border, borderRadius, colorScheme, direction, gap, height, paddingSize, prominence, width, ...props }: CardProps): JSX$1.Element;
|
|
1045
1052
|
displayName: string;
|
|
1046
1053
|
};
|
|
1047
1054
|
|
|
@@ -2078,11 +2085,6 @@ type EditableTextRootProps = Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue
|
|
|
2078
2085
|
* Whether the editable text is read only. If true, the editable text will not be editable and the trigger will not be shown.
|
|
2079
2086
|
*/
|
|
2080
2087
|
readOnly?: boolean;
|
|
2081
|
-
/**
|
|
2082
|
-
* When true, prevents the text from entering edit mode
|
|
2083
|
-
* @default false
|
|
2084
|
-
*/
|
|
2085
|
-
disabled?: boolean;
|
|
2086
2088
|
/**
|
|
2087
2089
|
* The id of the editable text.
|
|
2088
2090
|
*/
|
|
@@ -2119,7 +2121,6 @@ type EditableTextContextValues = {
|
|
|
2119
2121
|
typographicVariant: TypographicVariant;
|
|
2120
2122
|
submitMode: 'blur' | 'both' | 'enter' | 'none';
|
|
2121
2123
|
readOnly: boolean;
|
|
2122
|
-
disabled: boolean;
|
|
2123
2124
|
id: string;
|
|
2124
2125
|
label: string;
|
|
2125
2126
|
placeholder: string;
|
|
@@ -2128,7 +2129,7 @@ type EditableTextContextValues = {
|
|
|
2128
2129
|
finalFocusEl: (() => HTMLElement | null) | undefined;
|
|
2129
2130
|
};
|
|
2130
2131
|
declare const EditableTextContext: react.Context<EditableTextContextValues | null>;
|
|
2131
|
-
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly,
|
|
2132
|
+
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly, id, label, placeholder, minLines, maxLines, finalFocusEl, ...props }: EditableTextRootProps) => JSX$1.Element;
|
|
2132
2133
|
|
|
2133
2134
|
type EditableTextProps = Omit<EditableTextRootProps, 'children'> & {
|
|
2134
2135
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -711,11 +711,18 @@ type AlignContentType =
|
|
|
711
711
|
| 'center'
|
|
712
712
|
| 'flex-end'
|
|
713
713
|
| 'flex-start'
|
|
714
|
+
| 'normal'
|
|
714
715
|
| 'space-around'
|
|
715
716
|
| 'space-between'
|
|
716
717
|
| 'stretch';
|
|
717
718
|
|
|
718
|
-
type AlignItemsType =
|
|
719
|
+
type AlignItemsType =
|
|
720
|
+
| 'baseline'
|
|
721
|
+
| 'center'
|
|
722
|
+
| 'flex-end'
|
|
723
|
+
| 'flex-start'
|
|
724
|
+
| 'normal'
|
|
725
|
+
| 'stretch';
|
|
719
726
|
|
|
720
727
|
type AlignSelfType = 'auto' | 'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch';
|
|
721
728
|
|
|
@@ -1041,7 +1048,7 @@ type CardProps = BoxProps & ComponentPropsWithoutRef<'div'> & {
|
|
|
1041
1048
|
* Cards can be used to visually distinguish content sections. Extends the [Box component.](https://wistia.github.io/vhs/storybook-ui/?path=/docs/components-box--docs)
|
|
1042
1049
|
*/
|
|
1043
1050
|
declare const Card: {
|
|
1044
|
-
({ children, border, borderRadius, colorScheme, direction, gap, height, paddingSize, prominence, width, ...props }: CardProps): JSX$1.Element;
|
|
1051
|
+
({ children, alignItems, border, borderRadius, colorScheme, direction, gap, height, paddingSize, prominence, width, ...props }: CardProps): JSX$1.Element;
|
|
1045
1052
|
displayName: string;
|
|
1046
1053
|
};
|
|
1047
1054
|
|
|
@@ -2078,11 +2085,6 @@ type EditableTextRootProps = Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue
|
|
|
2078
2085
|
* Whether the editable text is read only. If true, the editable text will not be editable and the trigger will not be shown.
|
|
2079
2086
|
*/
|
|
2080
2087
|
readOnly?: boolean;
|
|
2081
|
-
/**
|
|
2082
|
-
* When true, prevents the text from entering edit mode
|
|
2083
|
-
* @default false
|
|
2084
|
-
*/
|
|
2085
|
-
disabled?: boolean;
|
|
2086
2088
|
/**
|
|
2087
2089
|
* The id of the editable text.
|
|
2088
2090
|
*/
|
|
@@ -2119,7 +2121,6 @@ type EditableTextContextValues = {
|
|
|
2119
2121
|
typographicVariant: TypographicVariant;
|
|
2120
2122
|
submitMode: 'blur' | 'both' | 'enter' | 'none';
|
|
2121
2123
|
readOnly: boolean;
|
|
2122
|
-
disabled: boolean;
|
|
2123
2124
|
id: string;
|
|
2124
2125
|
label: string;
|
|
2125
2126
|
placeholder: string;
|
|
@@ -2128,7 +2129,7 @@ type EditableTextContextValues = {
|
|
|
2128
2129
|
finalFocusEl: (() => HTMLElement | null) | undefined;
|
|
2129
2130
|
};
|
|
2130
2131
|
declare const EditableTextContext: react.Context<EditableTextContextValues | null>;
|
|
2131
|
-
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly,
|
|
2132
|
+
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly, id, label, placeholder, minLines, maxLines, finalFocusEl, ...props }: EditableTextRootProps) => JSX$1.Element;
|
|
2132
2133
|
|
|
2133
2134
|
type EditableTextProps = Omit<EditableTextRootProps, 'children'> & {
|
|
2134
2135
|
/**
|
package/dist/index.mjs
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.782f3b36.e196b15
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8420,7 +8420,7 @@ var DEFAULT_ELEMENT = "div";
|
|
|
8420
8420
|
var BoxComponent = forwardRef5(
|
|
8421
8421
|
({
|
|
8422
8422
|
alignContent = "stretch",
|
|
8423
|
-
alignItems = "
|
|
8423
|
+
alignItems = "stretch",
|
|
8424
8424
|
alignSelf,
|
|
8425
8425
|
basis,
|
|
8426
8426
|
children,
|
|
@@ -9301,6 +9301,7 @@ var prominenceMap = {
|
|
|
9301
9301
|
};
|
|
9302
9302
|
var Card = ({
|
|
9303
9303
|
children,
|
|
9304
|
+
alignItems = "flex-start",
|
|
9304
9305
|
border = false,
|
|
9305
9306
|
borderRadius = "border-radius-04",
|
|
9306
9307
|
colorScheme = "inherit",
|
|
@@ -9314,6 +9315,7 @@ var Card = ({
|
|
|
9314
9315
|
}) => /* @__PURE__ */ jsx214(
|
|
9315
9316
|
StyledCard,
|
|
9316
9317
|
{
|
|
9318
|
+
$alignItems: alignItems,
|
|
9317
9319
|
$backgroundColor: prominenceMap[prominence].backgroundColor,
|
|
9318
9320
|
$borderColor: border ? prominenceMap[prominence].borderColor : "transparent",
|
|
9319
9321
|
$borderRadius: borderRadius,
|
|
@@ -14230,7 +14232,6 @@ var EditableTextRoot = ({
|
|
|
14230
14232
|
typographicVariant = "body2",
|
|
14231
14233
|
submitMode = "both",
|
|
14232
14234
|
readOnly = false,
|
|
14233
|
-
disabled = false,
|
|
14234
14235
|
id,
|
|
14235
14236
|
label,
|
|
14236
14237
|
placeholder = "Click to edit this text",
|
|
@@ -14248,14 +14249,13 @@ var EditableTextRoot = ({
|
|
|
14248
14249
|
const computedId = isNonEmptyString6(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
14249
14250
|
const handleSetIsEditing = useCallback16(
|
|
14250
14251
|
(editing) => {
|
|
14251
|
-
if (disabled) return;
|
|
14252
14252
|
if (editing && !isEditing) {
|
|
14253
14253
|
setOriginalValue(value);
|
|
14254
14254
|
}
|
|
14255
14255
|
setIsEditing(editing);
|
|
14256
14256
|
onEditingChange?.(editing);
|
|
14257
14257
|
},
|
|
14258
|
-
[
|
|
14258
|
+
[isEditing, value, onEditingChange]
|
|
14259
14259
|
);
|
|
14260
14260
|
const setValue = useCallback16(
|
|
14261
14261
|
(newValue) => {
|
|
@@ -14278,7 +14278,6 @@ var EditableTextRoot = ({
|
|
|
14278
14278
|
typographicVariant,
|
|
14279
14279
|
submitMode,
|
|
14280
14280
|
readOnly,
|
|
14281
|
-
disabled,
|
|
14282
14281
|
id: computedId,
|
|
14283
14282
|
label,
|
|
14284
14283
|
placeholder,
|
|
@@ -14297,7 +14296,6 @@ var EditableTextRoot = ({
|
|
|
14297
14296
|
typographicVariant,
|
|
14298
14297
|
submitMode,
|
|
14299
14298
|
readOnly,
|
|
14300
|
-
disabled,
|
|
14301
14299
|
computedId,
|
|
14302
14300
|
label,
|
|
14303
14301
|
placeholder,
|
|
@@ -14309,9 +14307,6 @@ var EditableTextRoot = ({
|
|
|
14309
14307
|
if (readOnly) {
|
|
14310
14308
|
return "read-only";
|
|
14311
14309
|
}
|
|
14312
|
-
if (disabled) {
|
|
14313
|
-
return "disabled";
|
|
14314
|
-
}
|
|
14315
14310
|
if (isEditing) {
|
|
14316
14311
|
return "editing";
|
|
14317
14312
|
}
|
|
@@ -14372,16 +14367,7 @@ var EditableTextDisplayComponent = forwardRef21(
|
|
|
14372
14367
|
if (!context) {
|
|
14373
14368
|
throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
14374
14369
|
}
|
|
14375
|
-
const {
|
|
14376
|
-
value,
|
|
14377
|
-
typographicVariant,
|
|
14378
|
-
setIsEditing,
|
|
14379
|
-
placeholder,
|
|
14380
|
-
maxLines,
|
|
14381
|
-
isEditing,
|
|
14382
|
-
minLines,
|
|
14383
|
-
disabled
|
|
14384
|
-
} = context;
|
|
14370
|
+
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines } = context;
|
|
14385
14371
|
const triggerButtonRef = useRef17(null);
|
|
14386
14372
|
const handleTriggerClick = () => {
|
|
14387
14373
|
setIsEditing(true);
|
|
@@ -14392,7 +14378,7 @@ var EditableTextDisplayComponent = forwardRef21(
|
|
|
14392
14378
|
if (isEditing) {
|
|
14393
14379
|
return null;
|
|
14394
14380
|
}
|
|
14395
|
-
if (asTrigger && !context.readOnly
|
|
14381
|
+
if (asTrigger && !context.readOnly) {
|
|
14396
14382
|
return /* @__PURE__ */ jsx278(ClickRegion, { targetRef: triggerButtonRef, children: /* @__PURE__ */ jsxs43(
|
|
14397
14383
|
StyledEditableTextDisplay,
|
|
14398
14384
|
{
|