@threadlabs/looma 0.45.0 → 0.45.1
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-section/ui-section.html +53 -14
- package/dist/index.js +1 -1
- package/docs/catalog.json +24 -9
- package/package.json +1 -1
- package/styles/ui-section.css +31 -2
- package/vanilla/UiSection.d.ts +1 -1
- package/vanilla/UiSection.js +125 -21
- package/vue/UiSection.d.ts +9 -3
- package/vue/UiSection.vue +76 -11
- package/vue/chunks/UiSection.js +88 -23
- package/vue/components.css +25 -2
package/vue/chunks/UiSection.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as useReflectedProp, _ as nativeAttrs, a as checkHydratedRoot, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
1
|
+
import { C as useReflectedProp, _ as nativeAttrs, a as checkHydratedRoot, t as _plugin_vue_export_helper_default, y as preserveRootFocus } from "./_plugin-vue_export-helper.js";
|
|
2
2
|
import { h as vuePropInputs, i as checkPropInput, m as vPropValidity, t as BINDING_INPUTS_PROP } from "./props.js";
|
|
3
|
-
import { computed, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeProps, openBlock, renderSlot, toDisplayString, unref, watchSyncEffect, withDirectives } from "vue";
|
|
3
|
+
import { computed, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeProps, openBlock, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
|
|
4
4
|
//#region .build/vue/UiSection.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = [
|
|
6
6
|
"data-ui-section-prop-heading",
|
|
@@ -8,24 +8,55 @@ var _hoisted_1 = [
|
|
|
8
8
|
"data-ui-section-prop-variant",
|
|
9
9
|
"data-ui-section-state"
|
|
10
10
|
];
|
|
11
|
-
var _hoisted_2 =
|
|
11
|
+
var _hoisted_2 = ["hidden"];
|
|
12
|
+
var _hoisted_3 = {
|
|
13
|
+
class: "heading",
|
|
14
|
+
"data-hn-ui-section": ""
|
|
15
|
+
};
|
|
16
|
+
var _hoisted_4 = {
|
|
12
17
|
class: "head",
|
|
13
18
|
"data-hn-ui-section": ""
|
|
14
19
|
};
|
|
15
|
-
var
|
|
20
|
+
var _hoisted_5 = {
|
|
16
21
|
class: "copy",
|
|
17
22
|
"data-hn-ui-section": ""
|
|
18
23
|
};
|
|
19
|
-
var
|
|
20
|
-
var _hoisted_5 = {
|
|
24
|
+
var _hoisted_6 = {
|
|
21
25
|
class: "description",
|
|
22
26
|
"data-hn-ui-section": ""
|
|
23
27
|
};
|
|
24
|
-
var
|
|
28
|
+
var _hoisted_7 = {
|
|
25
29
|
class: "actions",
|
|
26
30
|
"data-hn-ui-section": ""
|
|
27
31
|
};
|
|
28
|
-
var
|
|
32
|
+
var _hoisted_8 = {
|
|
33
|
+
class: "body",
|
|
34
|
+
"data-hn-ui-section": ""
|
|
35
|
+
};
|
|
36
|
+
var _hoisted_9 = [
|
|
37
|
+
"data-ui-section-prop-heading",
|
|
38
|
+
"data-ui-section-prop-tone",
|
|
39
|
+
"data-ui-section-prop-variant",
|
|
40
|
+
"data-ui-section-state"
|
|
41
|
+
];
|
|
42
|
+
var _hoisted_10 = {
|
|
43
|
+
class: "head",
|
|
44
|
+
"data-hn-ui-section": ""
|
|
45
|
+
};
|
|
46
|
+
var _hoisted_11 = {
|
|
47
|
+
class: "copy",
|
|
48
|
+
"data-hn-ui-section": ""
|
|
49
|
+
};
|
|
50
|
+
var _hoisted_12 = ["hidden"];
|
|
51
|
+
var _hoisted_13 = {
|
|
52
|
+
class: "description",
|
|
53
|
+
"data-hn-ui-section": ""
|
|
54
|
+
};
|
|
55
|
+
var _hoisted_14 = {
|
|
56
|
+
class: "actions",
|
|
57
|
+
"data-hn-ui-section": ""
|
|
58
|
+
};
|
|
59
|
+
var _hoisted_15 = {
|
|
29
60
|
class: "body",
|
|
30
61
|
"data-hn-ui-section": ""
|
|
31
62
|
};
|
|
@@ -59,7 +90,7 @@ var UiSection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
59
90
|
},
|
|
60
91
|
required: false,
|
|
61
92
|
target: { attribute: "tone" },
|
|
62
|
-
description: "danger marks a section of destructive actions (a danger zone): its heading and a
|
|
93
|
+
description: "danger marks a section of destructive actions (a danger zone): its heading and a framed section's border take the danger colour.",
|
|
63
94
|
values: ["neutral", "danger"],
|
|
64
95
|
default: "neutral"
|
|
65
96
|
},
|
|
@@ -70,11 +101,12 @@ var UiSection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
70
101
|
},
|
|
71
102
|
required: false,
|
|
72
103
|
target: { attribute: "variant" },
|
|
73
|
-
description: "How the section is set apart. plain is a heading and content in the flow of the page; card sits it on a bordered surface, for a settings group; divided\n rules it off from the section before it, for a long form.",
|
|
104
|
+
description: "How the section is set apart. plain is a heading and content in the flow of the page; card sits it on a bordered surface, for a settings group; divided\n rules it off from the section before it, for a long form. fieldset joins the heading to a bordered frame using a native legend.",
|
|
74
105
|
values: [
|
|
75
106
|
"plain",
|
|
76
107
|
"card",
|
|
77
|
-
"divided"
|
|
108
|
+
"divided",
|
|
109
|
+
"fieldset"
|
|
78
110
|
],
|
|
79
111
|
default: "plain"
|
|
80
112
|
}
|
|
@@ -121,7 +153,9 @@ var UiSection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
121
153
|
checkedProps.value;
|
|
122
154
|
});
|
|
123
155
|
const reflectedProp = useReflectedProp();
|
|
124
|
-
|
|
156
|
+
const root = useTemplateRef("@html-next/root");
|
|
157
|
+
preserveRootFocus(root);
|
|
158
|
+
checkHydratedRoot(checkedProps.value.variant === "fieldset" ? "fieldset" : "section", "ui-section");
|
|
125
159
|
/** The values the styles' :host() and :state() rules test. */
|
|
126
160
|
const hostState = computed(() => [
|
|
127
161
|
checkedProps.value.variant && "variant",
|
|
@@ -130,31 +164,62 @@ var UiSection_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
130
164
|
checkedProps.value.tone != null && `tone=${encodeURIComponent(checkedProps.value.tone)}`
|
|
131
165
|
].filter(Boolean).join(" "));
|
|
132
166
|
return (_ctx, _cache) => {
|
|
133
|
-
return withDirectives((openBlock(), createElementBlock("
|
|
167
|
+
return checkedProps.value.variant === "fieldset" ? withDirectives((openBlock(), createElementBlock("fieldset", mergeProps({
|
|
168
|
+
key: 0,
|
|
169
|
+
class: "ui-section"
|
|
170
|
+
}, unref(nativeAttrs)(_ctx.$attrs), {
|
|
134
171
|
"data-hn": "",
|
|
135
172
|
"data-hn-ui-section": "",
|
|
136
173
|
"data-ui-section-prop-heading": unref(reflectedProp)("heading", "heading", checkedProps.value.heading, void 0, false),
|
|
137
174
|
"data-ui-section-prop-tone": unref(reflectedProp)("tone", "tone", checkedProps.value.tone, void 0, false),
|
|
138
175
|
"data-ui-section-prop-variant": unref(reflectedProp)("variant", "variant", checkedProps.value.variant, void 0, false),
|
|
139
|
-
"data-ui-section-state": hostState.value || void 0
|
|
176
|
+
"data-ui-section-state": hostState.value || void 0,
|
|
177
|
+
ref: "@html-next/root"
|
|
140
178
|
}), [
|
|
141
|
-
createElementVNode("
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
179
|
+
createElementVNode("legend", {
|
|
180
|
+
class: "legend",
|
|
181
|
+
"data-hn-ui-section": "",
|
|
182
|
+
hidden: !checkedProps.value.heading
|
|
183
|
+
}, [createElementVNode("h2", _hoisted_3, toDisplayString(checkedProps.value.heading), 1)], 8, _hoisted_2),
|
|
184
|
+
createElementVNode("span", _hoisted_4, [
|
|
185
|
+
createElementVNode("span", _hoisted_5, [createElementVNode("span", _hoisted_6, [renderSlot(_ctx.$slots, "description", {}, void 0, true)])]),
|
|
147
186
|
_cache[0] || (_cache[0] = createTextVNode(toDisplayString(" "), -1)),
|
|
148
|
-
createElementVNode("span",
|
|
187
|
+
createElementVNode("span", _hoisted_7, [renderSlot(_ctx.$slots, "actions", {}, void 0, true)])
|
|
149
188
|
]),
|
|
150
189
|
_cache[1] || (_cache[1] = createTextVNode(toDisplayString(" "), -1)),
|
|
151
|
-
createElementVNode("span",
|
|
190
|
+
createElementVNode("span", _hoisted_8, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])
|
|
152
191
|
], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
153
192
|
contract: propValidityContract,
|
|
154
193
|
values: { ...props }
|
|
194
|
+
}]]) : withDirectives((openBlock(), createElementBlock("section", mergeProps({
|
|
195
|
+
key: 1,
|
|
196
|
+
class: "ui-section"
|
|
197
|
+
}, unref(nativeAttrs)(_ctx.$attrs), {
|
|
198
|
+
"data-hn": "",
|
|
199
|
+
"data-hn-ui-section": "",
|
|
200
|
+
"data-ui-section-prop-heading": unref(reflectedProp)("heading", "heading", checkedProps.value.heading, void 0, false),
|
|
201
|
+
"data-ui-section-prop-tone": unref(reflectedProp)("tone", "tone", checkedProps.value.tone, void 0, false),
|
|
202
|
+
"data-ui-section-prop-variant": unref(reflectedProp)("variant", "variant", checkedProps.value.variant, void 0, false),
|
|
203
|
+
"data-ui-section-state": hostState.value || void 0,
|
|
204
|
+
ref: "@html-next/root"
|
|
205
|
+
}), [
|
|
206
|
+
createElementVNode("span", _hoisted_10, [
|
|
207
|
+
createElementVNode("span", _hoisted_11, [createElementVNode("h2", {
|
|
208
|
+
class: "heading",
|
|
209
|
+
"data-hn-ui-section": "",
|
|
210
|
+
hidden: !checkedProps.value.heading
|
|
211
|
+
}, toDisplayString(checkedProps.value.heading), 9, _hoisted_12), createElementVNode("span", _hoisted_13, [renderSlot(_ctx.$slots, "description", {}, void 0, true)])]),
|
|
212
|
+
_cache[2] || (_cache[2] = createTextVNode(toDisplayString(" "), -1)),
|
|
213
|
+
createElementVNode("span", _hoisted_14, [renderSlot(_ctx.$slots, "actions", {}, void 0, true)])
|
|
214
|
+
]),
|
|
215
|
+
_cache[3] || (_cache[3] = createTextVNode(toDisplayString(" "), -1)),
|
|
216
|
+
createElementVNode("span", _hoisted_15, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])
|
|
217
|
+
], 16, _hoisted_9)), [[unref(vPropValidity), {
|
|
218
|
+
contract: propValidityContract,
|
|
219
|
+
values: { ...props }
|
|
155
220
|
}]]);
|
|
156
221
|
};
|
|
157
222
|
}
|
|
158
|
-
}), [["__scopeId", "data-v-
|
|
223
|
+
}), [["__scopeId", "data-v-ccf42e80"]]);
|
|
159
224
|
//#endregion
|
|
160
225
|
export { UiSection_default as t };
|
package/vue/components.css
CHANGED
|
@@ -9594,7 +9594,7 @@ dialog:where([data-hn-ui-search-shell]) {
|
|
|
9594
9594
|
gap: var(--ui-space-4) !important;
|
|
9595
9595
|
min-inline-size: 0;
|
|
9596
9596
|
}
|
|
9597
|
-
:scope[data-ui-section-state~="variant=card"]:where([data-hn-ui-section]) {
|
|
9597
|
+
:scope[data-ui-section-state~="variant=card"]:where([data-hn-ui-section]),:scope[data-ui-section-state~="variant=fieldset"]:where([data-hn-ui-section]) {
|
|
9598
9598
|
--_ui-selection-context-surface: initial;
|
|
9599
9599
|
--_ui-selection-context-border: initial;
|
|
9600
9600
|
--_ui-selection-context-text: initial;
|
|
@@ -9603,11 +9603,34 @@ dialog:where([data-hn-ui-search-shell]) {
|
|
|
9603
9603
|
border-radius: var(--ui-radius-lg);
|
|
9604
9604
|
background: var(--ui-surface-raised);
|
|
9605
9605
|
}
|
|
9606
|
+
:scope[data-ui-section-state~="variant=fieldset"]:where([data-hn-ui-section]) {
|
|
9607
|
+
display: block !important;
|
|
9608
|
+
box-sizing: border-box !important;
|
|
9609
|
+
margin: 0 !important;
|
|
9610
|
+
padding-block-start: var(--ui-space-4) !important;
|
|
9611
|
+
}
|
|
9612
|
+
.legend:where([data-hn-ui-section]) {
|
|
9613
|
+
max-inline-size: 100%;
|
|
9614
|
+
box-sizing: border-box !important;
|
|
9615
|
+
padding-inline: var(--ui-space-2) !important;
|
|
9616
|
+
margin-inline-start: calc(-1 * var(--ui-space-2)) !important;
|
|
9617
|
+
overflow-wrap: anywhere;
|
|
9618
|
+
}
|
|
9619
|
+
.legend .heading:where([data-hn-ui-section]) {
|
|
9620
|
+
font-size: var(--ui-font-size-md);
|
|
9621
|
+
}
|
|
9622
|
+
:scope[data-ui-section-state~="variant=fieldset"] .head:where([data-hn-ui-section]) {
|
|
9623
|
+
margin-block-end: var(--ui-space-4) !important;
|
|
9624
|
+
}
|
|
9625
|
+
:scope[data-ui-section-state~="variant=fieldset"]
|
|
9626
|
+
.head:has(.description:empty):has(.actions:empty):where([data-hn-ui-section]) {
|
|
9627
|
+
display: none !important;
|
|
9628
|
+
}
|
|
9606
9629
|
:scope[data-ui-section-state~="variant=divided"]:where([data-hn-ui-section]) {
|
|
9607
9630
|
padding-block-start: var(--ui-space-6) !important;
|
|
9608
9631
|
border-block-start: var(--ui-border-width) solid var(--ui-border-divider);
|
|
9609
9632
|
}
|
|
9610
|
-
:scope[data-ui-section-state~="variant=card"][data-ui-section-state~="tone=danger"]:where([data-hn-ui-section]) {
|
|
9633
|
+
:scope[data-ui-section-state~="variant=card"][data-ui-section-state~="tone=danger"]:where([data-hn-ui-section]),:scope[data-ui-section-state~="variant=fieldset"][data-ui-section-state~="tone=danger"]:where([data-hn-ui-section]) {
|
|
9611
9634
|
--_ui-selection-context-surface: light-dark(
|
|
9612
9635
|
oklch(from var(--ui-danger-soft) calc(l - 0.045) calc(max(c, min(0.045, c * 3))) h),
|
|
9613
9636
|
oklch(from var(--ui-danger-soft) calc(l + 0.045) calc(max(c, min(0.045, c * 3))) h)
|