@primer/components 31.0.2-rc.c7dafefb → 31.2.0-rc.a53b3afb
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/.storybook/main.js +7 -9
- package/.storybook/preview.js +5 -1
- package/CHANGELOG.md +11 -1
- package/dist/browser.esm.js +11 -10
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +11 -10
- package/dist/browser.umd.js.map +1 -1
- package/docs/content/FilterList.md +2 -2
- package/docs/content/TextInputWithTokens.mdx +114 -0
- package/docs/content/theming.md +23 -0
- package/lib/Autocomplete/Autocomplete.d.ts +4 -4
- package/lib/Autocomplete/AutocompleteInput.d.ts +4 -4
- package/lib/Button/Button.d.ts +5 -5
- package/lib/Button/ButtonBase.d.ts +1 -1
- package/lib/Button/ButtonClose.d.ts +3 -3
- package/lib/Button/ButtonDanger.d.ts +5 -5
- package/lib/Button/ButtonInvisible.d.ts +5 -5
- package/lib/Button/ButtonOutline.d.ts +5 -5
- package/lib/Button/ButtonPrimary.d.ts +5 -5
- package/lib/CircleBadge.d.ts +2 -2
- package/lib/CircleOcticon.d.ts +4 -4
- package/lib/Dialog.d.ts +4 -4
- package/lib/Dropdown.d.ts +16 -16
- package/lib/DropdownMenu/DropdownButton.d.ts +6 -6
- package/lib/FilterList.d.ts +3 -3
- package/lib/Flash.d.ts +1 -1
- package/lib/Label.d.ts +1 -1
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.d.ts +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +24 -24
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/TextInputWithTokens.d.ts +8 -4
- package/lib/TextInputWithTokens.js +61 -8
- package/lib/Timeline.d.ts +4 -4
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/_TextInputWrapper.d.ts +1 -1
- package/lib/_TextInputWrapper.js +1 -1
- package/lib/__tests__/KeyPaths.types.test.d.ts +10 -0
- package/lib/__tests__/KeyPaths.types.test.js +10 -0
- package/lib/__tests__/TextInputWithTokens.test.js +149 -9
- package/lib/stories/TextInputWithTokens.stories.js +18 -1
- package/lib/sx.d.ts +8 -2
- package/lib/theme.d.ts +78 -0
- package/lib/theme.js +3 -1
- package/lib/utils/types/KeyPaths.d.ts +3 -0
- package/lib/utils/types/KeyPaths.js +1 -0
- package/lib-esm/Autocomplete/Autocomplete.d.ts +4 -4
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +4 -4
- package/lib-esm/Button/Button.d.ts +5 -5
- package/lib-esm/Button/ButtonBase.d.ts +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +3 -3
- package/lib-esm/Button/ButtonDanger.d.ts +5 -5
- package/lib-esm/Button/ButtonInvisible.d.ts +5 -5
- package/lib-esm/Button/ButtonOutline.d.ts +5 -5
- package/lib-esm/Button/ButtonPrimary.d.ts +5 -5
- package/lib-esm/CircleBadge.d.ts +2 -2
- package/lib-esm/CircleOcticon.d.ts +4 -4
- package/lib-esm/Dialog.d.ts +4 -4
- package/lib-esm/Dropdown.d.ts +16 -16
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +6 -6
- package/lib-esm/FilterList.d.ts +3 -3
- package/lib-esm/Flash.d.ts +1 -1
- package/lib-esm/Label.d.ts +1 -1
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +24 -24
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/TextInputWithTokens.d.ts +8 -4
- package/lib-esm/TextInputWithTokens.js +60 -8
- package/lib-esm/Timeline.d.ts +4 -4
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/_TextInputWrapper.d.ts +1 -1
- package/lib-esm/_TextInputWrapper.js +1 -1
- package/lib-esm/__tests__/KeyPaths.types.test.d.ts +10 -0
- package/lib-esm/__tests__/KeyPaths.types.test.js +3 -0
- package/lib-esm/__tests__/TextInputWithTokens.test.js +142 -9
- package/lib-esm/stories/TextInputWithTokens.stories.js +14 -0
- package/lib-esm/sx.d.ts +8 -2
- package/lib-esm/theme.d.ts +78 -0
- package/lib-esm/theme.js +2 -1
- package/lib-esm/utils/types/KeyPaths.d.ts +3 -0
- package/lib-esm/utils/types/KeyPaths.js +1 -0
- package/package-lock.json +37942 -41
- package/package.json +2 -1
- package/src/TextInputWithTokens.tsx +64 -8
- package/src/_TextInputWrapper.tsx +1 -0
- package/src/__tests__/KeyPaths.types.test.ts +13 -0
- package/src/__tests__/TextInputWithTokens.test.tsx +133 -1
- package/src/__tests__/__snapshots__/Autocomplete.test.tsx.snap +7 -0
- package/src/__tests__/__snapshots__/TextInput.test.tsx.snap +6 -0
- package/src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap +463 -0
- package/src/stories/TextInputWithTokens.stories.tsx +9 -0
- package/src/sx.ts +14 -2
- package/src/theme.ts +86 -0
- package/src/utils/types/KeyPaths.ts +4 -0
- package/stats.html +1 -1
@@ -3,5 +3,5 @@ import { TokenBaseProps } from './TokenBase';
|
|
3
3
|
export interface AvatarTokenProps extends TokenBaseProps {
|
4
4
|
avatarSrc: string;
|
5
5
|
}
|
6
|
-
declare const AvatarToken: React.ForwardRefExoticComponent<Pick<AvatarTokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "
|
6
|
+
declare const AvatarToken: React.ForwardRefExoticComponent<Pick<AvatarTokenProps, "default" | "muted" | "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "size" | "wrap" | "open" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "as" | "hrefLang" | "integrity" | "rel" | "charSet" | "download" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "onRemove" | "isSelected" | "avatarSrc"> & React.RefAttributes<HTMLElement>>;
|
7
7
|
export default AvatarToken;
|
@@ -10,5 +10,5 @@ export interface IssueLabelTokenProps extends TokenBaseProps {
|
|
10
10
|
*/
|
11
11
|
hideRemoveButton?: boolean;
|
12
12
|
}
|
13
|
-
declare const IssueLabelToken: React.ForwardRefExoticComponent<Pick<IssueLabelTokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "
|
13
|
+
declare const IssueLabelToken: React.ForwardRefExoticComponent<Pick<IssueLabelTokenProps, "default" | "muted" | "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "size" | "wrap" | "open" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "as" | "hrefLang" | "integrity" | "rel" | "charSet" | "download" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "onRemove" | "isSelected" | "hideRemoveButton" | "fillColor"> & React.RefAttributes<HTMLElement>>;
|
14
14
|
export default IssueLabelToken;
|
package/lib/Token/Token.d.ts
CHANGED
@@ -11,5 +11,5 @@ export interface TokenProps extends TokenBaseProps {
|
|
11
11
|
*/
|
12
12
|
hideRemoveButton?: boolean;
|
13
13
|
}
|
14
|
-
declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps & SxProp, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "
|
14
|
+
declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps & SxProp, "default" | "muted" | "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "size" | "wrap" | "open" | "sx" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "as" | "hrefLang" | "integrity" | "rel" | "charSet" | "download" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "leadingVisual" | "onRemove" | "isSelected" | "hideRemoveButton"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>>;
|
15
15
|
export default Token;
|
@@ -5,6 +5,6 @@ declare const TextInputWrapper: import("styled-components").StyledComponent<"spa
|
|
5
5
|
hasIcon?: boolean | undefined;
|
6
6
|
block?: boolean | undefined;
|
7
7
|
contrast?: boolean | undefined;
|
8
|
-
variant?: "
|
8
|
+
variant?: "small" | "large" | undefined;
|
9
9
|
} & WidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>> & MinWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>> & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
|
10
10
|
export default TextInputWrapper;
|
package/lib/_TextInputWrapper.js
CHANGED
@@ -39,7 +39,7 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
39
39
|
const TextInputWrapper = _styledComponents.default.span.withConfig({
|
40
40
|
displayName: "_TextInputWrapper__TextInputWrapper",
|
41
41
|
componentId: "sc-5vfcis-0"
|
42
|
-
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
42
|
+
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";cursor:text;", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
43
43
|
if (props.hasIcon) {
|
44
44
|
return (0, _styledComponents.css)(["padding:0;"]);
|
45
45
|
} else {
|
@@ -58,8 +58,18 @@ const LabelledTextInputWithTokens = ({
|
|
58
58
|
tokens: tokens,
|
59
59
|
onTokenRemove: onTokenRemove,
|
60
60
|
id: "tokenInput"
|
61
|
-
}, rest)));
|
62
|
-
|
61
|
+
}, rest))); // describe('axe test', () => {
|
62
|
+
// it('should have no axe violations', async () => {
|
63
|
+
// const onRemoveMock = jest.fn()
|
64
|
+
// const {container} = HTMLRender(<LabelledTextInputWithTokens tokens={mockTokens} onTokenRemove={onRemoveMock} />)
|
65
|
+
// const results = await axe(container)
|
66
|
+
// expect(results).toHaveNoViolations()
|
67
|
+
// cleanup()
|
68
|
+
// })
|
69
|
+
// })
|
70
|
+
|
71
|
+
|
72
|
+
jest.useFakeTimers();
|
63
73
|
describe('TextInputWithTokens', () => {
|
64
74
|
it('renders without tokens', () => {
|
65
75
|
const onRemoveMock = jest.fn();
|
@@ -127,6 +137,14 @@ describe('TextInputWithTokens', () => {
|
|
127
137
|
onTokenRemove: onRemoveMock
|
128
138
|
}))).toMatchSnapshot();
|
129
139
|
});
|
140
|
+
it('renders a truncated set of tokens', () => {
|
141
|
+
const onRemoveMock = jest.fn();
|
142
|
+
expect((0, _testing.render)( /*#__PURE__*/_react.default.createElement(_TextInputWithTokens.default, {
|
143
|
+
tokens: mockTokens,
|
144
|
+
onTokenRemove: onRemoveMock,
|
145
|
+
visibleTokenCount: 2
|
146
|
+
}))).toMatchSnapshot();
|
147
|
+
});
|
130
148
|
it('focuses the previous token when keying ArrowLeft', () => {
|
131
149
|
var _document$activeEleme, _document$activeEleme2;
|
132
150
|
|
@@ -250,8 +268,130 @@ describe('TextInputWithTokens', () => {
|
|
250
268
|
expect((_document$activeEleme8 = document.activeElement) === null || _document$activeEleme8 === void 0 ? void 0 : _document$activeEleme8.id).not.toEqual(lastTokenNode.id);
|
251
269
|
expect((_document$activeEleme9 = document.activeElement) === null || _document$activeEleme9 === void 0 ? void 0 : _document$activeEleme9.id).toEqual(inputNode.id);
|
252
270
|
});
|
271
|
+
it('does not focus the input when clicking a token', () => {
|
272
|
+
var _document$activeEleme10;
|
273
|
+
|
274
|
+
const onRemoveMock = jest.fn();
|
275
|
+
const {
|
276
|
+
getByLabelText,
|
277
|
+
getByText
|
278
|
+
} = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(LabelledTextInputWithTokens, {
|
279
|
+
tokens: mockTokens,
|
280
|
+
onTokenRemove: onRemoveMock,
|
281
|
+
visibleTokenCount: 2
|
282
|
+
}));
|
283
|
+
const inputNode = getByLabelText('Tokens');
|
284
|
+
const tokenNode = getByText(mockTokens[0].text);
|
285
|
+
expect(document.activeElement).not.toEqual(inputNode.id);
|
286
|
+
|
287
|
+
_react2.fireEvent.click(tokenNode);
|
288
|
+
|
289
|
+
expect((_document$activeEleme10 = document.activeElement) === null || _document$activeEleme10 === void 0 ? void 0 : _document$activeEleme10.id).not.toEqual(inputNode.id);
|
290
|
+
});
|
291
|
+
it('focuses the input when clicking somewhere in the component besides the tokens', () => {
|
292
|
+
var _document$activeEleme11;
|
293
|
+
|
294
|
+
const onRemoveMock = jest.fn();
|
295
|
+
const {
|
296
|
+
getByLabelText,
|
297
|
+
getByText
|
298
|
+
} = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(LabelledTextInputWithTokens, {
|
299
|
+
tokens: mockTokens,
|
300
|
+
onTokenRemove: onRemoveMock,
|
301
|
+
visibleTokenCount: 2
|
302
|
+
}));
|
303
|
+
const inputNode = getByLabelText('Tokens');
|
304
|
+
const truncatedTokenCount = getByText('+6');
|
305
|
+
expect(document.activeElement).not.toEqual(inputNode.id);
|
306
|
+
|
307
|
+
_react2.fireEvent.click(truncatedTokenCount);
|
308
|
+
|
309
|
+
expect((_document$activeEleme11 = document.activeElement) === null || _document$activeEleme11 === void 0 ? void 0 : _document$activeEleme11.id).toEqual(inputNode.id);
|
310
|
+
});
|
311
|
+
it('shows all tokens when the input is focused and hides them when it is blurred (when visibleTokenCount is set)', () => {
|
312
|
+
const onRemoveMock = jest.fn();
|
313
|
+
const visibleTokenCount = 2;
|
314
|
+
const {
|
315
|
+
getByLabelText,
|
316
|
+
getByText
|
317
|
+
} = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(LabelledTextInputWithTokens, {
|
318
|
+
tokens: mockTokens,
|
319
|
+
onTokenRemove: onRemoveMock,
|
320
|
+
visibleTokenCount: visibleTokenCount
|
321
|
+
}), /*#__PURE__*/_react.default.createElement("button", {
|
322
|
+
id: "focusableOutsideComponent"
|
323
|
+
}, "Focus me")));
|
324
|
+
const inputNode = getByLabelText('Tokens');
|
325
|
+
const focusableOutsideComponentNode = getByText('Focus me');
|
326
|
+
const allTokenLabels = mockTokens.map(token => token.text);
|
327
|
+
const truncatedTokenCountNode = getByText('+6');
|
328
|
+
(0, _react2.act)(() => {
|
329
|
+
jest.runAllTimers();
|
330
|
+
|
331
|
+
_react2.fireEvent.focus(inputNode);
|
332
|
+
});
|
333
|
+
setTimeout(() => {
|
334
|
+
for (const tokenLabel of allTokenLabels) {
|
335
|
+
const tokenNode = getByText(tokenLabel);
|
336
|
+
expect(tokenNode).toBeDefined();
|
337
|
+
}
|
338
|
+
}, 0);
|
339
|
+
(0, _react2.act)(() => {
|
340
|
+
jest.runAllTimers(); // onBlur isn't called on input unless we specifically fire the "blur" event
|
341
|
+
// eslint-disable-next-line github/no-blur
|
342
|
+
|
343
|
+
_react2.fireEvent.blur(inputNode);
|
344
|
+
|
345
|
+
_react2.fireEvent.focus(focusableOutsideComponentNode);
|
346
|
+
});
|
347
|
+
setTimeout(() => {
|
348
|
+
expect(truncatedTokenCountNode).toBeDefined();
|
349
|
+
|
350
|
+
for (const tokenLabel of allTokenLabels) {
|
351
|
+
const tokenNode = getByText(tokenLabel);
|
352
|
+
|
353
|
+
if (allTokenLabels.indexOf(tokenLabel) > visibleTokenCount) {
|
354
|
+
// eslint-disable-next-line jest/no-conditional-expect
|
355
|
+
expect(tokenNode).toBeDefined();
|
356
|
+
} else {
|
357
|
+
// eslint-disable-next-line jest/no-conditional-expect
|
358
|
+
expect(tokenNode).not.toBeDefined();
|
359
|
+
}
|
360
|
+
}
|
361
|
+
}, 0);
|
362
|
+
jest.useRealTimers();
|
363
|
+
});
|
364
|
+
it('does not hide tokens when blurring the input to focus within the component (when visibleTokenCount is set)', () => {
|
365
|
+
const onRemoveMock = jest.fn();
|
366
|
+
const visibleTokenCount = 2;
|
367
|
+
const {
|
368
|
+
getByLabelText,
|
369
|
+
getByText
|
370
|
+
} = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(LabelledTextInputWithTokens, {
|
371
|
+
tokens: mockTokens,
|
372
|
+
onTokenRemove: onRemoveMock,
|
373
|
+
visibleTokenCount: visibleTokenCount
|
374
|
+
}), /*#__PURE__*/_react.default.createElement("button", {
|
375
|
+
id: "focusableOutsideComponent"
|
376
|
+
}, "Focus me")));
|
377
|
+
const inputNode = getByLabelText('Tokens');
|
378
|
+
const firstTokenNode = getByText(mockTokens[visibleTokenCount - 1].text);
|
379
|
+
const allTokenLabels = mockTokens.map(token => token.text);
|
380
|
+
const truncatedTokenCountNode = getByText('+6');
|
381
|
+
(0, _react2.act)(() => {
|
382
|
+
_react2.fireEvent.focus(inputNode);
|
383
|
+
|
384
|
+
_react2.fireEvent.focus(firstTokenNode);
|
385
|
+
});
|
386
|
+
expect(truncatedTokenCountNode).toBeDefined();
|
387
|
+
|
388
|
+
for (const tokenLabel of allTokenLabels) {
|
389
|
+
const tokenNode = getByText(tokenLabel);
|
390
|
+
expect(tokenNode).toBeDefined();
|
391
|
+
}
|
392
|
+
});
|
253
393
|
it('focuses the first token when keying ArrowRight in the input', () => {
|
254
|
-
var _document$
|
394
|
+
var _document$activeEleme12, _document$activeEleme13;
|
255
395
|
|
256
396
|
const onRemoveMock = jest.fn();
|
257
397
|
const {
|
@@ -271,8 +411,8 @@ describe('TextInputWithTokens', () => {
|
|
271
411
|
key: 'ArrowRight'
|
272
412
|
});
|
273
413
|
|
274
|
-
expect((_document$
|
275
|
-
expect((_document$
|
414
|
+
expect((_document$activeEleme12 = document.activeElement) === null || _document$activeEleme12 === void 0 ? void 0 : _document$activeEleme12.id).not.toEqual(inputNode.id);
|
415
|
+
expect((_document$activeEleme13 = document.activeElement) === null || _document$activeEleme13 === void 0 ? void 0 : _document$activeEleme13.id).toEqual(firstTokenNode.id);
|
276
416
|
});
|
277
417
|
it('calls onTokenRemove on the last token when keying Backspace in an empty input', () => {
|
278
418
|
const onRemoveMock = jest.fn();
|
@@ -372,9 +512,9 @@ describe('TextInputWithTokens', () => {
|
|
372
512
|
|
373
513
|
jest.runAllTimers();
|
374
514
|
setTimeout(() => {
|
375
|
-
var _document$
|
515
|
+
var _document$activeEleme14;
|
376
516
|
|
377
|
-
expect((_document$
|
517
|
+
expect((_document$activeEleme14 = document.activeElement) === null || _document$activeEleme14 === void 0 ? void 0 : _document$activeEleme14.textContent).toBe(mockTokens[1].text);
|
378
518
|
}, 0);
|
379
519
|
jest.useRealTimers();
|
380
520
|
});
|
@@ -399,9 +539,9 @@ describe('TextInputWithTokens', () => {
|
|
399
539
|
|
400
540
|
jest.runAllTimers();
|
401
541
|
setTimeout(() => {
|
402
|
-
var _document$
|
542
|
+
var _document$activeEleme15;
|
403
543
|
|
404
|
-
expect((_document$
|
544
|
+
expect((_document$activeEleme15 = document.activeElement) === null || _document$activeEleme15 === void 0 ? void 0 : _document$activeEleme15.id).toBe(inputNode.id);
|
405
545
|
}, 0);
|
406
546
|
jest.useRealTimers();
|
407
547
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.Unstyled = exports.TokenRemoveButtonsHidden = exports.TokenWrappingPrevented = exports.MaxHeight = exports.TokenSizeVariants = exports.UsingIssueLabelTokens = exports.Default = exports.default = void 0;
|
6
|
+
exports.Unstyled = exports.WithVisibleTokenCount = exports.TokenRemoveButtonsHidden = exports.TokenWrappingPrevented = exports.MaxHeight = exports.TokenSizeVariants = exports.UsingIssueLabelTokens = exports.Default = exports.default = void 0;
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
@@ -208,6 +208,23 @@ const TokenRemoveButtonsHidden = () => {
|
|
208
208
|
exports.TokenRemoveButtonsHidden = TokenRemoveButtonsHidden;
|
209
209
|
TokenRemoveButtonsHidden.displayName = "TokenRemoveButtonsHidden";
|
210
210
|
|
211
|
+
const WithVisibleTokenCount = () => {
|
212
|
+
const [tokens, setTokens] = (0, _react.useState)([...mockTokens].slice(0, 5));
|
213
|
+
|
214
|
+
const onTokenRemove = tokenId => {
|
215
|
+
setTokens(tokens.filter(token => token.id !== tokenId));
|
216
|
+
};
|
217
|
+
|
218
|
+
return /*#__PURE__*/_react.default.createElement(_TextInputWithTokens.default, {
|
219
|
+
tokens: tokens,
|
220
|
+
onTokenRemove: onTokenRemove,
|
221
|
+
visibleTokenCount: 2
|
222
|
+
});
|
223
|
+
};
|
224
|
+
|
225
|
+
exports.WithVisibleTokenCount = WithVisibleTokenCount;
|
226
|
+
WithVisibleTokenCount.displayName = "WithVisibleTokenCount";
|
227
|
+
|
211
228
|
const Unstyled = () => {
|
212
229
|
const [tokens, setTokens] = (0, _react.useState)([...mockTokens].slice(0, 2));
|
213
230
|
|
package/lib/sx.d.ts
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
import { SystemStyleObject } from '@styled-system/css';
|
1
|
+
import { SystemCssProperties, SystemStyleObject } from '@styled-system/css';
|
2
|
+
import { ThemeColorPaths, ThemeShadowPaths } from './theme';
|
3
|
+
import { ColorProps, ShadowProps } from 'styled-system';
|
4
|
+
export declare type BetterCssProperties = {
|
5
|
+
[K in keyof SystemCssProperties]: K extends keyof ColorProps ? ThemeColorPaths | SystemCssProperties[K] : K extends keyof ShadowProps ? ThemeShadowPaths | SystemCssProperties[K] : SystemCssProperties[K];
|
6
|
+
};
|
7
|
+
export declare type BetterSystemStyleObject = BetterCssProperties | SystemStyleObject;
|
2
8
|
export interface SxProp {
|
3
|
-
sx?:
|
9
|
+
sx?: BetterSystemStyleObject;
|
4
10
|
}
|
5
11
|
declare const sx: (props: SxProp) => import("@styled-system/css").CssFunctionReturnType;
|
6
12
|
export default sx;
|
package/lib/theme.d.ts
CHANGED
@@ -1,2 +1,80 @@
|
|
1
1
|
import { theme } from './theme-preval';
|
2
|
+
import { KeyPaths } from './utils/types/KeyPaths';
|
2
3
|
export default theme;
|
4
|
+
declare type ThemeColors = {
|
5
|
+
fg: {
|
6
|
+
default: string;
|
7
|
+
muted: string;
|
8
|
+
subtle: string;
|
9
|
+
onEmphasis: string;
|
10
|
+
};
|
11
|
+
canvas: {
|
12
|
+
default: string;
|
13
|
+
overlay: string;
|
14
|
+
inset: string;
|
15
|
+
subtle: string;
|
16
|
+
};
|
17
|
+
border: {
|
18
|
+
default: string;
|
19
|
+
muted: string;
|
20
|
+
subtle: string;
|
21
|
+
};
|
22
|
+
neutral: {
|
23
|
+
emphasisPlus: string;
|
24
|
+
emphasis: string;
|
25
|
+
muted: string;
|
26
|
+
subtle: string;
|
27
|
+
};
|
28
|
+
accent: {
|
29
|
+
fg: string;
|
30
|
+
emphasis: string;
|
31
|
+
muted: string;
|
32
|
+
subtle: string;
|
33
|
+
};
|
34
|
+
success: {
|
35
|
+
fg: string;
|
36
|
+
emphasis: string;
|
37
|
+
muted: string;
|
38
|
+
subtle: string;
|
39
|
+
};
|
40
|
+
attention: {
|
41
|
+
fg: string;
|
42
|
+
emphasis: string;
|
43
|
+
muted: string;
|
44
|
+
subtle: string;
|
45
|
+
};
|
46
|
+
severe: {
|
47
|
+
fg: string;
|
48
|
+
emphasis: string;
|
49
|
+
muted: string;
|
50
|
+
subtle: string;
|
51
|
+
};
|
52
|
+
danger: {
|
53
|
+
fg: string;
|
54
|
+
emphasis: string;
|
55
|
+
muted: string;
|
56
|
+
subtle: string;
|
57
|
+
};
|
58
|
+
done: {
|
59
|
+
fg: string;
|
60
|
+
emphasis: string;
|
61
|
+
muted: string;
|
62
|
+
subtle: string;
|
63
|
+
};
|
64
|
+
sponsors: {
|
65
|
+
fg: string;
|
66
|
+
emphasis: string;
|
67
|
+
muted: string;
|
68
|
+
subtle: string;
|
69
|
+
};
|
70
|
+
};
|
71
|
+
declare type ThemeShadows = {
|
72
|
+
shadow: {
|
73
|
+
small: string;
|
74
|
+
medium: string;
|
75
|
+
large: string;
|
76
|
+
extraLarge: string;
|
77
|
+
};
|
78
|
+
};
|
79
|
+
export declare type ThemeColorPaths = KeyPaths<ThemeColors>;
|
80
|
+
export declare type ThemeShadowPaths = KeyPaths<ThemeShadows>;
|
package/lib/theme.js
CHANGED
@@ -7,5 +7,7 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _themePreval = require("./theme-preval");
|
9
9
|
|
10
|
-
var _default = _themePreval.theme;
|
10
|
+
var _default = _themePreval.theme; // NOTE: for now, ThemeColors and ThemeShadows are handcrafted types. It would be nice if these
|
11
|
+
// were exports from primitives (or a different shape but derived from those exports).
|
12
|
+
|
11
13
|
exports.default = _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";
|
@@ -74,7 +74,7 @@ declare const _default: React.FC<{
|
|
74
74
|
results?: number | undefined;
|
75
75
|
security?: string | undefined;
|
76
76
|
unselectable?: "on" | "off" | undefined;
|
77
|
-
inputMode?: "
|
77
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
78
78
|
is?: string | undefined;
|
79
79
|
'aria-activedescendant'?: string | undefined;
|
80
80
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -89,7 +89,7 @@ declare const _default: React.FC<{
|
|
89
89
|
'aria-describedby'?: string | undefined;
|
90
90
|
'aria-details'?: string | undefined;
|
91
91
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
92
|
-
'aria-dropeffect'?: "
|
92
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
93
93
|
'aria-errormessage'?: string | undefined;
|
94
94
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
95
95
|
'aria-flowto'?: string | undefined;
|
@@ -288,9 +288,9 @@ declare const _default: React.FC<{
|
|
288
288
|
onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
289
289
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
290
290
|
block?: boolean | undefined;
|
291
|
-
sx?: import("
|
291
|
+
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
292
292
|
disabled?: boolean | undefined;
|
293
|
-
variant?: "
|
293
|
+
variant?: "small" | "large" | undefined;
|
294
294
|
hasIcon?: boolean | undefined;
|
295
295
|
contrast?: boolean | undefined;
|
296
296
|
} & {
|
@@ -66,7 +66,7 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
66
66
|
results?: number | undefined;
|
67
67
|
security?: string | undefined;
|
68
68
|
unselectable?: "on" | "off" | undefined;
|
69
|
-
inputMode?: "
|
69
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
70
70
|
is?: string | undefined;
|
71
71
|
'aria-activedescendant'?: string | undefined;
|
72
72
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -81,7 +81,7 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
81
81
|
'aria-describedby'?: string | undefined;
|
82
82
|
'aria-details'?: string | undefined;
|
83
83
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
84
|
-
'aria-dropeffect'?: "
|
84
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
85
85
|
'aria-errormessage'?: string | undefined;
|
86
86
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
87
87
|
'aria-flowto'?: string | undefined;
|
@@ -280,9 +280,9 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
280
280
|
onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
281
281
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
282
282
|
block?: boolean | undefined;
|
283
|
-
sx?: import("
|
283
|
+
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
284
284
|
disabled?: boolean | undefined;
|
285
|
-
variant?: "
|
285
|
+
variant?: "small" | "large" | undefined;
|
286
286
|
hasIcon?: boolean | undefined;
|
287
287
|
contrast?: boolean | undefined;
|
288
288
|
} & {
|