@bitrix24/b24ui-nuxt 2.0.8 → 2.1.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.
Files changed (165) hide show
  1. package/dist/meta.d.mts +84957 -50082
  2. package/dist/meta.mjs +84957 -50082
  3. package/dist/module.d.mts +13 -1
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +8 -7
  6. package/dist/runtime/air-design-tokens/001_b24_global.css +1 -1
  7. package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -1
  8. package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -1
  9. package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -1
  10. package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -1
  11. package/dist/runtime/air-design-tokens/007_b24_global.css +1 -1
  12. package/dist/runtime/air-design-tokens/008_ui_global.css +1 -1
  13. package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -1
  14. package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -1
  15. package/dist/runtime/air-design-tokens/components/button.css +1 -1
  16. package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -1
  17. package/dist/runtime/air-design-tokens/components/popup.css +1 -1
  18. package/dist/runtime/air-design-tokens/components/scrollbar.css +1 -2
  19. package/dist/runtime/air-design-tokens/index.css +1 -1
  20. package/dist/runtime/components/Advice.d.vue.ts +1 -1
  21. package/dist/runtime/components/Advice.vue +1 -3
  22. package/dist/runtime/components/Advice.vue.d.ts +1 -1
  23. package/dist/runtime/components/App.d.vue.ts +1 -1
  24. package/dist/runtime/components/App.vue +2 -1
  25. package/dist/runtime/components/App.vue.d.ts +1 -1
  26. package/dist/runtime/components/Avatar.d.vue.ts +2 -1
  27. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  28. package/dist/runtime/components/Button.vue +1 -0
  29. package/dist/runtime/components/ChatPrompt.d.vue.ts +2 -2
  30. package/dist/runtime/components/ChatPrompt.vue +5 -5
  31. package/dist/runtime/components/ChatPrompt.vue.d.ts +2 -2
  32. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +5 -5
  33. package/dist/runtime/components/ChatPromptSubmit.vue +53 -4
  34. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +5 -5
  35. package/dist/runtime/components/Checkbox.d.vue.ts +2 -1
  36. package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
  37. package/dist/runtime/components/CommandPalette.vue +5 -4
  38. package/dist/runtime/components/DashboardSearch.d.vue.ts +3 -6
  39. package/dist/runtime/components/DashboardSearch.vue +2 -3
  40. package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -6
  41. package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -3
  42. package/dist/runtime/components/DashboardSearchButton.vue +44 -6
  43. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -3
  44. package/dist/runtime/components/Error.d.vue.ts +1 -1
  45. package/dist/runtime/components/Error.vue.d.ts +1 -1
  46. package/dist/runtime/components/FileUpload.d.vue.ts +3 -2
  47. package/dist/runtime/components/FileUpload.vue +9 -9
  48. package/dist/runtime/components/FileUpload.vue.d.ts +3 -2
  49. package/dist/runtime/components/Form.d.vue.ts +3 -2
  50. package/dist/runtime/components/Form.vue +3 -4
  51. package/dist/runtime/components/Form.vue.d.ts +3 -2
  52. package/dist/runtime/components/Input.d.vue.ts +7 -7
  53. package/dist/runtime/components/Input.vue +2 -2
  54. package/dist/runtime/components/Input.vue.d.ts +7 -7
  55. package/dist/runtime/components/InputDate.d.vue.ts +115 -0
  56. package/dist/runtime/components/InputDate.vue +198 -0
  57. package/dist/runtime/components/InputDate.vue.d.ts +115 -0
  58. package/dist/runtime/components/InputMenu.d.vue.ts +7 -128
  59. package/dist/runtime/components/InputMenu.vue +3 -3
  60. package/dist/runtime/components/InputMenu.vue.d.ts +7 -128
  61. package/dist/runtime/components/InputNumber.d.vue.ts +25 -124
  62. package/dist/runtime/components/InputNumber.vue +3 -3
  63. package/dist/runtime/components/InputNumber.vue.d.ts +25 -124
  64. package/dist/runtime/components/InputTags.d.vue.ts +6 -109
  65. package/dist/runtime/components/InputTags.vue +8 -8
  66. package/dist/runtime/components/InputTags.vue.d.ts +6 -109
  67. package/dist/runtime/components/InputTime.d.vue.ts +99 -0
  68. package/dist/runtime/components/InputTime.vue +170 -0
  69. package/dist/runtime/components/InputTime.vue.d.ts +99 -0
  70. package/dist/runtime/components/Link.d.vue.ts +4 -49
  71. package/dist/runtime/components/Link.vue +1 -0
  72. package/dist/runtime/components/Link.vue.d.ts +4 -49
  73. package/dist/runtime/components/Modal.d.vue.ts +6 -1
  74. package/dist/runtime/components/Modal.vue +37 -9
  75. package/dist/runtime/components/Modal.vue.d.ts +6 -1
  76. package/dist/runtime/components/Pagination.d.vue.ts +2 -2
  77. package/dist/runtime/components/Pagination.vue.d.ts +2 -2
  78. package/dist/runtime/components/PinInput.d.vue.ts +3 -3
  79. package/dist/runtime/components/PinInput.vue.d.ts +3 -3
  80. package/dist/runtime/components/Progress.d.vue.ts +1 -1
  81. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  82. package/dist/runtime/components/Select.d.vue.ts +6 -107
  83. package/dist/runtime/components/Select.vue +3 -3
  84. package/dist/runtime/components/Select.vue.d.ts +6 -107
  85. package/dist/runtime/components/SelectMenu.d.vue.ts +7 -106
  86. package/dist/runtime/components/SelectMenu.vue +3 -3
  87. package/dist/runtime/components/SelectMenu.vue.d.ts +7 -106
  88. package/dist/runtime/components/Slideover.d.vue.ts +1 -1
  89. package/dist/runtime/components/Slideover.vue.d.ts +1 -1
  90. package/dist/runtime/components/Switch.d.vue.ts +2 -1
  91. package/dist/runtime/components/Switch.vue.d.ts +2 -1
  92. package/dist/runtime/components/Table.d.vue.ts +5 -4
  93. package/dist/runtime/components/Table.vue +4 -3
  94. package/dist/runtime/components/Table.vue.d.ts +5 -4
  95. package/dist/runtime/components/Textarea.d.vue.ts +7 -6
  96. package/dist/runtime/components/Textarea.vue +2 -2
  97. package/dist/runtime/components/Textarea.vue.d.ts +7 -6
  98. package/dist/runtime/components/Toast.vue +5 -5
  99. package/dist/runtime/components/Toaster.d.vue.ts +1 -1
  100. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  101. package/dist/runtime/components/color-mode/ColorModeAvatar.d.vue.ts +3 -3
  102. package/dist/runtime/components/color-mode/ColorModeAvatar.vue +16 -4
  103. package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +3 -3
  104. package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +3 -3
  105. package/dist/runtime/components/color-mode/ColorModeButton.vue +54 -6
  106. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
  107. package/dist/runtime/components/color-mode/ColorModeImage.d.vue.ts +4 -3
  108. package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -0
  109. package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +4 -3
  110. package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  111. package/dist/runtime/components/color-mode/ColorModeSelect.vue +47 -5
  112. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  113. package/dist/runtime/components/color-mode/ColorModeSwitch.d.vue.ts +2 -2
  114. package/dist/runtime/components/color-mode/ColorModeSwitch.vue +29 -5
  115. package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +2 -2
  116. package/dist/runtime/components/content/ContentSearch.d.vue.ts +3 -6
  117. package/dist/runtime/components/content/ContentSearch.vue +2 -3
  118. package/dist/runtime/components/content/ContentSearch.vue.d.ts +3 -6
  119. package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -3
  120. package/dist/runtime/components/content/ContentSearchButton.vue +43 -5
  121. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -3
  122. package/dist/runtime/components/content/ContentSurround.vue +7 -1
  123. package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +11 -7
  124. package/dist/runtime/components/locale/LocaleSelect.vue +50 -6
  125. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +11 -7
  126. package/dist/runtime/components/prose/Callout.vue +4 -0
  127. package/dist/runtime/composables/index.d.ts +8 -0
  128. package/dist/runtime/composables/index.js +8 -0
  129. package/dist/runtime/composables/useFileUpload.d.ts +2 -1
  130. package/dist/runtime/composables/useFileUpload.js +13 -4
  131. package/dist/runtime/index.css +1 -1
  132. package/dist/runtime/inertia/components/Link.d.vue.ts +17 -10
  133. package/dist/runtime/inertia/components/Link.vue +8 -6
  134. package/dist/runtime/inertia/components/Link.vue.d.ts +17 -10
  135. package/dist/runtime/inertia/stubs.d.ts +1 -1
  136. package/dist/runtime/plugins/colors.js +4 -8
  137. package/dist/runtime/types/html.d.ts +8 -0
  138. package/dist/runtime/types/index.d.ts +2 -0
  139. package/dist/runtime/types/index.js +2 -0
  140. package/dist/runtime/types/input.d.ts +5 -5
  141. package/dist/runtime/types/utils.d.ts +2 -0
  142. package/dist/runtime/utils/content.d.ts +2 -2
  143. package/dist/runtime/utils/dashboard.d.ts +1 -1
  144. package/dist/runtime/utils/link.d.ts +1 -0
  145. package/dist/runtime/utils/link.js +40 -24
  146. package/dist/runtime/vue/components/Link.d.vue.ts +8 -37
  147. package/dist/runtime/vue/components/Link.vue +6 -11
  148. package/dist/runtime/vue/components/Link.vue.d.ts +8 -37
  149. package/dist/runtime/vue/components/color-mode/ColorModeButton.d.vue.ts +2 -2
  150. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +55 -5
  151. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +2 -2
  152. package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  153. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +46 -3
  154. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  155. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.d.vue.ts +1 -1
  156. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +24 -3
  157. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  158. package/dist/runtime/vue/stubs.d.ts +2 -2
  159. package/dist/runtime/vue/stubs.js +1 -1
  160. package/dist/shared/{b24ui-nuxt.CEMVb5Ee.mjs → b24ui-nuxt.CXLCGBie.mjs} +353 -128
  161. package/dist/unplugin.d.mts +3 -1
  162. package/dist/unplugin.mjs +4 -3
  163. package/dist/vite.mjs +3 -3
  164. package/package.json +27 -17
  165. /package/dist/runtime/{air-design-tokens/002_b24_context_utility.css → types/html.js} +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.8";
