diff --git a/.changeset/dropdown-component.md b/.changeset/dropdown-component.md new file mode 100644 index 0000000..7ee7fc9 --- /dev/null +++ b/.changeset/dropdown-component.md @@ -0,0 +1,5 @@ +--- +'@nciocpl/react-components': minor +--- + +Add `Dropdown` (NCIDS Select) component. Wraps a native `. */ + className?: string; + /** Array of options */ + options: DropdownOptionProps[]; + /** Aria label on the + {options.map((opt) => ( + + ))} + + ); +}; + +export default Dropdown; diff --git a/src/components/ncids/Dropdown/index.ts b/src/components/ncids/Dropdown/index.ts new file mode 100644 index 0000000..f30b1ed --- /dev/null +++ b/src/components/ncids/Dropdown/index.ts @@ -0,0 +1,2 @@ +export { Dropdown, default } from './Dropdown'; +export type { DropdownProps } from './Dropdown'; diff --git a/src/components/ncids/index.ts b/src/components/ncids/index.ts index 5ec3538..130d5d3 100644 --- a/src/components/ncids/index.ts +++ b/src/components/ncids/index.ts @@ -3,3 +3,5 @@ export { Pager } from './Pager'; export type { PagerProps, PageChangeData } from './Pager'; export { Collection, CollectionItem } from './Collection'; export type { CollectionProps, CollectionItemProps } from './Collection'; +export { Dropdown } from './Dropdown'; +export type { DropdownProps } from './Dropdown'; diff --git a/src/styles/index.scss b/src/styles/index.scss new file mode 100644 index 0000000..3082717 --- /dev/null +++ b/src/styles/index.scss @@ -0,0 +1,19 @@ +// Bundled NCIDS/USWDS styles for components shipped by this library. +// +// Consumers that don't already compile NCIDS SCSS can: +// import '@nciocpl/react-components/styles'; +// +// The bundle assumes the USWDS image sprite is served at /img. Map +// node_modules/@nciocpl/ncids-css/uswds-img to /img in your app's static +// asset pipeline (see README "Setup" for the standard recipes). + +@use 'uswds-core' with ( + $theme-image-path: '/img', + $theme-show-notifications: false, + $theme-show-compile-warnings: false +); + +@forward 'uswds-global'; +@forward 'usa-pagination'; +@forward 'usa-icon'; +@forward 'usa-collection';