Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hypothesis/frontend-shared

Package Overview
Dependencies
Maintainers
4
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hypothesis/frontend-shared - npm Package Compare versions

Comparing version 3.8.1 to 3.9.0

10

CHANGELOG.md

@@ -8,2 +8,12 @@ # Changelog

## [v3.9.0] - 2021-09-09
Add more options for `TextInput` `type`, and add `classes` prop support to all
`Button` components.
### Added
- Add support for other "text-like" input types to TextInput [#189](https://github.com/hypothesis/frontend-shared/pull/189)
- Add support for `classes` prop to Button components [#188](https://github.com/hypothesis/frontend-shared/pull/188)
## [v3.8.1] - 2021-09-02

@@ -10,0 +20,0 @@

@@ -22,2 +22,12 @@ /**

/**
* - Optional CSS class name(s) to use _in addition_
* to the button component's own clases
*/
classes?: string | undefined;
/**
* - Optional CSS class name that will _replace_
* the button component's own classes
*/
className?: string | undefined;
/**
* - Name of `SvgIcon` to render in the button

@@ -24,0 +34,0 @@ */

23

lib/components/buttons.js

@@ -33,2 +33,6 @@ "use strict";

* @prop {import('preact').Ref<HTMLButtonElement>} [buttonRef]
* @prop {string} [classes] - Optional CSS class name(s) to use _in addition_
* to the button component's own clases
* @prop {string} [className] - Optional CSS class name that will _replace_
* the button component's own classes
* @prop {string} [icon] - Name of `SvgIcon` to render in the button

@@ -76,2 +80,3 @@ * @prop {'left'|'right'} [iconPosition] - Icon positioned to left or to

buttonRef,
classes,
className,

@@ -87,3 +92,3 @@ icon,

} = _ref,
restProps = _objectWithoutProperties(_ref, ["buttonRef", "className", "icon", "iconPosition", "size", "variant", "expanded", "pressed", "type"]);
restProps = _objectWithoutProperties(_ref, ["buttonRef", "classes", "className", "icon", "iconPosition", "size", "variant", "expanded", "pressed", "type"]);

@@ -99,7 +104,7 @@ const ariaProps = {

[`${className}--icon-${iconPosition}`]: icon
}),
}, classes),
type: type
}, ariaProps), restProps), void 0, false, {
fileName: _jsxFileName,
lineNumber: 68,
lineNumber: 73,
columnNumber: 5

@@ -131,3 +136,3 @@ }, this);

fileName: _jsxFileName,
lineNumber: 94,
lineNumber: 100,
columnNumber: 7

@@ -137,3 +142,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 93,
lineNumber: 99,
columnNumber: 5

@@ -167,3 +172,3 @@ }, this);

fileName: _jsxFileName,
lineNumber: 112,
lineNumber: 118,
columnNumber: 43

@@ -174,3 +179,3 @@ }, this), children, icon && iconPosition === 'right' && (0, _jsxDevRuntime.jsxDEV)(_SvgIcon.SvgIcon, {

fileName: _jsxFileName,
lineNumber: 114,
lineNumber: 120,
columnNumber: 44

@@ -180,3 +185,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 111,
lineNumber: 117,
columnNumber: 5

@@ -197,3 +202,3 @@ }, this);

fileName: _jsxFileName,
lineNumber: 125,
lineNumber: 131,
columnNumber: 10

@@ -200,0 +205,0 @@ }, this);

@@ -10,8 +10,7 @@ /**

* set some error styling.
* @prop {'email'|'search'|'text'|'url'} [type="text"] - Set the <input> type:
* restricted to the "text-like" type values.
*/
/**
* `TextInput` sets the `type` attribute on the `input`, but any other valid
* `input` attribute should be forwarded.
* @typedef {Omit<import('preact').JSX.HTMLAttributes<HTMLInputElement>, 'type'>} HTMLInputElementProps
* @typedef {TextInputBaseProps & HTMLInputElementProps} TextInputProps
* @typedef {TextInputBaseProps & import('preact').JSX.HTMLAttributes<HTMLInputElement>} TextInputProps
*/

