Skip to content

Commit

Permalink
fix(docs): Motion components storybook updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pixel-perfectionist committed Oct 30, 2024
1 parent 3d044da commit 7ca592e
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "fix(docs): Collapse storybook updates",
"packageName": "@fluentui/react-motion-components-preview",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export const CollapseDelayed: PresenceComponent<CollapseRuntimeParams>;
// @public (undocumented)
export const CollapseExaggerated: PresenceComponent<CollapseRuntimeParams>;

// @public (undocumented)
export type CollapseRuntimeParams = {
animateOpacity?: boolean;
orientation?: CollapseOrientation;
};

// @public (undocumented)
export const CollapseSnappy: PresenceComponent<CollapseRuntimeParams>;

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './Collapse';
export type { CollapseRuntimeParams } from './collapse-types';
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export {
createCollapsePresence,
createCollapseDelayedPresence,
} from './components/Collapse';
export type { CollapseRuntimeParams } from './components/Collapse';
export { Fade, FadeSnappy, FadeExaggerated, createFadePresence } from './components/Fade';
export { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react';
import { PresenceComponentProps } from '@fluentui/react-components';
import { Collapse, CollapseRuntimeParams } from '@fluentui/react-motion-components-preview';

const LoremIpsum = React.forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement>>((props, ref) => (
<div ref={ref} {...props}>
{'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. '.repeat(
10,
)}
</div>
));

export const DefaultCollapse = (props: PresenceComponentProps & CollapseRuntimeParams) => {
return (
<Collapse {...props}>
<LoremIpsum />
</Collapse>
);
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Field, makeStyles, tokens, Switch } from '@fluentui/react-components';
import { Field, makeStyles, tokens, Switch, PresenceComponentProps } from '@fluentui/react-components';
import { Collapse } from '@fluentui/react-motion-components-preview';
import * as React from 'react';

Expand Down Expand Up @@ -35,7 +35,7 @@ const LoremIpsum = () => (
</>
);

export const Default = () => {
export const Default = (props: PresenceComponentProps) => {
const classes = useClasses();
const [visible, setVisible] = React.useState<boolean>(false);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The `Collapse` component manages content presence, using a height or width expand/collapse motion.
The `Collapse` component manages content [presence](?path=/docs/motion-apis-createpresencecomponent--docs), using a height or width expand/collapse motion.

> **⚠️ Preview components are considered unstable**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Collapse } from '@fluentui/react-motion-components-preview';
import { DefaultCollapse as Collapse } from './Collapse.stories';
import CollapseDescription from './CollapseDescription.md';

export { Default } from './CollapseDefault.stories';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react';
import { PresenceComponentProps } from '@fluentui/react-components';
import { Fade } from '@fluentui/react-motion-components-preview';

const LoremIpsum = React.forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement>>((props, ref) => (
<div ref={ref} {...props}>
{'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. '.repeat(
10,
)}
</div>
));

export const DefaultFade = (props: PresenceComponentProps) => {
return (
<Fade {...props}>
<LoremIpsum />
</Fade>
);
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fade } from '@fluentui/react-motion-components-preview';
import { DefaultFade as Fade } from './Fade.stories';
import FadeDescription from './FadeDescription.md';

export { Default } from './FadeDefault.stories';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react';
import { PresenceComponentProps } from '@fluentui/react-components';
import { Scale } from '@fluentui/react-motion-components-preview';

const LoremIpsum = React.forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement>>((props, ref) => (
<div ref={ref} {...props}>
{'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. '.repeat(
10,
)}
</div>
));

export const DefaultScale = (props: PresenceComponentProps) => {
return (
<Scale {...props}>
<LoremIpsum />
</Scale>
);
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Scale } from '@fluentui/react-motion-components-preview';
import { DefaultScale as Scale } from './Scale.stories';
import ScaleDescription from './ScaleDescription.md';

export { Default } from './ScaleDefault.stories';
Expand Down

0 comments on commit 7ca592e

Please sign in to comment.