File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed
packages/react/src/ProgressBar Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { Meta } from '@storybook/react-vite'
2
+ import { ProgressBar , Stack } from '..'
3
+ import { DotFillIcon } from '@primer/octicons-react'
4
+
5
+ export default {
6
+ title : 'Components/ProgressBar/Examples' ,
7
+ component : ProgressBar ,
8
+ } as Meta < typeof ProgressBar >
9
+
10
+ export const WithVisibleTextValue = ( ) => {
11
+ return (
12
+ < >
13
+ < ProgressBar progress = { 50 } aria-label = "Loading example" />
14
+ < p style = { { color : 'var(--fgColor-muted)' , font : 'var(--text-body-shorthand-medium)' } } > 50% completed</ p >
15
+ </ >
16
+ )
17
+ }
18
+
19
+ export const MultipleSegments = ( ) => {
20
+ return (
21
+ < >
22
+ < ProgressBar >
23
+ < ProgressBar . Item
24
+ progress = { 30 }
25
+ style = { { backgroundColor : 'var(--bgColor-success-emphasis)' } }
26
+ aria-labelledby = "done"
27
+ />
28
+ < ProgressBar . Item
29
+ progress = { 15 }
30
+ style = { { backgroundColor : 'var(--bgColor-accent-emphasis)' } }
31
+ aria-labelledby = "in-progress"
32
+ />
33
+ < ProgressBar . Item
34
+ progress = { 5 }
35
+ style = { { backgroundColor : 'var(--bgColor-danger-emphasis)' } }
36
+ aria-labelledby = "closed"
37
+ />
38
+ </ ProgressBar >
39
+ < Stack direction = "horizontal" wrap = "wrap" marginTop = { 2 } >
40
+ < Stack direction = "horizontal" gap = "condensed" align = "center" id = "done" >
41
+ < DotFillIcon fill = "var(--bgColor-success-emphasis)" />
42
+ Done
43
+ </ Stack >
44
+ < Stack direction = "horizontal" gap = "condensed" align = "center" id = "in-progress" >
45
+ < DotFillIcon fill = "var(--bgColor-accent-emphasis)" />
46
+ In progress
47
+ </ Stack >
48
+ < Stack direction = "horizontal" gap = "condensed" align = "center" id = "closed" >
49
+ < DotFillIcon fill = "var(--bgColor-danger-emphasis)" />
50
+ Closed
51
+ </ Stack >
52
+ </ Stack >
53
+ </ >
54
+ )
55
+ }
You can’t perform that action at this time.
0 commit comments