@@ -28,3 +27,3 @@ /**

*/
export function TextInput({ classes, inputRef, hasError, ...restProps }: TextInputProps): import("preact").JSX.Element;
export function TextInput({ classes, inputRef, hasError, type, ...restProps }: TextInputProps): import("preact").JSX.Element;
/**

@@ -60,330 +59,9 @@ * A wrapping component for pairing a `TextInput` with an `IconButton` component.

hasError?: boolean | undefined;
/**
* - Set the <input> type:
* restricted to the "text-like" type values.
*/
type?: "text" | "email" | "search" | "url" | undefined;
};
/**
* `TextInput` sets the `type` attribute on the `input`, but any other valid
* `input` attribute should be forwarded.
*/
export type HTMLInputElementProps = {
content?: string | undefined;
height?: string | number | undefined;
width?: string | number | undefined;
target?: string | undefined;
data?: string | undefined;
key?: any;
form?: string | undefined;
label?: string | undefined;
slot?: string | undefined;
span?: number | undefined;
style?: string | import("preact").JSX.CSSProperties | undefined;
summary?: string | undefined;
title?: string | undefined;
pattern?: string | undefined;
name?: string | undefined;
className?: string | undefined;
dir?: "auto" | "rtl" | "ltr" | undefined;
class?: string | undefined;
size?: number | undefined;
accept?: string | undefined;
acceptCharset?: string | undefined;
accessKey?: string | undefined;
action?: string | undefined;
allowFullScreen?: boolean | undefined;
allowTransparency?: boolean | undefined;
alt?: string | undefined;
as?: string | undefined;
async?: boolean | undefined;
autocomplete?: string | undefined;
autoComplete?: string | undefined;
autocorrect?: string | undefined;
autoCorrect?: string | undefined;
autofocus?: boolean | undefined;
autoFocus?: boolean | undefined;
autoPlay?: boolean | undefined;
capture?: string | boolean | undefined;
cellPadding?: string | number | undefined;
cellSpacing?: string | number | undefined;
charSet?: string | undefined;
challenge?: string | undefined;
checked?: boolean | undefined;
cols?: number | undefined;
colSpan?: number | undefined;
contentEditable?: boolean | undefined;
contextMenu?: string | undefined;
controls?: boolean | undefined;
controlsList?: string | undefined;
coords?: string | undefined;
crossOrigin?: string | undefined;
dateTime?: string | undefined;
default?: boolean | undefined;
defer?: boolean | undefined;
disabled?: boolean | undefined;
disableRemotePlayback?: boolean | undefined;
download?: any;
draggable?: boolean | undefined;
encType?: string | undefined;
formAction?: string | undefined;
formEncType?: string | undefined;
formMethod?: string | undefined;
formNoValidate?: boolean | undefined;
formTarget?: string | undefined;
frameBorder?: string | number | undefined;
headers?: string | undefined;
hidden?: boolean | undefined;
high?: number | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
for?: string | undefined;
htmlFor?: string | undefined;
httpEquiv?: string | undefined;
icon?: string | undefined;
id?: string | undefined;
inputMode?: string | undefined;
integrity?: string | undefined;
is?: string | undefined;
keyParams?: string | undefined;
keyType?: string | undefined;
kind?: string | undefined;
lang?: string | undefined;
list?: string | undefined;
loading?: "eager" | "lazy" | undefined;
loop?: boolean | undefined;
low?: number | undefined;
manifest?: string | undefined;
marginHeight?: number | undefined;
marginWidth?: number | undefined;
max?: string | number | undefined;
maxLength?: number | undefined;
media?: string | undefined;
mediaGroup?: string | undefined;
method?: string | undefined;
min?: string | number | undefined;
minLength?: number | undefined;
multiple?: boolean | undefined;
muted?: boolean | undefined;
nonce?: string | undefined;
noValidate?: boolean | undefined;
open?: boolean | undefined;
optimum?: number | undefined;
placeholder?: string | undefined;
playsInline?: boolean | undefined;
poster?: string | undefined;
preload?: string | undefined;
radioGroup?: string | undefined;
readonly?: boolean | undefined;
readOnly?: boolean | undefined;
rel?: string | undefined;
required?: boolean | undefined;
role?: string | undefined;
rows?: number | undefined;
rowSpan?: number | undefined;
sandbox?: string | undefined;
scope?: string | undefined;
scoped?: boolean | undefined;
scrolling?: string | undefined;
seamless?: boolean | undefined;
selected?: boolean | undefined;
shape?: string | undefined;
sizes?: string | undefined;
spellcheck?: boolean | undefined;
src?: string | undefined;
srcset?: string | undefined;
srcDoc?: string | undefined;
srcLang?: string | undefined;
srcSet?: string | undefined;
start?: number | undefined;
step?: string | number | undefined;
tabIndex?: number | undefined;
useMap?: string | undefined;
value?: string | number | string[] | undefined;
volume?: string | number | undefined;
wmode?: string | undefined;
wrap?: string | undefined;
about?: string | undefined;
datatype?: string | undefined;
inlist?: any;
prefix?: string | undefined;
property?: string | undefined;
resource?: string | undefined;
typeof?: string | undefined;
vocab?: string | undefined;
itemProp?: string | undefined;
itemScope?: boolean | undefined;
itemType?: string | undefined;
itemID?: string | undefined;
itemRef?: string | undefined;
ref?: import("preact").RefObject<HTMLInputElement> | import("preact").RefCallback<HTMLInputElement> | undefined;
jsx?: boolean | undefined;
onLoad?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onLoadCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onError?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onErrorCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onCopy?: import("preact").JSX.ClipboardEventHandler<HTMLInputElement> | undefined;
onCopyCapture?: import("preact").JSX.ClipboardEventHandler<HTMLInputElement> | undefined;
onCut?: import("preact").JSX.ClipboardEventHandler<HTMLInputElement> | undefined;
onCutCapture?: import("preact").JSX.ClipboardEventHandler<HTMLInputElement> | undefined;
onPaste?: import("preact").JSX.ClipboardEventHandler<HTMLInputElement> | undefined;
onPasteCapture?: import("preact").JSX.ClipboardEventHandler<HTMLInputElement> | undefined;
onCompositionEnd?: import("preact").JSX.CompositionEventHandler<HTMLInputElement> | undefined;
onCompositionEndCapture?: import("preact").JSX.CompositionEventHandler<HTMLInputElement> | undefined;
onCompositionStart?: import("preact").JSX.CompositionEventHandler<HTMLInputElement> | undefined;
onCompositionStartCapture?: import("preact").JSX.CompositionEventHandler<HTMLInputElement> | undefined;
onCompositionUpdate?: import("preact").JSX.CompositionEventHandler<HTMLInputElement> | undefined;
onCompositionUpdateCapture?: import("preact").JSX.CompositionEventHandler<HTMLInputElement> | undefined;
onToggle?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onFocus?: import("preact").JSX.FocusEventHandler<HTMLInputElement> | undefined;
onFocusCapture?: import("preact").JSX.FocusEventHandler<HTMLInputElement> | undefined;
onBlur?: import("preact").JSX.FocusEventHandler<HTMLInputElement> | undefined;
onBlurCapture?: import("preact").JSX.FocusEventHandler<HTMLInputElement> | undefined;
onChange?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onChangeCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onInput?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onInputCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSearch?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSearchCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSubmit?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSubmitCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onInvalid?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onInvalidCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onReset?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onResetCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onFormData?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onFormDataCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onKeyDown?: import("preact").JSX.KeyboardEventHandler<HTMLInputElement> | undefined;
onKeyDownCapture?: import("preact").JSX.KeyboardEventHandler<HTMLInputElement> | undefined;
onKeyPress?: import("preact").JSX.KeyboardEventHandler<HTMLInputElement> | undefined;
onKeyPressCapture?: import("preact").JSX.KeyboardEventHandler<HTMLInputElement> | undefined;
onKeyUp?: import("preact").JSX.KeyboardEventHandler<HTMLInputElement> | undefined;
onKeyUpCapture?: import("preact").JSX.KeyboardEventHandler<HTMLInputElement> | undefined;
onAbort?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onAbortCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onCanPlay?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onCanPlayCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onCanPlayThrough?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onCanPlayThroughCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onDurationChange?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onDurationChangeCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onEmptied?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onEmptiedCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onEncrypted?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onEncryptedCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onEnded?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onEndedCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onLoadedData?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onLoadedDataCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onLoadedMetadata?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onLoadedMetadataCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onLoadStart?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onLoadStartCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onPause?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onPauseCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onPlay?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onPlayCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onPlaying?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onPlayingCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onProgress?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onProgressCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onRateChange?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onRateChangeCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSeeked?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSeekedCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSeeking?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSeekingCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onStalled?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onStalledCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSuspend?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSuspendCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onTimeUpdate?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onTimeUpdateCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onVolumeChange?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onVolumeChangeCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onWaiting?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onWaitingCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onClick?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onClickCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onContextMenu?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onContextMenuCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onDblClick?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onDblClickCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onDrag?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragEnd?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragEndCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragEnter?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragEnterCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragExit?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragExitCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragLeave?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragLeaveCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragOver?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragOverCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragStart?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDragStartCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDrop?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onDropCapture?: import("preact").JSX.DragEventHandler<HTMLInputElement> | undefined;
onMouseDown?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseDownCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseEnter?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseEnterCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseLeave?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseLeaveCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseMove?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseMoveCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseOut?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseOutCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseOver?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseOverCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseUp?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onMouseUpCapture?: import("preact").JSX.MouseEventHandler<HTMLInputElement> | undefined;
onSelect?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onSelectCapture?: import("preact").JSX.GenericEventHandler<HTMLInputElement> | undefined;
onTouchCancel?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onTouchCancelCapture?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onTouchEnd?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onTouchEndCapture?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onTouchMove?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onTouchMoveCapture?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onTouchStart?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onTouchStartCapture?: import("preact").JSX.TouchEventHandler<HTMLInputElement> | undefined;
onPointerOver?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerOverCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerEnter?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerEnterCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerDown?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerDownCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerMove?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerMoveCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerUp?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerUpCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerCancel?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerCancelCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerOut?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerOutCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerLeave?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onPointerLeaveCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onGotPointerCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onGotPointerCaptureCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onLostPointerCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onLostPointerCaptureCapture?: import("preact").JSX.PointerEventHandler<HTMLInputElement> | undefined;
onScroll?: import("preact").JSX.UIEventHandler<HTMLInputElement> | undefined;
onScrollCapture?: import("preact").JSX.UIEventHandler<HTMLInputElement> | undefined;
onWheel?: import("preact").JSX.WheelEventHandler<HTMLInputElement> | undefined;
onWheelCapture?: import("preact").JSX.WheelEventHandler<HTMLInputElement> | undefined;
onAnimationStart?: import("preact").JSX.AnimationEventHandler<HTMLInputElement> | undefined;
onAnimationStartCapture?: import("preact").JSX.AnimationEventHandler<HTMLInputElement> | undefined;
onAnimationEnd?: import("preact").JSX.AnimationEventHandler<HTMLInputElement> | undefined;
onAnimationEndCapture?: import("preact").JSX.AnimationEventHandler<HTMLInputElement> | undefined;
onAnimationIteration?: import("preact").JSX.AnimationEventHandler<HTMLInputElement> | undefined;
onAnimationIterationCapture?: import("preact").JSX.AnimationEventHandler<HTMLInputElement> | undefined;
onTransitionEnd?: import("preact").JSX.TransitionEventHandler<HTMLInputElement> | undefined;
onTransitionEndCapture?: import("preact").JSX.TransitionEventHandler<HTMLInputElement> | undefined;
children?: import("preact").ComponentChildren;
dangerouslySetInnerHTML?: {
__html: string;
} | undefined;
};
/**
* `TextInput` sets the `type` attribute on the `input`, but any other valid
* `input` attribute should be forwarded.
*/
export type TextInputProps = TextInputBaseProps & Pick<import("preact").JSX.HTMLAttributes<HTMLInputElement>, "content" | "height" | "width" | "target" | "data" | "key" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "name" | "className" | "dir" | "class" | "size" | "accept" | "acceptCharset" | "accessKey" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autocomplete" | "autoComplete" | "autocorrect" | "autoCorrect" | "autofocus" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cols" | "colSpan" | "contentEditable" | "contextMenu" | "controls" | "controlsList" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "disableRemotePlayback" | "download" | "draggable" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "hidden" | "high" | "href" | "hrefLang" | "for" | "htmlFor" | "httpEquiv" | "icon" | "id" | "inputMode" | "integrity" | "is" | "keyParams" | "keyType" | "kind" | "lang" | "list" | "loading" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "radioGroup" | "readonly" | "readOnly" | "rel" | "required" | "role" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "spellcheck" | "src" | "srcset" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "tabIndex" | "useMap" | "value" | "volume" | "wmode" | "wrap" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "ref" | "jsx" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onToggle" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onInput" | "onInputCapture" | "onSearch" | "onSearchCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onReset" | "onResetCapture" | "onFormData" | "onFormDataCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDblClick" | "onDblClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseEnterCapture" | "onMouseLeave" | "onMouseLeaveCapture" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerOut" | "onPointerOutCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "children" | "dangerouslySetInnerHTML">;
export type TextInputProps = TextInputBaseProps & import("preact").JSX.HTMLAttributes<HTMLInputElement>;
export type TextInputWithButtonProps = {

@@ -390,0 +68,0 @@ children: Children;

@@ -36,9 +36,8 @@ "use strict";

* set some error styling.
* @prop {'email'|'search'|'text'|'url'} [type="text"] - Set the <input> type:
* restricted to the "text-like" type values.
*/
/**
* `TextInput` sets the `type` attribute on the `input`, but any other valid
* `input` attribute should be forwarded.
* @typedef {Omit<import('preact').JSX.HTMLAttributes<HTMLInputElement>, 'type'>} HTMLInputElementProps
* @typedef {TextInputBaseProps & HTMLInputElementProps} TextInputProps
* @typedef {TextInputBaseProps & import('preact').JSX.HTMLAttributes<HTMLInputElement>} TextInputProps
*/

@@ -61,5 +60,6 @@

inputRef,
hasError = false
hasError = false,
type = 'text'
} = _ref,
restProps = _objectWithoutProperties(_ref, ["classes", "inputRef", "hasError"]);
restProps = _objectWithoutProperties(_ref, ["classes", "inputRef", "hasError", "type"]);

