@threadlabs/looma 0.40.0 → 0.41.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.
- package/components/ui-site-header/ui-site-header.html +164 -0
- package/dist/index.js +1 -1
- package/docs/catalog.json +197 -1
- package/package.json +1 -1
- package/styles/ui-site-header.css +165 -0
- package/vanilla/UiSiteHeader.d.ts +25 -0
- package/vanilla/UiSiteHeader.js +96 -0
- package/vanilla/index.js +1 -0
- package/vue/UiSiteHeader.d.ts +47 -0
- package/vue/UiSiteHeader.js +2 -0
- package/vue/UiSiteHeader.vue +299 -0
- package/vue/chunks/UiSiteHeader.js +150 -0
- package/vue/components.css +154 -0
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<template component="ui-site-header">
|
|
2
|
+
<defs>
|
|
3
|
+
<prop name="label" type="string" default="Main">Accessible name for the primary navigation region.</prop>
|
|
4
|
+
<prop name="sticky" type="boolean" default="false">Keeps the header at the top of its scrolling container.</prop>
|
|
5
|
+
<prop name="breakpoint" type="keyword" values="sm, md, lg" default="lg"
|
|
6
|
+
>The viewport width at which navigation replaces the menu trigger: sm is 40rem, md 48rem, and lg 64rem. The consumer owns the menu or drawer the trigger
|
|
7
|
+
opens.</prop>
|
|
8
|
+
</defs>
|
|
9
|
+
<header>
|
|
10
|
+
<span class="menu"><slot name="menu"></slot></span>
|
|
11
|
+
<div class="identity">
|
|
12
|
+
<div class="brand"><slot name="brand"></slot></div>
|
|
13
|
+
<nav class="navigation" from:aria-label="$label"><slot name="navigation"></slot></nav>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
16
|
+
</header>
|
|
17
|
+
<style>
|
|
18
|
+
@property --ui-site-header-height {
|
|
19
|
+
syntax: "*";
|
|
20
|
+
inherits: false;
|
|
21
|
+
}
|
|
22
|
+
@property --ui-site-header-compact-height {
|
|
23
|
+
syntax: "*";
|
|
24
|
+
inherits: false;
|
|
25
|
+
}
|
|
26
|
+
@property --ui-site-header-padding-inline {
|
|
27
|
+
syntax: "*";
|
|
28
|
+
inherits: false;
|
|
29
|
+
}
|
|
30
|
+
@property --ui-site-header-surface {
|
|
31
|
+
syntax: "*";
|
|
32
|
+
inherits: false;
|
|
33
|
+
}
|
|
34
|
+
@property --ui-site-header-border {
|
|
35
|
+
syntax: "*";
|
|
36
|
+
inherits: false;
|
|
37
|
+
}
|
|
38
|
+
@property --ui-site-header-z-index {
|
|
39
|
+
syntax: "*";
|
|
40
|
+
inherits: false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host {
|
|
44
|
+
box-sizing: border-box !important;
|
|
45
|
+
display: flex !important;
|
|
46
|
+
flex-wrap: wrap !important;
|
|
47
|
+
align-items: center !important;
|
|
48
|
+
align-content: center !important;
|
|
49
|
+
gap: var(--ui-space-2) !important;
|
|
50
|
+
min-inline-size: 0;
|
|
51
|
+
min-block-size: var(--ui-site-header-compact-height, 3.75rem);
|
|
52
|
+
padding: var(--ui-space-2) var(--ui-site-header-padding-inline, var(--ui-space-4)) !important;
|
|
53
|
+
border-block-end: var(--ui-border-width) solid var(--ui-site-header-border, var(--ui-border));
|
|
54
|
+
background: var(--ui-site-header-surface, var(--ui-surface));
|
|
55
|
+
color: var(--ui-text-primary);
|
|
56
|
+
}
|
|
57
|
+
:host([sticky]) {
|
|
58
|
+
position: sticky;
|
|
59
|
+
inset-block-start: 0;
|
|
60
|
+
z-index: var(--ui-site-header-z-index, 10);
|
|
61
|
+
}
|
|
62
|
+
.menu, .actions {
|
|
63
|
+
display: flex !important;
|
|
64
|
+
flex: none;
|
|
65
|
+
align-items: center !important;
|
|
66
|
+
gap: var(--ui-space-2) !important;
|
|
67
|
+
min-inline-size: 0;
|
|
68
|
+
max-inline-size: 100%;
|
|
69
|
+
}
|
|
70
|
+
.actions {
|
|
71
|
+
flex-wrap: wrap !important;
|
|
72
|
+
margin-inline-start: auto !important;
|
|
73
|
+
}
|
|
74
|
+
/* Text shares a baseline inside one group; the group is centred beside any control height. */
|
|
75
|
+
.identity {
|
|
76
|
+
display: flex !important;
|
|
77
|
+
flex: 1 1 auto;
|
|
78
|
+
flex-wrap: wrap !important;
|
|
79
|
+
align-items: baseline !important;
|
|
80
|
+
gap: var(--ui-space-2) var(--ui-space-6) !important;
|
|
81
|
+
min-inline-size: 0;
|
|
82
|
+
}
|
|
83
|
+
.brand {
|
|
84
|
+
min-inline-size: 0;
|
|
85
|
+
font-size: var(--ui-font-size-lg);
|
|
86
|
+
font-weight: var(--ui-font-bold);
|
|
87
|
+
}
|
|
88
|
+
.brand > :slotted(a) {
|
|
89
|
+
display: inline-flex !important;
|
|
90
|
+
align-items: baseline !important;
|
|
91
|
+
gap: var(--ui-space-3) !important;
|
|
92
|
+
min-inline-size: 0;
|
|
93
|
+
max-inline-size: 100%;
|
|
94
|
+
color: inherit;
|
|
95
|
+
text-decoration: none;
|
|
96
|
+
}
|
|
97
|
+
.navigation {
|
|
98
|
+
display: flex !important;
|
|
99
|
+
flex-wrap: wrap !important;
|
|
100
|
+
align-items: baseline !important;
|
|
101
|
+
gap: var(--ui-space-2) var(--ui-space-5) !important;
|
|
102
|
+
min-inline-size: 0;
|
|
103
|
+
font-size: var(--ui-font-size-sm);
|
|
104
|
+
font-weight: var(--ui-font-semibold);
|
|
105
|
+
}
|
|
106
|
+
/* Without a supplied menu trigger, keep the destinations available on narrow screens. */
|
|
107
|
+
:host:has(> .menu:not(:empty)) .navigation {
|
|
108
|
+
display: none !important;
|
|
109
|
+
}
|
|
110
|
+
.navigation > :slotted(a) {
|
|
111
|
+
color: inherit;
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
}
|
|
114
|
+
.navigation > :slotted(a):is(:hover, [aria-current="page"], [aria-current="true"]) {
|
|
115
|
+
color: var(--ui-accent-active);
|
|
116
|
+
}
|
|
117
|
+
.brand > :slotted(a):focus-visible, .navigation > :slotted(a):focus-visible {
|
|
118
|
+
outline: var(--ui-focus-width) solid var(--ui-focus-ring);
|
|
119
|
+
outline-offset: var(--ui-focus-width);
|
|
120
|
+
}
|
|
121
|
+
.menu:empty, .actions:empty, .brand:empty, .navigation:empty {
|
|
122
|
+
display: none !important;
|
|
123
|
+
}
|
|
124
|
+
@media (min-width: 40rem) {
|
|
125
|
+
:host([breakpoint="sm"]) {
|
|
126
|
+
min-block-size: var(--ui-site-header-height, 4.25rem);
|
|
127
|
+
column-gap: var(--ui-space-4) !important;
|
|
128
|
+
}
|
|
129
|
+
:host([breakpoint="sm"]) .navigation:not(:empty) {
|
|
130
|
+
display: flex !important;
|
|
131
|
+
}
|
|
132
|
+
:host([breakpoint="sm"]) .menu {
|
|
133
|
+
display: none !important;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
@media (min-width: 48rem) {
|
|
137
|
+
:host([breakpoint="md"]) {
|
|
138
|
+
min-block-size: var(--ui-site-header-height, 4.25rem);
|
|
139
|
+
column-gap: var(--ui-space-4) !important;
|
|
140
|
+
}
|
|
141
|
+
:host([breakpoint="md"]) .navigation:not(:empty) {
|
|
142
|
+
display: flex !important;
|
|
143
|
+
}
|
|
144
|
+
:host([breakpoint="md"]) .menu {
|
|
145
|
+
display: none !important;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
@media (min-width: 64rem) {
|
|
149
|
+
:host([breakpoint="lg"]) {
|
|
150
|
+
min-block-size: var(--ui-site-header-height, 4.25rem);
|
|
151
|
+
column-gap: var(--ui-space-4) !important;
|
|
152
|
+
}
|
|
153
|
+
:host([breakpoint="lg"]) .navigation:not(:empty) {
|
|
154
|
+
display: flex !important;
|
|
155
|
+
}
|
|
156
|
+
:host([breakpoint="lg"]) .menu {
|
|
157
|
+
display: none !important;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
:host[hidden] {
|
|
161
|
+
display: none !important;
|
|
162
|
+
}
|
|
163
|
+
</style>
|
|
164
|
+
</template>
|