@bitrix24/b24ui-nuxt 2.0.8 → 2.0.9
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/meta.d.mts +27 -5
- package/dist/meta.mjs +27 -5
- package/dist/module.d.mts +13 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -5
- package/dist/runtime/air-design-tokens/001_b24_global.css +1 -1
- package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -1
- package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -1
- package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -1
- package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -1
- package/dist/runtime/air-design-tokens/007_b24_global.css +1 -1
- package/dist/runtime/air-design-tokens/008_ui_global.css +1 -1
- package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -1
- package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -1
- package/dist/runtime/air-design-tokens/components/button.css +1 -1
- package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -1
- package/dist/runtime/air-design-tokens/components/popup.css +1 -1
- package/dist/runtime/air-design-tokens/components/scrollbar.css +1 -2
- package/dist/runtime/air-design-tokens/index.css +1 -1
- package/dist/runtime/components/Form.d.vue.ts +1 -1
- package/dist/runtime/components/Form.vue +3 -4
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/Modal.d.vue.ts +5 -0
- package/dist/runtime/components/Modal.vue +37 -9
- package/dist/runtime/components/Modal.vue.d.ts +5 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/plugins/colors.js +4 -8
- package/dist/shared/{b24ui-nuxt.CEMVb5Ee.mjs → b24ui-nuxt.4XNR9Ysu.mjs} +219 -128
- package/dist/unplugin.d.mts +3 -1
- package/dist/unplugin.mjs +4 -3
- package/dist/vite.mjs +3 -3
- package/package.json +4 -4
- package/dist/runtime/air-design-tokens/002_b24_context_utility.css +0 -0
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import 'node:url';
|
|
2
|
+
import { pascalCase, kebabCase, camelCase } from 'scule';
|
|
3
|
+
import { genExport } from 'knitwork';
|
|
4
|
+
import { hasNuxtModule, addTypeTemplate, addTemplate, updateTemplates, logger } from '@nuxt/kit';
|
|
2
5
|
import { readFile } from 'node:fs/promises';
|
|
3
6
|
import { join } from 'pathe';
|
|
4
7
|
import { globSync } from 'tinyglobby';
|
|
5
|
-
import { kebabCase, camelCase, pascalCase } from 'scule';
|
|
6
|
-
import { genExport } from 'knitwork';
|
|
7
|
-
import { hasNuxtModule, addTypeTemplate, addTemplate, updateTemplates, logger } from '@nuxt/kit';
|
|
8
8
|
import { defuFn } from 'defu';
|
|
9
9
|
|
|
10
10
|
const name = "@bitrix24/b24ui-nuxt";
|
|
11
|
-
const version = "2.0.
|
|
11
|
+
const version = "2.0.9";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
function getDefaultConfig(theme) {
|
|
14
|
+
return {
|
|
15
|
+
prefix: theme?.prefix,
|
|
16
|
+
tv: {
|
|
17
|
+
twMergeConfig: {
|
|
18
|
+
prefix: theme?.prefix
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
14
23
|
const defaultOptions = {
|
|
15
24
|
colorMode: true,
|
|
16
25
|
colorModeTypeLight: "light",
|
|
@@ -19,6 +28,120 @@ const defaultOptions = {
|
|
|
19
28
|
content: false
|
|
20
29
|
};
|
|
21
30
|
|
|
31
|
+
function prefixClasses(classString, prefix) {
|
|
32
|
+
if (!prefix || !classString) {
|
|
33
|
+
return classString;
|
|
34
|
+
}
|
|
35
|
+
return classString.split(" ").filter(Boolean).map((cls) => `${prefix}:${cls}`).join(" ");
|
|
36
|
+
}
|
|
37
|
+
function isSizeValue(value) {
|
|
38
|
+
return /^(?:[2-9]x[sl]|base|xs|sm|md|lg|1[01]xl|4\.5xl|xl)$/.test(value.trim());
|
|
39
|
+
}
|
|
40
|
+
function applyPrefixToObject(obj, prefix, context = []) {
|
|
41
|
+
if (!obj || !prefix) {
|
|
42
|
+
return obj;
|
|
43
|
+
}
|
|
44
|
+
const currentKey = context[context.length - 1];
|
|
45
|
+
const compoundVariantsIndex = context.indexOf("compoundVariants");
|
|
46
|
+
const isInCompoundVariant = compoundVariantsIndex !== -1 && !context.slice(compoundVariantsIndex).includes("class");
|
|
47
|
+
const isInDefaultVariants = context.includes("defaultVariants");
|
|
48
|
+
const isComponentSizeValue = typeof obj === "string" && typeof currentKey === "string" && currentKey.endsWith("Size") && isSizeValue(obj);
|
|
49
|
+
if (typeof obj === "string" && (isInCompoundVariant || isInDefaultVariants || isComponentSizeValue)) {
|
|
50
|
+
return obj;
|
|
51
|
+
}
|
|
52
|
+
if (typeof obj === "string") {
|
|
53
|
+
return prefixClasses(obj, prefix);
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(obj)) {
|
|
56
|
+
return obj.map((item, index) => applyPrefixToObject(item, prefix, [...context, String(index)]));
|
|
57
|
+
}
|
|
58
|
+
if (typeof obj === "object") {
|
|
59
|
+
const result = {};
|
|
60
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
61
|
+
result[key] = applyPrefixToObject(value, prefix, [...context, key]);
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function buildComponentDependencyGraph(componentDir, componentPattern) {
|
|
69
|
+
const dependencyGraph = /* @__PURE__ */ new Map();
|
|
70
|
+
const componentFiles = globSync(["**/*.vue"], {
|
|
71
|
+
cwd: componentDir,
|
|
72
|
+
absolute: true
|
|
73
|
+
});
|
|
74
|
+
for (const componentFile of componentFiles) {
|
|
75
|
+
try {
|
|
76
|
+
const content = await readFile(componentFile, "utf-8");
|
|
77
|
+
const componentName = pascalCase(componentFile.split("/").pop().replace(".vue", ""));
|
|
78
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
79
|
+
const matches = content.matchAll(componentPattern);
|
|
80
|
+
for (const match of matches) {
|
|
81
|
+
const depName = match[1] || match[2];
|
|
82
|
+
if (depName && depName !== componentName) {
|
|
83
|
+
dependencies.add(depName);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
dependencyGraph.set(componentName, dependencies);
|
|
87
|
+
} catch {
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return dependencyGraph;
|
|
91
|
+
}
|
|
92
|
+
function resolveComponentDependencies(component, dependencyGraph, resolved = /* @__PURE__ */ new Set()) {
|
|
93
|
+
if (resolved.has(component)) {
|
|
94
|
+
return resolved;
|
|
95
|
+
}
|
|
96
|
+
resolved.add(component);
|
|
97
|
+
const dependencies = dependencyGraph.get(component);
|
|
98
|
+
if (dependencies) {
|
|
99
|
+
for (const dep of dependencies) {
|
|
100
|
+
resolveComponentDependencies(dep, dependencyGraph, resolved);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return resolved;
|
|
104
|
+
}
|
|
105
|
+
async function detectUsedComponents(rootDir, prefix, componentDir, includeComponents) {
|
|
106
|
+
const detectedComponents = /* @__PURE__ */ new Set();
|
|
107
|
+
if (includeComponents && includeComponents.length > 0) {
|
|
108
|
+
for (const component of includeComponents) {
|
|
109
|
+
detectedComponents.add(component);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const appFiles = globSync(["**/*.{vue,ts,js,tsx,jsx}"], {
|
|
113
|
+
cwd: rootDir,
|
|
114
|
+
ignore: ["node_modules/**", ".nuxt/**", "dist/**"]
|
|
115
|
+
});
|
|
116
|
+
const componentPattern = new RegExp(`<(?:Lazy)?${prefix}([A-Z][a-zA-Z]+)|\\b(?:Lazy)?${prefix}([A-Z][a-zA-Z]+)\\b`, "g");
|
|
117
|
+
for (const file of appFiles) {
|
|
118
|
+
try {
|
|
119
|
+
const filePath = join(rootDir, file);
|
|
120
|
+
const content = await readFile(filePath, "utf-8");
|
|
121
|
+
const matches = content.matchAll(componentPattern);
|
|
122
|
+
for (const match of matches) {
|
|
123
|
+
const componentName = match[1] || match[2];
|
|
124
|
+
if (componentName) {
|
|
125
|
+
detectedComponents.add(componentName);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (detectedComponents.size === 0) {
|
|
132
|
+
return void 0;
|
|
133
|
+
}
|
|
134
|
+
const dependencyGraph = await buildComponentDependencyGraph(componentDir, componentPattern);
|
|
135
|
+
const allComponents = /* @__PURE__ */ new Set();
|
|
136
|
+
for (const component of detectedComponents) {
|
|
137
|
+
const resolved = resolveComponentDependencies(component, dependencyGraph);
|
|
138
|
+
for (const resolvedComponent of resolved) {
|
|
139
|
+
allComponents.add(resolvedComponent);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return allComponents;
|
|
143
|
+
}
|
|
144
|
+
|
|
22
145
|
const accordion$1 = {
|
|
23
146
|
slots: {
|
|
24
147
|
root: "w-full",
|
|
@@ -4711,20 +4834,23 @@ const link = (options) => ({
|
|
|
4711
4834
|
|
|
4712
4835
|
const modal = {
|
|
4713
4836
|
slots: {
|
|
4714
|
-
overlay: "fixed inset-0
|
|
4837
|
+
overlay: "fixed inset-0",
|
|
4715
4838
|
content: [
|
|
4716
4839
|
"light",
|
|
4717
4840
|
"bg-(--popup-window-background-color)",
|
|
4718
|
-
"fixed",
|
|
4719
4841
|
"flex flex-col gap-[20px]",
|
|
4720
4842
|
"focus:outline-none",
|
|
4721
4843
|
"p-[24px] pt-[20px]"
|
|
4722
4844
|
].join(" "),
|
|
4723
|
-
contentWrapper: [
|
|
4724
|
-
"flex flex-col gap-[15px] pt-[4px]"
|
|
4725
|
-
].join(" "),
|
|
4845
|
+
contentWrapper: "flex flex-col gap-[15px] pt-[4px]",
|
|
4726
4846
|
header: "flex items-start justify-between gap-[6px]",
|
|
4727
4847
|
wrapper: "",
|
|
4848
|
+
body: "flex-1 text-(length:--ui-font-size-md) leading-normal",
|
|
4849
|
+
footer: [
|
|
4850
|
+
"flex items-center justify-between gap-[10px]",
|
|
4851
|
+
"border-t border-t-1 border-t-(--ui-color-divider-default)",
|
|
4852
|
+
"pt-[18px]"
|
|
4853
|
+
].join(" "),
|
|
4728
4854
|
title: [
|
|
4729
4855
|
"font-[family-name:var(--ui-font-family-primary)]",
|
|
4730
4856
|
"text-(--b24ui-typography-label-color)",
|
|
@@ -4737,13 +4863,7 @@ const modal = {
|
|
|
4737
4863
|
"text-(--b24ui-typography-description-color)",
|
|
4738
4864
|
"text-(length:--ui-font-size-sm)"
|
|
4739
4865
|
].join(" "),
|
|
4740
|
-
close: "-mt-[4px]"
|
|
4741
|
-
body: "flex-1 overflow-y-auto text-(length:--ui-font-size-md) leading-normal",
|
|
4742
|
-
footer: [
|
|
4743
|
-
"flex items-center justify-between gap-[10px]",
|
|
4744
|
-
"border-t border-t-1 border-t-(--ui-color-divider-default)",
|
|
4745
|
-
"pt-[18px]"
|
|
4746
|
-
].join(" ")
|
|
4866
|
+
close: "-mt-[4px]"
|
|
4747
4867
|
},
|
|
4748
4868
|
variants: {
|
|
4749
4869
|
overlayBlur: {
|
|
@@ -4763,13 +4883,30 @@ const modal = {
|
|
|
4763
4883
|
},
|
|
4764
4884
|
false: {
|
|
4765
4885
|
content: [
|
|
4766
|
-
|
|
4767
|
-
"w-[calc(100vw-2rem)] max-w-[32rem]
|
|
4886
|
+
// // 'top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',
|
|
4887
|
+
"w-[calc(100vw-2rem)] max-w-[32rem]",
|
|
4888
|
+
// // 'max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)]',
|
|
4768
4889
|
"rounded-[calc(var(--popup-window-border-radius)-2px)] shadow-lg"
|
|
4769
4890
|
// @memo see components/popup.css
|
|
4770
4891
|
// 'ring ring-(--popup-window-border)'
|
|
4771
4892
|
].join(" "),
|
|
4772
|
-
contentWrapper: "
|
|
4893
|
+
contentWrapper: ""
|
|
4894
|
+
// // overflow-hidden
|
|
4895
|
+
}
|
|
4896
|
+
},
|
|
4897
|
+
overlay: {
|
|
4898
|
+
true: {
|
|
4899
|
+
overlay: "bg-[#003366]/20"
|
|
4900
|
+
}
|
|
4901
|
+
},
|
|
4902
|
+
scrollable: {
|
|
4903
|
+
true: {
|
|
4904
|
+
overlay: "overflow-y-auto",
|
|
4905
|
+
content: "relative"
|
|
4906
|
+
},
|
|
4907
|
+
false: {
|
|
4908
|
+
content: "fixed",
|
|
4909
|
+
body: "overflow-y-auto"
|
|
4773
4910
|
}
|
|
4774
4911
|
},
|
|
4775
4912
|
scrollbarThin: {
|
|
@@ -4778,6 +4915,27 @@ const modal = {
|
|
|
4778
4915
|
}
|
|
4779
4916
|
}
|
|
4780
4917
|
},
|
|
4918
|
+
compoundVariants: [
|
|
4919
|
+
{
|
|
4920
|
+
scrollable: true,
|
|
4921
|
+
fullscreen: false,
|
|
4922
|
+
class: {
|
|
4923
|
+
overlay: "grid place-items-center p-4 sm:py-8"
|
|
4924
|
+
}
|
|
4925
|
+
},
|
|
4926
|
+
{
|
|
4927
|
+
scrollable: false,
|
|
4928
|
+
fullscreen: false,
|
|
4929
|
+
class: {
|
|
4930
|
+
content: [
|
|
4931
|
+
"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
4932
|
+
"max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)]"
|
|
4933
|
+
// // overflow-hidden
|
|
4934
|
+
].join(" "),
|
|
4935
|
+
contentWrapper: "overflow-hidden"
|
|
4936
|
+
}
|
|
4937
|
+
}
|
|
4938
|
+
],
|
|
4781
4939
|
defaultVariants: {
|
|
4782
4940
|
scrollbarThin: true,
|
|
4783
4941
|
overlayBlur: "auto"
|
|
@@ -9983,82 +10141,6 @@ const themeContent = {
|
|
|
9983
10141
|
contentToc: contentToc
|
|
9984
10142
|
};
|
|
9985
10143
|
|
|
9986
|
-
async function buildComponentDependencyGraph(componentDir, componentPattern) {
|
|
9987
|
-
const dependencyGraph = /* @__PURE__ */ new Map();
|
|
9988
|
-
const componentFiles = globSync(["**/*.vue"], {
|
|
9989
|
-
cwd: componentDir,
|
|
9990
|
-
absolute: true
|
|
9991
|
-
});
|
|
9992
|
-
for (const componentFile of componentFiles) {
|
|
9993
|
-
try {
|
|
9994
|
-
const content = await readFile(componentFile, "utf-8");
|
|
9995
|
-
const componentName = pascalCase(componentFile.split("/").pop().replace(".vue", ""));
|
|
9996
|
-
const dependencies = /* @__PURE__ */ new Set();
|
|
9997
|
-
const matches = content.matchAll(componentPattern);
|
|
9998
|
-
for (const match of matches) {
|
|
9999
|
-
const depName = match[1] || match[2];
|
|
10000
|
-
if (depName && depName !== componentName) {
|
|
10001
|
-
dependencies.add(depName);
|
|
10002
|
-
}
|
|
10003
|
-
}
|
|
10004
|
-
dependencyGraph.set(componentName, dependencies);
|
|
10005
|
-
} catch {
|
|
10006
|
-
}
|
|
10007
|
-
}
|
|
10008
|
-
return dependencyGraph;
|
|
10009
|
-
}
|
|
10010
|
-
function resolveComponentDependencies(component, dependencyGraph, resolved = /* @__PURE__ */ new Set()) {
|
|
10011
|
-
if (resolved.has(component)) {
|
|
10012
|
-
return resolved;
|
|
10013
|
-
}
|
|
10014
|
-
resolved.add(component);
|
|
10015
|
-
const dependencies = dependencyGraph.get(component);
|
|
10016
|
-
if (dependencies) {
|
|
10017
|
-
for (const dep of dependencies) {
|
|
10018
|
-
resolveComponentDependencies(dep, dependencyGraph, resolved);
|
|
10019
|
-
}
|
|
10020
|
-
}
|
|
10021
|
-
return resolved;
|
|
10022
|
-
}
|
|
10023
|
-
async function detectUsedComponents(rootDir, prefix, componentDir, includeComponents) {
|
|
10024
|
-
const detectedComponents = /* @__PURE__ */ new Set();
|
|
10025
|
-
if (includeComponents && includeComponents.length > 0) {
|
|
10026
|
-
for (const component of includeComponents) {
|
|
10027
|
-
detectedComponents.add(component);
|
|
10028
|
-
}
|
|
10029
|
-
}
|
|
10030
|
-
const appFiles = globSync(["**/*.{vue,ts,js,tsx,jsx}"], {
|
|
10031
|
-
cwd: rootDir,
|
|
10032
|
-
ignore: ["node_modules/**", ".nuxt/**", "dist/**"]
|
|
10033
|
-
});
|
|
10034
|
-
const componentPattern = new RegExp(`<(?:Lazy)?${prefix}([A-Z][a-zA-Z]+)|\\b(?:Lazy)?${prefix}([A-Z][a-zA-Z]+)\\b`, "g");
|
|
10035
|
-
for (const file of appFiles) {
|
|
10036
|
-
try {
|
|
10037
|
-
const filePath = join(rootDir, file);
|
|
10038
|
-
const content = await readFile(filePath, "utf-8");
|
|
10039
|
-
const matches = content.matchAll(componentPattern);
|
|
10040
|
-
for (const match of matches) {
|
|
10041
|
-
const componentName = match[1] || match[2];
|
|
10042
|
-
if (componentName) {
|
|
10043
|
-
detectedComponents.add(componentName);
|
|
10044
|
-
}
|
|
10045
|
-
}
|
|
10046
|
-
} catch {
|
|
10047
|
-
}
|
|
10048
|
-
}
|
|
10049
|
-
if (detectedComponents.size === 0) {
|
|
10050
|
-
return void 0;
|
|
10051
|
-
}
|
|
10052
|
-
const dependencyGraph = await buildComponentDependencyGraph(componentDir, componentPattern);
|
|
10053
|
-
const allComponents = /* @__PURE__ */ new Set();
|
|
10054
|
-
for (const component of detectedComponents) {
|
|
10055
|
-
const resolved = resolveComponentDependencies(component, dependencyGraph);
|
|
10056
|
-
for (const resolvedComponent of resolved) {
|
|
10057
|
-
allComponents.add(resolvedComponent);
|
|
10058
|
-
}
|
|
10059
|
-
}
|
|
10060
|
-
return allComponents;
|
|
10061
|
-
}
|
|
10062
10144
|
function getTemplates(options, uiConfig, nuxt, resolve) {
|
|
10063
10145
|
const templates = [];
|
|
10064
10146
|
let hasProse = false;
|
|
@@ -10071,7 +10153,8 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
|
|
|
10071
10153
|
write: true,
|
|
10072
10154
|
getContents: async () => {
|
|
10073
10155
|
const template = theme2[component];
|
|
10074
|
-
|
|
10156
|
+
let result = typeof template === "function" ? template(options) : template;
|
|
10157
|
+
result = applyPrefixToObject(result, options.theme?.prefix);
|
|
10075
10158
|
const variants = Object.entries(result.variants || {}).filter(([_, values]) => {
|
|
10076
10159
|
const keys = Object.keys(values);
|
|
10077
10160
|
return keys.some((key) => key !== "true" && key !== "false");
|
|
@@ -10098,7 +10181,24 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
|
|
|
10098
10181
|
});
|
|
10099
10182
|
}
|
|
10100
10183
|
}
|
|
10101
|
-
|
|
10184
|
+
const forNuxt = !!nuxt && (hasNuxtModule("@nuxtjs/mdc") || options.mdc || (hasNuxtModule("@nuxt/content") || options.content));
|
|
10185
|
+
const forVue = !nuxt && options.mdc;
|
|
10186
|
+
if (forNuxt || forVue) {
|
|
10187
|
+
hasProse = true;
|
|
10188
|
+
const path = "prose";
|
|
10189
|
+
writeThemeTemplate(themeProse, path);
|
|
10190
|
+
templates.push({
|
|
10191
|
+
filename: `b24ui/${path}/index.ts`,
|
|
10192
|
+
write: true,
|
|
10193
|
+
getContents: () => Object.keys(themeProse).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
|
|
10194
|
+
});
|
|
10195
|
+
}
|
|
10196
|
+
if (!!nuxt && (hasNuxtModule("@nuxt/content") || options.content)) {
|
|
10197
|
+
hasContent = true;
|
|
10198
|
+
writeThemeTemplate(themeContent, "content");
|
|
10199
|
+
}
|
|
10200
|
+
writeThemeTemplate(theme);
|
|
10201
|
+
async function generateSources() {
|
|
10102
10202
|
let sources = "";
|
|
10103
10203
|
if (!!nuxt && !!resolve && options.experimental?.componentDetection) {
|
|
10104
10204
|
const detectedComponents = await detectUsedComponents(
|
|
@@ -10142,30 +10242,26 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
|
|
|
10142
10242
|
}
|
|
10143
10243
|
return sources || '@source "./b24ui";';
|
|
10144
10244
|
}
|
|
10145
|
-
const forNuxt = !!nuxt && (hasNuxtModule("@nuxtjs/mdc") || options.mdc || (hasNuxtModule("@nuxt/content") || options.content));
|
|
10146
|
-
const forVue = !nuxt && options.mdc;
|
|
10147
|
-
if (forNuxt || forVue) {
|
|
10148
|
-
hasProse = true;
|
|
10149
|
-
const path = "prose";
|
|
10150
|
-
writeThemeTemplate(themeProse, path);
|
|
10151
|
-
templates.push({
|
|
10152
|
-
filename: `b24ui/${path}/index.ts`,
|
|
10153
|
-
write: true,
|
|
10154
|
-
getContents: () => Object.keys(themeProse).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
|
|
10155
|
-
});
|
|
10156
|
-
}
|
|
10157
|
-
if (!!nuxt && (hasNuxtModule("@nuxt/content") || options.content)) {
|
|
10158
|
-
hasContent = true;
|
|
10159
|
-
writeThemeTemplate(themeContent, "content");
|
|
10160
|
-
}
|
|
10161
|
-
writeThemeTemplate(theme);
|
|
10162
10245
|
templates.push({
|
|
10163
10246
|
filename: "b24ui.css",
|
|
10164
10247
|
write: true,
|
|
10165
10248
|
getContents: async () => {
|
|
10166
|
-
const sources = await
|
|
10249
|
+
const sources = await generateSources();
|
|
10250
|
+
const prefix = options.theme?.prefix ? `${options.theme.prefix}:` : "";
|
|
10167
10251
|
return `${sources}
|
|
10168
10252
|
|
|
10253
|
+
@layer base {
|
|
10254
|
+
body {
|
|
10255
|
+
scrollbar-gutter: stable;
|
|
10256
|
+
background: var(--air-theme-background);
|
|
10257
|
+
@apply ${prefix}antialiased ${prefix}font-(family-name:--ui-font-family-system) ${prefix}text-(--b24ui-typography-legend-color) ${prefix}scheme-light ${prefix}dark:scheme-dark ${prefix}edge-light:scheme-light ${prefix}edge-dark:scheme-light;
|
|
10258
|
+
}
|
|
10259
|
+
|
|
10260
|
+
.sidebar-layout.--inner {
|
|
10261
|
+
background: var(--air-theme-background);
|
|
10262
|
+
}
|
|
10263
|
+
}
|
|
10264
|
+
|
|
10169
10265
|
@theme static {}
|
|
10170
10266
|
|
|
10171
10267
|
@theme default inline {}
|
|
@@ -10175,17 +10271,11 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
|
|
|
10175
10271
|
templates.push({
|
|
10176
10272
|
filename: "b24ui/index.ts",
|
|
10177
10273
|
write: true,
|
|
10178
|
-
getContents: () =>
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
}
|
|
10184
|
-
if (hasProse) contents += `
|
|
10185
|
-
export * as prose from './prose'
|
|
10186
|
-
`;
|
|
10187
|
-
return contents;
|
|
10188
|
-
}
|
|
10274
|
+
getContents: () => [
|
|
10275
|
+
...Object.keys(theme).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`),
|
|
10276
|
+
...hasContent ? Object.keys(themeContent).map((component) => `export { default as ${component} } from './content/${kebabCase(component)}'`) : [],
|
|
10277
|
+
...hasProse ? [`export * as prose from './prose'`] : []
|
|
10278
|
+
].join("\n")
|
|
10189
10279
|
});
|
|
10190
10280
|
templates.push({
|
|
10191
10281
|
filename: "types/b24ui.d.ts",
|
|
@@ -10195,6 +10285,7 @@ import type { TVConfig } from '@bitrix24/b24ui-nuxt'
|
|
|
10195
10285
|
import type { defaultConfig } from 'tailwind-variants'
|
|
10196
10286
|
|
|
10197
10287
|
type AppConfigUI = {
|
|
10288
|
+
prefix?: string
|
|
10198
10289
|
tv?: typeof defaultConfig
|
|
10199
10290
|
} & TVConfig<typeof b24ui>
|
|
10200
10291
|
|
|
@@ -10243,4 +10334,4 @@ function addTemplates(options, nuxt, resolve) {
|
|
|
10243
10334
|
}
|
|
10244
10335
|
}
|
|
10245
10336
|
|
|
10246
|
-
export {
|
|
10337
|
+
export { getDefaultConfig as a, addTemplates as b, defaultOptions as d, getTemplates as g, name as n, version as v };
|
package/dist/unplugin.d.mts
CHANGED
|
@@ -7,7 +7,9 @@ import { TVConfig } from '../dist/runtime/types/tv.js';
|
|
|
7
7
|
import { ColorModeTypeLight } from '../dist/runtime/types/index.js';
|
|
8
8
|
import '@nuxt/schema';
|
|
9
9
|
|
|
10
|
-
type AppConfigB24UI = {
|
|
10
|
+
type AppConfigB24UI = {
|
|
11
|
+
prefix?: string;
|
|
12
|
+
} & TVConfig<typeof b24ui>;
|
|
11
13
|
interface Bitrix24UIOptions extends Omit<ModuleOptions, 'colorMode'> {
|
|
12
14
|
/** Whether to generate declaration files for auto-imported components. */
|
|
13
15
|
dts?: boolean;
|
package/dist/unplugin.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
|
|
|
3
3
|
import { createUnplugin } from 'unplugin';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import tailwind from '@tailwindcss/vite';
|
|
6
|
-
import { g as getTemplates, d as defaultOptions, a as
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.4XNR9Ysu.mjs';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import MagicString from 'magic-string';
|
|
@@ -12,9 +12,9 @@ import { resolvePathSync } from 'mlly';
|
|
|
12
12
|
import { globSync } from 'tinyglobby';
|
|
13
13
|
import AutoImportComponents from 'unplugin-vue-components';
|
|
14
14
|
import AutoImport from 'unplugin-auto-import';
|
|
15
|
-
import 'node:fs/promises';
|
|
16
15
|
import 'scule';
|
|
17
16
|
import '@nuxt/kit';
|
|
17
|
+
import 'node:fs/promises';
|
|
18
18
|
|
|
19
19
|
function TemplatePlugin(options, appConfig) {
|
|
20
20
|
const templates = getTemplates(options, appConfig.b24ui);
|
|
@@ -280,6 +280,7 @@ function AutoImportPlugin(options, meta) {
|
|
|
280
280
|
const runtimeDir = normalize(fileURLToPath(new URL("./runtime", import.meta.url)));
|
|
281
281
|
const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
|
|
282
282
|
const options = defu(_options, {}, defaultOptions);
|
|
283
|
+
options.theme = options.theme || {};
|
|
283
284
|
const appConfig = defu(
|
|
284
285
|
{
|
|
285
286
|
b24ui: options.b24ui,
|
|
@@ -288,7 +289,7 @@ const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
|
|
|
288
289
|
colorModeTypeLight: options.colorModeTypeLight
|
|
289
290
|
},
|
|
290
291
|
{
|
|
291
|
-
b24ui:
|
|
292
|
+
b24ui: getDefaultConfig(options.theme)
|
|
292
293
|
}
|
|
293
294
|
);
|
|
294
295
|
return [
|
package/dist/vite.mjs
CHANGED
|
@@ -4,12 +4,12 @@ import 'pathe';
|
|
|
4
4
|
import 'unplugin';
|
|
5
5
|
import 'defu';
|
|
6
6
|
import '@tailwindcss/vite';
|
|
7
|
-
import './shared/b24ui-nuxt.
|
|
8
|
-
import 'node:fs/promises';
|
|
9
|
-
import 'tinyglobby';
|
|
7
|
+
import './shared/b24ui-nuxt.4XNR9Ysu.mjs';
|
|
10
8
|
import 'scule';
|
|
11
9
|
import 'knitwork';
|
|
12
10
|
import '@nuxt/kit';
|
|
11
|
+
import 'node:fs/promises';
|
|
12
|
+
import 'tinyglobby';
|
|
13
13
|
import 'node:fs';
|
|
14
14
|
import 'node:path';
|
|
15
15
|
import 'magic-string';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrix24/b24ui-nuxt",
|
|
3
3
|
"description": "Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.9",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/bitrix24/b24ui.git"
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"vue-plugin.d.ts"
|
|
95
95
|
],
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@bitrix24/b24icons-vue": "^2.0.
|
|
97
|
+
"@bitrix24/b24icons-vue": "^2.0.5",
|
|
98
98
|
"@internationalized/date": "^3.10.0",
|
|
99
99
|
"@internationalized/number": "^3.6.5",
|
|
100
100
|
"@nuxt/kit": "^4.2.0",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"unplugin-auto-import": "^20.2.0",
|
|
137
137
|
"unplugin-vue-components": "^30.0.0",
|
|
138
138
|
"vaul-vue": "0.4.1",
|
|
139
|
-
"vue-component-type-helpers": "^3.1.
|
|
139
|
+
"vue-component-type-helpers": "^3.1.3"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
142
|
"@nuxt/content": "^3.7.1",
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"vitest": "^3.2.4",
|
|
158
158
|
"vitest-axe": "^0.1.0",
|
|
159
159
|
"vitest-environment-nuxt": "^1.0.1",
|
|
160
|
-
"vue-tsc": "^3.1.
|
|
160
|
+
"vue-tsc": "^3.1.3"
|
|
161
161
|
},
|
|
162
162
|
"peerDependencies": {
|
|
163
163
|
"@inertiajs/vue3": "^2.0.7",
|
|
File without changes
|