@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
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { C as useReflectedProp, _ as nativeAttrs, a as checkHydratedRoot, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
2
|
+
import { h as vuePropInputs, i as checkPropInput, m as vPropValidity, t as BINDING_INPUTS_PROP } from "./props.js";
|
|
3
|
+
import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
|
|
4
|
+
//#region .build/vue/UiSiteHeader.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _hoisted_1 = [
|
|
6
|
+
"data-ui-site-header-prop-breakpoint",
|
|
7
|
+
"data-ui-site-header-prop-label",
|
|
8
|
+
"data-ui-site-header-prop-sticky",
|
|
9
|
+
"data-ui-site-header-state"
|
|
10
|
+
];
|
|
11
|
+
var _hoisted_2 = {
|
|
12
|
+
class: "menu",
|
|
13
|
+
"data-hn-ui-site-header": ""
|
|
14
|
+
};
|
|
15
|
+
var _hoisted_3 = {
|
|
16
|
+
class: "identity",
|
|
17
|
+
"data-hn-ui-site-header": ""
|
|
18
|
+
};
|
|
19
|
+
var _hoisted_4 = {
|
|
20
|
+
class: "brand",
|
|
21
|
+
"data-hn-ui-site-header": ""
|
|
22
|
+
};
|
|
23
|
+
var _hoisted_5 = ["aria-label"];
|
|
24
|
+
var _hoisted_6 = {
|
|
25
|
+
class: "actions",
|
|
26
|
+
"data-hn-ui-site-header": ""
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region .build/vue/UiSiteHeader.vue
|
|
30
|
+
var UiSiteHeader_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
31
|
+
inheritAttrs: false,
|
|
32
|
+
__name: "UiSiteHeader",
|
|
33
|
+
props: {
|
|
34
|
+
breakpoint: { type: null },
|
|
35
|
+
label: { type: null },
|
|
36
|
+
sticky: { type: null },
|
|
37
|
+
[BINDING_INPUTS_PROP]: { type: null }
|
|
38
|
+
},
|
|
39
|
+
setup(__props) {
|
|
40
|
+
const propValidityContract = { props: {
|
|
41
|
+
breakpoint: {
|
|
42
|
+
type: {
|
|
43
|
+
kind: "terminal",
|
|
44
|
+
name: "keyword"
|
|
45
|
+
},
|
|
46
|
+
required: false,
|
|
47
|
+
target: { attribute: "breakpoint" },
|
|
48
|
+
description: "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\n opens.",
|
|
49
|
+
values: [
|
|
50
|
+
"sm",
|
|
51
|
+
"md",
|
|
52
|
+
"lg"
|
|
53
|
+
],
|
|
54
|
+
default: "lg"
|
|
55
|
+
},
|
|
56
|
+
label: {
|
|
57
|
+
type: {
|
|
58
|
+
kind: "terminal",
|
|
59
|
+
name: "string"
|
|
60
|
+
},
|
|
61
|
+
required: false,
|
|
62
|
+
target: { attribute: "aria-label" },
|
|
63
|
+
description: "Accessible name for the primary navigation region.",
|
|
64
|
+
default: "Main"
|
|
65
|
+
},
|
|
66
|
+
sticky: {
|
|
67
|
+
type: {
|
|
68
|
+
kind: "terminal",
|
|
69
|
+
name: "boolean"
|
|
70
|
+
},
|
|
71
|
+
required: false,
|
|
72
|
+
target: { attribute: "sticky" },
|
|
73
|
+
description: "Keeps the header at the top of its scrolling container.",
|
|
74
|
+
default: false
|
|
75
|
+
}
|
|
76
|
+
} };
|
|
77
|
+
const props = __props;
|
|
78
|
+
const inputTracking = vuePropInputs({
|
|
79
|
+
breakpoint: "lg",
|
|
80
|
+
label: "Main",
|
|
81
|
+
sticky: false
|
|
82
|
+
}, {
|
|
83
|
+
breakpoint: "lg",
|
|
84
|
+
label: "Main",
|
|
85
|
+
sticky: false
|
|
86
|
+
}, (name, value, source, values) => {
|
|
87
|
+
switch (name) {
|
|
88
|
+
case "breakpoint": return checkPropInput(value, {
|
|
89
|
+
kind: "terminal",
|
|
90
|
+
name: "keyword"
|
|
91
|
+
}, true, true);
|
|
92
|
+
case "label": return checkPropInput(value, {
|
|
93
|
+
kind: "terminal",
|
|
94
|
+
name: "string"
|
|
95
|
+
}, true, true);
|
|
96
|
+
case "sticky": return checkPropInput(value, {
|
|
97
|
+
kind: "terminal",
|
|
98
|
+
name: "boolean"
|
|
99
|
+
}, true, true);
|
|
100
|
+
default: return { ok: false };
|
|
101
|
+
}
|
|
102
|
+
}, () => {
|
|
103
|
+
checkedProps.value;
|
|
104
|
+
});
|
|
105
|
+
const propInputs = inputTracking.inputs;
|
|
106
|
+
const checkedProps = computed(() => {
|
|
107
|
+
inputTracking.version.value;
|
|
108
|
+
return {
|
|
109
|
+
breakpoint: propInputs.value("breakpoint", props["breakpoint"], props[BINDING_INPUTS_PROP]),
|
|
110
|
+
label: propInputs.value("label", props["label"], props[BINDING_INPUTS_PROP]),
|
|
111
|
+
sticky: propInputs.value("sticky", props["sticky"], props[BINDING_INPUTS_PROP])
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
checkedProps.value;
|
|
115
|
+
watchSyncEffect(() => {
|
|
116
|
+
checkedProps.value;
|
|
117
|
+
});
|
|
118
|
+
const reflectedProp = useReflectedProp();
|
|
119
|
+
checkHydratedRoot("header", "ui-site-header");
|
|
120
|
+
/** The values the styles' :host() and :state() rules test. */
|
|
121
|
+
const hostState = computed(() => [
|
|
122
|
+
checkedProps.value.sticky && "sticky",
|
|
123
|
+
checkedProps.value.breakpoint && "breakpoint",
|
|
124
|
+
checkedProps.value.breakpoint != null && `breakpoint=${encodeURIComponent(checkedProps.value.breakpoint)}`
|
|
125
|
+
].filter(Boolean).join(" "));
|
|
126
|
+
return (_ctx, _cache) => {
|
|
127
|
+
return withDirectives((openBlock(), createElementBlock("header", mergeProps({ class: "ui-site-header" }, unref(nativeAttrs)(_ctx.$attrs), {
|
|
128
|
+
"data-hn": "",
|
|
129
|
+
"data-hn-ui-site-header": "",
|
|
130
|
+
"data-ui-site-header-prop-breakpoint": unref(reflectedProp)("breakpoint", "breakpoint", checkedProps.value.breakpoint, void 0, false),
|
|
131
|
+
"data-ui-site-header-prop-label": unref(reflectedProp)("label", "label", checkedProps.value.label, void 0, false),
|
|
132
|
+
"data-ui-site-header-prop-sticky": unref(reflectedProp)("sticky", "sticky", checkedProps.value.sticky, void 0, false),
|
|
133
|
+
"data-ui-site-header-state": hostState.value || void 0
|
|
134
|
+
}), [
|
|
135
|
+
createElementVNode("span", _hoisted_2, [renderSlot(_ctx.$slots, "menu", {}, void 0, true)]),
|
|
136
|
+
createElementVNode("div", _hoisted_3, [createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "brand", {}, void 0, true)]), createElementVNode("nav", {
|
|
137
|
+
class: "navigation",
|
|
138
|
+
"data-hn-ui-site-header": "",
|
|
139
|
+
"aria-label": checkedProps.value.label ?? void 0
|
|
140
|
+
}, [renderSlot(_ctx.$slots, "navigation", {}, void 0, true)], 8, _hoisted_5)]),
|
|
141
|
+
createElementVNode("div", _hoisted_6, [renderSlot(_ctx.$slots, "actions", {}, void 0, true)])
|
|
142
|
+
], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
143
|
+
contract: propValidityContract,
|
|
144
|
+
values: { ...props }
|
|
145
|
+
}]]);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}), [["__scopeId", "data-v-a60b14b2"]]);
|
|
149
|
+
//#endregion
|
|
150
|
+
export { UiSiteHeader_default as t };
|
package/vue/components.css
CHANGED
|
@@ -10585,6 +10585,160 @@ dialog:where([data-hn-ui-search-shell]) {
|
|
|
10585
10585
|
}
|
|
10586
10586
|
}
|
|
10587
10587
|
|
|
10588
|
+
@property --ui-site-header-height {
|
|
10589
|
+
syntax: "*";
|
|
10590
|
+
inherits: false;
|
|
10591
|
+
}
|
|
10592
|
+
@property --ui-site-header-compact-height {
|
|
10593
|
+
syntax: "*";
|
|
10594
|
+
inherits: false;
|
|
10595
|
+
}
|
|
10596
|
+
@property --ui-site-header-padding-inline {
|
|
10597
|
+
syntax: "*";
|
|
10598
|
+
inherits: false;
|
|
10599
|
+
}
|
|
10600
|
+
@property --ui-site-header-surface {
|
|
10601
|
+
syntax: "*";
|
|
10602
|
+
inherits: false;
|
|
10603
|
+
}
|
|
10604
|
+
@property --ui-site-header-border {
|
|
10605
|
+
syntax: "*";
|
|
10606
|
+
inherits: false;
|
|
10607
|
+
}
|
|
10608
|
+
@property --ui-site-header-z-index {
|
|
10609
|
+
syntax: "*";
|
|
10610
|
+
inherits: false;
|
|
10611
|
+
}
|
|
10612
|
+
/* Text shares a baseline inside one group; the group is centred beside any control height. */
|
|
10613
|
+
/* Without a supplied menu trigger, keep the destinations available on narrow screens. */
|
|
10614
|
+
@scope (.ui-site-header) to ([data-hn]) {
|
|
10615
|
+
:scope:where([data-hn-ui-site-header]) {
|
|
10616
|
+
box-sizing: border-box !important;
|
|
10617
|
+
display: flex !important;
|
|
10618
|
+
flex-wrap: wrap !important;
|
|
10619
|
+
align-items: center !important;
|
|
10620
|
+
align-content: center !important;
|
|
10621
|
+
gap: var(--ui-space-2) !important;
|
|
10622
|
+
min-inline-size: 0;
|
|
10623
|
+
min-block-size: var(--ui-site-header-compact-height, 3.75rem);
|
|
10624
|
+
padding: var(--ui-space-2) var(--ui-site-header-padding-inline, var(--ui-space-4)) !important;
|
|
10625
|
+
border-block-end: var(--ui-border-width) solid var(--ui-site-header-border, var(--ui-border));
|
|
10626
|
+
background: var(--ui-site-header-surface, var(--ui-surface));
|
|
10627
|
+
color: var(--ui-text-primary);
|
|
10628
|
+
}
|
|
10629
|
+
:scope[data-ui-site-header-state~="sticky"]:where([data-hn-ui-site-header]) {
|
|
10630
|
+
position: sticky;
|
|
10631
|
+
inset-block-start: 0;
|
|
10632
|
+
z-index: var(--ui-site-header-z-index, 10);
|
|
10633
|
+
}
|
|
10634
|
+
.menu:where([data-hn-ui-site-header]),.actions:where([data-hn-ui-site-header]) {
|
|
10635
|
+
display: flex !important;
|
|
10636
|
+
flex: none;
|
|
10637
|
+
align-items: center !important;
|
|
10638
|
+
gap: var(--ui-space-2) !important;
|
|
10639
|
+
min-inline-size: 0;
|
|
10640
|
+
max-inline-size: 100%;
|
|
10641
|
+
}
|
|
10642
|
+
.actions:where([data-hn-ui-site-header]) {
|
|
10643
|
+
flex-wrap: wrap !important;
|
|
10644
|
+
margin-inline-start: auto !important;
|
|
10645
|
+
}
|
|
10646
|
+
.identity:where([data-hn-ui-site-header]) {
|
|
10647
|
+
display: flex !important;
|
|
10648
|
+
flex: 1 1 auto;
|
|
10649
|
+
flex-wrap: wrap !important;
|
|
10650
|
+
align-items: baseline !important;
|
|
10651
|
+
gap: var(--ui-space-2) var(--ui-space-6) !important;
|
|
10652
|
+
min-inline-size: 0;
|
|
10653
|
+
}
|
|
10654
|
+
.brand:where([data-hn-ui-site-header]) {
|
|
10655
|
+
min-inline-size: 0;
|
|
10656
|
+
font-size: var(--ui-font-size-lg);
|
|
10657
|
+
font-weight: var(--ui-font-bold);
|
|
10658
|
+
}
|
|
10659
|
+
.brand > :where(:not([data-hn-ui-site-header])):is(a) {
|
|
10660
|
+
display: inline-flex !important;
|
|
10661
|
+
align-items: baseline !important;
|
|
10662
|
+
gap: var(--ui-space-3) !important;
|
|
10663
|
+
min-inline-size: 0;
|
|
10664
|
+
max-inline-size: 100%;
|
|
10665
|
+
color: inherit;
|
|
10666
|
+
text-decoration: none;
|
|
10667
|
+
}
|
|
10668
|
+
.navigation:where([data-hn-ui-site-header]) {
|
|
10669
|
+
display: flex !important;
|
|
10670
|
+
flex-wrap: wrap !important;
|
|
10671
|
+
align-items: baseline !important;
|
|
10672
|
+
gap: var(--ui-space-2) var(--ui-space-5) !important;
|
|
10673
|
+
min-inline-size: 0;
|
|
10674
|
+
font-size: var(--ui-font-size-sm);
|
|
10675
|
+
font-weight: var(--ui-font-semibold);
|
|
10676
|
+
}
|
|
10677
|
+
:scope:has(> .menu:not(:empty)) .navigation:where([data-hn-ui-site-header]) {
|
|
10678
|
+
display: none !important;
|
|
10679
|
+
}
|
|
10680
|
+
.navigation > :where(:not([data-hn-ui-site-header])):is(a) {
|
|
10681
|
+
color: inherit;
|
|
10682
|
+
text-decoration: none;
|
|
10683
|
+
}
|
|
10684
|
+
.navigation
|
|
10685
|
+
> :where(:not([data-hn-ui-site-header])):is(a):is(:hover, [aria-current="page"], [aria-current="true"]) {
|
|
10686
|
+
color: var(--ui-accent-active);
|
|
10687
|
+
}
|
|
10688
|
+
.brand > :where(:not([data-hn-ui-site-header])):is(a):focus-visible,.navigation > :where(:not([data-hn-ui-site-header])):is(a):focus-visible {
|
|
10689
|
+
outline: var(--ui-focus-width) solid var(--ui-focus-ring);
|
|
10690
|
+
outline-offset: var(--ui-focus-width);
|
|
10691
|
+
}
|
|
10692
|
+
.menu:empty:where([data-hn-ui-site-header]),.actions:empty:where([data-hn-ui-site-header]),.brand:empty:where([data-hn-ui-site-header]),.navigation:empty:where([data-hn-ui-site-header]) {
|
|
10693
|
+
display: none !important;
|
|
10694
|
+
}
|
|
10695
|
+
@media (min-width: 40rem) {
|
|
10696
|
+
:scope[data-ui-site-header-state~="breakpoint=sm"]:where([data-hn-ui-site-header]) {
|
|
10697
|
+
min-block-size: var(--ui-site-header-height, 4.25rem);
|
|
10698
|
+
column-gap: var(--ui-space-4) !important;
|
|
10699
|
+
}
|
|
10700
|
+
:scope[data-ui-site-header-state~="breakpoint=sm"]
|
|
10701
|
+
.navigation:not(:empty):where([data-hn-ui-site-header]) {
|
|
10702
|
+
display: flex !important;
|
|
10703
|
+
}
|
|
10704
|
+
:scope[data-ui-site-header-state~="breakpoint=sm"]
|
|
10705
|
+
.menu:where([data-hn-ui-site-header]) {
|
|
10706
|
+
display: none !important;
|
|
10707
|
+
}
|
|
10708
|
+
}
|
|
10709
|
+
@media (min-width: 48rem) {
|
|
10710
|
+
:scope[data-ui-site-header-state~="breakpoint=md"]:where([data-hn-ui-site-header]) {
|
|
10711
|
+
min-block-size: var(--ui-site-header-height, 4.25rem);
|
|
10712
|
+
column-gap: var(--ui-space-4) !important;
|
|
10713
|
+
}
|
|
10714
|
+
:scope[data-ui-site-header-state~="breakpoint=md"]
|
|
10715
|
+
.navigation:not(:empty):where([data-hn-ui-site-header]) {
|
|
10716
|
+
display: flex !important;
|
|
10717
|
+
}
|
|
10718
|
+
:scope[data-ui-site-header-state~="breakpoint=md"]
|
|
10719
|
+
.menu:where([data-hn-ui-site-header]) {
|
|
10720
|
+
display: none !important;
|
|
10721
|
+
}
|
|
10722
|
+
}
|
|
10723
|
+
@media (min-width: 64rem) {
|
|
10724
|
+
:scope[data-ui-site-header-state~="breakpoint=lg"]:where([data-hn-ui-site-header]) {
|
|
10725
|
+
min-block-size: var(--ui-site-header-height, 4.25rem);
|
|
10726
|
+
column-gap: var(--ui-space-4) !important;
|
|
10727
|
+
}
|
|
10728
|
+
:scope[data-ui-site-header-state~="breakpoint=lg"]
|
|
10729
|
+
.navigation:not(:empty):where([data-hn-ui-site-header]) {
|
|
10730
|
+
display: flex !important;
|
|
10731
|
+
}
|
|
10732
|
+
:scope[data-ui-site-header-state~="breakpoint=lg"]
|
|
10733
|
+
.menu:where([data-hn-ui-site-header]) {
|
|
10734
|
+
display: none !important;
|
|
10735
|
+
}
|
|
10736
|
+
}
|
|
10737
|
+
:scope[hidden]:where([data-hn-ui-site-header]) {
|
|
10738
|
+
display: none !important;
|
|
10739
|
+
}
|
|
10740
|
+
}
|
|
10741
|
+
|
|
10588
10742
|
/* Dimensions belong to this placeholder, never a nested or neighbouring one. */
|
|
10589
10743
|
@property --ui-skeleton-width {
|
|
10590
10744
|
syntax: "*";
|