nuxt-ui-elements 0.1.8 → 0.1.11

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 (27) hide show
  1. package/README.md +36 -30
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +125 -13
  4. package/dist/runtime/components/DialogConfirm.d.vue.ts +49 -0
  5. package/dist/runtime/components/DialogConfirm.vue +170 -0
  6. package/dist/runtime/components/DialogConfirm.vue.d.ts +49 -0
  7. package/dist/runtime/composables/useDialog.d.ts +0 -0
  8. package/dist/runtime/composables/useDialog.js +25 -0
  9. package/dist/runtime/index.css +1 -0
  10. package/dist/runtime/types/tv.d.ts +64 -14
  11. package/package.json +14 -11
  12. package/dist/runtime/components/backgrounds/BackgroundAurora.d.vue.ts +0 -137
  13. package/dist/runtime/components/backgrounds/BackgroundAurora.vue +0 -145
  14. package/dist/runtime/components/backgrounds/BackgroundAurora.vue.d.ts +0 -137
  15. package/dist/runtime/components/backgrounds/BackgroundFlickeringGrid.d.vue.ts +0 -120
  16. package/dist/runtime/components/backgrounds/BackgroundFlickeringGrid.vue +0 -246
  17. package/dist/runtime/components/backgrounds/BackgroundFlickeringGrid.vue.d.ts +0 -120
  18. package/dist/runtime/composables/useColorResolver.d.ts +0 -40
  19. package/dist/runtime/composables/useColorResolver.js +0 -68
  20. package/dist/runtime/composables/useGradient.d.ts +0 -23
  21. package/dist/runtime/composables/useGradient.js +0 -37
  22. package/dist/runtime/composables/useThemeColors.d.ts +0 -69
  23. package/dist/runtime/composables/useThemeColors.js +0 -94
  24. package/dist/runtime/plugin.d.ts +0 -2
  25. package/dist/runtime/plugin.js +0 -4
  26. package/dist/runtime/themes/background-flickering-grid.d.ts +0 -7
  27. package/dist/runtime/themes/background-flickering-grid.js +0 -6
@@ -1,94 +0,0 @@
1
- import { converter, parse, formatCss } from "culori";
2
- const toOklch = converter("oklch");
3
- const toRgb = converter("rgb");
4
- export function parseOklch(oklchStr) {
5
- const parsed = parse(oklchStr);
6
- if (!parsed) return null;
7
- const oklch = toOklch(parsed);
8
- if (!oklch) return null;
9
- return {
10
- l: (oklch.l ?? 0) * 100,
11
- // Convert 0-1 to 0-100%
12
- c: oklch.c ?? 0,
13
- h: oklch.h ?? 0
14
- };
15
- }
16
- export function createOklch(l, c, h) {
17
- return formatCss({ mode: "oklch", l: l / 100, c, h });
18
- }
19
- export function adjustLightness(colorStr, targetLightness) {
20
- const parsed = parse(colorStr);
21
- if (!parsed) return colorStr;
22
- const oklch = toOklch(parsed);
23
- if (!oklch) return colorStr;
24
- oklch.l = targetLightness / 100;
25
- return formatCss(oklch);
26
- }
27
- export function darkenColor(colorStr, amount = 10) {
28
- const parsed = parse(colorStr);
29
- if (!parsed) return colorStr;
30
- const oklch = toOklch(parsed);
31
- if (!oklch || oklch.l === void 0) return colorStr;
32
- const currentLightness = oklch.l * 100;
33
- const newLightness = Math.max(0, currentLightness - amount);
34
- oklch.l = newLightness / 100;
35
- return formatCss(oklch);
36
- }
37
- export function adjustChroma(colorStr, targetChroma) {
38
- const parsed = parse(colorStr);
39
- if (!parsed) return colorStr;
40
- const oklch = toOklch(parsed);
41
- if (!oklch) return colorStr;
42
- oklch.c = targetChroma;
43
- return formatCss(oklch);
44
- }
45
- export function adjustHue(colorStr, targetHue) {
46
- const parsed = parse(colorStr);
47
- if (!parsed) return colorStr;
48
- const oklch = toOklch(parsed);
49
- if (!oklch) return colorStr;
50
- oklch.h = targetHue;
51
- return formatCss(oklch);
52
- }
53
- export function adjustOklch(colorStr, adjustments) {
54
- const parsed = parse(colorStr);
55
- if (!parsed) return colorStr;
56
- const oklch = toOklch(parsed);
57
- if (!oklch) return colorStr;
58
- if (adjustments.l !== void 0) oklch.l = adjustments.l / 100;
59
- if (adjustments.c !== void 0) oklch.c = adjustments.c;
60
- if (adjustments.h !== void 0) oklch.h = adjustments.h;
61
- return formatCss(oklch);
62
- }
63
- export function oklchToRgb(colorString) {
64
- const parsed = parse(colorString);
65
- if (!parsed) return "rgb(255, 255, 255)";
66
- const rgb = toRgb(parsed);
67
- if (!rgb) return "rgb(255, 255, 255)";
68
- const r = Math.max(0, Math.min(255, Math.round((rgb.r ?? 0) * 255)));
69
- const g = Math.max(0, Math.min(255, Math.round((rgb.g ?? 0) * 255)));
70
- const b = Math.max(0, Math.min(255, Math.round((rgb.b ?? 0) * 255)));
71
- const a = rgb.alpha ?? 1;
72
- return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
73
- }
74
- export function getThemeColor(colorName, shade = 500) {
75
- if (typeof document === "undefined") return "oklch(50% 0 0)";
76
- const styles = getComputedStyle(document.documentElement);
77
- const colorValue = styles.getPropertyValue(`--ui-color-${colorName}-${shade}`).trim();
78
- return colorValue || "oklch(50% 0 0)";
79
- }
80
- export function getColorShades(colorName, lightnessValues) {
81
- const baseColor = getThemeColor(colorName, 500);
82
- return lightnessValues.map((lightness) => adjustLightness(baseColor, lightness));
83
- }
84
- export function getColorShadesRgb(colorName, lightnessValues) {
85
- const shades = getColorShades(colorName, lightnessValues);
86
- return shades.map(oklchToRgb);
87
- }
88
- export function createColorPalette(colorName, adjustments) {
89
- const baseColor = getThemeColor(colorName, 500);
90
- return adjustments.map((adj) => {
91
- const adjusted = adjustOklch(baseColor, adj);
92
- return oklchToRgb(adjusted);
93
- });
94
- }
@@ -1,2 +0,0 @@
1
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- import { defineNuxtPlugin } from "#app";
2
- export default defineNuxtPlugin((_nuxtApp) => {
3
- console.log("Plugin injected by my-module!");
4
- });
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- slots: {
3
- base: string;
4
- canvas: string;
5
- };
6
- };
7
- export default _default;
@@ -1,6 +0,0 @@
1
- export default {
2
- slots: {
3
- base: "w-full h-full absolute inset-0",
4
- canvas: "w-full h-full block pointer-events-none"
5
- }
6
- };