@wistia/ui 0.10.17 → 0.10.18
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 +58 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.mjs +57 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1907,7 +1907,7 @@ type InputProps = Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElemen
|
|
|
1907
1907
|
/**
|
|
1908
1908
|
* The type of the input
|
|
1909
1909
|
*/
|
|
1910
|
-
type?: 'email' | 'multiline' | 'number' | 'phone' | 'search' | 'text' | 'url';
|
|
1910
|
+
type?: 'email' | 'multiline' | 'number' | 'password' | 'phone' | 'search' | 'text' | 'url';
|
|
1911
1911
|
};
|
|
1912
1912
|
/**
|
|
1913
1913
|
* Capture user input with a text field. Should be used within a [Form]() and [FormField]().
|
|
@@ -1944,7 +1944,7 @@ declare const Input: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HT
|
|
|
1944
1944
|
/**
|
|
1945
1945
|
* The type of the input
|
|
1946
1946
|
*/
|
|
1947
|
-
type?: "email" | "multiline" | "number" | "phone" | "search" | "text" | "url";
|
|
1947
|
+
type?: "email" | "multiline" | "number" | "password" | "phone" | "search" | "text" | "url";
|
|
1948
1948
|
} & react.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
1949
1949
|
|
|
1950
1950
|
type InputClickToCopyProps = Omit<InputProps, 'autoSelect' | 'disabled' | 'rightIcon' | 'type' | 'value'> & {
|
|
@@ -3036,6 +3036,10 @@ declare const Stack: (<C extends ElementType = "div">(props: PolymorphicComponen
|
|
|
3036
3036
|
|
|
3037
3037
|
type SwitchSizeType = 'lg' | 'md' | 'sm';
|
|
3038
3038
|
type SwitchProps = Omit<ComponentPropsWithoutRef<'input'>, 'hideLabel' | 'label' | 'size'> & {
|
|
3039
|
+
/**
|
|
3040
|
+
* The alignment of the switch relative to the label
|
|
3041
|
+
*/
|
|
3042
|
+
align?: 'left' | 'right';
|
|
3039
3043
|
/**
|
|
3040
3044
|
* Indicates the state of the switch
|
|
3041
3045
|
*/
|
|
@@ -3082,6 +3086,10 @@ type SwitchProps = Omit<ComponentPropsWithoutRef<'input'>, 'hideLabel' | 'label'
|
|
|
3082
3086
|
hideLabel?: boolean;
|
|
3083
3087
|
};
|
|
3084
3088
|
declare const Switch: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "label" | "size" | "hideLabel"> & {
|
|
3089
|
+
/**
|
|
3090
|
+
* The alignment of the switch relative to the label
|
|
3091
|
+
*/
|
|
3092
|
+
align?: "left" | "right";
|
|
3085
3093
|
/**
|
|
3086
3094
|
* Indicates the state of the switch
|
|
3087
3095
|
*/
|
|
@@ -3491,4 +3499,28 @@ declare const WistiaLogo: {
|
|
|
3491
3499
|
displayName: string;
|
|
3492
3500
|
};
|
|
3493
3501
|
|
|
3494
|
-
|
|
3502
|
+
type InputPasswordProps = Omit<InputProps, 'leftIcon' | 'monospace' | 'rightIcon' | 'type'> & {
|
|
3503
|
+
/**
|
|
3504
|
+
* Set the disabled state of the input
|
|
3505
|
+
*/
|
|
3506
|
+
disabled?: boolean;
|
|
3507
|
+
/**
|
|
3508
|
+
* Callback function that is called when the visibility state changes
|
|
3509
|
+
*/
|
|
3510
|
+
onVisibilityToggle?: (isVisible: boolean) => void;
|
|
3511
|
+
};
|
|
3512
|
+
/**
|
|
3513
|
+
* A password input component with a toggle button to show or hide the password text.
|
|
3514
|
+
*/
|
|
3515
|
+
declare const InputPassword: react.ForwardRefExoticComponent<Omit<InputProps, "type" | "monospace" | "leftIcon" | "rightIcon"> & {
|
|
3516
|
+
/**
|
|
3517
|
+
* Set the disabled state of the input
|
|
3518
|
+
*/
|
|
3519
|
+
disabled?: boolean;
|
|
3520
|
+
/**
|
|
3521
|
+
* Callback function that is called when the visibility state changes
|
|
3522
|
+
*/
|
|
3523
|
+
onVisibilityToggle?: (isVisible: boolean) => void;
|
|
3524
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
3525
|
+
|
|
3526
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, type BannerProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, type ClickRegionProps, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerIcon, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, type EllipsisProps, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, InputPassword, type InputPasswordProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, type ListProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Slider, type SliderProps, Stack, SubMenu, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -1907,7 +1907,7 @@ type InputProps = Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElemen
|
|
|
1907
1907
|
/**
|
|
1908
1908
|
* The type of the input
|
|
1909
1909
|
*/
|
|
1910
|
-
type?: 'email' | 'multiline' | 'number' | 'phone' | 'search' | 'text' | 'url';
|
|
1910
|
+
type?: 'email' | 'multiline' | 'number' | 'password' | 'phone' | 'search' | 'text' | 'url';
|
|
1911
1911
|
};
|
|
1912
1912
|
/**
|
|
1913
1913
|
* Capture user input with a text field. Should be used within a [Form]() and [FormField]().
|
|
@@ -1944,7 +1944,7 @@ declare const Input: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HT
|
|
|
1944
1944
|
/**
|
|
1945
1945
|
* The type of the input
|
|
1946
1946
|
*/
|
|
1947
|
-
type?: "email" | "multiline" | "number" | "phone" | "search" | "text" | "url";
|
|
1947
|
+
type?: "email" | "multiline" | "number" | "password" | "phone" | "search" | "text" | "url";
|
|
1948
1948
|
} & react.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
1949
1949
|
|
|
1950
1950
|
type InputClickToCopyProps = Omit<InputProps, 'autoSelect' | 'disabled' | 'rightIcon' | 'type' | 'value'> & {
|
|
@@ -3036,6 +3036,10 @@ declare const Stack: (<C extends ElementType = "div">(props: PolymorphicComponen
|
|
|
3036
3036
|
|
|
3037
3037
|
type SwitchSizeType = 'lg' | 'md' | 'sm';
|
|
3038
3038
|
type SwitchProps = Omit<ComponentPropsWithoutRef<'input'>, 'hideLabel' | 'label' | 'size'> & {
|
|
3039
|
+
/**
|
|
3040
|
+
* The alignment of the switch relative to the label
|
|
3041
|
+
*/
|
|
3042
|
+
align?: 'left' | 'right';
|
|
3039
3043
|
/**
|
|
3040
3044
|
* Indicates the state of the switch
|
|
3041
3045
|
*/
|
|
@@ -3082,6 +3086,10 @@ type SwitchProps = Omit<ComponentPropsWithoutRef<'input'>, 'hideLabel' | 'label'
|
|
|
3082
3086
|
hideLabel?: boolean;
|
|
3083
3087
|
};
|
|
3084
3088
|
declare const Switch: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "label" | "size" | "hideLabel"> & {
|
|
3089
|
+
/**
|
|
3090
|
+
* The alignment of the switch relative to the label
|
|
3091
|
+
*/
|
|
3092
|
+
align?: "left" | "right";
|
|
3085
3093
|
/**
|
|
3086
3094
|
* Indicates the state of the switch
|
|
3087
3095
|
*/
|
|
@@ -3491,4 +3499,28 @@ declare const WistiaLogo: {
|
|
|
3491
3499
|
displayName: string;
|
|
3492
3500
|
};
|
|
3493
3501
|
|
|
3494
|
-
|
|
3502
|
+
type InputPasswordProps = Omit<InputProps, 'leftIcon' | 'monospace' | 'rightIcon' | 'type'> & {
|
|
3503
|
+
/**
|
|
3504
|
+
* Set the disabled state of the input
|
|
3505
|
+
*/
|
|
3506
|
+
disabled?: boolean;
|
|
3507
|
+
/**
|
|
3508
|
+
* Callback function that is called when the visibility state changes
|
|
3509
|
+
*/
|
|
3510
|
+
onVisibilityToggle?: (isVisible: boolean) => void;
|
|
3511
|
+
};
|
|
3512
|
+
/**
|
|
3513
|
+
* A password input component with a toggle button to show or hide the password text.
|
|
3514
|
+
*/
|
|
3515
|
+
declare const InputPassword: react.ForwardRefExoticComponent<Omit<InputProps, "type" | "monospace" | "leftIcon" | "rightIcon"> & {
|
|
3516
|
+
/**
|
|
3517
|
+
* Set the disabled state of the input
|
|
3518
|
+
*/
|
|
3519
|
+
disabled?: boolean;
|
|
3520
|
+
/**
|
|
3521
|
+
* Callback function that is called when the visibility state changes
|
|
3522
|
+
*/
|
|
3523
|
+
onVisibilityToggle?: (isVisible: boolean) => void;
|
|
3524
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
3525
|
+
|
|
3526
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, type BannerProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, type ClickRegionProps, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerIcon, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, type EllipsisProps, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, InputPassword, type InputPasswordProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, type ListProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Slider, type SliderProps, Stack, SubMenu, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.10.
|
|
3
|
+
* @license @wistia/ui v0.10.18
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8834,10 +8834,12 @@ var StyledFormControlLabel = styled23.label`
|
|
|
8834
8834
|
font-size: var(--wui-typography-label-3-size);
|
|
8835
8835
|
font-weight: var(--wui-typography-label-3-weight);
|
|
8836
8836
|
line-height: var(--wui-typography-label-3-line-height);
|
|
8837
|
+
justify-content: ${({ $align }) => $align === "left" ? "flex-start" : "space-between"};
|
|
8837
8838
|
|
|
8838
8839
|
${({ $disabled }) => $disabled && disabledStyle2}
|
|
8839
8840
|
`;
|
|
8840
8841
|
var FormControlLabel = ({
|
|
8842
|
+
align = "left",
|
|
8841
8843
|
label,
|
|
8842
8844
|
description,
|
|
8843
8845
|
disabled = false,
|
|
@@ -8853,15 +8855,17 @@ var FormControlLabel = ({
|
|
|
8853
8855
|
label,
|
|
8854
8856
|
/* @__PURE__ */ jsx213(FormControlLabelDescription, { children: description })
|
|
8855
8857
|
] });
|
|
8858
|
+
const slot = isNotNil15(controlSlot) ? controlSlot : null;
|
|
8856
8859
|
return /* @__PURE__ */ jsxs15(
|
|
8857
8860
|
StyledFormControlLabel,
|
|
8858
8861
|
{
|
|
8862
|
+
$align: align,
|
|
8859
8863
|
$disabled: disabled,
|
|
8860
8864
|
htmlFor,
|
|
8861
8865
|
...props,
|
|
8862
8866
|
children: [
|
|
8863
|
-
|
|
8864
|
-
labelContent
|
|
8867
|
+
align === "left" ? slot : labelContent,
|
|
8868
|
+
align === "left" ? labelContent : slot
|
|
8865
8869
|
]
|
|
8866
8870
|
}
|
|
8867
8871
|
);
|
|
@@ -13337,6 +13341,7 @@ var StyledHiddenSwitchInput = styled67.input`
|
|
|
13337
13341
|
`;
|
|
13338
13342
|
var Switch = forwardRef28(
|
|
13339
13343
|
({
|
|
13344
|
+
align = "left",
|
|
13340
13345
|
checked,
|
|
13341
13346
|
disabled = false,
|
|
13342
13347
|
id,
|
|
@@ -13371,6 +13376,7 @@ var Switch = forwardRef28(
|
|
|
13371
13376
|
/* @__PURE__ */ jsx266(
|
|
13372
13377
|
FormControlLabel,
|
|
13373
13378
|
{
|
|
13379
|
+
align,
|
|
13374
13380
|
controlSlot: /* @__PURE__ */ jsx266(
|
|
13375
13381
|
StyledSwitchInput,
|
|
13376
13382
|
{
|
|
@@ -14389,6 +14395,53 @@ var WistiaLogo = ({
|
|
|
14389
14395
|
return href !== void 0 ? /* @__PURE__ */ jsx281("a", { href, children: Logo }) : Logo;
|
|
14390
14396
|
};
|
|
14391
14397
|
WistiaLogo.displayName = "WistiaLogo";
|
|
14398
|
+
|
|
14399
|
+
// src/components/InputPassword/InputPassword.tsx
|
|
14400
|
+
import styled82 from "styled-components";
|
|
14401
|
+
import { forwardRef as forwardRef31, useState as useState20 } from "react";
|
|
14402
|
+
import { isFunction as isFunction4 } from "@wistia/type-guards";
|
|
14403
|
+
import { jsx as jsx282 } from "react/jsx-runtime";
|
|
14404
|
+
var StyledIconButton = styled82(IconButton)`
|
|
14405
|
+
/* override size for icon button since prop gets changed by Input */
|
|
14406
|
+
height: var(--icon-button-size-sm);
|
|
14407
|
+
width: var(--icon-button-size-sm);
|
|
14408
|
+
|
|
14409
|
+
/* override input padding variable since it is used for Input Icon positioning */
|
|
14410
|
+
--wui-input-horizontal-padding: 4px;
|
|
14411
|
+
`;
|
|
14412
|
+
var InputPassword = forwardRef31(
|
|
14413
|
+
({ onVisibilityToggle, disabled = false, ...props }, ref) => {
|
|
14414
|
+
const [isVisible, setIsVisible] = useState20(false);
|
|
14415
|
+
const handleClick = () => {
|
|
14416
|
+
const newVisibility = !isVisible;
|
|
14417
|
+
setIsVisible(newVisibility);
|
|
14418
|
+
if (isFunction4(onVisibilityToggle)) {
|
|
14419
|
+
onVisibilityToggle(newVisibility);
|
|
14420
|
+
}
|
|
14421
|
+
};
|
|
14422
|
+
return /* @__PURE__ */ jsx282(
|
|
14423
|
+
Input,
|
|
14424
|
+
{
|
|
14425
|
+
...props,
|
|
14426
|
+
ref,
|
|
14427
|
+
disabled,
|
|
14428
|
+
rightIcon: /* @__PURE__ */ jsx282(
|
|
14429
|
+
StyledIconButton,
|
|
14430
|
+
{
|
|
14431
|
+
disabled,
|
|
14432
|
+
label: isVisible ? "Hide password" : "Show password",
|
|
14433
|
+
onClick: handleClick,
|
|
14434
|
+
tabIndex: disabled ? -1 : 0,
|
|
14435
|
+
variant: "ghost",
|
|
14436
|
+
children: /* @__PURE__ */ jsx282(Icon, { type: isVisible ? "preview" : "hide" })
|
|
14437
|
+
}
|
|
14438
|
+
),
|
|
14439
|
+
type: isVisible ? "text" : "password"
|
|
14440
|
+
}
|
|
14441
|
+
);
|
|
14442
|
+
}
|
|
14443
|
+
);
|
|
14444
|
+
InputPassword.displayName = "InputPassword";
|
|
14392
14445
|
export {
|
|
14393
14446
|
ActionButton,
|
|
14394
14447
|
Avatar,
|
|
@@ -14434,6 +14487,7 @@ export {
|
|
|
14434
14487
|
ImageDimensionsValidator,
|
|
14435
14488
|
Input,
|
|
14436
14489
|
InputClickToCopy,
|
|
14490
|
+
InputPassword,
|
|
14437
14491
|
KeyboardShortcut,
|
|
14438
14492
|
Label,
|
|
14439
14493
|
Link,
|