diff --git a/apps/vr-tests/src/stories/Stack.stories.tsx b/apps/vr-tests/src/stories/Stack.stories.tsx index 07fe4b54942707..59c437af665d5b 100644 --- a/apps/vr-tests/src/stories/Stack.stories.tsx +++ b/apps/vr-tests/src/stories/Stack.stories.tsx @@ -106,7 +106,7 @@ storiesOf('Stack', module) )) .addStory('Vertical Stack - Gap', () => ( - + )) .addStory('Vertical Stack - Vertically centered', () => ( @@ -151,7 +151,7 @@ storiesOf('Stack', module) .addStory( 'Vertical Stack - Item alignments', () => ( - + Auto-aligned item @@ -175,7 +175,7 @@ storiesOf('Stack', module) { rtl: true } ) .addStory('Vertical Stack - Growing items', () => ( - + Grow is 3 @@ -188,7 +188,7 @@ storiesOf('Stack', module) )) .addStory('Vertical Stack - Shrinking items', () => ( - + 1 2 (does not shrink) @@ -202,7 +202,12 @@ storiesOf('Stack', module) 'Vertical Stack - Wrap', () => ( - + 1 2 3 @@ -225,7 +230,7 @@ storiesOf('Stack', module) ) .addStory('Vertical Stack - Box shadow around items', () => ( - + 1 2 3 @@ -261,7 +266,7 @@ storiesOf('Stack', module) 'Horizontal Stack - Gap', () => ( - + ), { rtl: true } @@ -308,7 +313,12 @@ storiesOf('Stack', module) .addStory( 'Horizontal Stack - Item alignments', () => ( - + Auto-aligned item @@ -332,7 +342,7 @@ storiesOf('Stack', module) { rtl: true } ) .addStory('Horizontal Stack - Growing items', () => ( - + Grow is 3 @@ -345,7 +355,7 @@ storiesOf('Stack', module) )) .addStory('Horizontal Stack - Shrinking items', () => ( - + 1 2 (does not shrink) @@ -361,7 +371,7 @@ storiesOf('Stack', module) 'Horizontal Stack - Wrap', () => ( - + 1 2 3 @@ -398,7 +408,7 @@ storiesOf('Stack', module) ) .addStory('Horizontal Stack - Wrap with specified vertical gap', () => ( - + 1 2 3 @@ -433,7 +443,7 @@ storiesOf('Stack', module) )) .addStory('Horizontal Stack - Box shadow around items', () => ( - + 1 2 3 diff --git a/common/changes/@uifabric/foundation/cardApi_2019-03-20-21-17.json b/common/changes/@uifabric/foundation/cardApi_2019-03-20-21-17.json new file mode 100644 index 00000000000000..d1bca656a4075d --- /dev/null +++ b/common/changes/@uifabric/foundation/cardApi_2019-03-20-21-17.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/foundation", + "comment": "Passing styling and tokens to view.", + "type": "patch" + } + ], + "packageName": "@uifabric/foundation", + "email": "makotom@microsoft.com" +} \ No newline at end of file diff --git a/common/changes/@uifabric/merge-styles/cardApi_2019-03-28-20-09.json b/common/changes/@uifabric/merge-styles/cardApi_2019-03-28-20-09.json new file mode 100644 index 00000000000000..8c0f595c4e3923 --- /dev/null +++ b/common/changes/@uifabric/merge-styles/cardApi_2019-03-28-20-09.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/merge-styles", + "comment": "Deleting .api.ts file.", + "type": "patch" + } + ], + "packageName": "@uifabric/merge-styles", + "email": "Humberto.Morimoto@microsoft.com" +} \ No newline at end of file diff --git a/common/changes/@uifabric/react-cards/cardApi_2019-03-08-22-08.json b/common/changes/@uifabric/react-cards/cardApi_2019-03-08-22-08.json new file mode 100644 index 00000000000000..77df7df617256d --- /dev/null +++ b/common/changes/@uifabric/react-cards/cardApi_2019-03-08-22-08.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/react-cards", + "comment": "Card: Improving styling and adding compact Card styling and examples.", + "type": "minor" + } + ], + "packageName": "@uifabric/react-cards", + "email": "Humberto.Morimoto@microsoft.com" +} \ No newline at end of file diff --git a/common/changes/@uifabric/react-cards/cardApi_2019-03-18-15-59.json b/common/changes/@uifabric/react-cards/cardApi_2019-03-18-15-59.json new file mode 100644 index 00000000000000..9c13a4c71d6728 --- /dev/null +++ b/common/changes/@uifabric/react-cards/cardApi_2019-03-18-15-59.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/experiments", + "comment": "Updating examples using Stack to use childrenGap token instead of gap prop.", + "type": "patch" + } + ], + "packageName": "@uifabric/experiments", + "email": "Humberto.Morimoto@microsoft.com" +} \ No newline at end of file diff --git a/common/changes/office-ui-fabric-react/cardApi_2019-03-14-18-48.json b/common/changes/office-ui-fabric-react/cardApi_2019-03-14-18-48.json new file mode 100644 index 00000000000000..534f1d220a3deb --- /dev/null +++ b/common/changes/office-ui-fabric-react/cardApi_2019-03-14-18-48.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "Stack: Adding margin as a token of StackItem and childrenGap as a token of Stack and updating examples accordingly.", + "type": "minor" + } + ], + "packageName": "office-ui-fabric-react", + "email": "makotom@microsoft.com" +} \ No newline at end of file diff --git a/packages/experiments/src/components/Button/Button.view.tsx b/packages/experiments/src/components/Button/Button.view.tsx index fe19b4a8e99840..8eb07c3269e315 100644 --- a/packages/experiments/src/components/Button/Button.view.tsx +++ b/packages/experiments/src/components/Button/Button.view.tsx @@ -37,7 +37,7 @@ export const ButtonView: IButtonComponent['view'] = props => { {...buttonProps} aria-disabled={disabled} > - + {icon && } {content && } {children} diff --git a/packages/experiments/src/components/Button/MenuButton/examples/MenuButton.Example.tsx b/packages/experiments/src/components/Button/MenuButton/examples/MenuButton.Example.tsx index cf4d280891c381..ab6c30e3c7aa0f 100644 --- a/packages/experiments/src/components/Button/MenuButton/examples/MenuButton.Example.tsx +++ b/packages/experiments/src/components/Button/MenuButton/examples/MenuButton.Example.tsx @@ -5,12 +5,20 @@ import { Stack, Text } from 'office-ui-fabric-react'; const menuItems = [{ key: 'a', name: 'Item a' }, { key: 'b', name: 'Item b' }]; const buttonMenu: IMenuButtonProps['menu'] = render => render((MenuType, props) => ); -const sectionGap = 32; -const headingGap = 16; -const buttonGap = 12; +const tokens = { + sectionStack: { + childrenGap: 32 + }, + headingStack: { + childrenGap: 16 + }, + buttonStack: { + childrenGap: 12 + } +}; const ButtonStack = (props: { children: JSX.Element[] | JSX.Element }) => ( - + {props.children} ); @@ -19,10 +27,10 @@ const ButtonStack = (props: { children: JSX.Element[] | JSX.Element }) => ( export class MenuButtonExample extends React.Component<{}, {}> { public render(): JSX.Element { return ( - - + +
- + diff --git a/packages/experiments/src/components/Button/SplitMenuButton/examples/SplitMenuButton.Example.tsx b/packages/experiments/src/components/Button/SplitMenuButton/examples/SplitMenuButton.Example.tsx index 2c6e46db2d622e..45e3e3cd10e1ad 100644 --- a/packages/experiments/src/components/Button/SplitMenuButton/examples/SplitMenuButton.Example.tsx +++ b/packages/experiments/src/components/Button/SplitMenuButton/examples/SplitMenuButton.Example.tsx @@ -5,16 +5,24 @@ import { Stack } from 'office-ui-fabric-react'; const menuItems = [{ key: 'a', name: 'Item a' }, { key: 'b', name: 'Item b' }]; const buttonMenu: ISplitMenuButtonProps['menu'] = render => render((MenuType, props) => ); -const sectionGap = 32; -const headingGap = 16; -const buttonGap = 12; +const tokens = { + sectionStack: { + childrenGap: 32 + }, + headingStack: { + childrenGap: 16 + }, + buttonStack: { + childrenGap: 12 + } +}; const alertClicked = (): void => { alert('Clicked'); }; const ButtonStack = (props: { children: JSX.Element[] | JSX.Element }) => ( - + {props.children} ); @@ -23,10 +31,10 @@ const ButtonStack = (props: { children: JSX.Element[] | JSX.Element }) => ( export class SplitMenuButtonExample extends React.Component<{}, {}> { public render(): JSX.Element { return ( - - + +
- + diff --git a/packages/experiments/src/components/Button/examples/Button.Example.tsx b/packages/experiments/src/components/Button/examples/Button.Example.tsx index f6903875338a10..615ebd9e949028 100644 --- a/packages/experiments/src/components/Button/examples/Button.Example.tsx +++ b/packages/experiments/src/components/Button/examples/Button.Example.tsx @@ -2,16 +2,24 @@ import * as React from 'react'; import { Button } from '../index'; import { Icon, CommandBar, Stack, Text } from 'office-ui-fabric-react'; -const sectionGap = 32; -const headingGap = 16; -const buttonGap = 12; +const tokens = { + sectionStack: { + childrenGap: 32 + }, + headingStack: { + childrenGap: 16 + }, + buttonStack: { + childrenGap: 12 + } +}; const alertClicked = (): void => { alert('Clicked'); }; const ButtonStack = (props: { children: JSX.Element[] | JSX.Element }) => ( - + {props.children} ); @@ -20,10 +28,10 @@ const ButtonStack = (props: { children: JSX.Element[] | JSX.Element }) => ( export class ButtonExample extends React.Component<{}, {}> { public render(): JSX.Element { return ( - - + +
- +