-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Clean up Select file structure and move examples to main react (#…
…2992) Some file clean up and documentation [category:Components] Co-authored-by: manuel.carrera <[email protected]>
- Loading branch information
1 parent
fa261ae
commit 032e51b
Showing
7 changed files
with
247 additions
and
160 deletions.
There are no files selected for viewing
7 changes: 1 addition & 6 deletions
7
..._examples/stories/mdx/FormsWithFormik.mdx → ..._examples/stories/mdx/FormsWithFormik.mdx
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,15 +1,10 @@ | ||
import {ExampleCodeBlock} from '@workday/canvas-kit-docs'; | ||
import {SelectWithFormik} from './examples/SelectWithFormik'; | ||
import {TextInputWithFormik} from './examples/TextInputWithFormik'; | ||
|
||
<Meta title="Examples/Preview/Forms/With Formik" /> | ||
<Meta title="Examples/Forms/Select With Formik" /> | ||
|
||
# Canvas Kit Examples | ||
|
||
## Select Using Formik | ||
|
||
<ExampleCodeBlock code={SelectWithFormik} /> | ||
|
||
## Controlled Text Inputs Using Formik | ||
|
||
<ExampleCodeBlock code={TextInputWithFormik} /> |
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
|
||
import {Combobox} from '@workday/canvas-kit-react/combobox'; | ||
import {createStyles, px2rem} from '@workday/canvas-kit-styling'; | ||
import {mergeStyles} from '@workday/canvas-kit-react/layout'; | ||
import {useSelectCard} from './hooks/useSelectCard'; | ||
import {useSelectModel} from './hooks/useSelectModel'; | ||
import {createSubcomponent, ExtractProps} from '@workday/canvas-kit-react/common'; | ||
|
||
const selectCardStyles = createStyles({ | ||
maxHeight: px2rem(300), | ||
}); | ||
|
||
export const SelectCard = createSubcomponent('div')({ | ||
modelHook: useSelectModel, | ||
elemPropsHook: useSelectCard, | ||
})<ExtractProps<typeof Combobox.Menu.Card>>(({children, ...elemProps}, Element) => { | ||
return ( | ||
<Combobox.Menu.Card as={Element} {...mergeStyles(elemProps, selectCardStyles)}> | ||
{children} | ||
</Combobox.Menu.Card> | ||
); | ||
}); |
Oops, something went wrong.