@falcondev-oss/nuxt-layers-base 0.42.0 → 0.42.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.
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants'
|
|
1
2
|
import type { VNode } from 'vue'
|
|
3
|
+
import { cnMerge } from 'tailwind-variants'
|
|
2
4
|
|
|
3
5
|
export default defineSetupComponent(
|
|
4
6
|
(_: {
|
|
5
7
|
props: {
|
|
6
8
|
title?: string
|
|
7
9
|
end?: boolean
|
|
10
|
+
ui?: {
|
|
11
|
+
root?: ClassValue
|
|
12
|
+
content?: ClassValue
|
|
13
|
+
}
|
|
8
14
|
}
|
|
9
15
|
slots: {
|
|
10
16
|
default: () => VNode[]
|
|
@@ -13,24 +19,28 @@ export default defineSetupComponent(
|
|
|
13
19
|
options(_, {
|
|
14
20
|
name: 'URibbonSection',
|
|
15
21
|
inheritAttrs: false,
|
|
16
|
-
props: ['title', 'end'],
|
|
22
|
+
props: ['title', 'end', 'ui'],
|
|
17
23
|
emits: [],
|
|
18
24
|
setup:
|
|
19
25
|
(props, { slots, attrs }) =>
|
|
20
26
|
() => (
|
|
21
27
|
<div
|
|
22
28
|
data-end={props.end || undefined}
|
|
23
|
-
class={
|
|
29
|
+
class={cnMerge(
|
|
24
30
|
'border-default -mt-px -ml-px flex min-w-fit flex-col gap-1.5 border-l px-3 py-2',
|
|
25
31
|
// the row separator spans the full ribbon width (clipped by its overflow-hidden), so a
|
|
26
32
|
// partially filled wrapped line still gets an unbroken line above it
|
|
27
33
|
'before:border-default relative before:absolute before:inset-x-[-100vw] before:top-0 before:border-t',
|
|
28
34
|
// end sections hug their content, so the leading sections absorb the spare space
|
|
29
35
|
props.end ? 'flex-none' : 'flex-1',
|
|
30
|
-
|
|
36
|
+
props.ui?.root,
|
|
37
|
+
)()}
|
|
31
38
|
>
|
|
32
39
|
{props.title ? <p class="text-dimmed text-[10px] leading-none">{props.title}</p> : null}
|
|
33
|
-
<div
|
|
40
|
+
<div
|
|
41
|
+
class={cnMerge('flex flex-1 flex-wrap items-center gap-1', props.ui?.content)()}
|
|
42
|
+
{...attrs}
|
|
43
|
+
>
|
|
34
44
|
{slots.default?.()}
|
|
35
45
|
</div>
|
|
36
46
|
</div>
|