kmcom-nuxt-layers 2.2.6 → 2.2.9

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.
Files changed (202) hide show
  1. package/docs/FEEDS.md +197 -0
  2. package/docs/LAYERS-FIXES.md +101 -0
  3. package/docs/MIGRATION.md +627 -0
  4. package/docs/feed-layer.md +374 -0
  5. package/docs/patch-picture-provider-type.md +52 -0
  6. package/docs/shaderGuide.md +2071 -0
  7. package/docs/types-architecture.md +234 -0
  8. package/layers/animations/app/components/Motion/CountUp.vue +1 -2
  9. package/layers/animations/app/components/Motion/Magnetic.vue +1 -2
  10. package/layers/animations/app/components/Motion/Marquee.vue +2 -5
  11. package/layers/animations/app/components/Motion/MarqueeText.vue +1 -2
  12. package/layers/animations/app/components/Motion/Tilt.vue +1 -2
  13. package/layers/animations/app/composables/useCountUp.ts +4 -1
  14. package/layers/animations/app/composables/useMagneticElement.ts +1 -3
  15. package/layers/animations/app/composables/useMarqueeCopies.ts +3 -3
  16. package/layers/animations/app/types/animations.ts +8 -0
  17. package/layers/animations/app/types/index.ts +1 -0
  18. package/layers/animations/package.json +4 -1
  19. package/layers/canvas/app/components/ShaderCanvas.vue +4 -4
  20. package/layers/canvas/app/composables/useRendererCapabilities.ts +19 -15
  21. package/layers/canvas/app/types/index.ts +1 -0
  22. package/layers/canvas/package.json +2 -1
  23. package/layers/canvas/tsconfig.json +2 -1
  24. package/layers/content/app/components/Blog/Card.vue +5 -5
  25. package/layers/content/app/components/Gallery/AmbientImage.vue +3 -3
  26. package/layers/content/app/components/Gallery/Card.vue +3 -3
  27. package/layers/content/app/components/NuxtContent/Detail.vue +5 -1
  28. package/layers/content/app/components/NuxtContent/Surround.vue +5 -3
  29. package/layers/content/app/components/NuxtContent/Toc.vue +1 -1
  30. package/layers/content/app/components/Portfolio/Card.vue +5 -5
  31. package/layers/content/app/components/content/Figure.vue +3 -3
  32. package/layers/content/app/types/index.ts +1 -0
  33. package/layers/content/package.json +2 -1
  34. package/layers/core/app/composables/useErrorLog.ts +9 -11
  35. package/layers/core/app/utils/helpers.ts +14 -12
  36. package/layers/core/nuxt.config.ts +1 -0
  37. package/layers/feeds/app/plugins/feed-head.ts +1 -2
  38. package/layers/feeds/package.json +2 -1
  39. package/layers/feeds/public/feed/style.css +256 -0
  40. package/layers/feeds/server/routes/feed/discovery.get.ts +1 -2
  41. package/layers/feeds/server/utils/content-adapter.ts +3 -2
  42. package/layers/forms/app/components/Form/Field.vue +4 -4
  43. package/layers/forms/app/types/index.ts +1 -0
  44. package/layers/forms/package.json +2 -1
  45. package/layers/layout/app/components/Layout/Grid/Item.vue +33 -19
  46. package/layers/layout/app/components/Layout/Page/Container.vue +11 -11
  47. package/layers/layout/app/components/Layout/Page/Header.vue +1 -1
  48. package/layers/layout/app/components/Layout/Page/index.vue +1 -1
  49. package/layers/layout/app/components/Layout/Section/Gallery.vue +6 -1
  50. package/layers/layout/app/components/Layout/Section/Title.vue +1 -1
  51. package/layers/layout/app/types/index.ts +1 -0
  52. package/layers/layout/package.json +2 -1
  53. package/layers/mailer/app/types/index.ts +1 -0
  54. package/layers/mailer/app/types/mailer.ts +25 -0
  55. package/layers/mailer/package.json +2 -1
  56. package/layers/motion/package.json +2 -1
  57. package/layers/navigation/app/components/Links/Group.vue +1 -0
  58. package/layers/navigation/app/components/Links/Named.vue +2 -0
  59. package/layers/navigation/app/types/index.ts +1 -0
  60. package/layers/navigation/package.json +4 -1
  61. package/layers/page-transitions/package.json +4 -1
  62. package/layers/routing/app/types/app-config.d.ts +3 -1
  63. package/layers/routing/app/types/index.ts +1 -0
  64. package/layers/routing/package.json +2 -1
  65. package/layers/scripts/app/composables/useGtm.ts +1 -1
  66. package/layers/scripts/app/types/index.ts +1 -0
  67. package/layers/scripts/app/types/scripts.ts +14 -0
  68. package/layers/scripts/package.json +2 -1
  69. package/layers/scroll/app/components/Motion/ScrollScene.vue +3 -1
  70. package/layers/scroll/app/composables/useScrollSteps.ts +2 -9
  71. package/layers/scroll/app/composables/useSectionProgress.ts +2 -1
  72. package/layers/scroll/app/plugins/locomotive-scroll.client.ts +1 -8
  73. package/layers/scroll/app/types/index.ts +1 -0
  74. package/layers/scroll/app/types/scroll.ts +32 -0
  75. package/layers/scroll/package.json +3 -0
  76. package/layers/seo/package.json +2 -1
  77. package/layers/shader/app/components/Material/Fresnel.client.vue +1 -1
  78. package/layers/shader/app/components/Material/Image.client.vue +1 -1
  79. package/layers/shader/app/components/Material/Node.client.vue +7 -7
  80. package/layers/shader/app/components/Material/Noise.client.vue +1 -1
  81. package/layers/shader/app/components/Node/Color.client.vue +17 -20
  82. package/layers/shader/app/components/Node/Noise.client.vue +31 -34
  83. package/layers/shader/app/components/Pipeline/Aurora.client.vue +4 -8
  84. package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +8 -11
  85. package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +4 -8
  86. package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +6 -2
  87. package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +4 -8
  88. package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +4 -8
  89. package/layers/shader/app/components/Pipeline/Circle.client.vue +5 -8
  90. package/layers/shader/app/components/Pipeline/Clouds.client.vue +4 -8
  91. package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +2 -19
  92. package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +2 -19
  93. package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +5 -9
  94. package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +5 -8
  95. package/layers/shader/app/components/Pipeline/Cross.client.vue +4 -8
  96. package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +3 -7
  97. package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +2 -19
  98. package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +5 -8
  99. package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +5 -8
  100. package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +5 -8
  101. package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +2 -19
  102. package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +4 -8
  103. package/layers/shader/app/components/Pipeline/Dots.client.vue +4 -8
  104. package/layers/shader/app/components/Pipeline/DuoTone.client.vue +5 -9
  105. package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +3 -23
  106. package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +4 -7
  107. package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +4 -7
  108. package/layers/shader/app/components/Pipeline/Flame.client.vue +4 -8
  109. package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +5 -8
  110. package/layers/shader/app/components/Pipeline/GodRays.client.vue +4 -7
  111. package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +4 -8
  112. package/layers/shader/app/components/Pipeline/Grid.client.vue +4 -8
  113. package/layers/shader/app/components/Pipeline/Halation.client.vue +3 -7
  114. package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +2 -19
  115. package/layers/shader/app/components/Pipeline/Haze.client.vue +4 -7
  116. package/layers/shader/app/components/Pipeline/Hexagon.client.vue +4 -8
  117. package/layers/shader/app/components/Pipeline/LensFlare.client.vue +4 -7
  118. package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +2 -19
  119. package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +2 -2
  120. package/layers/shader/app/components/Pipeline/Marble.client.vue +4 -8
  121. package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +3 -7
  122. package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +2 -19
  123. package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +4 -8
  124. package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +4 -8
  125. package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +2 -19
  126. package/layers/shader/app/components/Pipeline/Polygon.client.vue +4 -8
  127. package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +4 -7
  128. package/layers/shader/app/components/Pipeline/Rectangle.client.vue +4 -8
  129. package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +4 -8
  130. package/layers/shader/app/components/Pipeline/Ring.client.vue +4 -8
  131. package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +2 -19
  132. package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +6 -9
  133. package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +2 -19
  134. package/layers/shader/app/components/Pipeline/SplitTone.client.vue +4 -8
  135. package/layers/shader/app/components/Pipeline/Star.client.vue +4 -8
  136. package/layers/shader/app/components/Pipeline/Stripes.client.vue +4 -8
  137. package/layers/shader/app/components/Pipeline/Tint.client.vue +4 -7
  138. package/layers/shader/app/components/Pipeline/Triangle.client.vue +4 -8
  139. package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +4 -8
  140. package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +4 -8
  141. package/layers/shader/app/components/Pipeline/Water.client.vue +5 -8
  142. package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +4 -7
  143. package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +3 -7
  144. package/layers/shader/app/components/Pipeline/Wood.client.vue +4 -8
  145. package/layers/shader/app/components/Preset/Aurora.client.vue +15 -21
  146. package/layers/shader/app/components/Preset/Flow.client.vue +2 -1
  147. package/layers/shader/app/components/Preset/GradientMesh.client.vue +2 -1
  148. package/layers/shader/app/components/Preset/Nebula.client.vue +2 -1
  149. package/layers/shader/app/components/Preset/Ocean.client.vue +2 -1
  150. package/layers/shader/app/components/Preset/ThemeAurora.client.vue +30 -90
  151. package/layers/shader/app/components/Preset/ThemeBubble.client.vue +30 -91
  152. package/layers/shader/app/components/Preset/ThemeFlow.client.vue +30 -90
  153. package/layers/shader/app/components/Preset/ThemeGradient.client.vue +30 -91
  154. package/layers/shader/app/components/Preset/ThemeLavaLamp.client.vue +30 -90
  155. package/layers/shader/app/components/Preset/ThemePlasma.client.vue +30 -90
  156. package/layers/shader/app/components/Preset/ThemeWave.client.vue +30 -90
  157. package/layers/shader/app/components/Shader/Background.client.vue +4 -4
  158. package/layers/shader/app/components/Shader/Host.client.vue +31 -33
  159. package/layers/shader/app/components/Shader/Runtime.client.vue +15 -23
  160. package/layers/shader/app/composables/useAmbientMaterials.ts +53 -51
  161. package/layers/shader/app/composables/useShaderMixBlend.ts +26 -0
  162. package/layers/shader/app/composables/useThemePreset.ts +75 -0
  163. package/layers/shader/app/shaders/common/noise.ts +2 -7
  164. package/layers/shader/app/shaders/types.ts +6 -6
  165. package/layers/shader/app/types/tsl.ts +7 -25
  166. package/layers/shader/app/types/uniforms.ts +2 -1
  167. package/layers/shader/app/utils/tsl/color.ts +7 -1
  168. package/layers/shader/package.json +2 -1
  169. package/layers/theme/app/components/ThemePicker/Colors.vue +1 -3
  170. package/layers/theme/app/types/app-config.d.ts +4 -2
  171. package/layers/theme/app/types/index.ts +1 -0
  172. package/layers/theme/app/types/theme.ts +3 -18
  173. package/layers/theme/package.json +2 -1
  174. package/layers/theme/server/plugins/theme-fouc.ts +1 -1
  175. package/layers/transitions/package.json +4 -1
  176. package/layers/typography/app/components/Typography/CodeBlock.vue +2 -2
  177. package/layers/typography/app/components/Typography/Headline.vue +2 -2
  178. package/layers/typography/app/components/Typography/HeadlineScreen.vue +1 -1
  179. package/layers/typography/app/components/Typography/QuoteBlock.vue +4 -1
  180. package/layers/typography/app/components/Typography/TextStroke.vue +2 -0
  181. package/layers/typography/app/components/Typography/index.vue +36 -27
  182. package/layers/typography/app/composables/typography.ts +27 -21
  183. package/layers/typography/app/types/colors.ts +9 -29
  184. package/layers/typography/app/types/index.ts +2 -0
  185. package/layers/typography/package.json +4 -1
  186. package/layers/ui/package.json +2 -1
  187. package/layers/visual/app/app.config.ts +5 -2
  188. package/layers/visual/app/components/Accent/Blob.vue +20 -20
  189. package/layers/visual/app/components/Accent/Scene.vue +2 -2
  190. package/layers/visual/app/components/Base/Modal.vue +2 -2
  191. package/layers/visual/app/components/Gradient/Background.vue +2 -2
  192. package/layers/visual/app/components/Gradient/Text.vue +2 -2
  193. package/layers/visual/app/components/Media/Picture.vue +3 -1
  194. package/layers/visual/app/components/Progress/Bar.vue +6 -6
  195. package/layers/visual/app/components/Tint/Overlay.vue +14 -14
  196. package/layers/visual/app/composables/accent.ts +10 -8
  197. package/layers/visual/app/composables/tint.ts +7 -7
  198. package/layers/visual/app/types/index.ts +6 -0
  199. package/layers/visual/app/types/media.ts +4 -2
  200. package/layers/visual/app/types/tint.ts +2 -1
  201. package/layers/visual/package.json +4 -1
  202. package/package.json +6 -2
