kmcom-nuxt-layers 1.6.11 → 1.6.15

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,7 +1,4 @@
1
1
  /* Motion Layer CSS */
2
- .motion-layer {
3
- /* Base styles for motion layer */
4
- }
5
2
 
6
3
  /* Transition classes */
7
4
  .transition-default {
@@ -6,6 +6,15 @@
6
6
  * same Tailwind pass as all utility generation (avoids HMR regeneration shift).
7
7
  */
8
8
 
9
+ /* --- Theme Transition --- */
10
+ @layer utilities {
11
+ .theme-transition {
12
+ transition-property: color, background-color, border-color, fill, stroke, box-shadow;
13
+ transition-duration: 700ms;
14
+ transition-delay: 0ms;
15
+ }
16
+ }
17
+
9
18
  /* --- Reduced Motion --- */
10
19
  [data-theme-motion='reduced'] *,
11
20
  [data-theme-motion='reduced'] *::before,
@@ -18,3 +18,9 @@
18
18
  [data-theme-transparency='reduced'] .accent-blob {
19
19
  opacity: 0 !important;
20
20
  }
21
+
22
+ @layer utilities {
23
+ .site-word {
24
+ display: block;
25
+ }
26
+ }
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <span v-for="(word, index) in useSite().subtitleWords" :key="index" class="site-word">
3
+ {{ word }}
4
+ </span>
5
+ </template>
@@ -1,15 +1,5 @@
1
- <script lang="ts" setup>
2
- import { splitSpaces } from '../../utils/regex'
3
-
4
- defineProps<{
5
- siteTitle: string
6
- tag: string
7
- titleVariant: string
8
- }>()
9
- </script>
10
-
11
1
  <template>
12
- <component :is="tag" :v-bind="$attrs">
13
- {{ titleVariant == 'split' ? splitSpaces(siteTitle) : siteTitle }}
14
- </component>
2
+ <span v-for="(word, index) in useSite().titleWords" :key="index" class="site-word">
3
+ {{ word }}
4
+ </span>
15
5
  </template>
@@ -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>
@@ -0,0 +1,13 @@
1
+ import { splitSpaces } from '../utils/regex'
2
+
3
+ export function useSite() {
4
+ const config = useAppConfig().site
5
+
6
+ return {
7
+ title: config.title as string,
8
+ titleWords: splitSpaces(config.title as string) as string[],
9
+ subtitle: config.subtitle as string,
10
+ subtitleWords: splitSpaces(config.subtitle as string) as string[],
11
+ description: config.description as string,
12
+ }
13
+ }
@@ -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
  ====================================================== */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kmcom-nuxt-layers",
3
3
  "private": false,
4
- "version": "1.6.11",
4
+ "version": "1.6.15",
5
5
  "description": "Composable Nuxt 4 layers for building scalable Vue applications",
6
6
  "files": [
7
7
  "layers/*/nuxt.config.ts",