@@ -72,3 +72,3 @@ return (0, _jsxDevRuntime.jsxDEV)("input", _objectSpread(_objectSpread({

ref: inputRef,
type: "text"
type: type
}), void 0, false, {

@@ -75,0 +75,0 @@ fileName: _jsxFileName,

@@ -137,2 +137,65 @@ "use strict";

}, this), (0, _jsxDevRuntime.jsxDEV)(_Library.default.Example, {
title: "As type='url'",
children: [(0, _jsxDevRuntime.jsxDEV)("p", {
children: [(0, _jsxDevRuntime.jsxDEV)("code", {
children: "TextInput"
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 61,
columnNumber: 13
}, this), " renders an ", (0, _jsxDevRuntime.jsxDEV)("code", {
children: "input"
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 61,
columnNumber: 47
}, this), " field of", ' ', (0, _jsxDevRuntime.jsxDEV)("code", {
children: "type=\"text\""
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 62,
columnNumber: 13
}, this), " by default, but text-like `type` values are also supported (", (0, _jsxDevRuntime.jsxDEV)("code", {
children: "email"
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 63,
columnNumber: 40
}, this), ", ", (0, _jsxDevRuntime.jsxDEV)("code", {
children: "search"
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 63,
columnNumber: 60
}, this), ",", ' ', (0, _jsxDevRuntime.jsxDEV)("code", {
children: "url"
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 64,
columnNumber: 13
}, this), ")."]
}, void 0, true, {
fileName: _jsxFileName,
lineNumber: 60,
columnNumber: 11
}, this), (0, _jsxDevRuntime.jsxDEV)(_Library.default.Demo, {
withSource: true,
children: (0, _jsxDevRuntime.jsxDEV)(_.TextInput, {
name: "my-input",
type: "url"
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 67,
columnNumber: 13
}, this)
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 66,
columnNumber: 11
}, this)]
}, void 0, true, {
fileName: _jsxFileName,
lineNumber: 59,
columnNumber: 9
}, this), (0, _jsxDevRuntime.jsxDEV)(_Library.default.Example, {
title: "Error state",

@@ -146,3 +209,3 @@ children: (0, _jsxDevRuntime.jsxDEV)(_Library.default.Demo, {

fileName: _jsxFileName,
lineNumber: 61,
lineNumber: 73,
columnNumber: 13

@@ -152,3 +215,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 60,
lineNumber: 72,
columnNumber: 11

@@ -158,3 +221,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 59,
lineNumber: 71,
columnNumber: 9

@@ -173,3 +236,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 68,
lineNumber: 80,
columnNumber: 36

@@ -179,3 +242,3 @@ }, this), " pattern: a text input on the left with an associated icon-only button on the right."]

fileName: _jsxFileName,
lineNumber: 67,
lineNumber: 79,
columnNumber: 9

@@ -187,3 +250,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)("p", {

fileName: _jsxFileName,
lineNumber: 73,
lineNumber: 85,
columnNumber: 36

@@ -194,3 +257,3 @@ }, this), " variant of", ' ', (0, _jsxDevRuntime.jsxDEV)("code", {

fileName: _jsxFileName,
lineNumber: 74,
lineNumber: 86,
columnNumber: 11

@@ -200,3 +263,3 @@ }, this), "."]

