@threadlabs/looma 0.23.7 → 0.23.8
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-disclosure/ui-disclosure.html +71 -19
- package/components/ui-disclosure/ui-disclosure.js +50 -4
- package/components/ui-nav-item/ui-nav-item.html +16 -11
- package/components/ui-sidebar/ui-sidebar.html +36 -7
- package/components/ui-sidebar/ui-sidebar.js +6 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-disclosure.css +65 -17
- package/styles/ui-nav-item.css +14 -11
- package/styles/ui-sidebar.css +34 -6
- package/tokens.css +15 -0
- package/vanilla/UiDisclosure.d.ts +2 -0
- package/vanilla/UiDisclosure.js +33 -18
- package/vanilla/UiNavItem.js +42 -18
- package/vanilla/UiSidebar.js +19 -16
- package/vue/UiDisclosure.d.ts +24 -4
- package/vue/UiDisclosure.vue +130 -22
- package/vue/UiNavItem.d.ts +8 -4
- package/vue/UiNavItem.vue +17 -12
- package/vue/UiSection.d.ts +1 -1
- package/vue/UiSidebar.vue +42 -8
- package/vue/chunks/UiDisclosure.js +70 -14
- package/vue/chunks/UiNavItem.js +14 -10
- package/vue/chunks/UiSidebar.js +12 -7
- package/vue/components.css +178 -93
package/vanilla/UiSidebar.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-sidebar/ui-sidebar.js";
|
|
4
4
|
import "../styles/ui-sidebar.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-sidebar","props":{"breakpoint":{"type":{"kind":"terminal","name":"keyword"},"values":["sm","md","lg"],"required":false,"target":{"attribute":"breakpoint"},"default":"md"},"collapsed":{"type":"boolean","required":false,"target":{"attribute":"collapsed"},"default":false},"maxWidth":{"type":"number","required":false,"target":{"attribute":"maxwidth"},"default":480},"minWidth":{"type":"number","required":false,"target":{"attribute":"minwidth"},"default":200},"resizable":{"type":"boolean","required":false,"target":{"attribute":"resizable"},"default":false},"resizeLabel":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":"Resize sidebar"},"resizeStep":{"type":"number","required":false,"target":{"attribute":"resizestep"},"default":16},"side":{"type":{"kind":"terminal","name":"keyword"},"values":["start","end"],"required":false,"target":{"attribute":"side"},"default":"start"},"width":{"type":"number","required":false,"target":{"attribute":"width"},"default":0}}},"template":{"kind":"element","name":"aside","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"content"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"resizer"},{"kind":"literal","name":"role","value":"separator"},{"kind":"literal","name":"aria-orientation","value":"vertical"},{"kind":"literal","name":"tabindex","value":"0"},{"kind":"literal","name":"data-ui-affordance","value":"resize"},{"kind":"attribute","name":"aria-label","expression":"resizeLabel","expressionPlan":{"source":"resizeLabel","ast":{"kind":"id","name":"resizeLabel"},"dependencies":["resizeLabel"]}},{"kind":"attribute","name":"hidden","expression":"not resizable or drawer or internalCollapsed","expressionPlan":{"source":"not resizable or drawer or internalCollapsed","ast":{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"unary","op":"not","operand":{"kind":"id","name":"resizable"}},"right":{"kind":"id","name":"drawer"}},"right":{"kind":"id","name":"internalCollapsed"}},"dependencies":["drawer","internalCollapsed","resizable"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"guide"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"resizer"}]},"declarations":[{"kind":"state","name":"internalCollapsed","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"drawer","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"resize","type":"object","shape":{"kind":"object","fields":[{"name":"width","type":{"kind":"terminal","name":"number"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"toggle","type":"object","shape":{"kind":"object","fields":[{"name":"open","type":{"kind":"terminal","name":"boolean"},"optional":false},{"name":"mode","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["docked","drawer"]},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"aside","choices":["aside"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-sidebar","props":{"breakpoint":{"type":{"kind":"terminal","name":"keyword"},"values":["sm","md","lg"],"required":false,"target":{"attribute":"breakpoint"},"default":"md"},"collapsed":{"type":"boolean","required":false,"target":{"attribute":"collapsed"},"default":false},"maxWidth":{"type":"number","required":false,"target":{"attribute":"maxwidth"},"default":480},"minWidth":{"type":"number","required":false,"target":{"attribute":"minwidth"},"default":200},"resizable":{"type":"boolean","required":false,"target":{"attribute":"resizable"},"default":false},"resizeLabel":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":"Resize sidebar"},"resizeStep":{"type":"number","required":false,"target":{"attribute":"resizestep"},"default":16},"side":{"type":{"kind":"terminal","name":"keyword"},"values":["start","end"],"required":false,"target":{"attribute":"side"},"default":"start"},"width":{"type":"number","required":false,"target":{"attribute":"width"},"default":0}}},"template":{"kind":"element","name":"aside","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"viewport"}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"content"}],"children":[{"kind":"slot"}]}]},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"resizer"},{"kind":"literal","name":"role","value":"separator"},{"kind":"literal","name":"aria-orientation","value":"vertical"},{"kind":"literal","name":"tabindex","value":"0"},{"kind":"literal","name":"data-ui-affordance","value":"resize"},{"kind":"attribute","name":"aria-label","expression":"resizeLabel","expressionPlan":{"source":"resizeLabel","ast":{"kind":"id","name":"resizeLabel"},"dependencies":["resizeLabel"]}},{"kind":"attribute","name":"hidden","expression":"not resizable or drawer or internalCollapsed","expressionPlan":{"source":"not resizable or drawer or internalCollapsed","ast":{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"unary","op":"not","operand":{"kind":"id","name":"resizable"}},"right":{"kind":"id","name":"drawer"}},"right":{"kind":"id","name":"internalCollapsed"}},"dependencies":["drawer","internalCollapsed","resizable"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"guide"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"resizer"}]},"declarations":[{"kind":"state","name":"internalCollapsed","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"drawer","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"resizing","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"resize","type":"object","shape":{"kind":"object","fields":[{"name":"width","type":{"kind":"terminal","name":"number"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"toggle","type":"object","shape":{"kind":"object","fields":[{"name":"open","type":{"kind":"terminal","name":"boolean"},"optional":false},{"name":"mode","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["docked","drawer"]},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"aside","choices":["aside"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiSidebar(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -15,31 +15,34 @@ export function createUiSidebar(options = {}) {
|
|
|
15
15
|
}
|
|
16
16
|
element.setAttribute("data-component", "ui-sidebar");
|
|
17
17
|
const element0 = document.createElement("div");
|
|
18
|
-
element0.setAttribute("class", "
|
|
18
|
+
element0.setAttribute("class", "viewport");
|
|
19
|
+
const element1 = document.createElement("div");
|
|
20
|
+
element1.setAttribute("class", "content");
|
|
19
21
|
if (children.length > 0) {
|
|
20
22
|
for (const child of children) {
|
|
21
23
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
22
24
|
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
23
25
|
projected.push([node, ""]);
|
|
24
|
-
|
|
26
|
+
element1.append(node);
|
|
25
27
|
}
|
|
26
28
|
} else {
|
|
27
29
|
}
|
|
30
|
+
element0.append(element1);
|
|
28
31
|
element.append(element0);
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const element2 = document.createElement("div");
|
|
33
|
+
element2.setAttribute("class", "resizer");
|
|
34
|
+
element2.setAttribute("role", "separator");
|
|
35
|
+
element2.setAttribute("aria-orientation", "vertical");
|
|
36
|
+
element2.setAttribute("tabindex", "0");
|
|
37
|
+
element2.setAttribute("data-ui-affordance", "resize");
|
|
35
38
|
const value0 = componentProps["resizeLabel"] === undefined ? "Resize sidebar" : componentProps["resizeLabel"];
|
|
36
|
-
if (value0 === null || value0 === undefined)
|
|
37
|
-
else
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
element.append(
|
|
39
|
+
if (value0 === null || value0 === undefined) element2.removeAttribute("aria-label");
|
|
40
|
+
else element2.setAttribute("aria-label", String(value0));
|
|
41
|
+
const element3 = document.createElement("span");
|
|
42
|
+
element3.setAttribute("class", "guide");
|
|
43
|
+
element3.setAttribute("aria-hidden", "true");
|
|
44
|
+
element2.append(element3);
|
|
45
|
+
element.append(element2);
|
|
43
46
|
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
44
47
|
controller,
|
|
45
48
|
});
|
package/vue/UiDisclosure.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
|
|
4
|
+
leading?: (props: typeof __VLS_1) => any;
|
|
5
5
|
} & {
|
|
6
|
-
|
|
6
|
+
summary?: (props: typeof __VLS_3) => any;
|
|
7
7
|
} & {
|
|
8
|
-
|
|
8
|
+
indicator?: (props: typeof __VLS_5) => any;
|
|
9
|
+
} & {
|
|
10
|
+
default?: (props: typeof __VLS_7) => any;
|
|
9
11
|
};
|
|
10
12
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
11
13
|
density: {
|
|
@@ -32,10 +34,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
32
34
|
type: PropType<boolean | null>;
|
|
33
35
|
default: boolean;
|
|
34
36
|
};
|
|
37
|
+
requiredOpen: {
|
|
38
|
+
type: PropType<boolean | null>;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
35
41
|
summary: {
|
|
36
42
|
type: PropType<string | null>;
|
|
37
43
|
default: string;
|
|
38
44
|
};
|
|
45
|
+
variant: {
|
|
46
|
+
type: PropType<"plain" | "navigation" | null>;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
39
49
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
40
50
|
open: (event: CustomEvent<{
|
|
41
51
|
readonly open: boolean;
|
|
@@ -73,10 +83,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
73
83
|
type: PropType<boolean | null>;
|
|
74
84
|
default: boolean;
|
|
75
85
|
};
|
|
86
|
+
requiredOpen: {
|
|
87
|
+
type: PropType<boolean | null>;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
76
90
|
summary: {
|
|
77
91
|
type: PropType<string | null>;
|
|
78
92
|
default: string;
|
|
79
93
|
};
|
|
94
|
+
variant: {
|
|
95
|
+
type: PropType<"plain" | "navigation" | null>;
|
|
96
|
+
default: string;
|
|
97
|
+
};
|
|
80
98
|
}>> & Readonly<{
|
|
81
99
|
onOpen?: ((event: CustomEvent<{
|
|
82
100
|
readonly open: boolean;
|
|
@@ -94,9 +112,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
94
112
|
summary: string | null;
|
|
95
113
|
name: string | null;
|
|
96
114
|
open: boolean | null;
|
|
115
|
+
variant: "plain" | "navigation" | null;
|
|
97
116
|
disabled: boolean | null;
|
|
98
117
|
density: "comfortable" | "compact" | null;
|
|
99
118
|
headingLevel: number | null;
|
|
119
|
+
requiredOpen: boolean | null;
|
|
100
120
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
101
121
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
102
122
|
declare const _default: typeof __VLS_export;
|
package/vue/UiDisclosure.vue
CHANGED
|
@@ -57,6 +57,14 @@ const propValidityContract = {
|
|
|
57
57
|
'Whether the disclosure is open initially or when set externally. The trigger toggles it from there, reporting each change as an open or close event.',
|
|
58
58
|
default: false,
|
|
59
59
|
},
|
|
60
|
+
requiredOpen: {
|
|
61
|
+
type: { kind: 'terminal', name: 'boolean' },
|
|
62
|
+
required: false,
|
|
63
|
+
target: { attribute: 'requiredopen' },
|
|
64
|
+
description:
|
|
65
|
+
'In a named exclusive group, keeps at least one member open. Clicking the last open trigger does not close it; opening another member transfers the open\n state.',
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
60
68
|
summary: {
|
|
61
69
|
type: { kind: 'terminal', name: 'string' },
|
|
62
70
|
required: false,
|
|
@@ -65,6 +73,15 @@ const propValidityContract = {
|
|
|
65
73
|
'The text of the trigger row that opens and closes the disclosure. It is the trigger button\'s accessible name, so name what the content is.',
|
|
66
74
|
default: 'Details',
|
|
67
75
|
},
|
|
76
|
+
variant: {
|
|
77
|
+
type: { kind: 'terminal', name: 'keyword' },
|
|
78
|
+
required: false,
|
|
79
|
+
target: { attribute: 'variant' },
|
|
80
|
+
description:
|
|
81
|
+
'Navigation shares icon columns, spacing, type, hover, and corners with Nav Item. Plain retains the standard disclosure treatment.',
|
|
82
|
+
values: ['plain', 'navigation'],
|
|
83
|
+
default: 'plain',
|
|
84
|
+
},
|
|
68
85
|
},
|
|
69
86
|
} as const
|
|
70
87
|
const props = defineProps({
|
|
@@ -77,7 +94,9 @@ const props = defineProps({
|
|
|
77
94
|
headingLevel: { type: null as unknown as PropType<number | null>, default: 0 },
|
|
78
95
|
name: { type: null as unknown as PropType<string | null>, default: '' },
|
|
79
96
|
open: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
97
|
+
requiredOpen: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
80
98
|
summary: { type: null as unknown as PropType<string | null>, default: 'Details' },
|
|
99
|
+
variant: { type: null as unknown as PropType<'plain' | 'navigation' | null>, default: 'plain' },
|
|
81
100
|
})
|
|
82
101
|
const acceptedProps: Record<string, unknown> = {
|
|
83
102
|
density: 'comfortable',
|
|
@@ -86,7 +105,9 @@ const acceptedProps: Record<string, unknown> = {
|
|
|
86
105
|
headingLevel: 0,
|
|
87
106
|
name: '',
|
|
88
107
|
open: false,
|
|
108
|
+
requiredOpen: false,
|
|
89
109
|
summary: 'Details',
|
|
110
|
+
variant: 'plain',
|
|
90
111
|
}
|
|
91
112
|
const checkedProps = computed(() => ({
|
|
92
113
|
density: checkedProp<'comfortable' | 'compact'>(
|
|
@@ -131,6 +152,13 @@ const checkedProps = computed(() => ({
|
|
|
131
152
|
'open',
|
|
132
153
|
acceptedProps,
|
|
133
154
|
) as boolean,
|
|
155
|
+
requiredOpen: checkedProp<boolean>(
|
|
156
|
+
props['requiredOpen'],
|
|
157
|
+
{ kind: 'terminal', name: 'boolean' },
|
|
158
|
+
false,
|
|
159
|
+
'requiredOpen',
|
|
160
|
+
acceptedProps,
|
|
161
|
+
) as boolean,
|
|
134
162
|
summary: checkedProp<string>(
|
|
135
163
|
props['summary'],
|
|
136
164
|
{ kind: 'terminal', name: 'string' },
|
|
@@ -138,6 +166,13 @@ const checkedProps = computed(() => ({
|
|
|
138
166
|
'summary',
|
|
139
167
|
acceptedProps,
|
|
140
168
|
) as string,
|
|
169
|
+
variant: checkedProp<'plain' | 'navigation'>(
|
|
170
|
+
props['variant'],
|
|
171
|
+
{ kind: 'terminal', name: 'keyword' },
|
|
172
|
+
false,
|
|
173
|
+
'variant',
|
|
174
|
+
acceptedProps,
|
|
175
|
+
) as 'plain' | 'navigation',
|
|
141
176
|
}))
|
|
142
177
|
void checkedProps.value
|
|
143
178
|
watchSyncEffect(() => {
|
|
@@ -199,6 +234,7 @@ const emit = defineEmits<{
|
|
|
199
234
|
}>()
|
|
200
235
|
|
|
201
236
|
const root = ref<HTMLElement | null>(null)
|
|
237
|
+
const headingElement = useTemplateRef<HTMLElement>('heading')
|
|
202
238
|
const triggerElement = useTemplateRef<HTMLElement>('trigger')
|
|
203
239
|
const panelElement = useTemplateRef<HTMLElement>('panel')
|
|
204
240
|
const internalOpen = ref(false)
|
|
@@ -267,6 +303,9 @@ const hostState = computed(() =>
|
|
|
267
303
|
&& `density=${encodeURIComponent(checkedProps.value.density)}`,
|
|
268
304
|
internalOpen.value && 'internalOpen',
|
|
269
305
|
checkedProps.value.fill && 'fill',
|
|
306
|
+
checkedProps.value.variant && 'variant',
|
|
307
|
+
checkedProps.value.variant != null
|
|
308
|
+
&& `variant=${encodeURIComponent(checkedProps.value.variant)}`,
|
|
270
309
|
].filter(Boolean).join(' ')
|
|
271
310
|
)
|
|
272
311
|
|
|
@@ -304,10 +343,20 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
304
343
|
? (incoming[name] ?? incoming[kebab] ?? null)
|
|
305
344
|
: null
|
|
306
345
|
},
|
|
307
|
-
propNames: [
|
|
346
|
+
propNames: [
|
|
347
|
+
'density',
|
|
348
|
+
'disabled',
|
|
349
|
+
'fill',
|
|
350
|
+
'headingLevel',
|
|
351
|
+
'name',
|
|
352
|
+
'open',
|
|
353
|
+
'requiredOpen',
|
|
354
|
+
'summary',
|
|
355
|
+
'variant',
|
|
356
|
+
],
|
|
308
357
|
propValidity: (name: string) =>
|
|
309
358
|
propValidityState({ contract: propValidityContract, values: { ...props } }, name),
|
|
310
|
-
refs: { trigger: triggerElement, panel: panelElement },
|
|
359
|
+
refs: { heading: headingElement, trigger: triggerElement, panel: panelElement },
|
|
311
360
|
state: { internalOpen, contentId, headingRole, headingAriaLevel },
|
|
312
361
|
})
|
|
313
362
|
</script>
|
|
@@ -323,11 +372,13 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
323
372
|
:data-heading-level="reflectedProp('headingLevel', 'heading-level', checkedProps.headingLevel, undefined, false)"
|
|
324
373
|
:data-name="reflectedProp('name', 'name', checkedProps.name, undefined, false)"
|
|
325
374
|
:data-open="reflectedProp('open', 'open', checkedProps.open, undefined, false)"
|
|
375
|
+
:data-required-open="reflectedProp('requiredOpen', 'required-open', checkedProps.requiredOpen, undefined, false)"
|
|
326
376
|
:data-summary="reflectedProp('summary', 'summary', checkedProps.summary, undefined, false)"
|
|
377
|
+
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
327
378
|
:data-ui-disclosure-state="hostState || undefined"
|
|
328
379
|
ref="root"
|
|
329
380
|
>
|
|
330
|
-
<div class="heading" :role="guarded" :aria-level="guardedBinding">
|
|
381
|
+
<div class="heading" :role="guarded" :aria-level="guardedBinding" ref="heading">
|
|
331
382
|
<button
|
|
332
383
|
class="trigger"
|
|
333
384
|
type="button"
|
|
@@ -336,8 +387,11 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
336
387
|
:disabled="checkedProps.disabled ?? undefined"
|
|
337
388
|
ref="trigger"
|
|
338
389
|
>
|
|
390
|
+
<span class="leading"><slot name="leading" /></span>
|
|
339
391
|
<span class="summary"><slot name="summary">{{ checkedProps.summary }}</slot></span>
|
|
340
|
-
<
|
|
392
|
+
<span class="indicator" aria-hidden="true"><slot name="indicator"><span
|
|
393
|
+
class="chevron"
|
|
394
|
+
></span></slot></span>
|
|
341
395
|
</button>
|
|
342
396
|
</div>
|
|
343
397
|
<div class="panel" :id="guardedBinding4" ref="panel">
|
|
@@ -390,8 +444,7 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
390
444
|
}
|
|
391
445
|
|
|
392
446
|
.trigger {
|
|
393
|
-
display:
|
|
394
|
-
grid-template-columns: minmax(0, 1fr) auto;
|
|
447
|
+
display: flex;
|
|
395
448
|
gap: var(--ui-space-3);
|
|
396
449
|
align-items: center;
|
|
397
450
|
inline-size: 100%;
|
|
@@ -422,20 +475,42 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
422
475
|
cursor: not-allowed;
|
|
423
476
|
}
|
|
424
477
|
|
|
478
|
+
.summary {
|
|
479
|
+
flex: 1;
|
|
480
|
+
min-inline-size: 0;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.leading,
|
|
484
|
+
.indicator {
|
|
485
|
+
display: inline-flex;
|
|
486
|
+
align-items: center;
|
|
487
|
+
justify-content: center;
|
|
488
|
+
flex: none;
|
|
489
|
+
}
|
|
490
|
+
.leading:empty {
|
|
491
|
+
display: none;
|
|
492
|
+
}
|
|
493
|
+
.indicator {
|
|
494
|
+
transition: transform var(--ui-motion-feedback) var(--ui-motion-feedback-ease);
|
|
495
|
+
}
|
|
496
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="internalOpen"] .indicator {
|
|
497
|
+
transform: rotate(180deg);
|
|
498
|
+
}
|
|
499
|
+
|
|
425
500
|
.chevron {
|
|
426
501
|
inline-size: 0.5rem;
|
|
427
502
|
block-size: 0.5rem;
|
|
428
503
|
border-inline-end: 2px solid currentColor;
|
|
429
504
|
border-block-end: 2px solid currentColor;
|
|
430
505
|
transform: rotate(45deg) translate(-1px, -1px);
|
|
431
|
-
transition: transform var(--ui-motion-fast) var(--ui-motion-ease);
|
|
432
506
|
}
|
|
433
507
|
|
|
434
508
|
.panel {
|
|
435
509
|
display: grid;
|
|
436
510
|
grid-template-rows: 0fr;
|
|
437
|
-
transition:
|
|
438
|
-
var(--ui-motion-
|
|
511
|
+
transition:
|
|
512
|
+
grid-template-rows var(--ui-motion-reveal) var(--ui-motion-reveal-ease),
|
|
513
|
+
content-visibility var(--ui-motion-reveal) allow-discrete;
|
|
439
514
|
}
|
|
440
515
|
|
|
441
516
|
.panel-inner {
|
|
@@ -450,22 +525,22 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
450
525
|
[data-component~="ui-disclosure"][data-ui-disclosure-state~="internalOpen"] .panel-inner {
|
|
451
526
|
padding-block: 0 var(--ui-space-3);
|
|
452
527
|
}
|
|
453
|
-
[data-component~="ui-disclosure"][data-ui-disclosure-state~="internalOpen"] .chevron {
|
|
454
|
-
transform: rotate(225deg) translate(-1px, -1px);
|
|
455
|
-
}
|
|
456
528
|
|
|
457
529
|
/* A bounded accordion owns one flexible body, so its trigger never scrolls away. The
|
|
458
530
|
* normal content-sized layout and its animation remain unchanged when fill is omitted. */
|
|
459
531
|
[data-component~="ui-disclosure"][data-ui-disclosure-state~="fill"] {
|
|
460
532
|
display: flex;
|
|
461
533
|
flex-direction: column;
|
|
462
|
-
flex:
|
|
463
|
-
min-block-size:
|
|
534
|
+
flex: 0 0 var(--_ui-disclosure-heading-size, var(--_trigger-min-block-size));
|
|
535
|
+
min-block-size: calc(
|
|
536
|
+
var(--_ui-disclosure-heading-size, var(--_trigger-min-block-size)) + var(--ui-border-width)
|
|
537
|
+
);
|
|
538
|
+
transition: flex-grow var(--ui-motion-layout) var(--ui-motion-layout-ease);
|
|
464
539
|
border-block-end: 0;
|
|
465
540
|
border-block-start: var(--ui-border-width) solid var(--ui-border-divider);
|
|
466
541
|
}
|
|
467
542
|
[data-component~="ui-disclosure"][data-ui-disclosure-state~="fill"][data-ui-disclosure-state~="internalOpen"] {
|
|
468
|
-
flex: 1;
|
|
543
|
+
flex-grow: 1;
|
|
469
544
|
}
|
|
470
545
|
[data-component~="ui-disclosure"][data-ui-disclosure-state~="fill"] .heading {
|
|
471
546
|
flex: none;
|
|
@@ -474,14 +549,8 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
474
549
|
border-radius: 0;
|
|
475
550
|
}
|
|
476
551
|
[data-component~="ui-disclosure"][data-ui-disclosure-state~="fill"] .panel {
|
|
477
|
-
display: flex;
|
|
478
552
|
flex: 1;
|
|
479
553
|
min-block-size: 0;
|
|
480
|
-
transition: none;
|
|
481
|
-
}
|
|
482
|
-
[data-component~="ui-disclosure"][data-ui-disclosure-state~="fill"] .panel[hidden] {
|
|
483
|
-
flex: none;
|
|
484
|
-
block-size: 0;
|
|
485
554
|
}
|
|
486
555
|
[data-component~="ui-disclosure"][data-ui-disclosure-state~="fill"] .panel-inner {
|
|
487
556
|
display: flex;
|
|
@@ -491,9 +560,48 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
491
560
|
padding: 0;
|
|
492
561
|
}
|
|
493
562
|
|
|
563
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"] .trigger {
|
|
564
|
+
gap: var(--ui-nav-gap);
|
|
565
|
+
padding-inline: var(--ui-nav-padding-inline);
|
|
566
|
+
min-block-size: var(--ui-nav-min-block-size);
|
|
567
|
+
padding-block: var(--ui-nav-padding-block);
|
|
568
|
+
border-radius: var(--ui-selection-radius);
|
|
569
|
+
font-size: var(--ui-font-size-md);
|
|
570
|
+
font-weight: var(--ui-font-normal);
|
|
571
|
+
color: var(--ui-text-secondary);
|
|
572
|
+
}
|
|
573
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"][data-ui-disclosure-state~="density=compact"]
|
|
574
|
+
.trigger {
|
|
575
|
+
padding-inline: var(--ui-nav-compact-padding-inline);
|
|
576
|
+
padding-block: var(--ui-nav-compact-padding-block);
|
|
577
|
+
min-block-size: var(--ui-nav-compact-min-block-size);
|
|
578
|
+
font-size: var(--ui-font-size-sm);
|
|
579
|
+
}
|
|
580
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"]
|
|
581
|
+
.trigger:hover:not(:disabled) {
|
|
582
|
+
background: var(--ui-nav-hover-surface);
|
|
583
|
+
color: var(--ui-text-primary);
|
|
584
|
+
}
|
|
585
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"][data-ui-disclosure-state~="internalOpen"]
|
|
586
|
+
.trigger {
|
|
587
|
+
color: var(--ui-selection-text);
|
|
588
|
+
}
|
|
589
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"]
|
|
590
|
+
:is(.leading, .indicator) {
|
|
591
|
+
inline-size: var(--ui-nav-icon-size);
|
|
592
|
+
font-size: var(--ui-nav-icon-size);
|
|
593
|
+
}
|
|
594
|
+
@media (pointer: coarse) {
|
|
595
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"][data-ui-disclosure-state~="density=compact"]
|
|
596
|
+
.trigger {
|
|
597
|
+
min-block-size: var(--ui-control-min-block-size);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
494
601
|
@media (prefers-reduced-motion: reduce) {
|
|
602
|
+
[data-component~="ui-disclosure"][data-ui-disclosure-state~="fill"],
|
|
495
603
|
.panel,
|
|
496
|
-
.
|
|
604
|
+
.indicator {
|
|
497
605
|
transition: none;
|
|
498
606
|
}
|
|
499
607
|
}
|
package/vue/UiNavItem.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_9: {}, __VLS_11: {};
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_9: {}, __VLS_11: {}, __VLS_13: {}, __VLS_15: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
4
|
leading?: (props: typeof __VLS_1) => any;
|
|
5
5
|
} & {
|
|
@@ -7,11 +7,15 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
} & {
|
|
8
8
|
description?: (props: typeof __VLS_5) => any;
|
|
9
9
|
} & {
|
|
10
|
-
|
|
10
|
+
trailing?: (props: typeof __VLS_7) => any;
|
|
11
11
|
} & {
|
|
12
|
-
|
|
12
|
+
leading?: (props: typeof __VLS_9) => any;
|
|
13
13
|
} & {
|
|
14
|
-
|
|
14
|
+
default?: (props: typeof __VLS_11) => any;
|
|
15
|
+
} & {
|
|
16
|
+
description?: (props: typeof __VLS_13) => any;
|
|
17
|
+
} & {
|
|
18
|
+
trailing?: (props: typeof __VLS_15) => any;
|
|
15
19
|
};
|
|
16
20
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
21
|
as: {
|
package/vue/UiNavItem.vue
CHANGED
|
@@ -267,7 +267,8 @@ function attribute(value: unknown): any {
|
|
|
267
267
|
><span class="indicator" aria-hidden="true"></span>
|
|
268
268
|
<span class="leading"><slot name="leading" /></span>
|
|
269
269
|
<span class="content"><span class="label"><slot /></span>
|
|
270
|
-
<span class="description"><slot name="description" /></span></span
|
|
270
|
+
<span class="description"><slot name="description" /></span></span>
|
|
271
|
+
<span class="trailing"><slot name="trailing" /></span></a>
|
|
271
272
|
<button
|
|
272
273
|
v-else
|
|
273
274
|
data-component="ui-nav-item"
|
|
@@ -307,6 +308,7 @@ function attribute(value: unknown): any {
|
|
|
307
308
|
<span class="leading"><slot name="leading" /></span>
|
|
308
309
|
<span class="content"><span class="label"><slot /></span>
|
|
309
310
|
<span class="description"><slot name="description" /></span></span>
|
|
311
|
+
<span class="trailing"><slot name="trailing" /></span>
|
|
310
312
|
</button>
|
|
311
313
|
</template>
|
|
312
314
|
|
|
@@ -340,13 +342,13 @@ function attribute(value: unknown): any {
|
|
|
340
342
|
box-sizing: border-box;
|
|
341
343
|
display: flex;
|
|
342
344
|
align-items: center;
|
|
343
|
-
gap: var(--ui-
|
|
345
|
+
gap: var(--ui-nav-gap);
|
|
344
346
|
inline-size: var(--ui-nav-item-inline-size, 100%);
|
|
345
347
|
min-inline-size: 0;
|
|
346
|
-
min-block-size: var(--ui-
|
|
348
|
+
min-block-size: var(--ui-nav-min-block-size);
|
|
347
349
|
margin: 0;
|
|
348
|
-
padding-block: var(--ui-
|
|
349
|
-
padding-inline: var(--ui-
|
|
350
|
+
padding-block: var(--ui-nav-padding-block);
|
|
351
|
+
padding-inline: var(--ui-nav-padding-inline);
|
|
350
352
|
border: 0;
|
|
351
353
|
border-radius: var(--ui-selection-radius);
|
|
352
354
|
background: transparent;
|
|
@@ -363,7 +365,7 @@ function attribute(value: unknown): any {
|
|
|
363
365
|
}
|
|
364
366
|
|
|
365
367
|
[data-component~="ui-nav-item"]:hover:not([aria-current]) {
|
|
366
|
-
background: var(--ui-
|
|
368
|
+
background: var(--ui-nav-hover-surface);
|
|
367
369
|
color: var(--ui-text-primary);
|
|
368
370
|
}
|
|
369
371
|
|
|
@@ -412,12 +414,15 @@ function attribute(value: unknown): any {
|
|
|
412
414
|
}
|
|
413
415
|
}
|
|
414
416
|
|
|
415
|
-
.leading
|
|
417
|
+
.leading,
|
|
418
|
+
.trailing {
|
|
416
419
|
display: inline-flex;
|
|
417
420
|
flex: none;
|
|
418
421
|
align-items: center;
|
|
422
|
+
justify-content: center;
|
|
423
|
+
inline-size: var(--ui-nav-icon-size);
|
|
419
424
|
color: inherit;
|
|
420
|
-
font-size: var(--ui-
|
|
425
|
+
font-size: var(--ui-nav-icon-size);
|
|
421
426
|
}
|
|
422
427
|
|
|
423
428
|
.content {
|
|
@@ -450,11 +455,10 @@ function attribute(value: unknown): any {
|
|
|
450
455
|
}
|
|
451
456
|
|
|
452
457
|
[data-component~="ui-nav-item"][data-ui-nav-item-state~="density=compact"] {
|
|
453
|
-
min-block-size: var(--ui-
|
|
454
|
-
padding-block: var(--ui-
|
|
455
|
-
padding-inline: var(--ui-
|
|
458
|
+
min-block-size: var(--ui-nav-compact-min-block-size);
|
|
459
|
+
padding-block: var(--ui-nav-compact-padding-block);
|
|
460
|
+
padding-inline: var(--ui-nav-compact-padding-inline);
|
|
456
461
|
}
|
|
457
|
-
[data-component~="ui-nav-item"][data-ui-nav-item-state~="density=compact"] .leading,
|
|
458
462
|
[data-component~="ui-nav-item"][data-ui-nav-item-state~="density=compact"] .label {
|
|
459
463
|
font-size: var(--ui-font-size-sm);
|
|
460
464
|
}
|
|
@@ -467,6 +471,7 @@ function attribute(value: unknown): any {
|
|
|
467
471
|
|
|
468
472
|
/* An unused region takes no space. */
|
|
469
473
|
.leading:empty,
|
|
474
|
+
.trailing:empty,
|
|
470
475
|
.description:empty {
|
|
471
476
|
display: none;
|
|
472
477
|
}
|
package/vue/UiSection.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
35
35
|
};
|
|
36
36
|
}>> & Readonly<{}>, {
|
|
37
37
|
tone: "neutral" | "danger" | null;
|
|
38
|
-
variant: "
|
|
38
|
+
variant: "plain" | "card" | "divided" | null;
|
|
39
39
|
heading: string | null;
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
41
41
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|