Socket
Socket
Sign inDemoInstall

@trussworks/react-uswds

Package Overview
Dependencies
Maintainers
11
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trussworks/react-uswds - npm Package Compare versions

Comparing version 1.17.0 to 2.0.0

lib/assets/483d64591df4bc21d2177cdb4d6cdc9f.svg

29

CHANGELOG.md

@@ -5,2 +5,31 @@ # Changelog

## [2.0.0](https://github.com/trussworks/react-uswds/compare/1.17.0...2.0.0) (2021-06-15)
### ⚠ BREAKING CHANGES
* Expose FileInput component ref with a clearFiles method (#1165)
* Expose ComboBox component ref with a clearSelection method (#1236)
* **deps-dev:** Update Typescript to 4.0+ (#1214)
* Modal component has been removed. The USWDS Modal will be added when reaching parity with USWDS 2.11.x
* Accordion component default behavior was updated to match USWDS. To continue to use the multiselectable behavior, use the multiselectable prop.
### Features
* Collection Component ([#1133](https://github.com/trussworks/react-uswds/issues/1133)) ([cdc200f](https://github.com/trussworks/react-uswds/commit/cdc200f5e084c5d63723ce4cf5dbb40252d6b2f5))
* Deprecate the Modal component ([#956](https://github.com/trussworks/react-uswds/issues/956)) ([7ae4e30](https://github.com/trussworks/react-uswds/commit/7ae4e30cf240af917fc66128e6dc8a047271c6de))
* Expose ComboBox component ref with a clearSelection method ([#1236](https://github.com/trussworks/react-uswds/issues/1236)) ([e90e4df](https://github.com/trussworks/react-uswds/commit/e90e4df9bdb55a217174e551dabb9e6535c384b8))
* Expose FileInput component ref with a clearFiles method ([#1165](https://github.com/trussworks/react-uswds/issues/1165)) ([0bc0b54](https://github.com/trussworks/react-uswds/commit/0bc0b54a2d38e789554d9ba4af57b9f854f002fc))
* Update Accordion component default behavior to match USWDS ([#922](https://github.com/trussworks/react-uswds/issues/922)) ([c063047](https://github.com/trussworks/react-uswds/commit/c063047a86551539bba3664d2ceb591e1d50971f))
### Bug Fixes
* Fix TimePicker filter behavior. Misc ComboBox Fixes ([#1139](https://github.com/trussworks/react-uswds/issues/1139)) ([c684844](https://github.com/trussworks/react-uswds/commit/c68484418a3e53d3b4ed98c5eb66e3522f81a475))
* Update storybook form control organization and SWDS URLs ([#1136](https://github.com/trussworks/react-uswds/issues/1136)) ([bfd7344](https://github.com/trussworks/react-uswds/commit/bfd73443732e78fd06841bf5d36a2e83fdb08bd2))
* Use embedded images for storybook ([#1265](https://github.com/trussworks/react-uswds/issues/1265)) ([#1266](https://github.com/trussworks/react-uswds/issues/1266)) ([61abd79](https://github.com/trussworks/react-uswds/commit/61abd7933a3ed9fa7fedeba6857e1417c0c51770))
* **deps-dev:** Update Typescript to 4.0+ ([#1214](https://github.com/trussworks/react-uswds/issues/1214)) ([f632744](https://github.com/trussworks/react-uswds/commit/f632744b566a4da8e7f27499af51ee18e55516b8))
## [1.17.0](https://github.com/trussworks/react-uswds/compare/1.16.0...1.17.0) (2021-05-05)

@@ -7,0 +36,0 @@

3

lib/components/Accordion/Accordion.d.ts

@@ -12,2 +12,3 @@ import React from 'react';

bordered?: boolean;
multiselectable?: boolean;
items: AccordionItem[];

@@ -17,3 +18,3 @@ className?: string;

export declare const AccordionItem: ({ title, id, content, expanded, className, handleToggle, }: AccordionItem) => React.ReactElement;
export declare const Accordion: ({ bordered, items, className, }: AccordionProps) => React.ReactElement;
export declare const Accordion: ({ bordered, items, className, multiselectable, }: AccordionProps) => React.ReactElement;
export default Accordion;

@@ -11,2 +11,6 @@ import React from 'react';

}
export interface CustomizableFilter {
filter: string;
extras?: Record<string, string>;
}
interface ComboBoxProps {

@@ -25,4 +29,9 @@ id: string;

ulProps?: JSX.IntrinsicElements['ul'];
customFilter?: CustomizableFilter;
disableFiltering?: boolean;
}
export declare const ComboBox: ({ id, name, className, options, defaultValue, disabled, onChange, assistiveHint, noResults, selectProps, inputProps, ulProps, ...customProps }: ComboBoxProps) => React.ReactElement;
export declare type ComboBoxRef = {
clearSelection: () => void;
};
export declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<ComboBoxRef>>;
export default ComboBox;
import React from 'react';
import type { ComboBoxOption } from './ComboBox';
import type { ComboBoxOption, CustomizableFilter } from './ComboBox';
import { FocusMode } from './ComboBox';

@@ -11,3 +11,4 @@ export declare enum ActionTypes {

UPDATE_FILTER = 5,
BLUR = 6
BLUR = 6,
CLEAR_SELECTION = 7
}

@@ -31,2 +32,4 @@ export declare type Action = {

type: ActionTypes.BLUR;
} | {
type: ActionTypes.CLEAR_SELECTION;
};

@@ -38,6 +41,5 @@ export interface State {

focusMode: FocusMode;
filter?: string;
filteredOptions: ComboBoxOption[];
inputValue: string;
}
export declare const useCombobox: (initialState: State, optionsList: ComboBoxOption[]) => [State, React.Dispatch<Action>];
export declare const useComboBox: (initialState: State, optionsList: ComboBoxOption[], disableFiltering: boolean, customizableFilter: CustomizableFilter) => [State, React.Dispatch<Action>];

@@ -10,5 +10,9 @@ import React from 'react';

onDrop?: (e: React.DragEvent) => void;
inputRef?: React.RefObject<HTMLInputElement>;
}
export declare const FileInput: ({ name, id, disabled, multiple, className, accept, onChange, onDrop, inputRef, ...inputProps }: FileInputProps & JSX.IntrinsicElements['input']) => React.ReactElement;
export declare type FileInputRef = {
clearFiles: () => void;
input: HTMLInputElement | null;
files: File[];
};
export declare const FileInput: React.ForwardRefExoticComponent<Pick<FileInputProps & React.ClassAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLInputElement>, "type" | "children" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "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" | "form" | "pattern" | "list" | "step" | "key" | "size" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "multiple" | "height" | "src" | "alt" | "crossOrigin" | "width" | "autoComplete" | "accept" | "capture" | "checked" | "enterKeyHint" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "required"> & React.RefAttributes<FileInputRef>>;
export {};

@@ -0,1 +1,2 @@

import { CustomizableFilter } from '../ComboBox/ComboBox';
export declare const DEFAULT_MAX_TIME = "23:59";

@@ -7,7 +8,2 @@ export declare const DEFAULT_MAX_TIME_MINUTES: number;

export declare const MIN_STEP = 1;
export declare const FILTER_DATASET: {
filter: string;
apQueryFilter: string;
hourQueryFilter: string;
minuteQueryFilter: string;
};
export declare const TIME_PICKER_CUSTOM_FILTER: CustomizableFilter;
import React from 'react';
import { ContainerSizes } from '../types';
declare type GridContainerProps<T> = {
declare type GridContainerProps = {
containerSize?: ContainerSizes;

@@ -11,4 +11,4 @@ className?: string;

}
export declare type DefaultGridContainerProps = GridContainerProps<JSX.IntrinsicElements['div']>;
export declare type CustomGridContainerProps<T> = GridContainerProps<T> & WithCustomGridContainerProps<T>;
export declare type DefaultGridContainerProps = GridContainerProps;
export declare type CustomGridContainerProps<T> = GridContainerProps & WithCustomGridContainerProps<T>;
export declare function isCustomProps<T>(props: DefaultGridContainerProps | CustomGridContainerProps<T>): props is CustomGridContainerProps<T>;

@@ -15,0 +15,0 @@ export declare function GridContainer(props: DefaultGridContainerProps): React.ReactElement;

@@ -1,2 +0,2 @@

import React, { ReactElement } from 'react';
import React from 'react';
interface IdentifierMastheadProps {

@@ -3,0 +3,0 @@ className?: string;

@@ -13,2 +13,12 @@ import './styles/index.scss';

export { SideNav } from './components/SideNav/SideNav';
/** Collection components */
export { Collection } from './components/Collection/Collection';
export { CollectionItem } from './components/Collection/CollectionItem';
export { CollectionHeading } from './components/Collection/CollectionHeading';
export { CollectionDescription } from './components/Collection/CollectionDescription';
export { CollectionMeta } from './components/Collection/CollectionMeta';
export { CollectionMetaItem } from './components/Collection/CollectionMetaItem';
export { CollectionMetaItemTag } from './components/Collection/CollectionMetaItemTag';
export { CollectionThumbnail } from './components/Collection/CollectionThumbnail';
export { CollectionCalendarDate } from './components/Collection/CollectionCalendarDate';
/** Grid components */

@@ -88,4 +98,2 @@ export { GridContainer } from './components/grid/GridContainer/GridContainer';

export { SiteAlert } from './components/SiteAlert/SiteAlert';
/** Truss-designed components */
export { Modal, Overlay, ModalContainer, connectModal, useModal, } from './components/Modal/Modal';
export type { ConnectedModalProps, ModalHook } from './components/Modal/Modal';
export type { FileInputRef } from './components/forms/FileInput/FileInput';

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactUSWDS=t():e.ReactUSWDS=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=104)}({104:function(e,t,n){"use strict";n(105)},105:function(e,t,n){"use strict";n.r(t)}})}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactUSWDS=t():e.ReactUSWDS=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=111)}({111:function(e,t,n){"use strict";n(112)},112:function(e,t,n){"use strict";n.r(t)}})}));
{
"name": "@trussworks/react-uswds",
"version": "1.17.0",
"version": "2.0.0",
"description": "React USWDS 2.0 component library",

@@ -27,2 +27,3 @@ "keywords": [

"test:coverage": "jest --coverage",
"test:serverside": "yarn build && node src/serverSideTest.js",
"storybook": "start-storybook -p 9009",

@@ -77,3 +78,3 @@ "storybook:deploy": "storybook-to-ghpages",

"@testing-library/react": "^11.0.2",
"@testing-library/react-hooks": "^5.0.0",
"@testing-library/react-hooks": "^7.0.0",
"@testing-library/user-event": "^13.1.5",

@@ -84,8 +85,8 @@ "@types/classnames": "^2.2.9",

"@types/react-dom": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^2.3.2",
"@typescript-eslint/parser": "^2.3.2",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"all-contributors-cli": "^6.20.0",
"awesome-typescript-loader": "^5.2.1",
"babel-eslint": "^10.0.3",
"babel-jest": "^26.1.0",
"babel-jest": "^27.0.2",
"babel-loader": "^8.0.6",

@@ -95,3 +96,3 @@ "classnames": "^2.2.6",

"danger": "^10.0.0",
"dotenv": "^8.2.0",
"dotenv": "^10.0.0",
"eslint": "^6.5.1",

@@ -110,3 +111,3 @@ "eslint-config-prettier": "^6.3.0",

"jest": "^26.1.0",
"lint-staged": "^10.0.9",
"lint-staged": "^11.0.0",
"mini-css-extract-plugin": "^1.0.0",

@@ -132,3 +133,3 @@ "prettier": "^2.0.2",

"ts-jest": "^26.1.2",
"typescript": "^3.8.0",
"typescript": "^4.2.4",
"url-loader": "^4.0.0",

@@ -135,0 +136,0 @@ "uswds": "2.10.3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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