fileName: _jsxFileName,
lineNumber: 72,
lineNumber: 84,
columnNumber: 9

@@ -212,3 +275,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)(_Library.default.Example, {

fileName: _jsxFileName,
lineNumber: 79,
lineNumber: 91,
columnNumber: 15

@@ -221,3 +284,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)(_.IconButton, {

fileName: _jsxFileName,
lineNumber: 80,
lineNumber: 92,
columnNumber: 15

@@ -227,3 +290,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 78,
lineNumber: 90,
columnNumber: 13

@@ -233,3 +296,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 77,
lineNumber: 89,
columnNumber: 11

@@ -239,3 +302,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 76,
lineNumber: 88,
columnNumber: 9

@@ -252,3 +315,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)(_Library.default.Example, {

fileName: _jsxFileName,
lineNumber: 88,
lineNumber: 100,
columnNumber: 15

@@ -262,3 +325,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)(_.IconButton, {

fileName: _jsxFileName,
lineNumber: 89,
lineNumber: 101,
columnNumber: 15

@@ -268,3 +331,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 87,
lineNumber: 99,
columnNumber: 13

@@ -274,3 +337,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 86,
lineNumber: 98,
columnNumber: 11

@@ -280,3 +343,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 85,
lineNumber: 97,
columnNumber: 9

@@ -286,3 +349,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 66,
lineNumber: 78,
columnNumber: 7

@@ -289,0 +352,0 @@ }, this)]

@@ -8,4 +8,2 @@ "use strict";

var _preact = require("preact");
var _hooks = require("preact/hooks");

@@ -25,3 +23,3 @@

const renderCallback = file => (0, _jsxDevRuntime.jsxDEV)(_preact.Fragment, {
const renderCallback = file => (0, _jsxDevRuntime.jsxDEV)(_jsxDevRuntime.Fragment, {
children: [(0, _jsxDevRuntime.jsxDEV)("td", {

@@ -31,3 +29,3 @@ children: file.displayName

fileName: _jsxFileName,
lineNumber: 12,
lineNumber: 11,
columnNumber: 5

@@ -38,10 +36,6 @@ }, void 0), (0, _jsxDevRuntime.jsxDEV)("td", {

fileName: _jsxFileName,
lineNumber: 13,
lineNumber: 12,
columnNumber: 5
}, void 0)]
}, void 0, true, {
fileName: _jsxFileName,
lineNumber: 11,
columnNumber: 3
}, void 0);
}, void 0, true);

@@ -66,3 +60,3 @@ const {

fileName: _jsxFileName,
lineNumber: 28,
lineNumber: 27,
columnNumber: 11

@@ -72,3 +66,3 @@ }, this), " will fill available space if none of its ancestors apply any constraints on height or width. It will fill 100% of its available space horizontally, and take up all the vertical space it needs. In this case, it will change vertical size during loading."]

