@moises.ai/design-system 3.9.10 → 3.9.12
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/package.json
CHANGED
|
@@ -31,21 +31,20 @@ function generatePattern(type, seed) {
|
|
|
31
31
|
const rng = createRng(seed)
|
|
32
32
|
const colors = palettes[type] || palettes.lyrics
|
|
33
33
|
const pick = () => colors[Math.floor(rng() * colors.length)]
|
|
34
|
-
const uid = hashSeed(String(seed) + type)
|
|
35
34
|
|
|
36
35
|
const bg = pick()
|
|
37
36
|
|
|
38
37
|
const blobCount = 4 + Math.floor(rng() * 2)
|
|
39
38
|
const blobs = Array.from({ length: blobCount }, () => ({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
x: -10 + rng() * 120,
|
|
40
|
+
y: -10 + rng() * 120,
|
|
41
|
+
size: 60 + rng() * 70,
|
|
43
42
|
fill: pick(),
|
|
44
43
|
}))
|
|
45
44
|
|
|
46
45
|
const blur = 18 + rng() * 10
|
|
47
46
|
|
|
48
|
-
return {
|
|
47
|
+
return { bg, blobs, blur }
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
export const ProductsBrandPattern = ({
|
|
@@ -73,36 +72,47 @@ export const ProductsBrandPattern = ({
|
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
const effectiveSeed = title != null ? title : randomSeed
|
|
76
|
-
const {
|
|
77
|
-
const filterId = `bl-${uid}`
|
|
75
|
+
const { bg, blobs, blur } = generatePattern(type, effectiveSeed)
|
|
78
76
|
|
|
79
77
|
return (
|
|
80
|
-
<
|
|
81
|
-
viewBox="0 0 100 100"
|
|
82
|
-
width={size}
|
|
83
|
-
height={size}
|
|
84
|
-
className={classNames(className)}
|
|
78
|
+
<div
|
|
85
79
|
aria-label={`${type} pattern`}
|
|
86
80
|
role="img"
|
|
81
|
+
className={classNames(className)}
|
|
82
|
+
style={{
|
|
83
|
+
position: 'relative',
|
|
84
|
+
width: size,
|
|
85
|
+
height: size,
|
|
86
|
+
overflow: 'hidden',
|
|
87
|
+
backgroundColor: bg,
|
|
88
|
+
flexShrink: 0,
|
|
89
|
+
}}
|
|
87
90
|
{...props}
|
|
88
91
|
>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</defs>
|
|
97
|
-
|
|
98
|
-
<rect width="100" height="100" fill={bg} />
|
|
99
|
-
|
|
100
|
-
<g clipPath={`url(#c-${uid})`} filter={`url(#${filterId})`}>
|
|
92
|
+
<div
|
|
93
|
+
style={{
|
|
94
|
+
position: 'absolute',
|
|
95
|
+
inset: 0,
|
|
96
|
+
filter: `blur(${blur}px)`,
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
101
99
|
{blobs.map((b, i) => (
|
|
102
|
-
<
|
|
100
|
+
<div
|
|
101
|
+
key={i}
|
|
102
|
+
style={{
|
|
103
|
+
position: 'absolute',
|
|
104
|
+
left: `${b.x}%`,
|
|
105
|
+
top: `${b.y}%`,
|
|
106
|
+
width: `${b.size}%`,
|
|
107
|
+
height: `${b.size}%`,
|
|
108
|
+
borderRadius: '50%',
|
|
109
|
+
backgroundColor: b.fill,
|
|
110
|
+
transform: 'translate(-50%, -50%)',
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
103
113
|
))}
|
|
104
|
-
</
|
|
105
|
-
</
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
106
116
|
)
|
|
107
117
|
}
|
|
108
118
|
|