@likec4/styles 1.57.0 → 1.59.0

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.
@@ -1,149 +0,0 @@
1
- import { r as colors_exports } from "./@radix-ui/colors.mjs";
2
- import { definePreset } from "@pandacss/dev";
3
- //#region ../../node_modules/.pnpm/pandacss-preset-radix-colors@0.2.1_@pandacss+dev@1.11.1_typescript@5.9.3__@radix-ui+colors@3.0.0/node_modules/pandacss-preset-radix-colors/index.mjs
4
- var SCALE_TAGS_REGEX = new RegExp(`(${["P3"].join("|")})|(?=[A-Z0-9])`, "g");
5
- function getScaleTags(fullName) {
6
- return fullName.split(SCALE_TAGS_REGEX).filter(Boolean).map((x) => x.toLowerCase());
7
- }
8
- function getScalePath(tags) {
9
- return tags.join(".");
10
- }
11
- function isScaleAlpha(tags) {
12
- return tags.includes("a");
13
- }
14
- function isScaleDark(tags) {
15
- return tags.includes("dark");
16
- }
17
- function isScaleP3(tags) {
18
- return tags.includes("p3");
19
- }
20
- function getScaleName(tags) {
21
- return tags[0];
22
- }
23
- function getScaleShades(value) {
24
- return Object.assign({}, ...Object.values(value).map((shade, i) => ({ [++i]: shade })));
25
- }
26
- function getScales(lightPrefix) {
27
- return Object.entries(colors_exports).map(([fullName, value]) => {
28
- const tags = getScaleTags(fullName);
29
- const dark = isScaleDark(tags);
30
- if (!dark && lightPrefix) tags.splice(1, 0, "light");
31
- return {
32
- fullName,
33
- tags,
34
- name: getScaleName(tags),
35
- path: getScalePath(tags),
36
- dark,
37
- alpha: isScaleAlpha(tags),
38
- p3: isScaleP3(tags),
39
- shades: getScaleShades(value)
40
- };
41
- });
42
- }
43
- function keysToObj(keys, value) {
44
- if (keys.length === 0) return value;
45
- const key = keys[0];
46
- const obj = keysToObj(keys.slice(1), value);
47
- return { [key]: obj };
48
- }
49
- function isObject(value) {
50
- return value !== null && value !== void 0 && typeof value === "object" && !Array.isArray(value);
51
- }
52
- function mergeObjs(target, ...sources) {
53
- if (!sources.length) return target;
54
- const source = sources.shift();
55
- if (isObject(target) && isObject(source)) for (const key in source) if (isObject(source[key])) {
56
- if (!target[key]) Object.assign(target, { [key]: {} });
57
- mergeObjs(target[key], source[key]);
58
- } else Object.assign(target, { [key]: source[key] });
59
- return mergeObjs(target, ...sources);
60
- }
61
- function findDarkScale(scale, scales) {
62
- return scales.find((x) => x.name === scale.name && x.alpha === scale.alpha && x.p3 === scale.p3 && x.dark);
63
- }
64
- function findP3Scale(scale, scales) {
65
- return scales.find((x) => x.name === scale.name && x.alpha === scale.alpha && x.dark === scale.dark && x.p3);
66
- }
67
- function findLightScale(scale, scales) {
68
- return scales.find((x) => x.name === scale.name && x.alpha === scale.alpha && x.dark === scale.dark && x.p3 === scale.p3 && x.tags.includes("light"));
69
- }
70
- function findRelatedScales(scale, scales, enableDarkMode, enableAutoP3) {
71
- const result = { current: scale };
72
- if (enableDarkMode && !scale.dark && !scale.tags.includes("light")) result.dark = findDarkScale(scale, scales);
73
- if (!result.dark && enableAutoP3 && !scale.p3) result.p3 = findP3Scale(scale, scales);
74
- if (result.dark) result.light = scale.tags.includes("light") ? scale : findLightScale(scale, scales);
75
- return result;
76
- }
77
- function buildTokenValue(shade, shadeIndex, relatedScales) {
78
- if (relatedScales.dark) return {
79
- base: `{colors.${relatedScales.light?.path}.${shadeIndex}}`,
80
- _dark: `{colors.${relatedScales.dark.path}.${shadeIndex}}`
81
- };
82
- if (relatedScales.p3) return {
83
- base: shade,
84
- _p3: `{colors.${relatedScales.p3.path}.${shadeIndex}}`
85
- };
86
- return shade;
87
- }
88
- function getSemanticTokens(darkMode, autoP3, colorScales = []) {
89
- let scales = getScales(darkMode);
90
- if (darkMode) scales = scales.concat(getScales(false).filter((x) => !x.dark));
91
- const filteredScales = scales.filter((scale) => shouldIncludeScale(scale, colorScales));
92
- return mergeObjs({}, ...filteredScales.map((scale) => generateScaleTokens(scale, filteredScales, darkMode, autoP3)));
93
- }
94
- function shouldIncludeScale(scale, colorScales) {
95
- if (colorScales.length === 0) return true;
96
- return colorScales.some((colorScale) => {
97
- return scale.path === colorScale || scale.path.startsWith(colorScale + ".");
98
- });
99
- }
100
- function generateScaleTokens(scale, allScales, enableDarkMode = false, enableAutoP3 = false) {
101
- const relatedScales = findRelatedScales(scale, allScales, enableDarkMode, enableAutoP3);
102
- const mergedShades = mergeObjs({}, ...Object.entries(scale.shades).map(([shadeIndex, color]) => {
103
- const tokenValue = buildTokenValue(color, shadeIndex, relatedScales);
104
- return { [shadeIndex]: { value: tokenValue } };
105
- }));
106
- return keysToObj(scale.tags, mergedShades);
107
- }
108
- var name = "pandacss-preset-radix-colors";
109
- var DEFAULT_DARK_MODE_CONDITION = ".dark &";
110
- function getConditions(darkModeCondition) {
111
- const conditions = {};
112
- if (darkModeCondition) conditions["dark"] = darkModeCondition;
113
- conditions["p3"] = "@media (color-gamut: p3)";
114
- return conditions;
115
- }
116
- function normalizeDarkMode(darkModeOption) {
117
- if (!darkModeOption) return { enabled: false };
118
- if (typeof darkModeOption === "boolean") return {
119
- enabled: true,
120
- condition: DEFAULT_DARK_MODE_CONDITION
121
- };
122
- return {
123
- enabled: darkModeOption.enabled ?? true,
124
- condition: darkModeOption.condition
125
- };
126
- }
127
- function validateColorScales(colorScales) {
128
- if (!colorScales || colorScales.length === 0) return;
129
- const scales = getScales();
130
- const unmatchedScales = colorScales.filter((colorScale) => {
131
- return !scales.some((scale) => scale.path === colorScale || scale.path.startsWith(colorScale + "."));
132
- });
133
- if (unmatchedScales.length > 0) console.warn(`[pandacss-preset-radix-colors] Color scale paths don't match any available scales: ${unmatchedScales.join(", ")}. Valid examples: "amber", "blue.dark", "gray.p3", "red.dark.a". Available base colors: ${Array.from(new Set(scales.map((s) => s.name))).join(", ")}.`);
134
- }
135
- function createPreset(options) {
136
- const darkModeConfig = normalizeDarkMode(options?.darkMode);
137
- validateColorScales(options?.colorScales);
138
- return definePreset({
139
- name,
140
- conditions: { extend: getConditions(darkModeConfig.enabled ? darkModeConfig.condition : void 0) },
141
- theme: { extend: { semanticTokens: { colors: getSemanticTokens(darkModeConfig.enabled, options?.autoP3, options?.colorScales) } } }
142
- });
143
- }
144
- function transformScaleName(scale) {
145
- return scale.split(/(Dark|P3|A)/).map((x) => x.toLowerCase()).filter(Boolean).join(".");
146
- }
147
- Object.keys(colors_exports).filter((scale) => !scale.includes("default")).map(transformScaleName);
148
- //#endregion
149
- export { createPreset as t };
@@ -1,148 +0,0 @@
1
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
2
- function e$4(e, t, n) {
3
- let r = (n) => e(n, ...t);
4
- return n === void 0 ? r : Object.assign(r, {
5
- lazy: n,
6
- lazyArgs: t
7
- });
8
- }
9
- //#endregion
10
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/purry.js
11
- function t$10(t, n, r) {
12
- let i = t.length - n.length;
13
- if (i === 0) return t(...n);
14
- if (i === 1) return e$4(t, n, r);
15
- throw Error(`Wrong number of arguments`);
16
- }
17
- //#endregion
18
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/capitalize.js
19
- function t$9(...t) {
20
- return t$10(n$6, t);
21
- }
22
- const n$6 = (e) => `${e[0]?.toUpperCase() ?? ``}${e.slice(1)}`, t$8 = {
23
- done: !1,
24
- hasNext: !1
25
- };
26
- //#endregion
27
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/pipe.js
28
- function t$7(e, ...t) {
29
- let a = e, o = t.map((e) => `lazy` in e ? r(e) : void 0), s = 0;
30
- for (; s < t.length;) {
31
- if (o[s] === void 0 || !i(a)) {
32
- let e = t[s];
33
- a = e(a), s += 1;
34
- continue;
35
- }
36
- let e = [];
37
- for (let n = s; n < t.length; n++) {
38
- let t = o[n];
39
- if (t === void 0 || (e.push(t), t.isSingle)) break;
40
- }
41
- let r = [];
42
- for (let t of a) if (n$4(t, r, e)) break;
43
- let { isSingle: c } = e.at(-1);
44
- a = c ? r[0] : r, s += e.length;
45
- }
46
- return a;
47
- }
48
- function n$4(t, r, i) {
49
- if (i.length === 0) return r.push(t), !1;
50
- let a = t, o = t$8, s = !1;
51
- for (let [e, t] of i.entries()) {
52
- let { index: c, items: l } = t;
53
- if (l.push(a), o = t(a, c, l), t.index += 1, o.hasNext) {
54
- if (o.hasMany ?? !1) {
55
- for (let t of o.next) if (n$4(t, r, i.slice(e + 1))) return !0;
56
- return s;
57
- }
58
- a = o.next;
59
- }
60
- if (!o.hasNext) break;
61
- o.done && (s = !0);
62
- }
63
- return o.hasNext && r.push(a), s;
64
- }
65
- function r(e) {
66
- let { lazy: t, lazyArgs: n } = e, r = t(...n);
67
- return Object.assign(r, {
68
- isSingle: t.single ?? !1,
69
- index: 0,
70
- items: []
71
- });
72
- }
73
- function i(e) {
74
- return typeof e == `string` || typeof e == `object` && !!e && Symbol.iterator in e;
75
- }
76
- //#endregion
77
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/hasAtLeast.js
78
- function t$6(...t) {
79
- return t$10(n$3, t);
80
- }
81
- const n$3 = (e, t) => e.length >= t;
82
- //#endregion
83
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isString.js
84
- function e$2(e) {
85
- return typeof e == `string`;
86
- }
87
- //#endregion
88
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/keys.js
89
- function t$5(...t) {
90
- return t$10(Object.keys, t);
91
- }
92
- //#endregion
93
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/mapKeys.js
94
- function t$4(...t) {
95
- return t$10(n$2, t);
96
- }
97
- function n$2(e, t) {
98
- let n = {};
99
- for (let [r, i] of Object.entries(e)) {
100
- let a = t(r, i, e);
101
- n[a] = i;
102
- }
103
- return n;
104
- }
105
- //#endregion
106
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/mapToObj.js
107
- function t$3(...t) {
108
- return t$10(n$1, t);
109
- }
110
- function n$1(e, t) {
111
- let n = {};
112
- for (let [r, i] of e.entries()) {
113
- let [a, o] = t(i, r, e);
114
- n[a] = o;
115
- }
116
- return n;
117
- }
118
- //#endregion
119
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/mapValues.js
120
- function t$2(...t) {
121
- return t$10(n, t);
122
- }
123
- function n(e, t) {
124
- let n = {};
125
- for (let [r, i] of Object.entries(e)) n[r] = t(i, r, e);
126
- return n;
127
- }
128
- //#endregion
129
- //#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/prop.js
130
- function e$1(e, ...n) {
131
- return typeof e == `string` || typeof e == `number` || typeof e == `symbol` ? (r) => t$1(r, e, ...n) : t$1(e, ...n);
132
- }
133
- function t$1(e, ...t) {
134
- let n = e;
135
- for (let e of t) {
136
- if (n == null) return;
137
- n = n[e];
138
- }
139
- return n;
140
- }
141
- new Set([
142
- `-`,
143
- `_`,
144
- ...` .
145
- .\v.\f.\r. .….\xA0. . . . . . . . . . . . .\u2028.\u2029. . . .`.split(`.`)
146
- ]);
147
- //#endregion
148
- export { t$5 as a, t$7 as c, t$4 as i, t$9 as l, t$2 as n, e$2 as o, t$3 as r, t$6 as s, e$1 as t };
@@ -1,13 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true
8
- });
9
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
- return target;
11
- };
12
- //#endregion
13
- export { __exportAll as t };
@@ -1,4 +0,0 @@
1
- {
2
- "types": "preset.d.mts",
3
- "module": "preset.mjs"
4
- }