@@ -7,15 +7,15 @@
7
7
  // This provides flexibility while maintaining code readability
8
8
 
9
9
  import type { UniformNode } from 'three/webgpu'
10
+ import type { Vector3 } from 'three'
10
11
 
11
- export type TSLNode = any
12
+ export type { TSLNode } from '../types/tsl'
12
13
 
13
- /**
14
- * Float uniform with full TSL operator support.
15
- * `ReturnType<typeof uniform>` collapses to `UniformNode<unknown, unknown>`,
16
- * which has no operator methods — use this concrete type instead.
17
- */
14
+ /** Float uniform: `uniform(someNumber)` */
18
15
  export type FloatUniform = UniformNode<'float', number>
19
16
 
17
+ /** Vec3 uniform: `uniform(new Vector3(...))` */
18
+ export type Vec3Uniform = UniformNode<'vec3', Vector3>
19
+
20
20
  // Re-export common Three types
21
21
  export type { Color, Texture, Vector2, Vector3, Vector4 } from 'three'
@@ -1,23 +1,11 @@
1
- /**
2
- * TSL Node types
3
- * Using generic types for flexibility across Three.js versions
4
- */
1
+ import type { Node } from 'three/webgpu'
5
2
 
6
- export type TSLNode = any
7
-
8
- export type TSLFloat = any
9
-
10
- export type TSLVec2 = any
11
-
12
- export type TSLVec3 = any
13
-
14
- export type TSLVec4 = any
15
-
16
- export type TSLColor = any
17
-
18
- export type TSLMat3 = any
19
-
20
- export type TSLMat4 = any
3
+ export type TSLNode = Node
4
+ export type TSLVec3 = Node<'vec3'>
5
+ export type TSLVec4 = Node<'vec4'>
6
+ export type TSLColor = Node<'color'>
7
+ export type TSLMat3 = Node<'mat3'>
8
+ export type TSLMat4 = Node<'mat4'>
21
9
 
