@ansiversa/components 0.0.21 → 0.0.22
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 +1 -1
- package/src/AvPageHeader.astro +22 -16
- package/src/styles/global.css +44 -0
package/package.json
CHANGED
package/src/AvPageHeader.astro
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import AvButton from "./AvButton.astro";
|
|
3
3
|
import AvContainer from "./AvContainer.astro";
|
|
4
4
|
|
|
5
|
+
type ButtonVariant = "primary" | "ghost" | "outline";
|
|
6
|
+
|
|
5
7
|
interface Action {
|
|
6
8
|
label: string;
|
|
7
9
|
href: string;
|
|
8
|
-
variant?:
|
|
10
|
+
variant?: ButtonVariant;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
interface Props {
|
|
@@ -21,22 +23,26 @@ const { title, description, primaryAction, secondaryAction } = Astro.props as Pr
|
|
|
21
23
|
<section class="av-page-header">
|
|
22
24
|
<AvContainer className="av-page-header__container">
|
|
23
25
|
<div class="av-page-header__body">
|
|
24
|
-
<
|
|
26
|
+
<div class="av-page-header__top">
|
|
27
|
+
<h1 class="av-page-header__title">{title}</h1>
|
|
28
|
+
|
|
29
|
+
{(primaryAction || secondaryAction) && (
|
|
30
|
+
<div class="av-page-header__actions">
|
|
31
|
+
{primaryAction && (
|
|
32
|
+
<AvButton href={primaryAction.href} variant={primaryAction.variant ?? "primary"}>
|
|
33
|
+
{primaryAction.label}
|
|
34
|
+
</AvButton>
|
|
35
|
+
)}
|
|
36
|
+
{secondaryAction && (
|
|
37
|
+
<AvButton href={secondaryAction.href} variant={secondaryAction.variant ?? "ghost"}>
|
|
38
|
+
{secondaryAction.label}
|
|
39
|
+
</AvButton>
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
</div>
|
|
44
|
+
|
|
25
45
|
{description && <p class="av-page-header__description">{description}</p>}
|
|
26
|
-
{(primaryAction || secondaryAction) && (
|
|
27
|
-
<div class="av-page-header__actions">
|
|
28
|
-
{primaryAction && (
|
|
29
|
-
<AvButton href={primaryAction.href} variant={primaryAction.variant ?? "primary"}>
|
|
30
|
-
{primaryAction.label}
|
|
31
|
-
</AvButton>
|
|
32
|
-
)}
|
|
33
|
-
{secondaryAction && (
|
|
34
|
-
<AvButton href={secondaryAction.href} variant={secondaryAction.variant ?? "ghost"}>
|
|
35
|
-
{secondaryAction.label}
|
|
36
|
-
</AvButton>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
)}
|
|
40
46
|
</div>
|
|
41
47
|
</AvContainer>
|
|
42
48
|
</section>
|
package/src/styles/global.css
CHANGED
|
@@ -1003,6 +1003,11 @@
|
|
|
1003
1003
|
@apply whitespace-nowrap;
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
|
+
.av-stack {
|
|
1007
|
+
display: flex;
|
|
1008
|
+
flex-direction: column;
|
|
1009
|
+
gap: 1rem;
|
|
1010
|
+
}
|
|
1006
1011
|
/* --- USER AVATAR BUTTON --- */
|
|
1007
1012
|
.av-user-avatar-button {
|
|
1008
1013
|
position: relative;
|
|
@@ -1056,6 +1061,45 @@
|
|
|
1056
1061
|
pointer-events: none;
|
|
1057
1062
|
}
|
|
1058
1063
|
|
|
1064
|
+
/* AvPageHeader */
|
|
1065
|
+
.av-page-header__top {
|
|
1066
|
+
display: flex;
|
|
1067
|
+
flex-direction: column; /* mobile: stacked */
|
|
1068
|
+
align-items: flex-start;
|
|
1069
|
+
gap: 0.75rem;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
.av-page-header__actions {
|
|
1073
|
+
display: flex;
|
|
1074
|
+
flex-direction: column; /* mobile: buttons one-per-row */
|
|
1075
|
+
gap: 0.5rem;
|
|
1076
|
+
width: 100%; /* mobile: full width so buttons align nicely */
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.av-page-header__actions .av-btn {
|
|
1080
|
+
width: 100%; /* mobile: full-width buttons */
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/* Desktop */
|
|
1084
|
+
@media (min-width: 640px) {
|
|
1085
|
+
.av-page-header__top {
|
|
1086
|
+
flex-direction: row; /* desktop: title left, actions right */
|
|
1087
|
+
align-items: flex-start;
|
|
1088
|
+
justify-content: space-between;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
.av-page-header__actions {
|
|
1092
|
+
flex-direction: row; /* desktop: inline actions */
|
|
1093
|
+
width: auto;
|
|
1094
|
+
justify-content: flex-end;
|
|
1095
|
+
flex-wrap: wrap;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
.av-page-header__actions .av-btn {
|
|
1099
|
+
width: auto;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1059
1103
|
/* Hover state */
|
|
1060
1104
|
.av-user-avatar-button:hover::before {
|
|
1061
1105
|
opacity: 1;
|