diff --git a/.changeset/cuddly-bags-sort.md b/.changeset/cuddly-bags-sort.md new file mode 100644 index 00000000000..d9ae0c3c250 --- /dev/null +++ b/.changeset/cuddly-bags-sort.md @@ -0,0 +1,5 @@ +--- +"@primer/react": patch +--- + +Add `InlineAutocomplete` component, `useCombobox` hook, and `useSyntheticChange` hook to drafts diff --git a/.changeset/funny-roses-impress.md b/.changeset/funny-roses-impress.md new file mode 100644 index 00000000000..16e99ea1919 --- /dev/null +++ b/.changeset/funny-roses-impress.md @@ -0,0 +1,5 @@ +--- +"@primer/react": minor +--- + +Add `padding` prop to `PageLayout.Header`, `PageLayout.Content`, `PageLayout.Pane`, and `PageLayout.Footer` diff --git a/@types/@koddsson/index.d.ts b/@types/@koddsson/index.d.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/@types/@koddsson/textarea-caret/index.d.ts b/@types/@koddsson/textarea-caret/index.d.ts new file mode 100644 index 00000000000..c2505997701 --- /dev/null +++ b/@types/@koddsson/textarea-caret/index.d.ts @@ -0,0 +1,11 @@ +declare module '@koddsson/textarea-caret' { + export interface CaretCoordinates { + top: number + left: number + height: number + } + export default function getCaretCoordinates( + input: HTMLTextAreaElement | HTMLInputElement, + index: number + ): CaretCoordinates +} diff --git a/docs/content/PageLayout.mdx b/docs/content/PageLayout.mdx index c4f939df260..577016ad206 100644 --- a/docs/content/PageLayout.mdx +++ b/docs/content/PageLayout.mdx @@ -58,6 +58,25 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo ``` +### With connected dividers + +```jsx live + + + + + + + + + + + + + + +``` + ### With pane on left ```jsx live @@ -139,29 +158,29 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | 'medium' | 'large' | 'xlarge'`} - defaultValue="'full'" + defaultValue="'xlarge'" description="The maximum width of the page container." /> @@ -170,6 +189,14 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo ### PageLayout.Header + + + + + +Input components **must always** be accompanied by a corresponding label to improve support for assistive +technologies. Examples below are provided for conciseness and may not reflect accessibility best practices. + +`InlineAutocomplete` can be used with the [`FormControl`](/FormControl) component to render a corresponding label. + + + +### Multi-line input + +Try typing a `#` symbol to see suggestions. Use `Enter` or click to apply a suggestion. + +```javascript live noinline drafts +const options = ['javascript', 'typescript', 'css', 'html', 'webassembly'] + +const SimpleExample = () => { + const [suggestions, setSuggestions] = React.useState([]) + + return ( + setSuggestions(options.filter(tag => tag.includes(query)))} + onHideSuggestions={() => setSuggestions([])} + > +