kmcom-nuxt-layers 2.2.5 → 2.2.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/docs/FEEDS.md +197 -0
- package/docs/LAYERS-FIXES.md +101 -0
- package/docs/MIGRATION.md +627 -0
- package/docs/feed-layer.md +374 -0
- package/docs/patch-picture-provider-type.md +52 -0
- package/docs/shaderGuide.md +2071 -0
- package/docs/types-architecture.md +234 -0
- package/layers/animations/app/components/Motion/CountUp.vue +1 -1
- package/layers/animations/app/components/Motion/Magnetic.vue +1 -1
- package/layers/animations/app/components/Motion/Marquee.vue +3 -2
- package/layers/animations/app/components/Motion/MarqueeText.vue +3 -2
- package/layers/animations/app/components/Motion/Tilt.vue +1 -1
- package/layers/animations/app/composables/useCountUp.ts +4 -1
- package/layers/animations/app/composables/useMagneticElement.ts +2 -4
- package/layers/animations/app/composables/useMarqueeCopies.ts +4 -4
- package/layers/animations/app/composables/useTiltEffect.ts +1 -1
- package/layers/animations/app/types/animations.ts +8 -0
- package/layers/animations/app/types/index.ts +1 -0
- package/layers/animations/package.json +4 -1
- package/layers/canvas/app/components/ShaderCanvas.vue +4 -4
- package/layers/canvas/app/composables/useRendererCapabilities.ts +19 -15
- package/layers/canvas/app/types/index.ts +1 -0
- package/layers/canvas/package.json +2 -1
- package/layers/canvas/tsconfig.json +2 -1
- package/layers/content/app/components/Blog/Card.vue +5 -5
- package/layers/content/app/components/Gallery/AmbientImage.vue +3 -3
- package/layers/content/app/components/Gallery/Card.vue +3 -3
- package/layers/content/app/components/Gallery/Lightbox.vue +5 -1
- package/layers/content/app/components/NuxtContent/Detail.vue +5 -1
- package/layers/content/app/components/NuxtContent/Surround.vue +5 -3
- package/layers/content/app/components/NuxtContent/Toc.vue +1 -1
- package/layers/content/app/components/Portfolio/Card.vue +5 -5
- package/layers/content/app/components/content/Figure.vue +3 -3
- package/layers/content/app/composables/useBlogPosts.ts +2 -2
- package/layers/content/app/composables/useCollectionItem.ts +1 -3
- package/layers/content/app/composables/useGalleryItems.ts +2 -2
- package/layers/content/app/types/index.ts +1 -0
- package/layers/content/package.json +2 -1
- package/layers/core/app/composables/useCache.ts +0 -1
- package/layers/core/app/composables/useErrorLog.ts +9 -11
- package/layers/core/app/plugins/error-handler.ts +36 -36
- package/layers/core/app/plugins/feature-detection.client.ts +15 -15
- package/layers/core/app/plugins/init.ts +121 -129
- package/layers/core/app/plugins/loading.client.ts +27 -27
- package/layers/core/app/plugins/scroll-guard.client.ts +26 -26
- package/layers/core/app/utils/helpers.ts +14 -12
- package/layers/core/nuxt.config.ts +1 -0
- package/layers/feeds/app/plugins/feed-head.ts +62 -63
- package/layers/feeds/package.json +2 -1
- package/layers/feeds/server/routes/feed/discovery.get.ts +1 -2
- package/layers/feeds/server/utils/content-adapter.ts +3 -2
- package/layers/forms/app/components/Form/Field.vue +4 -4
- package/layers/forms/app/types/index.ts +1 -0
- package/layers/forms/package.json +2 -1
- package/layers/forms/server/api/contact.post.ts +1 -1
- package/layers/layout/app/components/Layout/Grid/Item.vue +33 -19
- package/layers/layout/app/components/Layout/Page/Container.vue +11 -11
- package/layers/layout/app/components/Layout/Page/Header.vue +1 -1
- package/layers/layout/app/components/Layout/Page/index.vue +1 -1
- package/layers/layout/app/components/Layout/Section/Gallery.vue +6 -1
- package/layers/layout/app/components/Layout/Section/Title.vue +1 -1
- package/layers/layout/app/types/index.ts +1 -0
- package/layers/layout/package.json +2 -1
- package/layers/mailer/app/types/index.ts +1 -0
- package/layers/mailer/app/types/mailer.ts +25 -0
- package/layers/mailer/package.json +2 -1
- package/layers/motion/package.json +2 -1
- package/layers/navigation/app/components/Links/Group.vue +1 -0
- package/layers/navigation/app/components/Links/Named.vue +2 -0
- package/layers/navigation/app/types/index.ts +1 -0
- package/layers/navigation/package.json +4 -1
- package/layers/page-transitions/app/plugins/page-transitions.client.ts +9 -9
- package/layers/page-transitions/package.json +4 -1
- package/layers/routing/app/plugins/feature-flags.client.ts +9 -9
- package/layers/routing/app/types/app-config.d.ts +3 -1
- package/layers/routing/app/types/index.ts +1 -0
- package/layers/routing/package.json +2 -1
- package/layers/scripts/app/composables/useGtm.ts +1 -1
- package/layers/scripts/app/types/index.ts +1 -0
- package/layers/scripts/app/types/scripts.ts +14 -0
- package/layers/scripts/package.json +2 -1
- package/layers/scroll/app/components/Motion/ScrollScene.vue +3 -1
- package/layers/scroll/app/composables/useScrollSteps.ts +2 -9
- package/layers/scroll/app/composables/useSectionProgress.ts +2 -1
- package/layers/scroll/app/plugins/locomotive-scroll.client.ts +54 -61
- package/layers/scroll/app/types/index.ts +1 -0
- package/layers/scroll/app/types/scroll.ts +32 -0
- package/layers/scroll/package.json +3 -0
- package/layers/seo/package.json +2 -1
- package/layers/shader/app/components/Material/Fresnel.client.vue +1 -1
- package/layers/shader/app/components/Material/Image.client.vue +1 -1
- package/layers/shader/app/components/Material/Node.client.vue +7 -7
- package/layers/shader/app/components/Material/Noise.client.vue +1 -1
- package/layers/shader/app/components/Node/Color.client.vue +17 -20
- package/layers/shader/app/components/Node/Noise.client.vue +31 -34
- package/layers/shader/app/components/Pipeline/Aurora.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +8 -11
- package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +6 -2
- package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Circle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Clouds.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Cross.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Dots.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/DuoTone.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +3 -23
- package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Flame.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/GodRays.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Grid.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Halation.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Haze.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Hexagon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/LensFlare.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +2 -2
- package/layers/shader/app/components/Pipeline/Marble.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Polygon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Rectangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Ring.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +6 -9
- package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SplitTone.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Star.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Stripes.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Tint.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Triangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Water.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/Wood.client.vue +4 -8
- package/layers/shader/app/components/Preset/Aurora.client.vue +15 -21
- package/layers/shader/app/components/Preset/Flow.client.vue +2 -1
- package/layers/shader/app/components/Preset/GradientMesh.client.vue +2 -1
- package/layers/shader/app/components/Preset/Nebula.client.vue +2 -1
- package/layers/shader/app/components/Preset/Ocean.client.vue +2 -1
- package/layers/shader/app/components/Preset/ThemeAurora.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeBubble.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeFlow.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeGradient.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeLavaLamp.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemePlasma.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeWave.client.vue +30 -90
- package/layers/shader/app/components/Shader/Background.client.vue +4 -4
- package/layers/shader/app/components/Shader/Host.client.vue +31 -33
- package/layers/shader/app/components/Shader/Runtime.client.vue +15 -23
- package/layers/shader/app/composables/useAmbientMaterials.ts +53 -51
- package/layers/shader/app/composables/useShaderMixBlend.ts +26 -0
- package/layers/shader/app/composables/useThemePreset.ts +75 -0
- package/layers/shader/app/plugins/shader.client.ts +21 -21
- package/layers/shader/app/shaders/common/noise.ts +2 -7
- package/layers/shader/app/shaders/types.ts +6 -6
- package/layers/shader/app/types/tsl.ts +7 -25
- package/layers/shader/app/types/uniforms.ts +2 -1
- package/layers/shader/app/utils/tsl/color.ts +7 -1
- package/layers/shader/package.json +2 -1
- package/layers/theme/app/components/ThemePicker/Colors.vue +1 -3
- package/layers/theme/app/plugins/theme.client.ts +54 -51
- package/layers/theme/app/types/app-config.d.ts +4 -2
- package/layers/theme/app/types/index.ts +1 -0
- package/layers/theme/app/types/theme.ts +3 -18
- package/layers/theme/package.json +2 -1
- package/layers/theme/server/plugins/theme-fouc.ts +1 -1
- package/layers/transitions/package.json +4 -1
- package/layers/typography/app/components/Typography/CodeBlock.vue +2 -2
- package/layers/typography/app/components/Typography/Headline.vue +2 -2
- package/layers/typography/app/components/Typography/HeadlineScreen.vue +1 -1
- package/layers/typography/app/components/Typography/QuoteBlock.vue +4 -1
- package/layers/typography/app/components/Typography/TextStroke.vue +2 -0
- package/layers/typography/app/components/Typography/index.vue +36 -27
- package/layers/typography/app/composables/typography.ts +27 -21
- package/layers/typography/app/types/colors.ts +9 -29
- package/layers/typography/app/types/index.ts +2 -0
- package/layers/typography/package.json +4 -1
- package/layers/ui/package.json +2 -1
- package/layers/visual/app/app.config.ts +5 -2
- package/layers/visual/app/components/Accent/Blob.vue +20 -20
- package/layers/visual/app/components/Accent/Scene.vue +2 -2
- package/layers/visual/app/components/Base/Modal.vue +2 -2
- package/layers/visual/app/components/Gradient/Background.vue +2 -2
- package/layers/visual/app/components/Gradient/Text.vue +2 -2
- package/layers/visual/app/components/Media/Picture.vue +3 -1
- package/layers/visual/app/components/Progress/Bar.vue +6 -6
- package/layers/visual/app/components/Tint/Overlay.vue +14 -14
- package/layers/visual/app/composables/accent.ts +10 -8
- package/layers/visual/app/composables/gradient.ts +2 -3
- package/layers/visual/app/composables/tint.ts +7 -7
- package/layers/visual/app/types/index.ts +6 -0
- package/layers/visual/app/types/media.ts +4 -2
- package/layers/visual/app/types/tint.ts +2 -1
- package/layers/visual/package.json +4 -1
- package/package.json +5 -2
|
@@ -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,
|
|
111
|
-
accentScenes?: Record<string,
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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(
|
|
24
|
+
const { style } = useAccentBlob(() => ({ x, y, size, blur, opacity, color, shade, customColor }))
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<template>
|
|
@@ -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="
|
|
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'
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { ColorShade
|
|
2
|
+
import type { ColorShade } from '../../types/gradient'
|
|
3
|
+
import type { TintColorSlot, TintLevel } from '../../types/tint'
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
5
|
+
const {
|
|
6
|
+
color,
|
|
7
|
+
level,
|
|
8
|
+
shade = 500,
|
|
9
|
+
tag = 'div',
|
|
10
|
+
} = defineProps<{
|
|
11
|
+
color: TintColorSlot
|
|
12
|
+
level: TintLevel
|
|
13
|
+
shade?: ColorShade
|
|
14
|
+
tag?: string
|
|
15
|
+
}>()
|
|
16
16
|
|
|
17
|
-
const { style } = useTint(
|
|
17
|
+
const { style } = useTint(() => ({ color, level, shade }))
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ComputedRef, CSSProperties } from 'vue'
|
|
1
|
+
import type { ComputedRef, CSSProperties, MaybeRefOrGetter } from 'vue'
|
|
2
|
+
import { toValue } from 'vue'
|
|
2
3
|
|
|
3
4
|
import type { BlobBlur, BlobConfig } from '../types/accent'
|
|
4
5
|
|
|
@@ -25,22 +26,23 @@ function resolveColor(config: BlobConfig): string {
|
|
|
25
26
|
return `var(--ui-color-${color}-${shade})`
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
export function useAccentBlob(config: BlobConfig): {
|
|
29
|
+
export function useAccentBlob(config: MaybeRefOrGetter<BlobConfig>): {
|
|
29
30
|
style: ComputedRef<CSSProperties>
|
|
30
31
|
} {
|
|
31
32
|
const style = computed((): CSSProperties => {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
33
|
+
const resolved = toValue(config)
|
|
34
|
+
const size = resolved.size ?? '40rem'
|
|
35
|
+
const opacity = (resolved.opacity ?? 25) / 100
|
|
36
|
+
const blurPx = resolveBlurPx(resolved.blur)
|
|
35
37
|
|
|
36
38
|
return {
|
|
37
39
|
position: 'absolute',
|
|
38
|
-
left: `${
|
|
39
|
-
top: `${
|
|
40
|
+
left: `${resolved.x}%`,
|
|
41
|
+
top: `${resolved.y}%`,
|
|
40
42
|
transform: 'translate(-50%, -50%)',
|
|
41
43
|
width: size,
|
|
42
44
|
height: size,
|
|
43
|
-
backgroundColor: resolveColor(
|
|
45
|
+
backgroundColor: resolveColor(resolved),
|
|
44
46
|
opacity,
|
|
45
47
|
borderRadius: '9999px',
|
|
46
48
|
filter: blurPx > 0 ? `blur(${blurPx}px)` : undefined,
|
|
@@ -62,9 +62,8 @@ export function useGradient(
|
|
|
62
62
|
const presets = (appConfig.uiLayer as Record<string, unknown> | undefined)?.['gradients'] as
|
|
63
63
|
| Record<string, GradientConfig>
|
|
64
64
|
| undefined
|
|
65
|
-
let resolved: GradientConfig =
|
|
66
|
-
? (presets?.[raw] ?? DEFAULT_CONFIG)
|
|
67
|
-
: raw
|
|
65
|
+
let resolved: GradientConfig =
|
|
66
|
+
typeof raw === 'string' ? (presets?.[raw] ?? DEFAULT_CONFIG) : raw
|
|
68
67
|
|
|
69
68
|
if (override) {
|
|
70
69
|
resolved = { ...resolved, ...override }
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { ComputedRef, CSSProperties } from 'vue'
|
|
1
|
+
import type { ComputedRef, CSSProperties, MaybeRefOrGetter } from 'vue'
|
|
2
|
+
import { toValue } from 'vue'
|
|
2
3
|
|
|
3
4
|
import { TINT_LEVEL_OPACITY, type TintConfig } from '../types/tint'
|
|
4
5
|
|
|
5
|
-
export function useTint(config: TintConfig): {
|
|
6
|
+
export function useTint(config: MaybeRefOrGetter<TintConfig>): {
|
|
6
7
|
style: ComputedRef<CSSProperties>
|
|
7
8
|
} {
|
|
8
9
|
const style = computed((): CSSProperties => {
|
|
9
|
-
const { color, shade = 500 } = config
|
|
10
|
-
let backgroundColor
|
|
10
|
+
const { color, shade = 500, level } = toValue(config)
|
|
11
|
+
let backgroundColor = `var(--ui-color-${color}-${shade})`
|
|
11
12
|
if (color === 'white') backgroundColor = '#ffffff'
|
|
12
|
-
|
|
13
|
-
else backgroundColor = `var(--ui-color-${color}-${shade})`
|
|
13
|
+
if (color === 'black') backgroundColor = '#000000'
|
|
14
14
|
|
|
15
|
-
const opacity = TINT_LEVEL_OPACITY[
|
|
15
|
+
const opacity = TINT_LEVEL_OPACITY[level] / 100
|
|
16
16
|
return { backgroundColor, opacity }
|
|
17
17
|
})
|
|
18
18
|
|
|
@@ -174,12 +174,14 @@ export type PictureProps = {
|
|
|
174
174
|
decoding?: 'sync' | 'async' | 'auto'
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
import type { ComputedRef } from 'vue'
|
|
178
|
+
|
|
177
179
|
/**
|
|
178
180
|
* Return type for usePicture composable
|
|
179
181
|
*/
|
|
180
182
|
export type UsePictureReturn = {
|
|
181
183
|
/** Computed sizes attribute string */
|
|
182
|
-
sizesString:
|
|
184
|
+
sizesString: ComputedRef<string>
|
|
183
185
|
/** Computed format string */
|
|
184
|
-
computedFormat:
|
|
186
|
+
computedFormat: ComputedRef<string>
|
|
185
187
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ColorShade } from './gradient'
|
|
2
|
+
|
|
1
3
|
export type TintLevel = 'subtle' | 'light' | 'medium' | 'strong' | 'heavy'
|
|
2
4
|
export type TintColorSlot =
|
|
3
5
|
| 'primary'
|
|
@@ -8,7 +10,6 @@ export type TintColorSlot =
|
|
|
8
10
|
| 'error'
|
|
9
11
|
| 'white'
|
|
10
12
|
| 'black'
|
|
11
|
-
export type ColorShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950
|
|
12
13
|
|
|
13
14
|
export const TINT_LEVEL_OPACITY: Record<TintLevel, number> = {
|
|
14
15
|
subtle: 5,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kmcom-nuxt-layers",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.8",
|
|
5
5
|
"description": "Composable Nuxt 4 layers for building scalable Vue applications",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./layers/core": "./layers/core/nuxt.config.ts",
|
|
@@ -150,8 +150,10 @@
|
|
|
150
150
|
"@vueuse/core": "^14.3.0",
|
|
151
151
|
"@vueuse/nuxt": "^14.3.0",
|
|
152
152
|
"@webgpu/glslang": "^0.0.15",
|
|
153
|
+
"@webgpu/types": "^0.1.70",
|
|
153
154
|
"browserslist": "^4.28.2",
|
|
154
155
|
"changesets": "^1.0.2",
|
|
156
|
+
"csstype": "^3.2.3",
|
|
155
157
|
"cypress": "^15.16.0",
|
|
156
158
|
"depcheck": "^1.4.7",
|
|
157
159
|
"eslint": "^10.4.1",
|
|
@@ -183,7 +185,8 @@
|
|
|
183
185
|
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
184
186
|
"stylelint-prettier": "^5.0.3",
|
|
185
187
|
"tailwindcss": "^4.3.0",
|
|
186
|
-
"turbo": "^2.9.
|
|
188
|
+
"turbo": "^2.9.18",
|
|
189
|
+
"type-fest": "^5.7.0",
|
|
187
190
|
"typescript": "^6",
|
|
188
191
|
"vite-plugin-checker": "^0.14.1",
|
|
189
192
|
"vitest": "^4.1.8",
|