-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release/9.0
- Loading branch information
Showing
1,142 changed files
with
1,197 additions
and
892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
examples/create-react-app-typescript/src/components/Examples/SingleInputDateFieldExample.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { useState } from 'react'; | ||
import { SingleInputDateField } from '@cmsgov/design-system'; | ||
|
||
function SingleInputDateFieldExample() { | ||
const [dateString, updateDate] = useState(''); | ||
return ( | ||
<div> | ||
<h2>SingleInputDateField Example</h2> | ||
<SingleInputDateField | ||
hint="If you were born on a leap day, entering the date will either crash our servers or open a portal to an alternate dimension." | ||
label="Enter your date of birth." | ||
name="single-input-date-field" | ||
fromYear={2023} | ||
toYear={2023} | ||
value={dateString} | ||
onChange={updateDate} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default SingleInputDateFieldExample; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/design-system/src/components/CloseButton/CloseButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import useId from '../utilities/useId'; | ||
import { CloseIconThin } from '../Icons'; | ||
|
||
interface BaseCloseButtonProps { | ||
/** | ||
* An aria-label is required since the button content is only an X | ||
*/ | ||
'aria-label': string; | ||
/** | ||
* Additional classes to be added to the button element. | ||
*/ | ||
className?: string; | ||
/** | ||
* A custom `id` attribute for the dialog element | ||
*/ | ||
id?: string; | ||
} | ||
|
||
export type CloseButtonProps = Omit< | ||
React.ComponentPropsWithRef<'button'>, | ||
keyof BaseCloseButtonProps | ||
> & | ||
BaseCloseButtonProps; | ||
|
||
/** | ||
* | ||
*/ | ||
export const CloseButton = ({ className, id: idProp, ...buttonAttributes }: CloseButtonProps) => { | ||
const id = useId('close-button--', idProp); | ||
return ( | ||
<button | ||
className={classNames('ds-c-close-button', className)} | ||
type="button" | ||
id={id} | ||
{...buttonAttributes} | ||
> | ||
<CloseIconThin ariaHidden={false} id={`${id}__icon`} /> | ||
</button> | ||
); | ||
}; | ||
|
||
export default CloseButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './CloseButton'; |
Oops, something went wrong.