@threadlabs/looma 0.39.6 → 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-button/ui-button.html +8 -10
- package/components/ui-button/ui-button.js +5 -2
- package/components/ui-editor-link-card/ui-editor-link-card.html +0 -1
- package/components/ui-pagination/ui-pagination.html +3 -6
- package/components/ui-site-header/ui-site-header.html +164 -0
- package/dist/index.js +1 -1
- package/docs/card.html +1 -1
- package/docs/catalog.json +207 -32
- package/package.json +1 -1
- package/styles/ui-site-header.css +165 -0
- package/vanilla/UiButton.d.ts +0 -1
- package/vanilla/UiButton.js +71 -71
- package/vanilla/UiEditorLinkCard.js +1 -1
- package/vanilla/UiPagination.js +44 -57
- package/vanilla/UiSiteHeader.d.ts +25 -0
- package/vanilla/UiSiteHeader.js +96 -0
- package/vanilla/index.js +1 -0
- package/vue/UiButton.d.ts +0 -6
- package/vue/UiButton.vue +8 -30
- package/vue/UiEditorLinkCard.vue +0 -1
- package/vue/UiPagination.vue +13 -15
- package/vue/UiSiteHeader.d.ts +47 -0
- package/vue/UiSiteHeader.js +2 -0
- package/vue/UiSiteHeader.vue +299 -0
- package/vue/chunks/UiButton.js +8 -36
- package/vue/chunks/UiEditorLinkCard.js +0 -1
- package/vue/chunks/UiPagination.js +13 -27
- package/vue/chunks/UiSiteHeader.js +150 -0
- package/vue/components.css +154 -0
- package/vue/editor/index.js +107 -121
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
tone="danger" variant="outline" is a destructive secondary action. neutral is the quiet one, for a button that should not claim a colour. The field
|
|
30
30
|
variant always uses neutral field colors.</prop>
|
|
31
31
|
<prop name="disabled" type="boolean" default="false"
|
|
32
|
-
>Makes the button unavailable: it cannot be pressed, uses a flat neutral palette, and loses its raised look. A disabled link (
|
|
33
|
-
|
|
32
|
+
>Makes the button unavailable: it cannot be pressed, uses a flat neutral palette, and loses its raised look. A disabled link (with href) drops its href and
|
|
33
|
+
states aria-disabled="true" instead, because a link has no native disabled state.</prop>
|
|
34
34
|
<prop name="loading" type="boolean" default="false"
|
|
35
35
|
>Keeps the action focusable and its label visible while work is in progress. It shows a decorative spinner, states aria-disabled and aria-busy, and prevents
|
|
36
36
|
activation or form submission until cleared.</prop>
|
|
@@ -41,12 +41,10 @@
|
|
|
41
41
|
<prop name="type" type="keyword" values="button, submit, reset" default="button"
|
|
42
42
|
>The button's type, as on a native button. button by default, so it never submits a form by accident. A link has no type.</prop>
|
|
43
43
|
<prop name="href" type="string"
|
|
44
|
-
>The link's destination.
|
|
45
|
-
aria-disabled="true", so it cannot be followed.</prop>
|
|
46
|
-
<prop name="target" type="string">Where a link opens, as on a native link. Only meaningful with
|
|
47
|
-
<prop name="rel" type="string">The link's relationship to its destination, as on a native link. Only meaningful with
|
|
48
|
-
<prop name="as" type="keyword" values="button, a" default="button"
|
|
49
|
-
>The native element the button renders: a button, or a link (a) that navigates to href.</prop>
|
|
44
|
+
>The link's destination. Supplying href automatically renders a native link instead of a button, including an empty href for the current document. A
|
|
45
|
+
disabled link drops its href and states aria-disabled="true", so it cannot be followed.</prop>
|
|
46
|
+
<prop name="target" type="string">Where a link opens, as on a native link. Only meaningful with href.</prop>
|
|
47
|
+
<prop name="rel" type="string">The link's relationship to its destination, as on a native link. Only meaningful with href.</prop>
|
|
50
48
|
<!-- Each root carries only its own attributes: a link has no type or disabled, and a disabled link
|
|
51
49
|
loses its href and states aria-disabled instead. The language has no conditional expression, so a
|
|
52
50
|
table keyed by a boolean's text picks each value, and null leaves the attribute off. -->
|
|
@@ -55,7 +53,7 @@
|
|
|
55
53
|
<a
|
|
56
54
|
from:data-appearance="$appearance"
|
|
57
55
|
from:data-tone="$colorTone"
|
|
58
|
-
$when="$appearance = 'card' and $
|
|
56
|
+
$when="$appearance = 'card' and $href != null"
|
|
59
57
|
from:href="{ true: null, false: $href }[concat($disabled or $loading or $pending)]"
|
|
60
58
|
from:target="$target"
|
|
61
59
|
from:rel="$rel"
|
|
@@ -87,7 +85,7 @@
|
|
|
87
85
|
<a
|
|
88
86
|
from:data-appearance="$appearance"
|
|
89
87
|
from:data-tone="$colorTone"
|
|
90
|
-
$when="$
|
|
88
|
+
$when="$href != null"
|
|
91
89
|
from:href="{ true: null, false: $href }[concat($disabled or $loading or $pending)]"
|
|
92
90
|
from:target="$target"
|
|
93
91
|
from:rel="$rel"
|
|
@@ -5,6 +5,9 @@ export function connect(host) {
|
|
|
5
5
|
event.preventDefault();
|
|
6
6
|
event.stopImmediatePropagation();
|
|
7
7
|
};
|
|
8
|
-
host.
|
|
9
|
-
|
|
8
|
+
return host.effect(() => {
|
|
9
|
+
const element = host.element;
|
|
10
|
+
element.addEventListener("click", onClick, true);
|
|
11
|
+
return () => element.removeEventListener("click", onClick, true);
|
|
12
|
+
});
|
|
10
13
|
}
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
tone="neutral"
|
|
38
38
|
from:size="$size"
|
|
39
39
|
from:disabled="$disabled or not $hasPrevious or $page <= 1"
|
|
40
|
-
from:
|
|
41
|
-
from:href="$previousHref"
|
|
40
|
+
from:href="{ true: $previousHref, false: null }[concat($previousHref != '')]"
|
|
42
41
|
from:aria-label="$previousLabel"
|
|
43
42
|
from:data-pagination-page="$page - 1"
|
|
44
43
|
><ui-icon name="chevron-left"></ui-icon></ui-button>
|
|
@@ -50,8 +49,7 @@
|
|
|
50
49
|
from:tone="{ true: 'accent', false: 'neutral' }[concat($item.value = $page)]"
|
|
51
50
|
from:size="$size"
|
|
52
51
|
from:disabled="$disabled"
|
|
53
|
-
from:
|
|
54
|
-
from:href="$item.href"
|
|
52
|
+
from:href="{ true: $item.href, false: null }[concat(default($item.href, '') != '')]"
|
|
55
53
|
from:data-pagination-page="$item.value"
|
|
56
54
|
from:aria-label="concat($pageLabel, ' ', format($item.value, 'number'))"
|
|
57
55
|
from:aria-current="{ true: 'page', false: null }[concat($item.value = $page)]"
|
|
@@ -63,8 +61,7 @@
|
|
|
63
61
|
tone="neutral"
|
|
64
62
|
from:size="$size"
|
|
65
63
|
from:disabled="$disabled or not $hasNext"
|
|
66
|
-
from:
|
|
67
|
-
from:href="$nextHref"
|
|
64
|
+
from:href="{ true: $nextHref, false: null }[concat($nextHref != '')]"
|
|
68
65
|
from:aria-label="$nextLabel"
|
|
69
66
|
from:data-pagination-page="$page + 1"
|
|
70
67
|
><ui-icon name="chevron-right"></ui-icon></ui-button>
|
|
@@ -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>
|