phlex_kit 0.6.2 → 0.7.0
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 924514c45499b5f5d021cc5ec5416246c38ccfc0cb40bef9f65a9592e12960b3
|
|
4
|
+
data.tar.gz: 9531c44809a4b586547c41a45e2274acf24618436f10ca6d54f368f975ad199e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edbe03d8c7b0eafca03b08f4da7e28b0f220be45e3725e18fcc82972d9737341180be65617bcfee479d67a150e3876da29551bf39a46d52459b9a0f794d1672f
|
|
7
|
+
data.tar.gz: a25b1d74ac3d5cfb12dfd0f72a20bf1fcf92b115a7f25602cb62dfd0c19c77987db2ee02ee6fd4efd97548306b75d70e188eea2c56bbb4564cb2503d41f592bb
|
|
@@ -20,6 +20,16 @@
|
|
|
20
20
|
position-try-fallbacks: flip-block;
|
|
21
21
|
}
|
|
22
22
|
.pk-dropdown-menu-content-up { position-area: block-start span-inline-end; margin: 0 0 4px; }
|
|
23
|
+
.pk-dropdown-menu-content-right {
|
|
24
|
+
position-area: inline-end span-block-end;
|
|
25
|
+
margin: 0 0 0 4px;
|
|
26
|
+
position-try-fallbacks: flip-inline;
|
|
27
|
+
}
|
|
28
|
+
.pk-dropdown-menu-content-left {
|
|
29
|
+
position-area: inline-start span-block-end;
|
|
30
|
+
margin: 0 4px 0 0;
|
|
31
|
+
position-try-fallbacks: flip-inline;
|
|
32
|
+
}
|
|
23
33
|
.pk-dropdown-menu-viewport {
|
|
24
34
|
min-width: 10rem;
|
|
25
35
|
border-radius: calc(var(--pk-radius) - 2px);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
module PhlexKit
|
|
2
2
|
# The dropdown panel — a native [popover=manual] the trigger toggles,
|
|
3
3
|
# anchor-positioned with viewport-edge flipping. `side:` is :bottom
|
|
4
|
-
# (default, opens below)
|
|
5
|
-
# the viewport, e.g. the sidebar footer)
|
|
4
|
+
# (default, opens below), :top (opens above — for triggers near the bottom
|
|
5
|
+
# of the viewport, e.g. the sidebar footer), :right or :left (opens beside
|
|
6
|
+
# the trigger — shadcn's side prop). See dropdown_menu.rb.
|
|
6
7
|
class DropdownMenuContent < BaseComponent
|
|
8
|
+
SIDES = { bottom: nil, top: "pk-dropdown-menu-content-up", left: "pk-dropdown-menu-content-left", right: "pk-dropdown-menu-content-right" }.freeze
|
|
9
|
+
|
|
7
10
|
def initialize(side: :bottom, **attrs)
|
|
8
11
|
@side = side.to_sym
|
|
9
12
|
@attrs = attrs
|
|
@@ -18,7 +21,7 @@ module PhlexKit
|
|
|
18
21
|
private
|
|
19
22
|
|
|
20
23
|
def wrapper_classes
|
|
21
|
-
[ "pk-dropdown-menu-content", (
|
|
24
|
+
[ "pk-dropdown-menu-content", fetch_option(SIDES, @side, :side) ].compact.join(" ")
|
|
22
25
|
end
|
|
23
26
|
end
|
|
24
27
|
end
|
data/lib/phlex_kit/version.rb
CHANGED