Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Adds examples of usage for CSSBaseline",
"packageName": "@fluentui/react-examples",
"email": "bsunderhus@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Removes circular dependencies on react-theme-provider and react-provider",
"packageName": "@fluentui/react-make-styles",
"email": "bsunderhus@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Adds CSSBaseline component to react-provider",
"packageName": "@fluentui/react-provider",
"email": "bsunderhus@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Update dependencies",
"packageName": "@fluentui/react-theme-provider",
"email": "bsunderhus@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { CSSBaseline } from '@fluentui/react-provider';
import * as React from 'react';

export const Base = () => <CSSBaseline />;
3 changes: 1 addition & 2 deletions packages/react-make-styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"react-dom": "16.8.6"
},
"dependencies": {
"@fluentui/react-shared-contexts": "^9.0.0-alpha.4",
"@fluentui/make-styles": "^9.0.0-alpha.10",
"@fluentui/react-provider": "^9.0.0-alpha.19",
"@fluentui/react-theme": "^9.0.0-alpha.8",
"@fluentui/react-theme-provider": "^9.0.0-alpha.19",
"tslib": "^1.10.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-make-styles/src/makeStaticStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
makeStaticStyles as vanillaMakeStaticStyles,
MakeStaticStylesOptions,
} from '@fluentui/make-styles';
import { useFluent } from '@fluentui/react-provider';
import { useFluent } from '@fluentui/react-shared-contexts';

import { useRenderer } from './useRenderer';

Expand Down
3 changes: 1 addition & 2 deletions packages/react-make-styles/src/makeStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
MakeStylesRenderer,
MakeStylesStyleRule,
} from '@fluentui/make-styles';
import { useFluent } from '@fluentui/react-provider';
import { useTheme } from '@fluentui/react-theme-provider';
import { useTheme, useFluent } from '@fluentui/react-shared-contexts';
import { Theme } from '@fluentui/react-theme';
import * as React from 'react';

Expand Down
7 changes: 7 additions & 0 deletions packages/react-provider/etc/react-provider.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import * as React from 'react';
import { Theme } from '@fluentui/react-theme';
import { useFluent } from '@fluentui/react-shared-contexts';

// @public (undocumented)
export const CSSBaseline: React.MemoExoticComponent<(props: CSSBaselineProps) => null>;

// @public (undocumented)
export interface CSSBaselineProps {
}

// @public (undocumented)
export const FluentProvider: React.ForwardRefExoticComponent<FluentProviderProps & React.RefAttributes<HTMLElement>>;

Expand Down
4 changes: 3 additions & 1 deletion packages/react-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
"just": "just-scripts",
"lint": "just-scripts lint"
"lint": "just-scripts lint",
"start": "just-scripts dev:storybook"
},
"devDependencies": {
"@fluentui/eslint-plugin": "^1.1.0",
Expand All @@ -41,6 +42,7 @@
"@fluentui/react-theme": "^9.0.0-alpha.8",
"@fluentui/react-theme-provider": "^9.0.0-alpha.19",
"@fluentui/react-utilities": "^9.0.0-alpha.15",
"@fluentui/react-make-styles": "^9.0.0-alpha.20",
"tslib": "^1.10.0"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/react-provider/src/CSSBaseline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components/CSSBaseline/index';
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as React from 'react';
import { makeStaticStyles } from '@fluentui/react-make-styles';

// eslint-disable-next-line @fluentui/max-len
const normalizeCSS = `/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}`;

const useGlobalStyles = makeStaticStyles(normalizeCSS);

export interface CSSBaselineProps {}

export const CSSBaseline = React.memo((props: CSSBaselineProps) => {
useGlobalStyles();
return null;
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './CSSBaseline';
1 change: 1 addition & 0 deletions packages/react-provider/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './FluentProvider';
export { useFluent } from '@fluentui/react-shared-contexts';
export * from './CSSBaseline';