-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(uds): convert all items to typescript
- Loading branch information
Showing
31 changed files
with
499 additions
and
422 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"cSpell.words": [ | ||
"arcgis", | ||
"autodocs", | ||
"baselayer", | ||
"basemap", | ||
"Centerlines", | ||
|
41 changes: 22 additions & 19 deletions
41
packages/utah-design-system/src/components/AlertDialog.stories.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 |
---|---|---|
@@ -1,32 +1,35 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import { DialogTrigger } from 'react-aria-components'; | ||
import { AlertDialog } from './AlertDialog'; | ||
import { AlertDialog as Component } from './AlertDialog'; | ||
import { Button } from './Button'; | ||
import { Modal } from './Modal'; | ||
|
||
const meta: Meta<typeof AlertDialog> = { | ||
component: AlertDialog, | ||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
decorators: [ | ||
(Story) => ( | ||
<DialogTrigger> | ||
<Button variant="destructive">Delete…</Button> | ||
<Modal> | ||
<Story /> | ||
</Modal> | ||
</DialogTrigger> | ||
), | ||
], | ||
argTypes: {}, | ||
args: { | ||
title: 'Delete folder', | ||
children: | ||
'Are you sure you want to delete "Documents"? All contents will be permanently destroyed.', | ||
variant: 'destructive', | ||
actionLabel: 'Delete', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Example = (args: any) => ( | ||
<DialogTrigger> | ||
<Button variant="destructive">Delete…</Button> | ||
<Modal> | ||
<AlertDialog {...args} /> | ||
</Modal> | ||
</DialogTrigger> | ||
); | ||
|
||
Example.args = { | ||
title: 'Delete folder', | ||
children: | ||
'Are you sure you want to delete "Documents"? All contents will be permanently destroyed.', | ||
variant: 'destructive', | ||
actionLabel: 'Delete', | ||
}; | ||
export const Example = {}; |
44 changes: 34 additions & 10 deletions
44
packages/utah-design-system/src/components/Avatar.stories.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 |
---|---|---|
@@ -1,20 +1,44 @@ | ||
import { Avatar } from './Avatar'; | ||
import { Meta } from '@storybook/react'; | ||
import { Avatar as Component } from './Avatar'; | ||
|
||
export default { | ||
component: Avatar, | ||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: { | ||
user: { | ||
email: 'ugrc-developers@utah.gov', | ||
displayName: 'UGRC Developers', | ||
emailVerified: true, | ||
isAnonymous: false, | ||
metadata: {}, | ||
providerData: [], | ||
refreshToken: '', | ||
tenantId: '', | ||
getIdToken: () => Promise.resolve(''), | ||
getIdTokenResult: () => Promise.resolve({} as any), | ||
reload: () => Promise.resolve(), | ||
toJSON: () => ({}), | ||
delete: () => Promise.resolve(), | ||
phoneNumber: null, | ||
photoURL: null, | ||
providerId: '', | ||
uid: '', | ||
}, | ||
}, | ||
}; | ||
|
||
export const Example = (args: any) => <Avatar {...args} />; | ||
Example.args = { | ||
user: { email: 'ugrc-developers@utah.gov', displayName: 'UGRC Developers' }, | ||
}; | ||
|
||
export const Anonymous = (args: any) => <Avatar {...args} />; | ||
export default meta; | ||
|
||
export const NoGravatar = (args: any) => <Avatar {...args} />; | ||
export const Example = {}; | ||
export const Anonymous = (args: any) => <Component {...args} />; | ||
Anonymous.args = { | ||
user: undefined, | ||
}; | ||
export const NoGravatar = (args: any) => <Component {...args} />; | ||
NoGravatar.args = { | ||
user: { email: 'test@test.com', displayName: 'Test User' }, | ||
}; |
18 changes: 18 additions & 0 deletions
18
packages/utah-design-system/src/components/Banner.stories.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,18 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import { Banner as Component } from './Banner.tsx'; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: { | ||
children: 'Something went wrong', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Example = {}; |
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
7 changes: 4 additions & 3 deletions
7
packages/utah-design-system/src/components/Button.stories.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
14 changes: 8 additions & 6 deletions
14
packages/utah-design-system/src/components/Checkbox.stories.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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { Checkbox } from './Checkbox'; | ||
import { Meta } from '@storybook/react'; | ||
import { Checkbox as Component } from './Checkbox'; | ||
|
||
export default { | ||
component: Checkbox, | ||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: { | ||
isDisabled: false, | ||
children: 'Checkbox', | ||
}, | ||
}; | ||
|
||
export const Default = { | ||
args: {}, | ||
}; | ||
export default meta; | ||
|
||
export const Example = {}; |
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
21 changes: 21 additions & 0 deletions
21
packages/utah-design-system/src/components/FormErrors.stories.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,21 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import { FormErrors as Component } from './FormErrors.tsx'; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: { | ||
errors: { | ||
email: new Error('Email is required'), | ||
password: new Error('Password is required'), | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Example = {}; |
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
Oops, something went wrong.