22
10
  export type GradientStop = {
23
11
  position: number
@@ -31,9 +19,3 @@ export type FBMOptions = {
31
19
  amplitude?: number
32
20
  frequency?: number
33
21
  }
34
-
35
- export type VoronoiResult = {
36
- distance: TSLFloat
37
- cellCenter: TSLVec2
38
- edgeDistance: TSLFloat
39
- }
@@ -1,4 +1,5 @@
1
1
  import type { Color, Matrix3, Matrix4, Texture, Vector2, Vector3, Vector4 } from 'three'
2
+ import type { TSLNode } from './tsl'
2
3
 
3
4
  export type UniformPrimitive = number | boolean | string
4
5
  export type UniformVector = Vector2 | Vector3 | Vector4
@@ -17,5 +18,5 @@ export type UniformValues = Record<string, UniformValue>
17
18
 
18
19
  export type UniformsState<T extends UniformValues> = {
19
20
  values: T
20
- nodes: Record<keyof T, import('./tsl').TSLNode>
21
+ nodes: Record<keyof T, TSLNode>
21
22
  }
@@ -1,8 +1,14 @@
1
- import { abs, clamp, float, Fn, max, min, mix, mod, vec3 } from 'three/tsl'
1
+ import { Color, Vector3 } from 'three'
2
+ import { abs, clamp, float, Fn, max, min, mix, mod, uniform, vec3 } from 'three/tsl'
2
3
 
3
4
  import type { GradientStop, TSLNode } from '../../types'
4
5
  import { circularDistance } from './math'
5
6
 
7
+ export function hexToVec3Uniform(hex: string) {
8
+ const c = new Color(hex)
9
+ return uniform(new Vector3(c.r, c.g, c.b))
10
+ }
11
+
6
12
  /**
7
13
  * Linear gradient with multiple color stops
8
14
  */
@@ -6,7 +6,8 @@
6
6
  "scripts": {
7
7
  "dev": "nuxi dev",
8
8
  "dev:playground": "PLAYGROUND_LAYERS=core,canvas,shader pnpm -F playground dev",
9
- "typecheck": "vue-tsc --noEmit -p ../../tsconfig.typecheck.json"
9
+ "typecheck": "vue-tsc --noEmit -p ../../tsconfig.typecheck.json",
10
+ "lint": "eslint ."
10
11
  },
11
12
  "dependencies": {
12
13
  "@vueuse/core": "catalog:"
@@ -1,10 +1,8 @@
1
1
  <script setup lang="ts">
2
- import type { AccentColor } from '#layers/theme/app/types/theme'
3
-
4
2
  const appConfig = useAppConfig()
5
3
  const { activeAccent, setAccent } = useAccentColor()
6
4
 
7
- const accents = computed(() => ((appConfig as any).themeLayer?.accents as AccentColor[]) ?? [])
5
+ const accents = computed(() => appConfig.themeLayer?.accents ?? [])
8
6
  </script>
9
7
 
10
8
  <template>
@@ -1,8 +1,10 @@
1
+ import type { AccentColor } from './theme'
2
+
1
3
  declare module '@nuxt/schema' {
2
4
  interface AppConfigInput {
3
5
  themeLayer?: {
4
- accents?: Array<import('./theme').AccentColor>
5
- defaultAccent?: import('./theme').AccentColor
6
+ accents?: AccentColor[]
7
+ defaultAccent?: AccentColor
6
8
  }
7
9
  }
8
10
  }
@@ -0,0 +1 @@
1
+ export type * from './theme'
@@ -5,24 +5,9 @@
5
5
  * and the theme preferences interface.
6
6
  */
7
7
 
8
- export type AccentColor =
9
- | 'red'
10
- | 'orange'
11
- | 'amber'
12
- | 'yellow'
13
- | 'lime'
14
- | 'green'
15
- | 'emerald'
16
- | 'teal'
17
- | 'cyan'
18
- | 'sky'
19
- | 'blue'
20
- | 'indigo'
21
- | 'violet'
22
- | 'purple'
23
- | 'fuchsia'
24
- | 'pink'
25
- | 'rose'
8
+ import type { AccentColor } from '#types'
9
+
10
+ export type { AccentColor }
26
11
 
27
12
  export type PreferenceOverride = 'system' | 'on' | 'off'
28
13
 
@@ -9,6 +9,7 @@
9
9
  "dev:prepare": "nuxt prepare .playground",
10
10
  "build": "nuxt build .playground",
11
11
  "generate": "nuxt generate .playground",
12
- "preview": "nuxt preview .playground"
12
+ "preview": "nuxt preview .playground",
13
+ "lint": "eslint ."
13
14
  }
14
15
  }
