Skip to content
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

(web components) add progress and progress ring examples to show animated options #20114

Merged
Merged
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": "patch",
"comment": "add progress animated examples",
"packageName": "@fluentui/web-components",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export default {
},
};

const ProgressRingTemplate = ({ paused }) => `
<fluent-progress-ring
const ProgressRingTemplate = ({ paused, value }) => `
<fluent-progress-ring
${value ? `value="${value}"` : ''}
${paused ? `paused="${paused}"` : ''}
></fluent-progress-ring>
`;
Expand All @@ -20,15 +21,53 @@ export const ProgressRing = ProgressRingTemplate.bind({});

ProgressRing.args = {
paused: false,
value: 65,
};

const example = `
<fluent-progress-ring min="0" max="100" value="75"></fluent-progress-ring>
const defaultExample = `
<fluent-progress-ring min="0" max="100" value="${ProgressRing.args.value}"></fluent-progress-ring>
`;

ProgressRing.parameters = {
docs: {
source: {
code: example,
code: defaultExample,
},
},
};

export const ProgressRingAnimated = ProgressRingTemplate.bind({});

ProgressRingAnimated.args = {
paused: false,
};

export const ProgressRingPaused = ProgressRingTemplate.bind({});

ProgressRingPaused.args = {
paused: true,
};

const animatedExample = `
<fluent-progress-ring></fluent-progress-ring>
`;

const pausedExample = `
<fluent-progress-ring paused></fluent-progress-ring>
`;

ProgressRingAnimated.parameters = {
docs: {
source: {
code: animatedExample,
},
},
};

ProgressRingPaused.parameters = {
docs: {
source: {
code: pausedExample,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,54 @@ const ProgressTemplate = ({ paused, value }) => `
export const Progress = ProgressTemplate.bind({});

Progress.args = {
value: 50,
paused: false,
value: 50,
};

const example = `
<fluent-progress min="0" max="100" value="75"></fluent-progress>
const defaultExample = `
<fluent-progress min="0" max="100" value="${Progress.args.value}"></fluent-progress>
`;

Progress.parameters = {
docs: {
source: {
code: example,
code: defaultExample,
},
},
};

export const ProgressAnimated = ProgressTemplate.bind({});

ProgressAnimated.args = {
paused: false,
};

export const ProgressPaused = ProgressTemplate.bind({});

ProgressPaused.args = {
paused: true,
};

const animatedExample = `
<fluent-progress></fluent-progress>
`;

const pausedExample = `
<fluent-progress paused></fluent-progress>
`;

ProgressAnimated.parameters = {
docs: {
source: {
code: animatedExample,
},
},
};

ProgressPaused.parameters = {
docs: {
source: {
code: pausedExample,
},
},
};