kmcom-nuxt-layers 1.6.11 → 1.6.12
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.
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useColor } from '../../composables/color'
|
|
3
|
+
import { useTypography } from '../../composables/typography'
|
|
4
|
+
import type { UiColors } from '../../types/colors'
|
|
5
|
+
import type {
|
|
6
|
+
FontLeading,
|
|
7
|
+
FontScreenSize,
|
|
8
|
+
FontSlant,
|
|
9
|
+
FontTracking,
|
|
10
|
+
FontWeight,
|
|
11
|
+
FontWidth,
|
|
12
|
+
TextAlign,
|
|
13
|
+
TextTransform,
|
|
14
|
+
} from '../../types/typography'
|
|
15
|
+
|
|
16
|
+
defineOptions({ inheritAttrs: false })
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(
|
|
19
|
+
defineProps<{
|
|
20
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6
|
|
21
|
+
size?: FontScreenSize
|
|
22
|
+
weight?: FontWeight
|
|
23
|
+
width?: FontWidth
|
|
24
|
+
slant?: FontSlant
|
|
25
|
+
leading?: FontLeading
|
|
26
|
+
tracking?: FontTracking
|
|
27
|
+
align?: TextAlign
|
|
28
|
+
transform?: TextTransform
|
|
29
|
+
color?: UiColors
|
|
30
|
+
class?: string
|
|
31
|
+
}>(),
|
|
32
|
+
{
|
|
33
|
+
level: 1,
|
|
34
|
+
size: 'screen-xxl',
|
|
35
|
+
weight: 'font-bold',
|
|
36
|
+
width: 'font-stretch-normal',
|
|
37
|
+
slant: 'normal',
|
|
38
|
+
leading: 'leading-tight',
|
|
39
|
+
tracking: 'tracking-tight',
|
|
40
|
+
align: 'left',
|
|
41
|
+
transform: 'none',
|
|
42
|
+
class: '',
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
const tag = computed(() => `h${props.level}` as const)
|
|
47
|
+
const sizeClass = computed(() => `text-${props.size}`)
|
|
48
|
+
|
|
49
|
+
const { classes } = useTypography({
|
|
50
|
+
weight: props.weight,
|
|
51
|
+
width: props.width,
|
|
52
|
+
slant: props.slant,
|
|
53
|
+
leading: props.leading,
|
|
54
|
+
tracking: props.tracking,
|
|
55
|
+
align: props.align,
|
|
56
|
+
transform: props.transform,
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const colorClass = useColor(props.color, 'text')
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<component
|
|
64
|
+
:is="tag"
|
|
65
|
+
:class="[sizeClass, classes, colorClass, props.class]"
|
|
66
|
+
v-bind="$attrs"
|
|
67
|
+
>
|
|
68
|
+
<slot />
|
|
69
|
+
</component>
|
|
70
|
+
</template>
|
|
@@ -112,6 +112,13 @@ export type FontTracking =
|
|
|
112
112
|
| 'tracking-widest'
|
|
113
113
|
| FontTrackingNumber
|
|
114
114
|
|
|
115
|
+
/* ======================================================
|
|
116
|
+
Screen-scale Font Sizes
|
|
117
|
+
- Companion to text-screen-* fluid tokens
|
|
118
|
+
====================================================== */
|
|
119
|
+
|
|
120
|
+
export type FontScreenSize = 'screen' | 'screen-xl' | 'screen-xxl' | 'screen-xxxl'
|
|
121
|
+
|
|
115
122
|
/* ======================================================
|
|
116
123
|
Text Layout
|
|
117
124
|
====================================================== */
|