replicas-cli 0.3.400 → 0.3.402
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/index.cjs +12 -17
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -22515,14 +22515,15 @@ var init_v1 = __esm({
|
|
|
22515
22515
|
});
|
|
22516
22516
|
|
|
22517
22517
|
// ../shared/src/design-tokens.ts
|
|
22518
|
-
function customPalette(
|
|
22518
|
+
function customPalette(custom2) {
|
|
22519
|
+
const { background, foreground } = custom2;
|
|
22519
22520
|
const selected = mix(background, foreground, 0.105);
|
|
22520
22521
|
return {
|
|
22521
22522
|
background,
|
|
22522
22523
|
subtle: mix(background, foreground, 0.035),
|
|
22523
22524
|
muted: mix(background, foreground, 0.06),
|
|
22524
22525
|
selected,
|
|
22525
|
-
elevated:
|
|
22526
|
+
elevated: customMode(custom2) === "dark" ? selected : background,
|
|
22526
22527
|
foreground,
|
|
22527
22528
|
mutedForeground: mix(background, foreground, 0.65),
|
|
22528
22529
|
faintForeground: mix(background, foreground, 0.43),
|
|
@@ -22547,12 +22548,13 @@ function customAccent(accent, paletteColors) {
|
|
|
22547
22548
|
};
|
|
22548
22549
|
}
|
|
22549
22550
|
function designColors({ mode, palette, accent, custom: custom2 }) {
|
|
22551
|
+
const resolved = resolvePalette(mode, palette, custom2);
|
|
22550
22552
|
const presets = PALETTE_COLORS[mode];
|
|
22551
|
-
const paletteColors = presets[
|
|
22553
|
+
const paletteColors = presets[resolved] ?? customPalette(custom2);
|
|
22552
22554
|
const colors = { ...DESIGN_COLORS[mode], ...paletteColors, ...accent === "custom" ? customAccent(custom2.accent, paletteColors) : ACCENT_COLORS[accent][mode] };
|
|
22553
|
-
return
|
|
22555
|
+
return resolved === "custom" ? { ...colors, ...Object.fromEntries(READABLE_TEXT_KEYS.map((key) => [key, readableText(colors[key], paletteColors)])) } : colors;
|
|
22554
22556
|
}
|
|
22555
|
-
var plain, PALETTE_PRESETS, PALETTES,
|
|
22557
|
+
var plain, PALETTE_PRESETS, PALETTES, PALETTE_COLORS, ACCENT_PRESETS, ACCENTS, ACCENT_COLORS, dark, DESIGN_COLORS, SERIES, BRAND_COLORS, channels, mix, luminance, contrast, customMode, DEFAULT_APPEARANCE, resolvePalette, READABLE_TEXT_KEYS;
|
|
22556
22558
|
var init_design_tokens = __esm({
|
|
22557
22559
|
"../shared/src/design-tokens.ts"() {
|
|
22558
22560
|
"use strict";
|
|
@@ -22572,12 +22574,7 @@ var init_design_tokens = __esm({
|
|
|
22572
22574
|
dark: ["default", "slate", "stone", "black", "high-contrast"],
|
|
22573
22575
|
light: ["default", "slate", "stone", "neutral", "high-contrast"]
|
|
22574
22576
|
};
|
|
22575
|
-
PALETTES =
|
|
22576
|
-
dark: [...PALETTE_PRESETS.dark, "custom"],
|
|
22577
|
-
light: [...PALETTE_PRESETS.light, "custom"]
|
|
22578
|
-
};
|
|
22579
|
-
PALETTE_NAMES = [.../* @__PURE__ */ new Set([...PALETTES.dark, ...PALETTES.light])];
|
|
22580
|
-
resolvePalette = (mode, palette) => PALETTES[mode].some((name) => name === palette) ? palette : "default";
|
|
22577
|
+
PALETTES = [.../* @__PURE__ */ new Set([...PALETTE_PRESETS.dark, ...PALETTE_PRESETS.light]), "custom"];
|
|
22581
22578
|
PALETTE_COLORS = {
|
|
22582
22579
|
dark: {
|
|
22583
22580
|
default: { background: "#111111", subtle: "#181818", muted: "#1f1f1f", selected: "#2a2a2a", elevated: "#2a2a2a", foreground: "#ededed", mutedForeground: "#a3a3a3", faintForeground: "#737373", border: "#2a2a2a", borderStrong: "#5c5c5c" },
|
|
@@ -22682,15 +22679,13 @@ var init_design_tokens = __esm({
|
|
|
22682
22679
|
const [lighter, darker] = [luminance(a), luminance(b)].sort((x, y) => y - x);
|
|
22683
22680
|
return (lighter + 0.05) / (darker + 0.05);
|
|
22684
22681
|
};
|
|
22682
|
+
customMode = ({ background, foreground }) => luminance(background) < luminance(foreground) ? "dark" : "light";
|
|
22685
22683
|
DEFAULT_APPEARANCE = {
|
|
22686
22684
|
palette: "default",
|
|
22687
22685
|
accent: "green",
|
|
22688
|
-
custom: {
|
|
22689
|
-
dark: { background: PALETTE_COLORS.dark.default.background, foreground: PALETTE_COLORS.dark.default.foreground },
|
|
22690
|
-
light: { background: PALETTE_COLORS.light.default.background, foreground: PALETTE_COLORS.light.default.foreground },
|
|
22691
|
-
accent: "#888888"
|
|
22692
|
-
}
|
|
22686
|
+
custom: { background: PALETTE_COLORS.dark.default.background, foreground: PALETTE_COLORS.dark.default.foreground, accent: "#888888" }
|
|
22693
22687
|
};
|
|
22688
|
+
resolvePalette = (mode, palette, custom2) => (palette === "custom" ? customMode(custom2) === mode : PALETTE_PRESETS[mode].some((name) => name === palette)) ? palette : "default";
|
|
22694
22689
|
READABLE_TEXT_KEYS = ["primaryText", "successText", "destructiveText", "warningText"];
|
|
22695
22690
|
}
|
|
22696
22691
|
});
|
|
@@ -37857,7 +37852,7 @@ var CLI_VERSION;
|
|
|
37857
37852
|
var init_cli_version = __esm({
|
|
37858
37853
|
"../shared/src/cli-version.ts"() {
|
|
37859
37854
|
"use strict";
|
|
37860
|
-
CLI_VERSION = "0.3.
|
|
37855
|
+
CLI_VERSION = "0.3.402";
|
|
37861
37856
|
}
|
|
37862
37857
|
});
|
|
37863
37858
|
|