-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foundation: Component Creation #5721
Closed
2 of 9 tasks
Labels
Comments
2 tasks
In the example above, is |
Yep. It's implemented in experiments and handles the |
2 tasks
2 tasks
2 tasks
I've pulled out incomplete items into separate issues so will close this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Component Details
There is a need to create a foundation package that improves and extends the existing
styled
functionality that OUFR provides. This new Foundation package has the following goals:styled
implementation in Foundation package.styled
separately until deprecated.Design Assets
createComponent
createComponent is the core function for Foundation, consuming the view, state and styles objects to create an HOC that handles all styling and props processing.
Arguments
IComponentOptions
IComponentOptions
below.IStyleProviders
IStateComponent
renderView
prop.IComponentOptions
string
IStylesProp<TViewProps, TStyleSet>
(props: IViewComponentProps<TViewProps, TProcessedStyledSet>) => JSX.Element
TStatics
Types
Types are used to eliminate dependencies on specific styling library, allowing Foundation to have no other OUFR dependencies. This requires the consuming component library to provide these types.
TComponentProps
TViewProps
TComponentProps
is the same asTViewProps
.TStyleSet
TProcessedStyleSet
mergeStyleSets
provider after processingTStyleSet
and provided to views.TTheme
Component Library Interface
It is recommended that the component library provide an interface file that passes in global types (such as OUFR's
ITheme
andIProccessedStyleSet
) to Foundation so that the interfaces for components are simplified. For example:Imports
As one of the primary goals of Foundation is to be agnostic of styling and component libraries, Foundation should have no other OUFR dependencies.
Exports/ Component Breakdown
Intended Package
@uifabric/foundation
Code mockup/example
The API approach is similar to
styled
, the main differences being the explicit callout ofstate
andview
arguments.Code Sample
Component Ownership
This will be a core Fabric package with initial implementation and support provided by the core Fabric team (main POC @JasonGore.)
Deadlines
TODOs
getTheme
provider.create-component
script and New Component wiki.Steps
The text was updated successfully, but these errors were encountered: