@heliosgraphics/ui 2.0.1-alpha.2 → 2.0.1-alpha.4
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.
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
user-select: none;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.dropdownOpen [data-ui-
|
|
8
|
+
.dropdownOpen .dropdown__activator [data-ui-icon="caret-down"],
|
|
9
|
+
.dropdownOpen .dropdown__activator [data-ui-icon="arrow-down"],
|
|
10
|
+
.dropdownOpen .dropdown__activator [data-ui-icon="chevron-down"] {
|
|
9
11
|
transition: transform 96ms ease-in-out;
|
|
10
12
|
transform: rotate(180deg);
|
|
11
13
|
}
|
|
@@ -53,40 +55,19 @@
|
|
|
53
55
|
position: absolute;
|
|
54
56
|
z-index: var(--z-index-8);
|
|
55
57
|
|
|
56
|
-
display: none;
|
|
57
58
|
min-width: 240px;
|
|
58
59
|
opacity: 0;
|
|
59
60
|
|
|
60
61
|
transition:
|
|
61
|
-
display 96ms ease-in-out allow-discrete,
|
|
62
62
|
transform 96ms ease-in-out,
|
|
63
63
|
opacity 96ms ease-in-out;
|
|
64
64
|
pointer-events: none;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.dropdown__navActive {
|
|
68
|
-
|
|
69
|
-
opacity: 1;
|
|
67
|
+
.dropdown__nav.dropdown__navActive {
|
|
68
|
+
opacity: 1 !important;
|
|
70
69
|
|
|
71
|
-
transform: translateY(0);
|
|
70
|
+
transform: translateY(0) !important;
|
|
72
71
|
|
|
73
72
|
pointer-events: all;
|
|
74
|
-
|
|
75
|
-
@starting-style {
|
|
76
|
-
opacity: 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.dropdownBottomLeft .dropdown__navActive,
|
|
81
|
-
.dropdownBottomRight .dropdown__navActive {
|
|
82
|
-
@starting-style {
|
|
83
|
-
transform: translateY(-6px);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.dropdownTopLeft .dropdown__navActive,
|
|
88
|
-
.dropdownTopRight .dropdown__navActive {
|
|
89
|
-
@starting-style {
|
|
90
|
-
transform: translateY(6px);
|
|
91
|
-
}
|
|
92
73
|
}
|
package/components/Icon/Icon.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { type FC, useId, useInsertionEffect } from "react"
|
|
1
|
+
import { Children, type FC } from "react"
|
|
2
|
+
import { Masonry as Plock } from "react-plock"
|
|
4
3
|
import type { MasonryProps } from "./Masonry.types"
|
|
5
4
|
|
|
6
5
|
export const Masonry: FC<MasonryProps> = ({
|
|
@@ -9,40 +8,21 @@ export const Masonry: FC<MasonryProps> = ({
|
|
|
9
8
|
gap = [2, 4, 6],
|
|
10
9
|
breakpoints = [0, 640, 960],
|
|
11
10
|
}) => {
|
|
12
|
-
const reactId = useId()
|
|
13
|
-
const id = `masonry${reactId.replace(/:/g, "")}`
|
|
14
|
-
|
|
15
|
-
useInsertionEffect(() => {
|
|
16
|
-
const style = document.createElement("style")
|
|
17
|
-
|
|
18
|
-
style.dataset["masonryId"] = id
|
|
19
|
-
style.textContent = `
|
|
20
|
-
.${id} { column-count: ${columns[0]}; column-gap: ${gap[0]}px; }
|
|
21
|
-
.${id} > * { break-inside: avoid; margin-bottom: ${gap[0]}px; }
|
|
22
|
-
|
|
23
|
-
@media (min-width: ${breakpoints[1]}px) {
|
|
24
|
-
.${id} { column-count: ${columns[1]}; column-gap: ${gap[1]}px; }
|
|
25
|
-
.${id} > * { margin-bottom: ${gap[1]}px; }
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@media (min-width: ${breakpoints[2]}px) {
|
|
29
|
-
.${id} { column-count: ${columns[2]}; column-gap: ${gap[2]}px; }
|
|
30
|
-
.${id} > * { margin-bottom: ${gap[2]}px; }
|
|
31
|
-
}
|
|
32
|
-
`
|
|
33
|
-
document.head.appendChild(style)
|
|
34
|
-
|
|
35
|
-
return (): void => {
|
|
36
|
-
style.remove()
|
|
37
|
-
}
|
|
38
|
-
}, [id, columns, gap, breakpoints])
|
|
39
|
-
|
|
40
11
|
if (!children) return null
|
|
41
12
|
|
|
13
|
+
const items = Children.toArray(children)
|
|
14
|
+
const numericGap = gap.map((g) => (g === "px" ? 1 : g)) as Array<number>
|
|
15
|
+
|
|
42
16
|
return (
|
|
43
|
-
<
|
|
44
|
-
{
|
|
45
|
-
|
|
17
|
+
<Plock
|
|
18
|
+
items={items}
|
|
19
|
+
config={{
|
|
20
|
+
columns,
|
|
21
|
+
gap: numericGap,
|
|
22
|
+
media: breakpoints,
|
|
23
|
+
}}
|
|
24
|
+
render={(item, index) => <div key={index}>{item}</div>}
|
|
25
|
+
/>
|
|
46
26
|
)
|
|
47
27
|
}
|
|
48
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heliosgraphics/ui",
|
|
3
|
-
"version": "2.0.1-alpha.
|
|
3
|
+
"version": "2.0.1-alpha.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"@heliosgraphics/utils": "^6.0.0-alpha.9",
|
|
46
46
|
"marked": "^17.0.3",
|
|
47
47
|
"marked-linkify-it": "^3.1.14",
|
|
48
|
-
"marked-xhtml": "^1.0.14"
|
|
48
|
+
"marked-xhtml": "^1.0.14",
|
|
49
|
+
"react-plock": "^3.6.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@testing-library/react": "^16.3.2",
|