@pareto-engineering/design-system 2.0.0-alpha.2 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/a/AnimatedCounter/AnimatedCounter.js +16 -29
- package/dist/cjs/a/AnimatedCounter/styles.scss +3 -11
- package/dist/cjs/a/Conversation/styles.scss +2 -0
- package/dist/cjs/a/GradientBackground/GradientBackground.js +140 -0
- package/dist/cjs/a/GradientBackground/index.js +15 -0
- package/dist/cjs/a/GradientBackground/styles.scss +191 -0
- package/dist/cjs/a/People/People.js +15 -7
- package/dist/cjs/a/People/common/Person/Person.js +11 -4
- package/dist/cjs/a/People/styles.scss +13 -15
- package/dist/cjs/a/Shapes/Shapes.js +141 -0
- package/dist/cjs/a/{RatingsInput/common/Rating → Shapes}/index.js +3 -3
- package/dist/cjs/a/Shapes/styles.scss +199 -0
- package/dist/cjs/a/TeamInfo/styles.scss +2 -2
- package/dist/cjs/b/Button/styles.scss +1 -1
- package/dist/cjs/{a/RatingsInput/RatingsInput.js → b/Metrics/Metrics.js} +30 -29
- package/dist/cjs/{a/RatingsInput → b/Metrics}/index.js +3 -3
- package/dist/cjs/b/Metrics/styles.scss +91 -0
- package/dist/cjs/b/QuestionDropdown/styles.scss +1 -1
- package/dist/cjs/b/index.js +9 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -1
- package/dist/cjs/experimental/GradientBackground/GradientBackground.js +98 -0
- package/dist/cjs/experimental/GradientBackground/index.js +15 -0
- package/dist/cjs/experimental/GradientBackground/styles.scss +64 -0
- package/dist/cjs/experimental/index.js +13 -0
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
- package/dist/cjs/f/fields/SelectInput/styles.scss +3 -3
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +2 -2
- package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/cjs/f/fields/TextInput/styles.scss +3 -3
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +1 -1
- package/dist/cjs/form.scss +1 -1
- package/dist/es/a/AnimatedCounter/AnimatedCounter.js +17 -30
- package/dist/es/a/AnimatedCounter/styles.scss +3 -11
- package/dist/es/a/Conversation/styles.scss +2 -0
- package/dist/es/a/GradientBackground/GradientBackground.js +118 -0
- package/dist/es/a/GradientBackground/index.js +2 -0
- package/dist/es/a/GradientBackground/styles.scss +191 -0
- package/dist/es/a/People/People.js +14 -7
- package/dist/es/a/People/common/Person/Person.js +11 -4
- package/dist/es/a/People/styles.scss +13 -15
- package/dist/es/a/Shapes/Shapes.js +119 -0
- package/dist/es/a/{RatingsInput/common/Rating → Shapes}/index.js +1 -1
- package/dist/es/a/Shapes/styles.scss +199 -0
- package/dist/es/a/TeamInfo/styles.scss +2 -2
- package/dist/es/b/Button/styles.scss +1 -1
- package/dist/es/b/Metrics/Metrics.js +72 -0
- package/dist/es/b/Metrics/index.js +2 -0
- package/dist/es/b/Metrics/styles.scss +91 -0
- package/dist/es/b/QuestionDropdown/styles.scss +1 -1
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -1
- package/dist/es/experimental/GradientBackground/GradientBackground.js +76 -0
- package/dist/es/experimental/GradientBackground/index.js +2 -0
- package/dist/es/experimental/GradientBackground/styles.scss +64 -0
- package/dist/es/experimental/index.js +1 -0
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
- package/dist/es/f/fields/SelectInput/styles.scss +3 -3
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +2 -2
- package/dist/es/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/es/f/fields/TextInput/styles.scss +3 -3
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +1 -1
- package/dist/es/form.scss +1 -1
- package/package.json +3 -3
- package/src/__snapshots__/Storyshots.test.js.snap +2454 -250
- package/src/local.scss +3 -0
- package/src/stories/a/AnimatedCounter.stories.jsx +9 -5
- package/src/stories/a/ContentCard.stories.jsx +1 -1
- package/src/stories/a/Conversation.stories.jsx +1 -1
- package/src/stories/a/People.stories.jsx +25 -1
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/a/Quote.stories.jsx +1 -1
- package/src/stories/a/Spinner.stories.jsx +1 -1
- package/src/stories/b/Button.stories.jsx +41 -10
- package/src/stories/b/Metrics.stories.jsx +62 -0
- package/src/stories/b/ThemeSelector.stories.jsx +1 -1
- package/src/stories/b/Title.stories.jsx +1 -1
- package/src/stories/c/ContentSlides.stories.jsx +2 -2
- package/src/stories/colors.js +5 -3
- package/src/stories/f/CheckboxInput.stories.jsx +1 -1
- package/src/stories/f/TaskRecommendationInput.stories.jsx +1 -1
- package/src/stories/f/TextInput.stories.jsx +4 -4
- package/src/stories/f/TextareaInput.stories.jsx +2 -2
- package/src/ui/a/AnimatedCounter/AnimatedCounter.jsx +21 -27
- package/src/ui/a/AnimatedCounter/styles.scss +3 -11
- package/src/ui/a/Conversation/styles.scss +2 -0
- package/src/ui/a/People/People.jsx +12 -4
- package/src/ui/a/People/common/Person/Person.jsx +7 -1
- package/src/ui/a/People/styles.scss +13 -15
- package/src/ui/a/TeamInfo/styles.scss +2 -2
- package/src/ui/b/Button/styles.scss +1 -1
- package/src/ui/b/Metrics/Metrics.jsx +93 -0
- package/src/ui/b/Metrics/index.js +2 -0
- package/src/ui/b/Metrics/styles.scss +91 -0
- package/src/ui/b/QuestionDropdown/styles.scss +1 -1
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +1 -1
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +1 -1
- package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +2 -2
- package/src/ui/f/fields/SelectInput/styles.scss +3 -3
- package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +2 -2
- package/src/ui/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/src/ui/f/fields/TextInput/styles.scss +3 -3
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +1 -1
- package/src/ui/form.scss +1 -1
- package/dist/cjs/a/RatingsInput/common/Rating/Rating.js +0 -120
- package/dist/cjs/a/RatingsInput/common/index.js +0 -13
- package/dist/cjs/a/RatingsInput/styles.scss +0 -35
- package/dist/es/a/RatingsInput/RatingsInput.js +0 -72
- package/dist/es/a/RatingsInput/common/Rating/Rating.js +0 -102
- package/dist/es/a/RatingsInput/common/index.js +0 -1
- package/dist/es/a/RatingsInput/index.js +0 -2
- package/dist/es/a/RatingsInput/styles.scss +0 -35
package/src/local.scss
CHANGED
|
@@ -18,13 +18,17 @@ export default {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const Base = () => (
|
|
21
|
-
<AnimatedCounter delay={5} number={100}
|
|
21
|
+
<AnimatedCounter delay={5} number={100.555} after="%" />
|
|
22
22
|
)
|
|
23
23
|
|
|
24
|
-
export const
|
|
25
|
-
<AnimatedCounter delay={5}
|
|
24
|
+
export const Before = () => (
|
|
25
|
+
<AnimatedCounter delay={5} number={100} before="%" />
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
export const
|
|
29
|
-
<AnimatedCounter delay={5}
|
|
28
|
+
export const After = () => (
|
|
29
|
+
<AnimatedCounter delay={5} number={100} after="%" />
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
export const BeforeAndAfter = () => (
|
|
33
|
+
<AnimatedCounter delay={5} number={100} before="%" after="+" />
|
|
30
34
|
)
|
|
@@ -103,7 +103,7 @@ export const LayoutRight = () => {
|
|
|
103
103
|
|
|
104
104
|
export const LayoutCenter = () => (
|
|
105
105
|
<div className="u1 p-u" style={{ backgroundColor: 'green' }}>
|
|
106
|
-
<ContentCard color="
|
|
106
|
+
<ContentCard color="background1">
|
|
107
107
|
<ContentCard.Section layout="center" className="p-u">
|
|
108
108
|
<p className="content p-u">
|
|
109
109
|
Lorem ipsum dolor sit amet consectetur adipisicing elit. Suscipit asperiores facilis,
|
|
@@ -30,7 +30,7 @@ export const Base = () => {
|
|
|
30
30
|
from :'ours',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
message:'Hi Camille, please compile an assesment of top
|
|
33
|
+
message:'Hi Camille, please compile an assesment of top 6 firms/brand providers for the listed fields in the US.',
|
|
34
34
|
sender :'HUMBL',
|
|
35
35
|
from :'theirs',
|
|
36
36
|
},
|
|
@@ -23,21 +23,45 @@ export const Base = () => {
|
|
|
23
23
|
image:'https://lh3.googleusercontent.com/a-/AOh14GiVivY1C3gxFz1kjHfih0jzpV08rlIIfMIgBvPs',
|
|
24
24
|
name :'Phoebe Yao',
|
|
25
25
|
role :'Pareto Founder',
|
|
26
|
+
color:'main1',
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
image:'https://pareto-v1.s3.us-west-2.amazonaws.com/profile-pictures/Lanie-Col-long.png',
|
|
29
30
|
name :'Lanie Col-long',
|
|
30
31
|
role :'Pareto Partner',
|
|
32
|
+
color:'main3',
|
|
31
33
|
},
|
|
32
34
|
{
|
|
33
35
|
image:'https://pareto-v1.s3.us-west-2.amazonaws.com/profile-pictures/Camille-Arigo.jpg',
|
|
34
36
|
name :'Camillie Arigo',
|
|
35
37
|
role :'Pareto Partner',
|
|
38
|
+
color:'background4',
|
|
36
39
|
},
|
|
37
40
|
]
|
|
38
41
|
|
|
39
42
|
return (
|
|
40
|
-
<div className="x-
|
|
43
|
+
<div className="x-background1 b-x v1 p-v">
|
|
44
|
+
<People>
|
|
45
|
+
{peopleMap.map((person) => (
|
|
46
|
+
<People.Person key={person.name} {...person} />
|
|
47
|
+
))}
|
|
48
|
+
</People>
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const OnePerson = () => {
|
|
54
|
+
const peopleMap = [
|
|
55
|
+
{
|
|
56
|
+
image:'https://pareto-v1.s3.us-west-2.amazonaws.com/profile-pictures/Camille-Arigo.jpg',
|
|
57
|
+
name :'Camillie Arigo',
|
|
58
|
+
role :'Pareto Partner',
|
|
59
|
+
color:'background4',
|
|
60
|
+
},
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div className="x-background1 b-x v1 p-v">
|
|
41
65
|
<People>
|
|
42
66
|
{peopleMap.map((person) => (
|
|
43
67
|
<People.Person key={person.name} {...person} />
|
|
@@ -28,9 +28,17 @@ export const Ghost = (props) => (
|
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
export const Simple = (props) => (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<>
|
|
32
|
+
{ALL_COLORS.map((colorName) => (
|
|
33
|
+
<Button {...props} color={colorName} key={colorName} isSimple>
|
|
34
|
+
This is a
|
|
35
|
+
{' '}
|
|
36
|
+
{colorName}
|
|
37
|
+
{' '}
|
|
38
|
+
button
|
|
39
|
+
</Button>
|
|
40
|
+
))}
|
|
41
|
+
</>
|
|
34
42
|
)
|
|
35
43
|
|
|
36
44
|
export const Colors = (props) => (
|
|
@@ -62,17 +70,40 @@ export const GhostColors = (props) => (
|
|
|
62
70
|
)
|
|
63
71
|
|
|
64
72
|
export const Compact = (props) => (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
<>
|
|
74
|
+
{ALL_COLORS.map((colorName) => (
|
|
75
|
+
<Button {...props} color={colorName} key={colorName} isCompact>
|
|
76
|
+
This is a
|
|
77
|
+
{' '}
|
|
78
|
+
{colorName}
|
|
79
|
+
{' '}
|
|
80
|
+
</Button>
|
|
81
|
+
))}
|
|
82
|
+
</>
|
|
68
83
|
)
|
|
69
84
|
|
|
70
85
|
export const Disabled = (props) => (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
<>
|
|
87
|
+
{ALL_COLORS.map((colorName) => (
|
|
88
|
+
<Button {...props} color={colorName} key={colorName} disabled>
|
|
89
|
+
This is a
|
|
90
|
+
{' '}
|
|
91
|
+
{colorName}
|
|
92
|
+
{' '}
|
|
93
|
+
</Button>
|
|
94
|
+
))}
|
|
95
|
+
</>
|
|
74
96
|
)
|
|
75
97
|
|
|
76
98
|
export const Loading = (props) => (
|
|
77
|
-
|
|
99
|
+
<>
|
|
100
|
+
{ALL_COLORS.map((colorName) => (
|
|
101
|
+
<Button {...props} color={colorName} key={colorName} isLoading>
|
|
102
|
+
This is a
|
|
103
|
+
{' '}
|
|
104
|
+
{colorName}
|
|
105
|
+
{' '}
|
|
106
|
+
</Button>
|
|
107
|
+
))}
|
|
108
|
+
</>
|
|
78
109
|
)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Metrics } from 'ui'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title :'b/Metrics',
|
|
8
|
+
component :Metrics,
|
|
9
|
+
subcomponents:{
|
|
10
|
+
// Item:Metrics.Item
|
|
11
|
+
},
|
|
12
|
+
decorators:[
|
|
13
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
14
|
+
],
|
|
15
|
+
argTypes:{
|
|
16
|
+
backgroundColor:{ control: 'color' },
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Base = () => {
|
|
21
|
+
const items = [
|
|
22
|
+
{
|
|
23
|
+
circleColor:'success',
|
|
24
|
+
color :'black',
|
|
25
|
+
delay :'2',
|
|
26
|
+
number :'75',
|
|
27
|
+
after :'%',
|
|
28
|
+
before :'+',
|
|
29
|
+
description:'Merchandise sell-though rate during tour',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
circleColor:'warning',
|
|
33
|
+
color :'black',
|
|
34
|
+
delay :'2',
|
|
35
|
+
number :'250',
|
|
36
|
+
after :'K',
|
|
37
|
+
description:'Stat or metric growth',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
circleColor:'navlink',
|
|
41
|
+
color :'black',
|
|
42
|
+
delay :'2',
|
|
43
|
+
number :'11710',
|
|
44
|
+
before :'+',
|
|
45
|
+
description:'Stat or metric growth',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
circleColor:'error',
|
|
49
|
+
color :'black',
|
|
50
|
+
delay :'2',
|
|
51
|
+
number :'0.28',
|
|
52
|
+
before :'$',
|
|
53
|
+
description:'Merchandise sell-though rate during tour',
|
|
54
|
+
},
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Metrics
|
|
59
|
+
items={items}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -36,7 +36,7 @@ export const WithSubtitle = (props) => (
|
|
|
36
36
|
export const Sizes = (props) => (
|
|
37
37
|
['h1', 'h2', 'h3', 'h4', 'h5'].map((size) => (
|
|
38
38
|
<div className="u2 pv-u" key={size}>
|
|
39
|
-
<div className="y-
|
|
39
|
+
<div className="y-background2 b-dark-y">
|
|
40
40
|
<Title
|
|
41
41
|
heading={`This is a title in ${size}`}
|
|
42
42
|
headingAs={size}
|
|
@@ -74,7 +74,7 @@ export const Base = () => {
|
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
76
|
<div className={`ui-${userTheme}`} style={{ height: '100%' }}>
|
|
77
|
-
<ContentSlides className="y-
|
|
77
|
+
<ContentSlides className="y-background1" steps={steps}>
|
|
78
78
|
<ContentSlides.Sidebar
|
|
79
79
|
header={(
|
|
80
80
|
<Logo color="paragraph" />
|
|
@@ -341,7 +341,7 @@ export const Simple = () => {
|
|
|
341
341
|
)
|
|
342
342
|
}
|
|
343
343
|
return (
|
|
344
|
-
<ContentSlides className="y-
|
|
344
|
+
<ContentSlides className="y-background1" steps={steps} simple>
|
|
345
345
|
<Main />
|
|
346
346
|
</ContentSlides>
|
|
347
347
|
)
|
package/src/stories/colors.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const THEME = [
|
|
2
2
|
'main1',
|
|
3
3
|
'main2',
|
|
4
|
-
'
|
|
5
|
-
'
|
|
4
|
+
'main3',
|
|
5
|
+
'main4',
|
|
6
6
|
]
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -27,10 +27,12 @@ const MODALS = [
|
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
const UI = [
|
|
30
|
-
'
|
|
30
|
+
'background1',
|
|
31
31
|
'background2',
|
|
32
32
|
'background3',
|
|
33
33
|
'background4',
|
|
34
|
+
'background5',
|
|
35
|
+
'background6',
|
|
34
36
|
'heading',
|
|
35
37
|
'paragraph',
|
|
36
38
|
'subtitle',
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const Base = () => (
|
|
30
|
-
<div className="y-
|
|
30
|
+
<div className="y-background1 b-y">
|
|
31
31
|
<CheckboxInput value="Business to customer" name="businessTypes">Business to customer</CheckboxInput>
|
|
32
32
|
<CheckboxInput value="Business to business" name="businessTypes">Business to business</CheckboxInput>
|
|
33
33
|
<CheckboxInput value="E-commerce" name="businessTypes">E-commerce</CheckboxInput>
|
|
@@ -26,7 +26,7 @@ export default {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const Base = () => (
|
|
29
|
-
<div className="y-
|
|
29
|
+
<div className="y-background1 b-y v2 p-v" style={{ height: '100%' }}>
|
|
30
30
|
<TaskRecommendationInput
|
|
31
31
|
name="taskRecommendations"
|
|
32
32
|
value="businessTypes"
|
|
@@ -41,19 +41,19 @@ export const Base = () => {
|
|
|
41
41
|
return errorMessage
|
|
42
42
|
}
|
|
43
43
|
return (
|
|
44
|
-
|
|
44
|
+
<div className="y-background1 b-dark-y u2 pb-u">
|
|
45
45
|
<TextInput
|
|
46
46
|
name="firstName"
|
|
47
47
|
label="What's your first name ?"
|
|
48
48
|
validate={validate}
|
|
49
49
|
/>
|
|
50
50
|
<FormDebugger />
|
|
51
|
-
|
|
51
|
+
</div>
|
|
52
52
|
)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export const DisabledTextInput = () => (
|
|
56
|
-
<div className="y-
|
|
56
|
+
<div className="y-background1 b-dark-y u2 pb-u">
|
|
57
57
|
<TextInput
|
|
58
58
|
name="firstName"
|
|
59
59
|
label="What's your first name ?"
|
|
@@ -63,7 +63,7 @@ export const DisabledTextInput = () => (
|
|
|
63
63
|
)
|
|
64
64
|
|
|
65
65
|
export const DateTime = () => (
|
|
66
|
-
<div className="y-
|
|
66
|
+
<div className="y-background1 b-dark-y">
|
|
67
67
|
<TextInput
|
|
68
68
|
name="date"
|
|
69
69
|
label="Select date"
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export const Base = () => (
|
|
32
|
-
<div className="y-
|
|
32
|
+
<div className="y-background1 b-dark-y">
|
|
33
33
|
<TextareaInput
|
|
34
34
|
name="feedBack"
|
|
35
35
|
label="What can we improve on?"
|
|
@@ -38,7 +38,7 @@ export const Base = () => (
|
|
|
38
38
|
</div>
|
|
39
39
|
)
|
|
40
40
|
export const DisabledTextareaInput = () => (
|
|
41
|
-
<div className="y-
|
|
41
|
+
<div className="y-background1 b-dark-y">
|
|
42
42
|
<TextareaInput
|
|
43
43
|
name="feedBack"
|
|
44
44
|
label="What can we improve on?"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useLayoutEffect } from 'react'
|
|
4
|
+
import { useLayoutEffect, useCallback } from 'react'
|
|
5
5
|
|
|
6
6
|
import CountUp from 'react-countup'
|
|
7
7
|
|
|
@@ -26,10 +26,8 @@ const AnimatedCounter = ({
|
|
|
26
26
|
style,
|
|
27
27
|
color,
|
|
28
28
|
number,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
descriptionPosition,
|
|
32
|
-
unitPosition,
|
|
29
|
+
before,
|
|
30
|
+
after,
|
|
33
31
|
delay,
|
|
34
32
|
// ...otherProps
|
|
35
33
|
}) => {
|
|
@@ -37,6 +35,11 @@ const AnimatedCounter = ({
|
|
|
37
35
|
import('./styles.scss')
|
|
38
36
|
}, [])
|
|
39
37
|
|
|
38
|
+
const countDecimals = useCallback((value) => {
|
|
39
|
+
if ((value % 1) !== 0) return value.toString().split('.')[1].length
|
|
40
|
+
return 0
|
|
41
|
+
}, [])
|
|
42
|
+
|
|
40
43
|
return (
|
|
41
44
|
<div
|
|
42
45
|
id={id}
|
|
@@ -51,19 +54,17 @@ const AnimatedCounter = ({
|
|
|
51
54
|
style={style}
|
|
52
55
|
// {...otherProps}
|
|
53
56
|
>
|
|
54
|
-
{descriptionPosition === 'top' && <p className="info top-description uc s-1 md-s0">{description}</p>}
|
|
55
57
|
<div className="count s3">
|
|
56
|
-
{
|
|
57
|
-
<CountUp end={number} delay={delay} redraw>
|
|
58
|
+
{before && <span>{before}</span>}
|
|
59
|
+
<CountUp end={number} delay={delay} decimals={countDecimals(number)} redraw>
|
|
58
60
|
{({ countUpRef, start }) => (
|
|
59
61
|
<VisibilitySensor onChange={start} delayedCall>
|
|
60
62
|
<span ref={countUpRef} />
|
|
61
63
|
</VisibilitySensor>
|
|
62
64
|
)}
|
|
63
65
|
</CountUp>
|
|
64
|
-
{
|
|
66
|
+
{after && <span>{after}</span>}
|
|
65
67
|
</div>
|
|
66
|
-
{descriptionPosition === 'bottom' && <p className="info uc s-1 md-s0 v50 mt-v">{description}</p>}
|
|
67
68
|
</div>
|
|
68
69
|
)
|
|
69
70
|
}
|
|
@@ -92,33 +93,26 @@ AnimatedCounter.propTypes = {
|
|
|
92
93
|
/**
|
|
93
94
|
* The review count value
|
|
94
95
|
*/
|
|
95
|
-
number
|
|
96
|
+
number:PropTypes.number,
|
|
97
|
+
|
|
96
98
|
/**
|
|
97
|
-
* The
|
|
99
|
+
* The unit before the number
|
|
98
100
|
*/
|
|
99
|
-
|
|
101
|
+
before:PropTypes.string,
|
|
102
|
+
|
|
100
103
|
/**
|
|
101
|
-
* The
|
|
104
|
+
* The unit after the number
|
|
102
105
|
*/
|
|
103
|
-
|
|
106
|
+
after:PropTypes.string,
|
|
107
|
+
|
|
104
108
|
/**
|
|
105
109
|
* react counter delay
|
|
106
110
|
*/
|
|
107
|
-
delay
|
|
108
|
-
/**
|
|
109
|
-
* If the animated counter description should be at the top
|
|
110
|
-
*/
|
|
111
|
-
descriptionPosition:PropTypes.oneOf(['top', 'bottom']),
|
|
112
|
-
/**
|
|
113
|
-
* If the unit should be before or after the animated numbers
|
|
114
|
-
*/
|
|
115
|
-
unitPosition :PropTypes.string,
|
|
111
|
+
delay:PropTypes.number,
|
|
116
112
|
}
|
|
117
113
|
|
|
118
114
|
AnimatedCounter.defaultProps = {
|
|
119
|
-
color
|
|
120
|
-
descriptionPosition:'bottom',
|
|
121
|
-
unitPosition :'after',
|
|
115
|
+
color:'main1',
|
|
122
116
|
}
|
|
123
117
|
|
|
124
118
|
export default AnimatedCounter
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
|
|
3
3
|
@use "@pareto-engineering/bem";
|
|
4
|
-
|
|
4
|
+
//@use "@aztlan/stylebook/src/mixins";
|
|
5
|
+
//@use "@aztlan/stylebook/src/globals" as *;
|
|
5
6
|
|
|
6
7
|
.#{bem.$base}.animated-counter {
|
|
7
|
-
align-items: center;
|
|
8
8
|
display: flex;
|
|
9
|
-
|
|
9
|
+
justify-content: center;
|
|
10
10
|
|
|
11
11
|
.count {
|
|
12
12
|
color: var(--x);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
.top-description {
|
|
16
|
-
margin-bottom: .5em;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.info {
|
|
20
|
-
color: var(--metadata);
|
|
21
|
-
}
|
|
22
14
|
}
|
|
23
15
|
|
|
24
16
|
|
|
@@ -7,6 +7,7 @@ $default-padding: var(--u);
|
|
|
7
7
|
$default-conversation-background: var(--y);
|
|
8
8
|
$default-message-max-width: calc(100% - #{$default-padding});
|
|
9
9
|
$default-message-min-width: 12em;
|
|
10
|
+
$default-message-border: var(--theme-border);
|
|
10
11
|
|
|
11
12
|
.#{bem.$base}.conversation {
|
|
12
13
|
display: flex;
|
|
@@ -26,6 +27,7 @@ $default-message-min-width: 12em;
|
|
|
26
27
|
border-radius: var(--theme-border-radius);
|
|
27
28
|
background-color: var(--x);
|
|
28
29
|
align-self: flex-start;
|
|
30
|
+
border: $default-message-border;
|
|
29
31
|
|
|
30
32
|
.#{bem.$element-content} {
|
|
31
33
|
display: flex;
|
|
@@ -22,8 +22,9 @@ const People = ({
|
|
|
22
22
|
id,
|
|
23
23
|
className:userClassName,
|
|
24
24
|
style,
|
|
25
|
-
|
|
25
|
+
imageSize,
|
|
26
26
|
children,
|
|
27
|
+
columnWidth,
|
|
27
28
|
// ...otherProps
|
|
28
29
|
}) => {
|
|
29
30
|
useLayoutEffect(() => {
|
|
@@ -44,8 +45,9 @@ const People = ({
|
|
|
44
45
|
.filter((e) => e)
|
|
45
46
|
.join(' ')}
|
|
46
47
|
style={{
|
|
47
|
-
'--image-height-width':imageHeightWidth,
|
|
48
48
|
...style,
|
|
49
|
+
'--image-size' :imageSize,
|
|
50
|
+
'--column-width':columnWidth,
|
|
49
51
|
}}
|
|
50
52
|
// {...otherProps}
|
|
51
53
|
>
|
|
@@ -78,11 +80,17 @@ People.propTypes = {
|
|
|
78
80
|
/**
|
|
79
81
|
* The height and width of all the person's image
|
|
80
82
|
*/
|
|
81
|
-
|
|
83
|
+
imageSize:PropTypes.string,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The width of the a person's column
|
|
87
|
+
*/
|
|
88
|
+
columnWidth:PropTypes.string,
|
|
82
89
|
}
|
|
83
90
|
|
|
84
91
|
People.defaultProps = {
|
|
85
|
-
|
|
92
|
+
imageSize :'3em',
|
|
93
|
+
columnWidth:'12em',
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
People.Person = Person
|
|
@@ -21,6 +21,7 @@ const Person = ({
|
|
|
21
21
|
name,
|
|
22
22
|
image,
|
|
23
23
|
role,
|
|
24
|
+
color,
|
|
24
25
|
// ...otherProps
|
|
25
26
|
}) => (
|
|
26
27
|
<div
|
|
@@ -31,6 +32,7 @@ const Person = ({
|
|
|
31
32
|
|
|
32
33
|
componentClassName,
|
|
33
34
|
userClassName,
|
|
35
|
+
`y-${color}`,
|
|
34
36
|
]
|
|
35
37
|
.filter((e) => e)
|
|
36
38
|
.join(' ')}
|
|
@@ -72,10 +74,14 @@ Person.propTypes = {
|
|
|
72
74
|
* The person's role
|
|
73
75
|
*/
|
|
74
76
|
role :PropTypes.string.isRequired,
|
|
77
|
+
/**
|
|
78
|
+
* The base color of the person's component
|
|
79
|
+
*/
|
|
80
|
+
color:PropTypes.string,
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
Person.defaultProps = {
|
|
78
|
-
|
|
84
|
+
color:'background2',
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
export default Person
|
|
@@ -9,22 +9,26 @@ $default-person-border-radius:2em;
|
|
|
9
9
|
$default-padding:var(--u);
|
|
10
10
|
$default-horizontal-margin: .5em;
|
|
11
11
|
|
|
12
|
+
$default-grid-gap: 1em;
|
|
13
|
+
|
|
12
14
|
.#{bem.$base}.people {
|
|
13
|
-
display:
|
|
14
|
-
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--column-width), 1fr));
|
|
17
|
+
gap:$default-grid-gap;
|
|
18
|
+
|
|
15
19
|
|
|
16
20
|
.person {
|
|
17
21
|
align-items: center;
|
|
18
|
-
background-color: var(--
|
|
22
|
+
background-color: var(--y);
|
|
19
23
|
border-radius: $default-person-border-radius;
|
|
20
24
|
display: flex;
|
|
21
|
-
|
|
25
|
+
|
|
22
26
|
padding-right: $default-padding;
|
|
23
27
|
|
|
24
28
|
.image {
|
|
25
29
|
border-radius: $default-border-radius;
|
|
26
|
-
height: var(--image-
|
|
27
|
-
width: var(--image-
|
|
30
|
+
height: var(--image-size);
|
|
31
|
+
width: var(--image-size);
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
.details {
|
|
@@ -34,21 +38,15 @@ $default-horizontal-margin: .5em;
|
|
|
34
38
|
|
|
35
39
|
.name {
|
|
36
40
|
margin-bottom: .25em;
|
|
41
|
+
color: var(--on-y);
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
.role {
|
|
40
|
-
color: var(--
|
|
45
|
+
color: var(--on-y);
|
|
46
|
+
opacity: .5;
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
|
|
45
|
-
@include mixins.media($to:$sm-md) {
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
|
|
48
|
-
>:not(:last-child) {
|
|
49
|
-
margin-bottom: var(--u);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
|