fileName: _jsxFileName,
lineNumber: 27,
lineNumber: 26,
columnNumber: 7

@@ -83,3 +77,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)(_Library.default.Demo, {

fileName: _jsxFileName,
lineNumber: 35,
lineNumber: 34,
columnNumber: 11

@@ -89,3 +83,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 34,
lineNumber: 33,
columnNumber: 9

@@ -103,3 +97,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)(_.Table, {

fileName: _jsxFileName,
lineNumber: 39,
lineNumber: 38,
columnNumber: 9

@@ -109,3 +103,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 33,
lineNumber: 32,
columnNumber: 7

@@ -115,3 +109,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 26,
lineNumber: 25,
columnNumber: 5

@@ -134,3 +128,3 @@ }, this);

fileName: _jsxFileName,
lineNumber: 63,
lineNumber: 62,
columnNumber: 9

@@ -141,3 +135,3 @@ }, this), " render inside of a ", (0, _jsxDevRuntime.jsxDEV)("code", {

fileName: _jsxFileName,
lineNumber: 63,
lineNumber: 62,
columnNumber: 48

@@ -147,3 +141,3 @@ }, this), " container component, which gives the table a scroll context and allows it to scroll if it overflows. Apply height/width constraints to an appropriate parent elements to enable this. Height will not change when loading."]

