kmcom-nuxt-layers 2.2.6 → 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 -2
- package/layers/animations/app/components/Motion/Magnetic.vue +1 -2
- package/layers/animations/app/components/Motion/Marquee.vue +2 -5
- package/layers/animations/app/components/Motion/MarqueeText.vue +1 -2
- package/layers/animations/app/components/Motion/Tilt.vue +1 -2
- package/layers/animations/app/composables/useCountUp.ts +4 -1
- package/layers/animations/app/composables/useMagneticElement.ts +1 -3
- package/layers/animations/app/composables/useMarqueeCopies.ts +3 -3
- 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/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/types/index.ts +1 -0
- package/layers/content/package.json +2 -1
- package/layers/core/app/composables/useErrorLog.ts +9 -11
- 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 +1 -2
- 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/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/package.json +4 -1
- 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 +1 -8
- 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/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/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/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
|
@@ -14,33 +14,42 @@
|
|
|
14
14
|
TypographyTag,
|
|
15
15
|
} from '../../types/typography'
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
const { classes } = useTypography(
|
|
43
|
-
|
|
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(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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(
|
|
61
|
+
normalizeAxis(p.width, {
|
|
56
62
|
numericFormatter: (v) => `font-stretch-[${v}%]`,
|
|
57
63
|
}),
|
|
58
64
|
|
|
59
|
-
normalizeAxis(
|
|
65
|
+
normalizeAxis(p.slant, {
|
|
60
66
|
fallback: 'not-italic',
|
|
61
67
|
}),
|
|
62
68
|
|
|
63
|
-
normalizeAxis(
|
|
69
|
+
normalizeAxis(p.leading, {
|
|
64
70
|
prefix: 'leading',
|
|
65
71
|
fallback: 'leading-normal',
|
|
66
72
|
}),
|
|
67
73
|
|
|
68
|
-
normalizeAxis(
|
|
74
|
+
normalizeAxis(p.tracking, {
|
|
69
75
|
prefix: 'tracking',
|
|
70
76
|
fallback: 'tracking-normal',
|
|
71
77
|
}),
|
|
72
78
|
|
|
73
|
-
getSizeClass(
|
|
79
|
+
getSizeClass(p.size),
|
|
74
80
|
|
|
75
|
-
|
|
81
|
+
p.align ? `text-${p.align}` : '',
|
|
76
82
|
|
|
77
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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'
|
package/layers/ui/package.json
CHANGED
|
@@ -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,
|
|
@@ -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",
|