@moises.ai/design-system 3.9.10 → 3.9.11
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,7 +31,6 @@ 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
|
|
|
@@ -45,7 +44,7 @@ function generatePattern(type, seed) {
|
|
|
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,31 +72,22 @@ 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
78
|
<svg
|
|
81
79
|
viewBox="0 0 100 100"
|
|
82
80
|
width={size}
|
|
83
81
|
height={size}
|
|
82
|
+
overflow="hidden"
|
|
84
83
|
className={classNames(className)}
|
|
85
84
|
aria-label={`${type} pattern`}
|
|
86
85
|
role="img"
|
|
87
86
|
{...props}
|
|
88
87
|
>
|
|
89
|
-
<defs>
|
|
90
|
-
<filter id={filterId} x="-50%" y="-50%" width="200%" height="200%">
|
|
91
|
-
<feGaussianBlur stdDeviation={blur} />
|
|
92
|
-
</filter>
|
|
93
|
-
<clipPath id={`c-${uid}`}>
|
|
94
|
-
<rect width="100" height="100" />
|
|
95
|
-
</clipPath>
|
|
96
|
-
</defs>
|
|
97
|
-
|
|
98
88
|
<rect width="100" height="100" fill={bg} />
|
|
99
89
|
|
|
100
|
-
<g
|
|
90
|
+
<g style={{ filter: `blur(${blur}px)` }}>
|
|
101
91
|
{blobs.map((b, i) => (
|
|
102
92
|
<circle key={i} cx={b.cx} cy={b.cy} r={b.r} fill={b.fill} />
|
|
103
93
|
))}
|