fileName: _jsxFileName,
lineNumber: 62,
lineNumber: 61,
columnNumber: 7

@@ -154,3 +148,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)("p", {

fileName: _jsxFileName,
lineNumber: 68,
lineNumber: 67,
columnNumber: 7

@@ -166,3 +160,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)(_Library.default.Demo, {

fileName: _jsxFileName,
lineNumber: 71,
lineNumber: 70,
columnNumber: 11

@@ -172,3 +166,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 70,
lineNumber: 69,
columnNumber: 9

@@ -189,3 +183,3 @@ }, this), (0, _jsxDevRuntime.jsxDEV)("div", {

fileName: _jsxFileName,
lineNumber: 79,
lineNumber: 78,
columnNumber: 11

@@ -195,3 +189,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 75,
lineNumber: 74,
columnNumber: 9

@@ -201,3 +195,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 69,
lineNumber: 68,
columnNumber: 7

@@ -207,3 +201,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 61,
lineNumber: 60,
columnNumber: 5

@@ -220,7 +214,7 @@ }, this);

fileName: _jsxFileName,
lineNumber: 99,
lineNumber: 98,
columnNumber: 9
}, this), (0, _jsxDevRuntime.jsxDEV)(ScrollboxTableExample, {}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 100,
lineNumber: 99,
columnNumber: 9

@@ -230,3 +224,3 @@ }, this)]

fileName: _jsxFileName,
lineNumber: 98,
lineNumber: 97,
columnNumber: 7

@@ -236,3 +230,3 @@ }, this)

fileName: _jsxFileName,
lineNumber: 97,
lineNumber: 96,
columnNumber: 5

@@ -239,0 +233,0 @@ }, this);

{
"name": "@hypothesis/frontend-shared",
"version": "3.8.1",
"version": "3.9.0",
"description": "Shared components, styles and utilities for Hypothesis projects",

@@ -5,0 +5,0 @@ "license": "BSD-2-Clause",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc