rimelight-components 2.1.85 → 2.1.87
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/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/page/PageEditor.vue +3 -3
- package/dist/runtime/components/page/PageRenderer.vue +1 -1
- package/dist/runtime/components/swatches/ColorPalette.vue +103 -34
- package/dist/runtime/components/swatches/ColorSwatch.d.vue.ts +1 -0
- package/dist/runtime/components/swatches/ColorSwatch.vue +4 -3
- package/dist/runtime/components/swatches/ColorSwatch.vue.d.ts +1 -0
- package/dist/runtime/components/swatches/FontPalette.d.vue.ts +18 -0
- package/dist/runtime/components/swatches/FontPalette.vue +289 -0
- package/dist/runtime/components/swatches/FontPalette.vue.d.ts +18 -0
- package/package.json +2 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { readdirSync } from 'node:fs';
|
|
|
4
4
|
import { basename } from 'node:path';
|
|
5
5
|
|
|
6
6
|
const name = "rimelight-components";
|
|
7
|
-
const version = "2.1.
|
|
7
|
+
const version = "2.1.87";
|
|
8
8
|
const homepage = "https://rimelight.com/tools/rimelight-components";
|
|
9
9
|
|
|
10
10
|
const defaultOptions = {
|
|
@@ -56,7 +56,7 @@ const pageEditorStyles = tv({
|
|
|
56
56
|
title: "",
|
|
57
57
|
surroundSkeleton: "grid grid-cols-1 gap-md sm:grid-cols-2",
|
|
58
58
|
skeleton: "h-48 w-full rounded-xl",
|
|
59
|
-
metadata: "flex flex-col gap-xs text-xs text-dimmed p-
|
|
59
|
+
metadata: "flex flex-col gap-xs text-xs text-dimmed p-lg",
|
|
60
60
|
resizer: "relative flex flex-col items-center justify-center w-6 cursor-col-resize group px-1 py-16",
|
|
61
61
|
previewColumn: "h-full overflow-y-auto"
|
|
62
62
|
}
|
|
@@ -286,8 +286,8 @@ const handleTreeNavigate = (slug) => {
|
|
|
286
286
|
</UHeader>
|
|
287
287
|
</RCHeaderLayer>
|
|
288
288
|
|
|
289
|
-
<div
|
|
290
|
-
ref="split-container"
|
|
289
|
+
<div
|
|
290
|
+
ref="split-container"
|
|
291
291
|
:class="splitContainer({ class: rc.splitContainer })"
|
|
292
292
|
:style="{ height: `calc(100vh - ${totalHeight}px)` }"
|
|
293
293
|
>
|
|
@@ -34,7 +34,7 @@ const pageRendererStyles = tv({
|
|
|
34
34
|
title: "",
|
|
35
35
|
surroundSkeleton: "grid grid-cols-1 gap-md sm:grid-cols-2",
|
|
36
36
|
skeleton: "h-48 w-full rounded-xl",
|
|
37
|
-
metadata: "flex flex-col gap-xs text-xs text-dimmed p-
|
|
37
|
+
metadata: "flex flex-col gap-xs text-xs text-dimmed p-lg"
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const {
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
+
import chroma from "chroma-js";
|
|
3
4
|
import ColorSwatch from "./ColorSwatch.vue";
|
|
4
5
|
import { tv } from "../../internal/tv";
|
|
5
|
-
import { useRC } from "../../composables";
|
|
6
|
+
import { useRC, useHeaderStack } from "../../composables";
|
|
6
7
|
const { css = "", rc: rcProp } = defineProps({
|
|
7
8
|
css: { type: String, required: false },
|
|
8
9
|
rc: { type: Object, required: false }
|
|
9
10
|
});
|
|
10
11
|
const { rc } = useRC("ColorPalette", rcProp);
|
|
12
|
+
const { totalHeight } = useHeaderStack();
|
|
13
|
+
const stickyTop = computed(() => `${totalHeight.value + 32}px`);
|
|
11
14
|
const paletteStyles = tv({
|
|
12
15
|
slots: {
|
|
13
|
-
root: "
|
|
14
|
-
section: "flex flex-col gap-6",
|
|
15
|
-
title: "",
|
|
16
|
+
root: "w-full",
|
|
16
17
|
grid: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"
|
|
17
18
|
}
|
|
18
19
|
});
|
|
19
|
-
const { root,
|
|
20
|
-
const
|
|
20
|
+
const { root, grid } = paletteStyles();
|
|
21
|
+
const tabItems = computed(() => {
|
|
21
22
|
if (!css) return [];
|
|
22
|
-
const
|
|
23
|
+
const tabs = [];
|
|
23
24
|
const lines = css.split("\n");
|
|
24
25
|
const stack = [];
|
|
25
26
|
function getFormat(value) {
|
|
@@ -44,13 +45,26 @@ const sections = computed(() => {
|
|
|
44
45
|
if (colorMatch && !line.trim().startsWith("/*")) {
|
|
45
46
|
const fullVarName = colorMatch[1] ?? "";
|
|
46
47
|
const value = colorMatch[2]?.trim() ?? "";
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
const activeStack = stack[0] === "Colors" ? stack.slice(1) : stack;
|
|
49
|
+
const topLevelLabel = activeStack[0] || "Other";
|
|
50
|
+
const subLevelLabel = activeStack.length > 1 ? activeStack.slice(1).join(" \u203A ") : topLevelLabel;
|
|
51
|
+
let tab = tabs.find((t) => t.label === topLevelLabel);
|
|
52
|
+
if (!tab) {
|
|
53
|
+
tab = {
|
|
54
|
+
label: topLevelLabel,
|
|
55
|
+
subsections: []
|
|
56
|
+
};
|
|
57
|
+
tabs.push(tab);
|
|
52
58
|
}
|
|
53
|
-
|
|
59
|
+
let subSection = tab.subsections.find((s) => s.label === subLevelLabel);
|
|
60
|
+
if (!subSection) {
|
|
61
|
+
subSection = {
|
|
62
|
+
label: subLevelLabel,
|
|
63
|
+
swatches: []
|
|
64
|
+
};
|
|
65
|
+
tab.subsections.push(subSection);
|
|
66
|
+
}
|
|
67
|
+
subSection.swatches.push({
|
|
54
68
|
name: getName(fullVarName),
|
|
55
69
|
value,
|
|
56
70
|
format: getFormat(value)
|
|
@@ -60,14 +74,48 @@ const sections = computed(() => {
|
|
|
60
74
|
stack.pop();
|
|
61
75
|
}
|
|
62
76
|
});
|
|
63
|
-
return
|
|
77
|
+
return tabs;
|
|
64
78
|
});
|
|
79
|
+
function parseOklch(str) {
|
|
80
|
+
const match = str.match(/oklch\(([\d.]+%?)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*[\d.]+%?)?\)/);
|
|
81
|
+
if (match) {
|
|
82
|
+
let l = parseFloat(match[1] ?? "0");
|
|
83
|
+
if (match[1]?.endsWith("%")) l /= 100;
|
|
84
|
+
const c = parseFloat(match[2] ?? "0");
|
|
85
|
+
const h = parseFloat(match[3] ?? "0");
|
|
86
|
+
return [l, c, h];
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
65
90
|
function getSwatchProps(swatch) {
|
|
66
91
|
const p = { name: swatch.name };
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
92
|
+
try {
|
|
93
|
+
let color;
|
|
94
|
+
if (swatch.format === "oklch") {
|
|
95
|
+
const oklchValues = parseOklch(swatch.value);
|
|
96
|
+
if (oklchValues) {
|
|
97
|
+
color = chroma.oklch(...oklchValues);
|
|
98
|
+
} else {
|
|
99
|
+
color = chroma(swatch.value);
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
color = chroma(swatch.value);
|
|
103
|
+
}
|
|
104
|
+
p.hex = color.hex();
|
|
105
|
+
p.rgb = color.css();
|
|
106
|
+
p.hsl = color.css("hsl");
|
|
107
|
+
const [l, c, h] = color.oklch();
|
|
108
|
+
p.oklch = `oklch(${Math.round(l * 1e3) / 10}% ${Math.round(c * 1e3) / 1e3} ${Math.round(h * 100) / 100})`;
|
|
109
|
+
const [cy, m, y, k] = color.cmyk();
|
|
110
|
+
p.cmyk = `cmyk(${Math.round(cy * 100)}%, ${Math.round(m * 100)}%, ${Math.round(y * 100)}%, ${Math.round(k * 100)}%)`;
|
|
111
|
+
p.textColor = color.luminance() > 0.45 ? "#000000" : "#FFFFFF";
|
|
112
|
+
} catch (e) {
|
|
113
|
+
if (swatch.format !== "unknown") {
|
|
114
|
+
p[swatch.format] = swatch.value;
|
|
115
|
+
} else {
|
|
116
|
+
p.oklch = swatch.value;
|
|
117
|
+
}
|
|
118
|
+
p.textColor = "#FFFFFF";
|
|
71
119
|
}
|
|
72
120
|
return p;
|
|
73
121
|
}
|
|
@@ -75,22 +123,43 @@ function getSwatchProps(swatch) {
|
|
|
75
123
|
|
|
76
124
|
<template>
|
|
77
125
|
<div :class="root({ class: rc.root })">
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
126
|
+
<UTabs
|
|
127
|
+
:items="tabItems"
|
|
128
|
+
orientation="vertical"
|
|
129
|
+
variant="link"
|
|
130
|
+
:style="{ '--palette-sticky-top': stickyTop }"
|
|
131
|
+
:ui="{
|
|
132
|
+
root: 'flex flex-col md:flex-row gap-12 items-start overflow-visible',
|
|
133
|
+
list: 'md:w-64 shrink-0 md:sticky md:top-[var(--palette-sticky-top)] self-start z-10 overflow-visible',
|
|
134
|
+
content: 'flex-1 min-w-0'
|
|
135
|
+
}"
|
|
82
136
|
>
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
137
|
+
<template #content="{ item }">
|
|
138
|
+
<h2 class="text-3xl font-bold text-highlighted mb-8">
|
|
139
|
+
{{ item.label }}
|
|
140
|
+
</h2>
|
|
141
|
+
<UAccordion
|
|
142
|
+
:items="item.subsections"
|
|
143
|
+
type="multiple"
|
|
144
|
+
class="w-full"
|
|
145
|
+
:ui="{
|
|
146
|
+
item: 'border-b border-default last:border-b-0',
|
|
147
|
+
trigger: 'text-xl font-bold py-4',
|
|
148
|
+
body: 'py-6 px-4'
|
|
149
|
+
}"
|
|
150
|
+
>
|
|
151
|
+
<template #body="{ item: subSection }">
|
|
152
|
+
<div :class="grid({ class: rc.grid })">
|
|
153
|
+
<ColorSwatch
|
|
154
|
+
v-for="swatch in subSection.swatches"
|
|
155
|
+
:key="swatch.name"
|
|
156
|
+
v-bind="getSwatchProps(swatch)"
|
|
157
|
+
:class="rc.swatch"
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
</template>
|
|
161
|
+
</UAccordion>
|
|
162
|
+
</template>
|
|
163
|
+
</UTabs>
|
|
95
164
|
</div>
|
|
96
165
|
</template>
|
|
@@ -4,13 +4,14 @@ import { computed } from "vue";
|
|
|
4
4
|
import { useClipboard } from "@vueuse/core";
|
|
5
5
|
import { tv } from "../../internal/tv";
|
|
6
6
|
import { useRC } from "../../composables";
|
|
7
|
-
const { name, hex, rgb, hsl, oklch, cmyk, rc: rcProp } = defineProps({
|
|
7
|
+
const { name, hex, rgb, hsl, oklch, cmyk, textColor, rc: rcProp } = defineProps({
|
|
8
8
|
name: { type: String, required: false },
|
|
9
9
|
hex: { type: String, required: false },
|
|
10
10
|
rgb: { type: String, required: false },
|
|
11
11
|
hsl: { type: String, required: false },
|
|
12
12
|
oklch: { type: String, required: false },
|
|
13
13
|
cmyk: { type: String, required: false },
|
|
14
|
+
textColor: { type: String, required: false },
|
|
14
15
|
rc: { type: Object, required: false }
|
|
15
16
|
});
|
|
16
17
|
const emit = defineEmits([]);
|
|
@@ -74,8 +75,8 @@ const color = computed(() => {
|
|
|
74
75
|
</template>
|
|
75
76
|
<div :class="content({ class: rc.content })">
|
|
76
77
|
<div :class="preview({ class: rc.preview })" :style="{ backgroundColor: color }">
|
|
77
|
-
<div :class="details({ class: rc.details })">
|
|
78
|
-
<span v-if="name" class="text-sm">{{
|
|
78
|
+
<div :class="details({ class: rc.details })" :style="{ color: textColor || 'white' }">
|
|
79
|
+
<span v-if="name" class="text-sm font-bold uppercase tracking-wider mb-2 border-b border-current pb-1">{{ name }}</span>
|
|
79
80
|
<span v-if="hex">HEX {{ formatColor(hex) }}</span>
|
|
80
81
|
<span v-if="rgb">{{ formatColor(rgb) }}</span>
|
|
81
82
|
<span v-if="hsl">{{ formatColor(hsl) }}</span>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface FontPaletteProps {
|
|
2
|
+
/**
|
|
3
|
+
* Raw CSS content to parse
|
|
4
|
+
*/
|
|
5
|
+
css?: string;
|
|
6
|
+
/**
|
|
7
|
+
* UI custom classes
|
|
8
|
+
*/
|
|
9
|
+
rc?: {
|
|
10
|
+
root?: string;
|
|
11
|
+
section?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
grid?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<FontPaletteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FontPaletteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import chroma from "chroma-js";
|
|
4
|
+
import { useRC, useHeaderStack } from "../../composables";
|
|
5
|
+
import { tv } from "../../internal/tv";
|
|
6
|
+
const { css = "", rc: rcProp } = defineProps({
|
|
7
|
+
css: { type: String, required: false },
|
|
8
|
+
rc: { type: Object, required: false }
|
|
9
|
+
});
|
|
10
|
+
const { rc } = useRC("FontPalette", rcProp);
|
|
11
|
+
const { totalHeight } = useHeaderStack();
|
|
12
|
+
const stickyTop = computed(() => `${totalHeight.value + 32}px`);
|
|
13
|
+
const paletteStyles = tv({
|
|
14
|
+
slots: {
|
|
15
|
+
root: "w-full",
|
|
16
|
+
section: "flex flex-col gap-12"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const { root } = paletteStyles();
|
|
20
|
+
function parseOklch(str) {
|
|
21
|
+
const match = str.match(/oklch\(([\d.]+%?)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*[\d.]+%?)?\)/);
|
|
22
|
+
if (match) {
|
|
23
|
+
let l = parseFloat(match[1] ?? "0");
|
|
24
|
+
if (match[1]?.endsWith("%")) l /= 100;
|
|
25
|
+
const c = parseFloat(match[2] ?? "0");
|
|
26
|
+
const h = parseFloat(match[3] ?? "0");
|
|
27
|
+
return [l, c, h];
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
function getColor(value) {
|
|
32
|
+
try {
|
|
33
|
+
if (value.startsWith("oklch")) {
|
|
34
|
+
const oklchValues = parseOklch(value);
|
|
35
|
+
if (oklchValues) {
|
|
36
|
+
return chroma.oklch(...oklchValues);
|
|
37
|
+
}
|
|
38
|
+
} else if (value.startsWith("#") || value.startsWith("rgb") || value.startsWith("hsl")) {
|
|
39
|
+
return chroma(value);
|
|
40
|
+
}
|
|
41
|
+
} catch (e) {
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
function resolveVariable(varName, map, fallbackMap) {
|
|
46
|
+
let value = map.get(varName);
|
|
47
|
+
if (!value && fallbackMap) {
|
|
48
|
+
value = fallbackMap.get(varName);
|
|
49
|
+
}
|
|
50
|
+
if (!value) return varName;
|
|
51
|
+
const varMatch = value.match(/^var\(([\w-]+)\)$/);
|
|
52
|
+
if (varMatch) {
|
|
53
|
+
return resolveVariable(varMatch[1], map, fallbackMap);
|
|
54
|
+
}
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
const parsedData = computed(() => {
|
|
58
|
+
if (!css) return { fonts: [], colors: [] };
|
|
59
|
+
const fonts = [];
|
|
60
|
+
const rootVars = /* @__PURE__ */ new Map();
|
|
61
|
+
const darkVars = /* @__PURE__ */ new Map();
|
|
62
|
+
const lines = css.split("\n");
|
|
63
|
+
let currentBlock = "root";
|
|
64
|
+
lines.forEach((line) => {
|
|
65
|
+
if (line.includes(".dark {")) {
|
|
66
|
+
currentBlock = "dark";
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (line.includes("}") && currentBlock === "dark") {
|
|
70
|
+
currentBlock = "root";
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const varMatch = line.match(/^\s*(--[\w-]+):\s*(.*?);/);
|
|
74
|
+
if (varMatch && !line.trim().startsWith("/*")) {
|
|
75
|
+
const key = varMatch[1] ?? "";
|
|
76
|
+
const value = varMatch[2]?.trim() ?? "";
|
|
77
|
+
if (currentBlock === "root") {
|
|
78
|
+
rootVars.set(key, value);
|
|
79
|
+
} else {
|
|
80
|
+
darkVars.set(key, value);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const fontMatch = line.match(/^\s*--font-([\w-]+):\s*(.*?);/);
|
|
84
|
+
if (fontMatch && !line.trim().startsWith("/*")) {
|
|
85
|
+
fonts.push({
|
|
86
|
+
name: fontMatch[1] ?? "",
|
|
87
|
+
family: fontMatch[2]?.trim() ?? ""
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const colors = [];
|
|
92
|
+
const keys = /* @__PURE__ */ new Set([...rootVars.keys(), ...darkVars.keys()]);
|
|
93
|
+
keys.forEach((key) => {
|
|
94
|
+
if (key.startsWith("--text-") || key.startsWith("--ui-text-")) {
|
|
95
|
+
const name = key.replace(/^--(?:ui-)?text-/, "");
|
|
96
|
+
const resolvedLight = resolveVariable(key, rootVars);
|
|
97
|
+
const colorCheck = getColor(resolvedLight);
|
|
98
|
+
if (colorCheck) {
|
|
99
|
+
const resolvedDark = resolveVariable(key, darkVars, rootVars);
|
|
100
|
+
const lightBg = "bg-white";
|
|
101
|
+
const darkBg = "bg-black";
|
|
102
|
+
colors.push({
|
|
103
|
+
name,
|
|
104
|
+
fullVarName: key,
|
|
105
|
+
lightValue: resolvedLight,
|
|
106
|
+
// stored for debugging/info if needed
|
|
107
|
+
lightBg,
|
|
108
|
+
darkValue: resolvedDark,
|
|
109
|
+
darkBg
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return { fonts, colors };
|
|
115
|
+
});
|
|
116
|
+
const sampleText = "The quick brown fox jumps over the lazy dog";
|
|
117
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
118
|
+
const alphabetLower = "abcdefghijklmnopqrstuvwxyz";
|
|
119
|
+
const numbers = "0123456789";
|
|
120
|
+
const symbols = `!@#$%^&*()_+-=[]{};':",./<>?`;
|
|
121
|
+
const headingLevels = [
|
|
122
|
+
{ tag: "h1", label: "Heading 1" },
|
|
123
|
+
{ tag: "h2", label: "Heading 2" },
|
|
124
|
+
{ tag: "h3", label: "Heading 3" },
|
|
125
|
+
{ tag: "h4", label: "Heading 4" },
|
|
126
|
+
{ tag: "h5", label: "Heading 5" },
|
|
127
|
+
{ tag: "h6", label: "Heading 6" }
|
|
128
|
+
];
|
|
129
|
+
const tabItems = computed(() => {
|
|
130
|
+
return parsedData.value.fonts.map((f) => ({
|
|
131
|
+
label: f.name.charAt(0).toUpperCase() + f.name.slice(1),
|
|
132
|
+
font: f,
|
|
133
|
+
slot: "content"
|
|
134
|
+
}));
|
|
135
|
+
});
|
|
136
|
+
function getFontStyles(family) {
|
|
137
|
+
return { fontFamily: family };
|
|
138
|
+
}
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<template>
|
|
142
|
+
<div :class="root({ class: rc.root })">
|
|
143
|
+
<UTabs
|
|
144
|
+
:items="tabItems"
|
|
145
|
+
orientation="vertical"
|
|
146
|
+
variant="link"
|
|
147
|
+
:style="{ '--palette-sticky-top': stickyTop }"
|
|
148
|
+
:ui="{
|
|
149
|
+
root: 'flex flex-col md:flex-row gap-12 items-start overflow-visible',
|
|
150
|
+
list: 'md:w-64 shrink-0 md:sticky md:top-[var(--palette-sticky-top)] self-start z-10 overflow-visible',
|
|
151
|
+
content: 'flex-1 min-w-0'
|
|
152
|
+
}"
|
|
153
|
+
>
|
|
154
|
+
<template #content="{ item }">
|
|
155
|
+
<div class="flex flex-col gap-8">
|
|
156
|
+
<header>
|
|
157
|
+
<h2 class="text-3xl font-bold text-highlighted mb-2">
|
|
158
|
+
{{ item.label }}
|
|
159
|
+
</h2>
|
|
160
|
+
<code class="text-sm text-muted">{{ item.font.family }}</code>
|
|
161
|
+
</header>
|
|
162
|
+
|
|
163
|
+
<UAccordion
|
|
164
|
+
multiple
|
|
165
|
+
:items="[
|
|
166
|
+
{ label: 'Specimen', slot: 'specimen' },
|
|
167
|
+
{ label: 'Hierarchy', slot: 'hierarchy' },
|
|
168
|
+
{ label: 'Color', slot: 'colors' }
|
|
169
|
+
]"
|
|
170
|
+
:ui="{
|
|
171
|
+
item: 'border-b border-default last:border-b-0',
|
|
172
|
+
trigger: 'text-xl font-bold py-4',
|
|
173
|
+
body: 'py-6 px-4'
|
|
174
|
+
}"
|
|
175
|
+
>
|
|
176
|
+
<template #specimen>
|
|
177
|
+
<div
|
|
178
|
+
class="flex flex-col gap-8 py-4 text-highlighted"
|
|
179
|
+
:style="getFontStyles(item.font.family)"
|
|
180
|
+
>
|
|
181
|
+
<div class="flex flex-col md:flex-row md:items-baseline gap-4">
|
|
182
|
+
<span class="w-32 text-xs text-muted font-mono uppercase shrink-0"
|
|
183
|
+
>Uppercase</span
|
|
184
|
+
>
|
|
185
|
+
<div class="text-4xl break-all line-height-none tracking-tight">
|
|
186
|
+
{{ alphabet }}
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="flex flex-col md:flex-row md:items-baseline gap-4">
|
|
190
|
+
<span class="w-32 text-xs text-muted font-mono uppercase shrink-0"
|
|
191
|
+
>Lowercase</span
|
|
192
|
+
>
|
|
193
|
+
<div class="text-4xl break-all line-height-none tracking-tight">
|
|
194
|
+
{{ alphabetLower }}
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="flex flex-col md:flex-row md:items-baseline gap-4">
|
|
198
|
+
<span class="w-32 text-xs text-muted font-mono uppercase shrink-0">Numbers</span>
|
|
199
|
+
<div class="text-4xl">
|
|
200
|
+
{{ numbers }}
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
<div class="flex flex-col md:flex-row md:items-baseline gap-4">
|
|
204
|
+
<span class="w-32 text-xs text-muted font-mono uppercase shrink-0">Symbols</span>
|
|
205
|
+
<div class="text-4xl">
|
|
206
|
+
{{ symbols }}
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</template>
|
|
211
|
+
|
|
212
|
+
<template #hierarchy>
|
|
213
|
+
<div
|
|
214
|
+
class="flex flex-col gap-8 pb-8"
|
|
215
|
+
:style="getFontStyles(item.font.family)"
|
|
216
|
+
>
|
|
217
|
+
<div
|
|
218
|
+
v-for="h in headingLevels"
|
|
219
|
+
:key="h.tag"
|
|
220
|
+
class="flex flex-col md:flex-row md:items-baseline gap-4"
|
|
221
|
+
>
|
|
222
|
+
<span class="w-12 text-xs text-muted font-mono uppercase shrink-0">{{
|
|
223
|
+
h.tag
|
|
224
|
+
}}</span>
|
|
225
|
+
<component :is="h.tag" class="m-0">{{ h.label }}</component>
|
|
226
|
+
</div>
|
|
227
|
+
<div class="flex flex-col md:flex-row md:items-baseline gap-4">
|
|
228
|
+
<span class="w-12 text-xs text-muted font-mono uppercase shrink-0">p</span>
|
|
229
|
+
<p class="m-0 leading-relaxed max-w-2xl">
|
|
230
|
+
{{ sampleText }}. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed
|
|
231
|
+
do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
232
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
233
|
+
consequat.
|
|
234
|
+
</p>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</template>
|
|
238
|
+
|
|
239
|
+
<template #colors>
|
|
240
|
+
<div
|
|
241
|
+
class="flex flex-col gap-8 pb-8"
|
|
242
|
+
:style="getFontStyles(item.font.family)"
|
|
243
|
+
>
|
|
244
|
+
<div
|
|
245
|
+
v-for="c in parsedData.colors"
|
|
246
|
+
:key="c.name"
|
|
247
|
+
class="flex flex-col md:flex-row gap-4"
|
|
248
|
+
>
|
|
249
|
+
<span class="w-32 text-xs text-muted font-mono shrink-0 pt-2">{{
|
|
250
|
+
c.fullVarName
|
|
251
|
+
}}</span>
|
|
252
|
+
<div
|
|
253
|
+
class="flex-1 grid grid-cols-2 rounded-lg overflow-hidden h-20"
|
|
254
|
+
>
|
|
255
|
+
<!-- Light Mode -->
|
|
256
|
+
<div
|
|
257
|
+
class="flex flex-col items-center justify-center p-2 gap-1"
|
|
258
|
+
:class="c.lightBg"
|
|
259
|
+
>
|
|
260
|
+
<p class="text-2xl font-bold" :style="{ color: c.lightValue }">Aa</p>
|
|
261
|
+
<span
|
|
262
|
+
class="text-[10px] opacity-50 font-mono hidden md:block"
|
|
263
|
+
:style="{ color: c.lightValue }"
|
|
264
|
+
>{{ c.lightValue.slice(0, 15) }}...</span
|
|
265
|
+
>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<!-- Dark Mode -->
|
|
269
|
+
<div
|
|
270
|
+
class="flex flex-col items-center justify-center p-2 gap-1"
|
|
271
|
+
:class="c.darkBg"
|
|
272
|
+
>
|
|
273
|
+
<p class="text-2xl font-bold" :style="{ color: c.darkValue }">Aa</p>
|
|
274
|
+
<span
|
|
275
|
+
class="text-[10px] opacity-50 font-mono hidden md:block"
|
|
276
|
+
:style="{ color: c.darkValue }"
|
|
277
|
+
>{{ c.darkValue.slice(0, 15) }}...</span
|
|
278
|
+
>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
</template>
|
|
284
|
+
</UAccordion>
|
|
285
|
+
</div>
|
|
286
|
+
</template>
|
|
287
|
+
</UTabs>
|
|
288
|
+
</div>
|
|
289
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface FontPaletteProps {
|
|
2
|
+
/**
|
|
3
|
+
* Raw CSS content to parse
|
|
4
|
+
*/
|
|
5
|
+
css?: string;
|
|
6
|
+
/**
|
|
7
|
+
* UI custom classes
|
|
8
|
+
*/
|
|
9
|
+
rc?: {
|
|
10
|
+
root?: string;
|
|
11
|
+
section?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
grid?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<FontPaletteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FontPaletteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimelight-components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.87",
|
|
4
4
|
"description": "A component library by Rimelight Entertainment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"@nuxt/ui": "^4.2.1",
|
|
90
90
|
"@nuxtjs/i18n": "^10.2.1",
|
|
91
91
|
"@tauri-apps/plugin-http": "^2.5.7",
|
|
92
|
+
"@types/chroma-js": "^3.1.2",
|
|
92
93
|
"@types/node": "^25.2.0",
|
|
93
94
|
"@vueuse/core": "^14.2.0",
|
|
94
95
|
"@vueuse/nuxt": "^14.2.0",
|