11
+ const version = "2.1.0";
12
12
 
13
- const getDefaultUiConfig = () => ({});
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",
@@ -3645,6 +3768,72 @@ const input = {
3645
3768
  }
3646
3769
  };
3647
3770
 
3771
+ const inputDate = () => {
3772
+ return defuFn({
3773
+ slots: {
3774
+ root: () => void 0,
3775
+ base: () => [
3776
+ "group",
3777
+ "relative",
3778
+ "inline-flex items-center",
3779
+ "select-none",
3780
+ "transition-colors",
3781
+ "style-blurred-bg-input"
3782
+ ].join(" "),
3783
+ segment: [
3784
+ "rounded",
3785
+ "text-center",
3786
+ "outline-hidden",
3787
+ "text-(--ui-color-base-1)",
3788
+ "data-placeholder:text-(--ui-color-design-plain-na-content-secondary)",
3789
+ "hover:text-(--ui-color-base-1)",
3790
+ "focus:text-(--ui-color-base-1)",
3791
+ "active:text-(--ui-color-base-1)",
3792
+ "font-[family-name:var(--ui-font-family-primary)] font-(--ui-font-weight-regular)",
3793
+ "align-middle",
3794
+ "data-[segment=literal]:text-(--ui-color-base-6)",
3795
+ "data-invalid:text-(--ui-color-accent-main-alert)",
3796
+ "data-disabled:cursor-not-allowed",
3797
+ "data-disabled:pointer-events-none",
3798
+ "data-disabled:select-none",
3799
+ "data-disabled:opacity-30",
3800
+ "transition-colors",
3801
+ "focus:bg-(--ui-color-bg-content-secondary)"
3802
+ ].join(" "),
3803
+ separatorIcon: "shrink-0 size-4 text-(--ui-color-base-6)"
3804
+ },
3805
+ variants: {
3806
+ size: {
3807
+ xss: {
3808
+ base: (prev) => [prev, "gap-0.20", "px-1"].join(" "),
3809
+ segment: "data-[segment=day]:w-6 data-[segment=month]:w-6 data-[segment=year]:w-9"
3810
+ },
3811
+ xs: {
3812
+ base: (prev) => [prev, "gap-0.25", "px-2"].join(" "),
3813
+ segment: "data-[segment=day]:w-6 data-[segment=month]:w-6 data-[segment=year]:w-9"
3814
+ },
3815
+ sm: {
3816
+ base: (prev) => [prev, "gap-0.5", "px-2"].join(" "),
3817
+ segment: "data-[segment=day]:w-6 data-[segment=month]:w-6 data-[segment=year]:w-9"
3818
+ },
3819
+ md: {
3820
+ base: (prev) => [prev, "gap-0.5", "px-3"].join(" "),
3821
+ segment: "data-[segment=day]:w-7 data-[segment=month]:w-7 data-[segment=year]:w-11"
3822
+ },
3823
+ lg: {
3824
+ base: (prev) => [prev, "gap-0.75", "px-3"].join(" "),
3825
+ segment: "data-[segment=day]:w-7 data-[segment=month]:w-7 data-[segment=year]:w-11"
3826
+ },
3827
+ xl: {
3828
+ base: (prev) => [prev, "gap-0.75", "px-3"].join(" "),
3829
+ segment: "data-[segment=day]:w-8 data-[segment=month]:w-8 data-[segment=year]:w-13"
3830
+ }
3831
+ }
3832
+ },
3833
+ compoundVariants: []
3834
+ }, input);
3835
+ };
3836
+
3648
3837
  const inputMenu = () => {
3649
3838
  return defuFn({
3650
3839
  slots: {
@@ -4633,6 +4822,72 @@ function replaceFocus$2(str) {
4633
4822
  return str.replace(/focus:/g, "has-focus:").replace(/focus-visible:/g, "has-focus-visible:");
4634
4823
  }
4635
4824
 
4825
+ const inputTime = () => {
4826
+ return defuFn({
4827
+ slots: {
4828
+ root: () => void 0,
4829
+ base: () => [
4830
+ "group",
4831
+ "relative",
4832
+ "inline-flex items-center",
4833
+ "select-none",
4834
+ "transition-colors",
4835
+ "style-blurred-bg-input"
4836
+ ].join(" "),
4837
+ segment: [
4838
+ "rounded",
4839
+ "text-center",
4840
+ "outline-hidden",
4841
+ "text-(--ui-color-base-1)",
4842
+ "data-placeholder:text-(--ui-color-design-plain-na-content-secondary)",
4843
+ "hover:text-(--ui-color-base-1)",
4844
+ "focus:text-(--ui-color-base-1)",
4845
+ "active:text-(--ui-color-base-1)",
4846
+ "font-[family-name:var(--ui-font-family-primary)] font-(--ui-font-weight-regular)",
4847
+ "align-middle",
4848
+ "data-[segment=literal]:text-(--ui-color-base-6)",
4849
+ "data-invalid:text-(--ui-color-accent-main-alert)",
4850
+ "data-disabled:cursor-not-allowed",
4851
+ "data-disabled:pointer-events-none",
4852
+ "data-disabled:select-none",
4853
+ "data-disabled:opacity-30",
4854
+ "data-disabled:resize-none",
4855
+ "transition-colors",
4856
+ "focus:bg-(--ui-color-bg-content-secondary)"
4857
+ ].join(" ")
4858
+ },
4859
+ variants: {
4860
+ size: {
4861
+ xss: {
4862
+ base: (prev) => [prev, "gap-0.20", "px-1"].join(" "),
4863
+ segment: "not-data-[segment=literal]:w-6"
4864
+ },
4865
+ xs: {
4866
+ base: (prev) => [prev, "gap-0.25", "px-2"].join(" "),
4867
+ segment: "not-data-[segment=literal]:w-6"
4868
+ },
4869
+ sm: {
4870
+ base: (prev) => [prev, "gap-0.5", "px-2"].join(" "),
4871
+ segment: "not-data-[segment=literal]:w-6"
4872
+ },
4873
+ md: {
4874
+ base: (prev) => [prev, "gap-0.5", "px-3"].join(" "),
4875
+ segment: "not-data-[segment=literal]:w-7"
4876
+ },
4877
+ lg: {
4878
+ base: (prev) => [prev, "gap-0.75", "px-3"].join(" "),
4879
+ segment: "not-data-[segment=literal]:w-7"
4880
+ },
4881
+ xl: {
4882
+ base: (prev) => [prev, "gap-0.75", "px-3"].join(" "),
4883
+ segment: "not-data-[segment=literal]:w-8"
4884
+ }
4885
+ }
4886
+ },
4887
+ compoundVariants: []
4888
+ }, input);
4889
+ };
4890
+
4636
4891
  const kbd$1 = {
4637
4892
  slots: {
4638
4893
  base: [
@@ -4711,20 +4966,23 @@ const link = (options) => ({
4711
4966
 
4712
4967
  const modal = {
4713
4968
  slots: {
4714
- overlay: "fixed inset-0 bg-[#003366]/20",
4969
+ overlay: "fixed inset-0",
4715
4970
  content: [
4716
4971
  "light",
4717
4972
  "bg-(--popup-window-background-color)",
4718
- "fixed",
4719
4973
  "flex flex-col gap-[20px]",
4720
4974
  "focus:outline-none",
4721
4975
  "p-[24px] pt-[20px]"
4722
4976
  ].join(" "),
4723
- contentWrapper: [
4724
- "flex flex-col gap-[15px] pt-[4px]"
4725
- ].join(" "),
4977
+ contentWrapper: "flex flex-col gap-[15px] pt-[4px]",
4726
4978
  header: "flex items-start justify-between gap-[6px]",
4727
4979
  wrapper: "",
4980
+ body: "flex-1 text-(length:--ui-font-size-md) leading-normal",
4981
+ footer: [
4982
+ "flex items-center justify-between gap-[10px]",
4983
+ "border-t border-t-1 border-t-(--ui-color-divider-default)",
4984
+ "pt-[18px]"
4985
+ ].join(" "),
4728
4986
  title: [
4729
4987
  "font-[family-name:var(--ui-font-family-primary)]",
4730
4988
  "text-(--b24ui-typography-label-color)",
@@ -4737,13 +4995,7 @@ const modal = {
4737
4995
  "text-(--b24ui-typography-description-color)",
4738
4996
  "text-(length:--ui-font-size-sm)"
4739
4997
  ].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(" ")
4998
+ close: "-mt-[4px]"
4747
4999
  },
4748
5000
  variants: {
4749
5001
  overlayBlur: {
@@ -4763,13 +5015,30 @@ const modal = {
4763
5015
  },
4764
5016
  false: {
4765
5017
  content: [
4766
- "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
4767
- "w-[calc(100vw-2rem)] max-w-[32rem] max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)]",
5018
+ // // 'top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',
5019
+ "w-[calc(100vw-2rem)] max-w-[32rem]",
5020
+ // // 'max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)]',
4768
5021
  "rounded-[calc(var(--popup-window-border-radius)-2px)] shadow-lg"
4769
5022
  // @memo see components/popup.css
4770
5023
  // 'ring ring-(--popup-window-border)'
4771
5024
  ].join(" "),
4772
- contentWrapper: "overflow-hidden"
5025
+ contentWrapper: ""
5026
+ // // overflow-hidden
5027
+ }
5028
+ },
5029
+ overlay: {
5030
+ true: {
5031
+ overlay: "bg-[#003366]/20"
5032
+ }
5033
+ },
5034
+ scrollable: {
5035
+ true: {
5036
+ overlay: "overflow-y-auto",
5037
+ content: "relative"
5038
+ },
5039
+ false: {
5040
+ content: "fixed",
5041
+ body: "overflow-y-auto"
4773
5042
  }
4774
5043
  },
4775
5044
  scrollbarThin: {
@@ -4778,6 +5047,27 @@ const modal = {
4778
5047
  }
4779
5048
  }
4780
5049
  },
5050
+ compoundVariants: [
5051
+ {
5052
+ scrollable: true,
5053
+ fullscreen: false,
5054
+ class: {
5055
+ overlay: "grid place-items-center p-4 sm:py-8"
5056
+ }
5057
+ },
5058
+ {
5059
+ scrollable: false,
5060
+ fullscreen: false,
5061
+ class: {
5062
+ content: [
5063
+ "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
5064
+ "max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)]"
5065
+ // // overflow-hidden
5066
+ ].join(" "),
5067
+ contentWrapper: "overflow-hidden"
5068
+ }
5069
+ }
5070
+ ],
4781
5071
  defaultVariants: {
4782
5072
  scrollbarThin: true,
4783
5073
  overlayBlur: "auto"
@@ -8863,9 +9153,11 @@ const theme = {
8863
9153
  form: form,
8864
9154
  formField: formField,
8865
9155
  input: input,
9156
+ inputDate: inputDate,
8866
9157
  inputMenu: inputMenu,
8867
9158
  inputNumber: inputNumber,
8868
9159
  inputTags: inputTags,
9160
+ inputTime: inputTime,
8869
9161
  kbd: kbd$1,
8870
9162
  link: link,
8871
9163
  modal: modal,
@@ -9983,82 +10275,6 @@ const themeContent = {
9983
10275
  contentToc: contentToc
9984
10276
  };
9985
10277
 
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
10278
  function getTemplates(options, uiConfig, nuxt, resolve) {
10063
10279
  const templates = [];
10064
10280
  let hasProse = false;
@@ -10071,7 +10287,8 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
10071
10287
  write: true,
10072
10288
  getContents: async () => {
10073
10289
  const template = theme2[component];
10074
- const result = typeof template === "function" ? template(options) : template;
10290
+ let result = typeof template === "function" ? template(options) : template;
10291
+ result = applyPrefixToObject(result, options.theme?.prefix);
10075
10292
  const variants = Object.entries(result.variants || {}).filter(([_, values]) => {
10076
10293
  const keys = Object.keys(values);
10077
10294
  return keys.some((key) => key !== "true" && key !== "false");
@@ -10098,7 +10315,24 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
10098
10315
  });
10099
10316
  }
10100
10317
  }
10101
- async function getSources() {
10318
+ const forNuxt = !!nuxt && (hasNuxtModule("@nuxtjs/mdc") || options.mdc || (hasNuxtModule("@nuxt/content") || options.content));
10319
+ const forVue = !nuxt && options.mdc;
10320
+ if (forNuxt || forVue) {
10321
+ hasProse = true;
10322
+ const path = "prose";
10323
+ writeThemeTemplate(themeProse, path);
10324
+ templates.push({
10325
+ filename: `b24ui/${path}/index.ts`,
10326
+ write: true,
10327
+ getContents: () => Object.keys(themeProse).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
10328
+ });
10329
+ }
10330
+ if (!!nuxt && (hasNuxtModule("@nuxt/content") || options.content)) {
10331
+ hasContent = true;
10332
+ writeThemeTemplate(themeContent, "content");
10333
+ }
10334
+ writeThemeTemplate(theme);
10335
+ async function generateSources() {
10102
10336
  let sources = "";
10103
10337
  if (!!nuxt && !!resolve && options.experimental?.componentDetection) {
10104
10338
  const detectedComponents = await detectUsedComponents(
@@ -10142,30 +10376,26 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
10142
10376
  }
10143
10377
  return sources || '@source "./b24ui";';
10144
10378
  }
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
10379
  templates.push({
10163
10380
  filename: "b24ui.css",
10164
10381
  write: true,
10165
10382
  getContents: async () => {
10166
- const sources = await getSources();
10383
+ const sources = await generateSources();
10384
+ const prefix = options.theme?.prefix ? `${options.theme.prefix}:` : "";
10167
10385
  return `${sources}
10168
10386
 
10387
+ @layer base {
10388
+ body {
10389
+ scrollbar-gutter: stable;
10390
+ background: var(--air-theme-background);
10391
+ @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;
10392
+ }
10393
+
10394
+ .sidebar-layout.--inner {
10395
+ background: var(--air-theme-background);
10396
+ }
10397
+ }
10398
+
10169
10399
  @theme static {}
10170
10400
 
10171
10401
  @theme default inline {}
@@ -10175,17 +10405,11 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
10175
10405
  templates.push({
10176
10406
  filename: "b24ui/index.ts",
10177
10407
  write: true,
10178
- getContents: () => {
10179
- let contents = Object.keys(theme).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n");
10180
- if (hasContent) {
10181
- contents += "\n";
10182
- contents += Object.keys(themeContent).map((component) => `export { default as ${component} } from './content/${kebabCase(component)}'`).join("\n");
10183
- }
10184
- if (hasProse) contents += `
10185
- export * as prose from './prose'
10186
- `;
10187
- return contents;
10188
- }
10408
+ getContents: () => [
10409
+ ...Object.keys(theme).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`),
10410
+ ...hasContent ? Object.keys(themeContent).map((component) => `export { default as ${component} } from './content/${kebabCase(component)}'`) : [],
10411
+ ...hasProse ? [`export * as prose from './prose'`] : []
10412
+ ].join("\n")
10189
10413
  });
10190
10414
  templates.push({
10191
10415
  filename: "types/b24ui.d.ts",
@@ -10195,6 +10419,7 @@ import type { TVConfig } from '@bitrix24/b24ui-nuxt'
10195
10419
  import type { defaultConfig } from 'tailwind-variants'
10196
10420
 
10197
10421
  type AppConfigUI = {
10422
+ prefix?: string
10198
10423
  tv?: typeof defaultConfig
10199
10424
  } & TVConfig<typeof b24ui>
10200
10425
 
@@ -10243,4 +10468,4 @@ function addTemplates(options, nuxt, resolve) {
10243
10468
  }
10244
10469
  }
10245
10470
 
10246
- export { getDefaultUiConfig as a, addTemplates as b, defaultOptions as d, getTemplates as g, name as n, version as v };
10471
+ export { getDefaultConfig as a, addTemplates as b, defaultOptions as d, getTemplates as g, name as n, version as v };
@@ -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 = {} & TVConfig<typeof b24ui>;
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 getDefaultUiConfig } from './shared/b24ui-nuxt.CEMVb5Ee.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.CXLCGBie.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: getDefaultUiConfig()
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.CEMVb5Ee.mjs';
8
- import 'node:fs/promises';
9
- import 'tinyglobby';
7
+ import './shared/b24ui-nuxt.CXLCGBie.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';