@@ -150,7 +150,7 @@ const initScript = `(function(){
150
150
  export default defineNitroPlugin((nitroApp) => {
151
151
  nitroApp.hooks.hook('render:html', (html) => {
152
152
  html.head.unshift(
153
- `<style id="theme-accent-css">${accentCSS}</style>` + `<script>${initScript}</script>`
153
+ `<style id="theme-accent-css">${accentCSS}</style><script>${initScript}</script>`
154
154
  )
155
155
  })
156
156
  })
@@ -2,5 +2,8 @@
2
2
  "name": "kmcom-layer-transitions",
3
3
  "version": "0.0.1",
4
4
  "type": "module",
5
- "main": "./nuxt.config.ts"
5
+ "main": "./nuxt.config.ts",
6
+ "scripts": {
7
+ "lint": "eslint ."
8
+ }
6
9
  }
@@ -6,9 +6,9 @@
6
6
  defineOptions({ inheritAttrs: false })
7
7
 
8
8
  const {
9
- language,
9
+ language = undefined,
10
10
  color = 'default',
11
- size,
11
+ size = undefined,
12
12
  class: classProp = '',
13
13
  } = defineProps<{
14
14
  language?: string
@@ -24,8 +24,8 @@
24
24
  tracking = 'tracking-tight',
25
25
  align = 'left',
26
26
  transform = 'none',
27
- color,
28
- size,
27
+ color = undefined,
28
+ size = undefined,
29
29
  class: classProp = '',
30
30
  } = defineProps<{
31
31
  level?: 1 | 2 | 3 | 4 | 5 | 6
@@ -25,7 +25,7 @@
25
25
  tracking = 'tracking-tight',
26
26
  align = 'left',
27
27
  transform = 'none',
28
- color,
28
+ color = undefined,
29
29
  class: classProp = '',
30
30
  } = defineProps<{
31
31
  level?: 1 | 2 | 3 | 4 | 5 | 6
@@ -5,7 +5,10 @@
5
5
 
6
6
  defineOptions({ inheritAttrs: false })
7
7
 
8
- const { color, size } = defineProps<{ color?: UiColors; size?: FontSize }>()
8
+ const { color = undefined, size = undefined } = defineProps<{
9
+ color?: UiColors
10
+ size?: FontSize
11
+ }>()
9
12
  const colorClass = useColor(color, 'text')
10
13
  </script>
11
14
 
@@ -1,4 +1,6 @@
1
1
  <script lang="ts" setup>
2
+ defineOptions({ inheritAttrs: false })
3
+
2
4
  const {
3
5
  strokeWidth = 1.5,
4
6
  strokeColor = 'currentColor',
@@ -14,33 +14,42 @@
14
14
  TypographyTag,
15
15
  } from '../../types/typography'
16
16
 
17
- const props = withDefaults(
18
- defineProps<{
19
- tag?: TypographyTag
20
- weight?: FontWeight
21
- width?: FontWidth
22
- slant?: FontSlant
23
- leading?: FontLeading
24
- tracking?: FontTracking
25
- align?: TextAlign
26
- transform?: TextTransform
27
- color?: UiColors
28
- size?: FontSize
29
- }>(),
30
- {
31
- tag: 'p',
32
- weight: 'font-normal',
33
- width: 'font-stretch-normal',
34
- slant: 'normal',
35
- leading: 'leading-normal',
36
- tracking: 'tracking-normal',
37
- align: 'left',
38
- transform: 'none',
39
- size: 'base',
40
- }
41
- )
42
- const { classes } = useTypography(props)
43
- const colorClass = useColor(props.color, 'text')
17
+ defineOptions({ inheritAttrs: false })
18
+
19
+ const {
20
+ tag = 'p',
21
+ weight = 'font-normal',
22
+ width = 'font-stretch-normal',
23
+ slant = 'normal',
24
+ leading = 'leading-normal',
25
+ tracking = 'tracking-normal',
26
+ align = 'left',
27
+ transform = 'none',
28
+ color = undefined,
29
+ size = 'base',
30
+ } = defineProps<{
31
+ tag?: TypographyTag
32
+ weight?: FontWeight
33
+ width?: FontWidth
34
+ slant?: FontSlant
35
+ leading?: FontLeading
36
+ tracking?: FontTracking
37
+ align?: TextAlign
38
+ transform?: TextTransform
39
+ color?: UiColors
40
+ size?: FontSize
41
+ }>()
42
+ const { classes } = useTypography(() => ({
43
+ weight,
44
+ width,
45
+ slant,
46
+ leading,
47
+ tracking,
48
+ align,
49
+ transform,
50
+ size,
51
+ }))
52
+ const colorClass = useColor(color, 'text')
44
53
  </script>
45
54
 
46
55
  <template>
@@ -1,3 +1,6 @@
1
+ import type { MaybeRefOrGetter } from 'vue'
2
+ import { toValue } from 'vue'
3
+
1
4
  import type {
2
5
  FontLeading,
3
6
  FontSize,
@@ -35,50 +38,53 @@ function getSizeClass(size: FontSize | undefined): string {
35
38
  return typeof size === 'number' ? `text-[${size}]` : `text-${size}`
36
39
  }
37
40
 
38
- export function useTypography(props: {
39
- weight?: FontWeight
40
- slant?: FontSlant
41
- width?: FontWidth
42
- leading?: FontLeading
43
- tracking?: FontTracking
44
- align?: TextAlign
45
- transform?: TextTransform
46
- size?: FontSize
47
- }) {
48
- const classes = computed(() =>
49
- [
50
- normalizeAxis(props.weight, {
41
+ export function useTypography(
42
+ props: MaybeRefOrGetter<{
43
+ weight?: FontWeight
44
+ slant?: FontSlant
45
+ width?: FontWidth
46
+ leading?: FontLeading
47
+ tracking?: FontTracking
48
+ align?: TextAlign
49
+ transform?: TextTransform
50
+ size?: FontSize
51
+ }>
52
+ ) {
53
+ const classes = computed(() => {
54
+ const p = toValue(props)
55
+ return [
56
+ normalizeAxis(p.weight, {
51
57
  prefix: 'font',
52
58
  fallback: 'font-normal',
53
59
  }),
54
60
 
55
- normalizeAxis(props.width, {
61
+ normalizeAxis(p.width, {
56
62
  numericFormatter: (v) => `font-stretch-[${v}%]`,
57
63
  }),
58
64
 
59
- normalizeAxis(props.slant, {
65
+ normalizeAxis(p.slant, {
60
66
  fallback: 'not-italic',
61
67
  }),
62
68
 
63
- normalizeAxis(props.leading, {
69
+ normalizeAxis(p.leading, {
64
70
  prefix: 'leading',
65
71
  fallback: 'leading-normal',
66
72
  }),
67
73
 
68
- normalizeAxis(props.tracking, {
74
+ normalizeAxis(p.tracking, {
69
75
  prefix: 'tracking',
70
76
  fallback: 'tracking-normal',
71
77
  }),
72
78
 
73
- getSizeClass(props.size),
79
+ getSizeClass(p.size),
74
80
 
75
- props.align ? `text-${props.align}` : '',
81
+ p.align ? `text-${p.align}` : '',
76
82
 
77
- props.transform && props.transform !== 'none' ? props.transform : '',
83
+ p.transform && p.transform !== 'none' ? p.transform : '',
78
84
  ]
79
85
  .filter(Boolean)
80
86
  .join(' ')
81
- )
87
+ })
82
88
 
83
89
  return { classes }
84
90
  }
@@ -1,29 +1,9 @@
1
- /***************************************************************
2
- UI Primitives - Semantic Color Types
3
-
4
- `UiSemanticColor` defines neutral or semantic colors for general UI elements.
5
- `UiStatusColor` defines status-related colors (info, success, warning, error).
6
- `UiCustomColors` defines custom design colors like accent or secondary.
7
- `UiBaseColor` defines fundamental colors (black, white).
8
- `UiColors` is the union of all color types and can be applied to text, backgrounds, borders, or other UI elements.
9
- `ColorUsage` defines the intended usage of a color in a component.
10
- ***************************************************************/
11
-
12
- export type ColorUsage = 'text' | 'bg' | 'border'
13
-
14
- export type UiSemanticColor = 'dimmed' | 'muted' | 'toned' | 'default' | 'highlighted' | 'inverted'
15
-
16
- export type UiStatusColor = 'info' | 'success' | 'warning' | 'error'
17
-
18
- export type UiDefaultNuxtUiColors = 'primary' | 'neutral'
19
-
20
- export type UiCustomColors = 'secondary' | 'accent'
21
-
22
- export type UiBaseColor = 'black' | 'white'
23
-
24
- export type UiColors =
25
- | UiSemanticColor
26
- | UiStatusColor
27
- | UiDefaultNuxtUiColors
28
- | UiCustomColors
29
- | UiBaseColor
1
+ export type {
2
+ ColorUsage,
3
+ UiSemanticColor,
4
+ UiStatusColor,
5
+ UiDefaultNuxtUiColors,
6
+ UiCustomColors,
7
+ UiBaseColor,
8
+ UiColors,
9
+ } from '#types'
@@ -0,0 +1,2 @@
1
+ export type * from './colors'
2
+ export type * from './typography'
@@ -2,5 +2,8 @@
2
2
  "name": "kmcom-layer-typography",
3
3
  "version": "0.0.1",
4
4
  "type": "module",
5
- "main": "./nuxt.config.ts"
5
+ "main": "./nuxt.config.ts",
6
+ "scripts": {
7
+ "lint": "eslint ."
8
+ }
6
9
  }
@@ -10,6 +10,7 @@
10
10
  "dev:prepare": "nuxt prepare .playground",
11
11
  "build": "UI_STANDALONE=true nuxi build",
12
12
  "generate": "UI_STANDALONE=true nuxi generate",
13
- "preview": "nuxt preview .playground"
13
+ "preview": "nuxt preview .playground",
14
+ "lint": "eslint ."
14
15
  }
15
16
  }
@@ -1,3 +1,6 @@
1
+ import type { GradientConfig } from './types/gradient'
2
+ import type { AccentSceneConfig } from './types/accent'
3
+
1
4
  export default defineAppConfig({
2
5
  uiLayer: {
3
6
  gradients: {
@@ -107,8 +110,8 @@ declare module '@nuxt/schema' {
107
110
  interface AppConfigInput {
108
111
  uiLayer?: {
109
112
  name?: string
110
- gradients?: Record<string, import('./types/gradient').GradientConfig>
111
- accentScenes?: Record<string, import('./types/accent').AccentSceneConfig>
113
+ gradients?: Record<string, GradientConfig>
114
+ accentScenes?: Record<string, AccentSceneConfig>
112
115
  }
113
116
  }
114
117
  }
@@ -1,27 +1,27 @@
1
1
  <script setup lang="ts">
2
2
  import type { AccentBlobColor, BlobBlur } from '../../types/accent'
3
3
 
4
- const props = withDefaults(
5
- defineProps<{
6
- x: number
7
- y: number
8
- size?: string
9
- blur?: BlobBlur
10
- opacity?: number
11
- color?: AccentBlobColor
12
- shade?: 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950
13
- customColor?: string
14
- }>(),
15
- {
16
- size: '40rem',
17
- blur: '3xl',
18
- opacity: 25,
19
- color: 'primary',
20
- shade: 500,
21
- }
22
- )
4
+ const {
5
+ x,
6
+ y,
7
+ size = '40rem',
8
+ blur = '3xl',
9
+ opacity = 25,
10
+ color = 'primary',
11
+ shade = 500,
12
+ customColor = undefined,
13
+ } = defineProps<{
14
+ x: number
15
+ y: number
16
+ size?: string
17
+ blur?: BlobBlur
18
+ opacity?: number
19
+ color?: AccentBlobColor
20
+ shade?: 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950
21
+ customColor?: string
22
+ }>()
23
23
 
24
- const { style } = useAccentBlob(props)
24
+ const { style } = useAccentBlob(() => ({ x, y, size, blur, opacity, color, shade, customColor }))
25
25
  </script>
26
26
 
27
27
  <template>
@@ -2,8 +2,8 @@
2
2
  import type { AccentSceneConfig, BlobConfig } from '../../types/accent'
3
3
 
4
4
  const {
5
- preset,
6
- blobs,
5
+ preset = undefined,
6
+ blobs = undefined,
7
7
  tag = 'div',
8
8
  } = defineProps<{
9
9
  preset?: string
@@ -16,8 +16,8 @@
16
16
  */
17
17
  const {
18
18
  open = false,
19
- title,
20
- description,
19
+ title = undefined,
20
+ description = undefined,
21
21
  size = 'md',
22
22
  } = defineProps<{
23
23
  open?: boolean
@@ -2,8 +2,8 @@
2
2
  import type { GradientConfig } from '../../types/gradient'
3
3
 
4
4
  const {
5
- preset,
6
- config,
5
+ preset = undefined,
6
+ config = undefined,
7
7
  tag = 'div',
8
8
  } = defineProps<{
9
9
  preset?: string
@@ -2,8 +2,8 @@
2
2
  import type { GradientConfig } from '../../types/gradient'
3
3
 
4
4
  const {
5
- preset,
6
- config,
5
+ preset = undefined,
6
+ config = undefined,
7
7
  tag = 'span',
8
8
  } = defineProps<{
9
9
  preset?: string
@@ -2,6 +2,8 @@
2
2
  import { usePicture } from '../../composables/picture'
3
3
  import type { PictureProps } from '../../types/media'
4
4
 
5
+ defineOptions({ inheritAttrs: false })
6
+
5
7
  const {
6
8
  src,
7
9
  alt,
@@ -40,7 +42,7 @@
40
42
  :loading
41
43
  :fetchpriority
42
44
  :decoding
43
- :provider="(provider as any)"
45
+ :provider="provider as any"
44
46
  :preset
45
47
  :densities
46
48
  :class="wrapperClass"
@@ -1,12 +1,12 @@
1
1
  <script setup lang="ts">
2
2
  const {
3
3
  progress = null,
4
- color,
5
- size,
6
- orientation,
7
- status,
8
- animation,
9
- inverted,
4
+ color = undefined,
5
+ size = undefined,
6
+ orientation = undefined,
7
+ status = undefined,
8
+ animation = undefined,
9
+ inverted = undefined,
10
10
  } = defineProps<{
11
11
  progress?: number | null
12
12
  color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral'