-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Component Examples: Add Fluent options for Experiments and OUFR Dev S…
…ite (#6757) * Revert "Fluent experiment: Move Customizer inside each ExampleCard (#6715)" This reverts commit ed4aac1. * Consolidate theme definitions into theme-samples package. Add Fluent to theme dropdown for all OUFR and experiment component examples. Remove Fluent styles page since it is now redundant with ExampleCard functionality. Split Fluent styles definitions into mutliple component styles files. * Change files. * Use new fluent-theme package. Move utility function to variants package. * Change files. * Minor cleanup: Remove unused dependency, alias new packages. * JS doc cleanup. * Remove erroneous return value.
- Loading branch information
Showing
63 changed files
with
295 additions
and
2,638 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
155 changes: 6 additions & 149 deletions
155
apps/fabric-website-resources/src/customizations/customizations.ts
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,157 +1,14 @@ | ||
import { createTheme, ICustomizations, ITheme } from 'office-ui-fabric-react'; | ||
import { IExampleCardCustomizations, IAppCustomizations } from '@uifabric/example-app-base'; | ||
import { getNeutralVariant, getSoftVariant, getStrongVariant } from '@uifabric/variants'; | ||
|
||
const defaultCustomizations: ICustomizations = { | ||
settings: { | ||
theme: createTheme({}) | ||
}, | ||
scopedSettings: {} | ||
}; | ||
|
||
const wordCustomizations: ICustomizations = { | ||
settings: { | ||
theme: createTheme({ | ||
palette: { | ||
themePrimary: '#2b579a', | ||
themeSecondary: '#366ec2' | ||
}, | ||
semanticColors: { | ||
buttonBackground: 'white', | ||
buttonBackgroundHovered: 'rgb(240, 240, 240)', | ||
buttonBackgroundPressed: 'rgb(240, 240, 240)', | ||
buttonText: 'rgb(43, 87, 154)', | ||
buttonBorder: 'rgb(237, 235, 233)' | ||
} | ||
}) | ||
}, | ||
|
||
scopedSettings: { | ||
Button: { | ||
styleVariables: { | ||
baseVariant: { | ||
baseState: { | ||
borderWidth: 1, | ||
minHeight: 26, | ||
textSize: 13.5, | ||
lineHeight: 13.5, | ||
textWeight: 600, | ||
iconSize: 12, | ||
contentPadding: '0px 6px' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
const teamsCustomizations: ICustomizations = { | ||
settings: { | ||
theme: createTheme({ | ||
palette: { | ||
themePrimary: '#6061aa', | ||
themeLighterAlt: '#f7f7fc', | ||
themeLighter: '#e1e1f2', | ||
themeLight: '#c7c8e6', | ||
themeTertiary: '#9797cd', | ||
themeSecondary: '#6f70b5', | ||
themeDarkAlt: '#56579a', | ||
themeDark: '#494a82', | ||
themeDarker: '#363660', | ||
neutralLighterAlt: '#f8f8f8', | ||
neutralLighter: '#f4f4f4', | ||
neutralLight: '#eaeaea', | ||
neutralQuaternaryAlt: '#dadada', | ||
neutralQuaternary: '#d0d0d0', | ||
neutralTertiaryAlt: '#c8c8c8', | ||
neutralTertiary: '#b6b0b0', | ||
neutralSecondary: '#9f9797', | ||
neutralPrimaryAlt: '#877f7f', | ||
neutralPrimary: '#282424', | ||
neutralDark: '#585151', | ||
black: '#403b3b', | ||
white: '#fff' | ||
}, | ||
semanticColors: { | ||
buttonBackground: 'transparent', | ||
buttonBackgroundHovered: '#bdbdbd', | ||
buttonBackgroundPressed: '#a7a7a7', | ||
|
||
buttonText: '#252424', | ||
buttonTextPressed: '#252424', | ||
buttonTextHovered: '#252424', | ||
|
||
buttonBorder: '#bdbdbd', | ||
|
||
primaryBorder: 'transparent' | ||
} | ||
}) | ||
}, | ||
|
||
scopedSettings: { | ||
Button: { | ||
styleVariables: { | ||
baseVariant: { | ||
baseState: { | ||
borderRadius: 3, | ||
borderWidth: 2, | ||
iconSize: 16, | ||
iconWeight: 700, | ||
textWeight: 400, | ||
contentPadding: '4px 32px' | ||
}, | ||
enabled: { | ||
iconColor: '#252424', | ||
borderColorHovered: 'transparent', | ||
borderColorPressed: 'transparent' | ||
}, | ||
expanded: { | ||
borderColor: 'transparent' | ||
} | ||
}, | ||
circular: { | ||
baseState: { | ||
borderWidth: 1 | ||
}, | ||
enabled: { | ||
backgroundColorHovered: '#464775', | ||
backgroundColorPressed: '#464775', | ||
|
||
textColorHovered: '#fff', | ||
textColorPressed: '#fff', | ||
|
||
iconColorHovered: '#fff', | ||
iconColorPressed: '#fff' | ||
} | ||
}, | ||
primary: { | ||
enabled: { | ||
iconColor: 'white' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
import { FluentCustomizations } from '@uifabric/fluent-theme'; | ||
import { DefaultCustomizations, TeamsCustomizations, WordCustomizations } from '@uifabric/theme-samples'; | ||
|
||
const exampleCardCustomizations: IExampleCardCustomizations[] = [ | ||
{ title: 'Default', customizations: defaultCustomizations }, | ||
{ title: 'Word', customizations: wordCustomizations }, | ||
{ title: 'Teams', customizations: teamsCustomizations } | ||
{ title: 'Default', customizations: DefaultCustomizations }, | ||
{ title: 'Fluent', customizations: FluentCustomizations }, | ||
{ title: 'Word', customizations: WordCustomizations }, | ||
{ title: 'Teams', customizations: TeamsCustomizations } | ||
]; | ||
|
||
exampleCardCustomizations.forEach(theme => { | ||
_updateSchemes(theme.customizations.settings.theme); | ||
}); | ||
|
||
export const AppCustomizations: IAppCustomizations = { | ||
exampleCardCustomizations | ||
}; | ||
|
||
function _updateSchemes(theme: ITheme): void { | ||
theme.schemes = { | ||
strong: getStrongVariant(theme), | ||
soft: getSoftVariant(theme), | ||
neutral: getNeutralVariant(theme) | ||
}; | ||
} |
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
11 changes: 11 additions & 0 deletions
11
...on/changes/@uifabric/experiments/jg-6716-examplecard-fluent-support_2018-10-18-21-35.json
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,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@uifabric/experiments", | ||
"comment": "Move theme definitions to theme-samples package. Remove Fluent styles page.", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@uifabric/experiments", | ||
"email": "jagore@microsoft.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
...on/changes/@uifabric/experiments/jg-6716-examplecard-fluent-support_2018-10-19-16-58.json
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,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@uifabric/experiments", | ||
"comment": "Use fluent-theme package customizations.", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@uifabric/experiments", | ||
"email": "jagore@microsoft.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
...ifabric/fabric-website-resources/jg-6716-examplecard-fluent-support_2018-10-18-21-35.json
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,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@uifabric/fabric-website-resources", | ||
"comment": "Move theme definitions to theme-samples package.", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@uifabric/fabric-website-resources", | ||
"email": "jagore@microsoft.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
...ifabric/fabric-website-resources/jg-6716-examplecard-fluent-support_2018-10-19-16-58.json
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,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@uifabric/fabric-website-resources", | ||
"comment": "Use fluent-theme package customizations.", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@uifabric/fabric-website-resources", | ||
"email": "jagore@microsoft.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
...n/changes/@uifabric/fluent-theme/jg-6716-examplecard-fluent-support_2018-10-19-16-58.json
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,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@uifabric/fluent-theme", | ||
"comment": "Use variants addVariants utility function.", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@uifabric/fluent-theme", | ||
"email": "jagore@microsoft.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
.../changes/@uifabric/theme-samples/jg-6716-examplecard-fluent-support_2018-10-18-21-35.json
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,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@uifabric/theme-samples", | ||
"comment": "Add sample theme defintions for Word and Teams.", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@uifabric/theme-samples", | ||
"email": "jagore@microsoft.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
common/changes/@uifabric/variants/jg-6716-examplecard-fluent-support_2018-10-19-16-58.json
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,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@uifabric/variants", | ||
"comment": "Add addVariants utility function.", | ||
"type": "minor" | ||
} | ||
], | ||
"packageName": "@uifabric/variants", | ||
"email": "jagore@microsoft.com" | ||
} |
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
75 changes: 0 additions & 75 deletions
75
packages/experiments/src/components/fluent/FluentColors.ts
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
packages/experiments/src/components/fluent/FluentCustomizations.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.