@bitrix24/b24ui-nuxt 0.1.4 → 0.1.6

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,3 +1,8 @@
1
+ const buttonGroup = [
2
+ "horizontal",
3
+ "vertical"
4
+ ] as const
5
+
1
6
  const color = [
2
7
  "default",
3
8
  "danger",
@@ -34,6 +39,13 @@ export default {
34
39
  "trailingIcon": "shrink-0 cursor-pointer hover:rounded-full hover:bg-current/20 dark:hover:bg-current/35"
35
40
  },
36
41
  "variants": {
42
+ "buttonGroup": {
43
+ "horizontal": "focus-visible:outline-none ring ring-inset ring-0 focus-visible:ring-2 group-[.is-button-group]/items:not-only:first:rounded-e-none group-[.is-button-group]/items:not-only:last:rounded-s-none group-[.is-button-group]/items:not-last:not-first:rounded-none group-[.is-button-group]/items:not-only:first:border-e-0 group-[.is-button-group]/items:not-only:not-first:border-s-0",
44
+ "vertical": "focus-visible:outline-none ring ring-inset ring-0 focus-visible:ring-2 not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
45
+ },
46
+ "noSplit": {
47
+ "false": "group-[.is-button-group]/items:not-only:not-first:after:content-[''] group-[.is-button-group]/items:not-only:not-first:after:absolute group-[.is-button-group]/items:not-only:not-first:after:top-[7px] group-[.is-button-group]/items:not-only:not-first:after:bottom-[6px] group-[.is-button-group]/items:not-only:not-first:after:left-0 group-[.is-button-group]/items:not-only:not-first:after:w-px group-[.is-button-group]/items:not-only:not-first:after:bg-current/30"
48
+ },
37
49
  "useLink": {
38
50
  "true": {
39
51
  "base": "cursor-pointer",
@@ -116,7 +128,7 @@ export default {
116
128
  {
117
129
  "color": "default" as typeof color[number],
118
130
  "depth": "normal" as typeof depth[number],
119
- "class": "ring ring-inset text-base-800 bg-base-150 ring-base-150 dark:text-base-950 dark:bg-base-200 dark:ring-base-200"
131
+ "class": "ring ring-inset text-base-800 bg-base-150 ring-base-300 dark:text-base-950 dark:bg-base-200 dark:ring-base-800"
120
132
  },
121
133
  {
122
134
  "color": "default" as typeof color[number],
@@ -240,6 +252,13 @@ export default {
240
252
  {
241
253
  "useClose": true,
242
254
  "class": ""
255
+ },
256
+ {
257
+ "buttonGroup": [
258
+ "horizontal" as typeof buttonGroup[number],
259
+ "vertical" as typeof buttonGroup[number]
260
+ ],
261
+ "class": "rounded-2xs"
243
262
  }
244
263
  ],
245
264
  "defaultVariants": {
@@ -20,7 +20,7 @@ export default {
20
20
  "lg": ""
21
21
  },
22
22
  "orientation": {
23
- "horizontal": "inline-flex -space-x-px",
23
+ "horizontal": "flex flex-row -space-x-px",
24
24
  "vertical": "flex flex-col -space-y-px"
25
25
  }
26
26
  }
@@ -45,11 +45,11 @@ export default {
45
45
  },
46
46
  "variants": {
47
47
  "buttonGroup": {
48
- "horizontal": "focus-visible:outline-none ring ring-inset ring-0 focus-visible:ring-2 not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none not-only:first:border-e-0 not-only:not-first:border-s-0",
48
+ "horizontal": "focus-visible:outline-none ring ring-inset ring-0 focus-visible:ring-2 group-[.is-button-group]/items:not-only:first:rounded-e-none group-[.is-button-group]/items:not-only:last:rounded-s-none group-[.is-button-group]/items:not-last:not-first:rounded-none group-[.is-button-group]/items:not-only:first:border-e-0 group-[.is-button-group]/items:not-only:not-first:border-s-0",
49
49
  "vertical": "focus-visible:outline-none ring ring-inset ring-0 focus-visible:ring-2 not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
50
50
  },
51
51
  "noSplit": {
52
- "false": "not-only:not-first:after:content-[''] not-only:not-first:after:absolute not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px not-only:not-first:after:bg-current/30"
52
+ "false": "group-[.is-button-group]/items:not-only:not-first:after:content-[''] group-[.is-button-group]/items:not-only:not-first:after:absolute group-[.is-button-group]/items:not-only:not-first:after:top-[7px] group-[.is-button-group]/items:not-only:not-first:after:bottom-[6px] group-[.is-button-group]/items:not-only:not-first:after:left-0 group-[.is-button-group]/items:not-only:not-first:after:w-px group-[.is-button-group]/items:not-only:not-first:after:bg-current/30"
53
53
  },
54
54
  "color": {
55
55
  "default": "text-white dark:text-base-100 bg-base-650 border border-base-650 hover:bg-base-850 hover:border-base-850 hover:focus-visible:ring-0 active:bg-slate-850 active:border-slate-850 active:focus-visible:ring-0 disabled:bg-base-650 aria-disabled:bg-base-650 disabled:border-base-650 aria-disabled:border-base-650 focus-visible:outline-base-650 ring-base-850 focus-visible:ring-base-850",
@@ -51,8 +51,8 @@ export default {
51
51
  "variants": {
52
52
  "buttonGroup": {
53
53
  "horizontal": {
54
- "root": "group",
55
- "base": "focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
54
+ "root": "group leading-none",
55
+ "base": "focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-e-3xl group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
56
56
  },
57
57
  "vertical": {
58
58
  "root": "group",
@@ -60,7 +60,7 @@ export default {
60
60
  }
61
61
  },
62
62
  "noSplit": {
63
- "false": "not-only:not-first:after:content-[''] not-only:not-first:after:absolute not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px not-only:not-first:after:bg-current/30"
63
+ "false": "group-not-only:not-first:after:content-[''] group-not-only:not-first:after:absolute group-not-only:not-first:after:top-[7px] group-not-only:not-first:after:bottom-[6px] group-not-only:not-first:after:left-0 group-not-only:not-first:after:w-px group-not-only:not-first:after:bg-current/30"
64
64
  },
65
65
  "size": {
66
66
  "xs": {
@@ -38,8 +38,8 @@ const type = [
38
38
 
39
39
  export default {
40
40
  "slots": {
41
- "root": "relative inline-flex items-center min-w-full w-full",
42
- "base": "relative inline-flex items-center group min-w-full w-full py-0 border-0 focus:outline-none cursor-pointer disabled:cursor-not-allowed disabled:bg-base-30/37 disabled:text-base-500 dark:disabled:bg-base-900/37 dark:disabled:text-base-800 appearance-none transition duration-300 ease-linear ring ring-inset ring-base-300 dark:ring-base-800 text-base-master bg-white hover:text-base-900 focus:text-base-900 active:text-base-900 dark:text-base-150 dark:bg-transparent dark:hover:text-base-350 dark:focus:text-base-350 dark:active:text-base-350 font-b24-primary font-regular text-sm align-middle text-ellipsis whitespace-nowrap",
41
+ "root": "relative inline-flex items-center w-full",
42
+ "base": "relative inline-flex items-center group py-0 border-0 focus:outline-none cursor-pointer disabled:cursor-not-allowed disabled:bg-base-30/37 disabled:text-base-500 dark:disabled:bg-base-900/37 dark:disabled:text-base-800 appearance-none transition duration-300 ease-linear ring ring-inset ring-base-300 dark:ring-base-800 text-base-master bg-white hover:text-base-900 focus:text-base-900 active:text-base-900 dark:text-base-150 dark:bg-transparent dark:hover:text-base-350 dark:focus:text-base-350 dark:active:text-base-350 font-b24-primary font-regular text-sm leading-none align-middle text-ellipsis whitespace-nowrap",
43
43
  "leading": "absolute inset-y-0 start-0 flex items-center",
44
44
  "leadingIcon": "shrink-0 text-base-400",
45
45
  "leadingAvatar": "shrink-0",
@@ -71,8 +71,8 @@ export default {
71
71
  "variants": {
72
72
  "buttonGroup": {
73
73
  "horizontal": {
74
- "root": "group",
75
- "base": "focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
74
+ "root": "group leading-none",
75
+ "base": "focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-e-3xl group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
76
76
  },
77
77
  "vertical": {
78
78
  "root": "group",
@@ -80,7 +80,7 @@ export default {
80
80
  }
81
81
  },
82
82
  "noSplit": {
83
- "false": "not-only:not-first:after:content-[''] not-only:not-first:after:absolute not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px not-only:not-first:after:bg-current/30"
83
+ "false": "group-not-only:not-first:after:content-[''] group-not-only:not-first:after:absolute group-not-only:not-first:after:top-[7px] group-not-only:not-first:after:bottom-[6px] group-not-only:not-first:after:left-0 group-not-only:not-first:after:w-px group-not-only:not-first:after:bg-current/30"
84
84
  },
85
85
  "size": {
86
86
  "xs": {
@@ -34,8 +34,8 @@ export default {
34
34
  "variants": {
35
35
  "buttonGroup": {
36
36
  "horizontal": {
37
- "root": "group",
38
- "base": "focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
37
+ "root": "group leading-none",
38
+ "base": "focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-e-3xl group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
39
39
  },
40
40
  "vertical": {
41
41
  "root": "group",
@@ -43,7 +43,7 @@ export default {
43
43
  }
44
44
  },
45
45
  "noSplit": {
46
- "false": "not-only:not-first:after:content-[''] not-only:not-first:after:absolute not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px not-only:not-first:after:bg-current/30"
46
+ "false": "group-not-only:not-first:after:content-[''] group-not-only:not-first:after:absolute group-not-only:not-first:after:top-[7px] group-not-only:not-first:after:bottom-[6px] group-not-only:not-first:after:left-0 group-not-only:not-first:after:w-px group-not-only:not-first:after:bg-current/30"
47
47
  },
48
48
  "color": {
49
49
  "default": "",
package/dist/module.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  const defu = require('defu');
4
4
  const kit = require('@nuxt/kit');
5
- const templates = require('./shared/b24ui-nuxt.D8eTlsIC.cjs');
5
+ const templates = require('./shared/b24ui-nuxt.BAQG__ma.cjs');
6
6
  require('node:url');
7
7
  require('scule');
8
8
 
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.13.1"
6
6
  },
7
7
  "docs": "https://bitrix24.github.io/b24ui/guide/installation-nuxt-app.html",
8
- "version": "0.1.4",
8
+ "version": "0.1.6",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.4",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defu } from 'defu';
2
2
  import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
3
- import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.CGBDJv97.mjs';
3
+ import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.n3bAiAAD.mjs';
4
4
  import 'node:url';
5
5
  import 'scule';
6
6
 
@@ -44,6 +44,7 @@ export interface BadgeSlots {
44
44
  <script setup lang="ts">
45
45
  import { computed } from 'vue'
46
46
  import { Primitive } from 'reka-ui'
47
+ import { useButtonGroup } from '../composables/useButtonGroup'
47
48
  import { useComponentIcons } from '../composables/useComponentIcons'
48
49
  import Cross20Icon from '@bitrix24/b24icons-vue/actions/Cross20Icon'
49
50
  import B24Avatar from './Avatar.vue'
@@ -61,12 +62,14 @@ async function onCloseClickWrapper(event: MouseEvent) {
61
62
  } finally { /* empty */ }
62
63
  }
63
64
 
65
+ const { orientation, size: buttonGroupSize } = useButtonGroup<BadgeProps>(props)
64
66
  const { isLeading, leadingIconName } = useComponentIcons(props)
65
67
 
66
68
  const b24ui = computed(() => badge({
67
69
  color: props.color,
68
70
  depth: props.depth,
69
- size: props.size,
71
+ size: buttonGroupSize.value || props.size,
72
+ buttonGroup: orientation.value,
70
73
  useLink: Boolean(props.useLink),
71
74
  useClose: Boolean(props.useClose),
72
75
  useFill: Boolean(props.useFill),
@@ -52,7 +52,7 @@ provide(buttonGroupInjectionKey, computed(() => ({
52
52
  </script>
53
53
 
54
54
  <template>
55
- <Primitive :as="as" :class="buttonGroup({ orientation, class: props.class })">
55
+ <Primitive :as="as" class="group/items is-button-group" :class="buttonGroup({ orientation, class: props.class })">
56
56
  <slot />
57
57
  </Primitive>
58
58
  </template>
@@ -99,6 +99,7 @@ import { reactiveOmit } from '@vueuse/core'
99
99
  import { hasProtocol } from 'ufo'
100
100
  import { useRoute } from '#imports'
101
101
  import { RouterLink } from 'vue-router'
102
+ import B24LinkBase from './../../components/LinkBase.vue'
102
103
 
103
104
  defineOptions({ inheritAttrs: false })
104
105
 
@@ -262,6 +262,73 @@ const avatarGroup = {
262
262
  }
263
263
  };
264
264
 
265
+ const buttonGroupVariant = {
266
+ buttonGroup: {
267
+ horizontal: [
268
+ "focus-visible:outline-none",
269
+ "ring ring-inset ring-0 focus-visible:ring-2",
270
+ "group-[.is-button-group]/items:not-only:first:rounded-e-none group-[.is-button-group]/items:not-only:last:rounded-s-none group-[.is-button-group]/items:not-last:not-first:rounded-none",
271
+ "group-[.is-button-group]/items:not-only:first:border-e-0 group-[.is-button-group]/items:not-only:not-first:border-s-0"
272
+ ].join(" "),
273
+ vertical: [
274
+ "focus-visible:outline-none",
275
+ "ring ring-inset ring-0 focus-visible:ring-2",
276
+ "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
277
+ ].join(" ")
278
+ },
279
+ noSplit: {
280
+ false: [
281
+ "group-[.is-button-group]/items:not-only:not-first:after:content-[''] group-[.is-button-group]/items:not-only:not-first:after:absolute",
282
+ "group-[.is-button-group]/items:not-only:not-first:after:top-[7px] group-[.is-button-group]/items:not-only:not-first:after:bottom-[6px] group-[.is-button-group]/items:not-only:not-first:after:left-0 group-[.is-button-group]/items:not-only:not-first:after:w-px",
283
+ "group-[.is-button-group]/items:not-only:not-first:after:bg-current/30"
284
+ ].join(" ")
285
+ }
286
+ };
287
+ const buttonGroupVariantWithRoot = {
288
+ buttonGroup: {
289
+ horizontal: {
290
+ root: "group leading-none",
291
+ base: [
292
+ "focus-visible:outline-none",
293
+ "ring ring-inset ring-1 focus-visible:ring-2",
294
+ "group-not-only:group-first:rounded-e-3xl group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none",
295
+ "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none",
296
+ "group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
297
+ ].join(" ")
298
+ },
299
+ vertical: {
300
+ root: "group",
301
+ base: [
302
+ "focus-visible:outline-none",
303
+ "ring ring-inset ring-1 focus-visible:ring-2",
304
+ "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
305
+ ].join(" ")
306
+ }
307
+ },
308
+ noSplit: {
309
+ false: [
310
+ "group-not-only:not-first:after:content-[''] group-not-only:not-first:after:absolute",
311
+ "group-not-only:not-first:after:top-[7px] group-not-only:not-first:after:bottom-[6px] group-not-only:not-first:after:left-0 group-not-only:not-first:after:w-px",
312
+ "group-not-only:not-first:after:bg-current/30"
313
+ ].join(" ")
314
+ }
315
+ };
316
+ const buttonGroup = {
317
+ base: "relative",
318
+ variants: {
319
+ size: {
320
+ xs: "",
321
+ sm: "",
322
+ md: "",
323
+ lg: ""
324
+ },
325
+ orientation: {
326
+ horizontal: "flex flex-row -space-x-px",
327
+ vertical: "flex flex-col -space-y-px"
328
+ }
329
+ }
330
+ };
331
+
265
332
  const badge = {
266
333
  slots: {
267
334
  base: [
@@ -279,6 +346,7 @@ const badge = {
279
346
  trailingIcon: "shrink-0 cursor-pointer hover:rounded-full hover:bg-current/20 dark:hover:bg-current/35"
280
347
  },
281
348
  variants: {
349
+ ...buttonGroupVariant,
282
350
  useLink: {
283
351
  true: {
284
352
  base: "cursor-pointer",
@@ -370,8 +438,8 @@ const badge = {
370
438
  depth: "normal",
371
439
  class: [
372
440
  "ring ring-inset",
373
- "text-base-800 bg-base-150 ring-base-150",
374
- "dark:text-base-950 dark:bg-base-200 dark:ring-base-200"
441
+ "text-base-800 bg-base-150 ring-base-300",
442
+ "dark:text-base-950 dark:bg-base-200 dark:ring-base-800"
375
443
  ].join(" ")
376
444
  },
377
445
  // LIGHT ////
@@ -626,6 +694,12 @@ const badge = {
626
694
  {
627
695
  useClose: true,
628
696
  class: ""
697
+ },
698
+ // endregion ////
699
+ // region buttonGroup ////
700
+ {
701
+ buttonGroup: ["horizontal", "vertical"],
702
+ class: "rounded-2xs"
629
703
  }
630
704
  // endregion ////
631
705
  ],
@@ -637,72 +711,6 @@ const badge = {
637
711
  }
638
712
  };
639
713
 
640
- const buttonGroupVariant = {
641
- buttonGroup: {
642
- horizontal: [
643
- "focus-visible:outline-none",
644
- "ring ring-inset ring-0 focus-visible:ring-2",
645
- "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
646
- "not-only:first:border-e-0 not-only:not-first:border-s-0"
647
- ].join(" "),
648
- vertical: [
649
- "focus-visible:outline-none",
650
- "ring ring-inset ring-0 focus-visible:ring-2",
651
- "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
652
- ].join(" ")
653
- },
654
- noSplit: {
655
- false: [
656
- "not-only:not-first:after:content-[''] not-only:not-first:after:absolute",
657
- "not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px",
658
- "not-only:not-first:after:bg-current/30"
659
- ].join(" ")
660
- }
661
- };
662
- const buttonGroupVariantWithRoot = {
663
- buttonGroup: {
664
- horizontal: {
665
- root: "group",
666
- base: [
667
- "focus-visible:outline-none",
668
- "ring ring-inset ring-1 focus-visible:ring-2",
669
- "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none",
670
- "group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
671
- ].join(" ")
672
- },
673
- vertical: {
674
- root: "group",
675
- base: [
676
- "focus-visible:outline-none",
677
- "ring ring-inset ring-1 focus-visible:ring-2",
678
- "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
679
- ].join(" ")
680
- }
681
- },
682
- noSplit: {
683
- false: [
684
- "not-only:not-first:after:content-[''] not-only:not-first:after:absolute",
685
- "not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px",
686
- "not-only:not-first:after:bg-current/30"
687
- ].join(" ")
688
- }
689
- };
690
- const buttonGroup = {
691
- base: "relative",
692
- variants: {
693
- size: {
694
- xs: "",
695
- sm: "",
696
- md: "",
697
- lg: ""
698
- },
699
- orientation: {
700
- horizontal: "inline-flex -space-x-px",
701
- vertical: "flex flex-col -space-y-px"
702
- }
703
- }
704
- };
705
-
706
714
  const button = {
707
715
  slots: {
708
716
  base: [
@@ -2699,10 +2707,10 @@ const select = () => {
2699
2707
  return defu.defuFn(
2700
2708
  {
2701
2709
  slots: {
2702
- root: () => "relative inline-flex items-center min-w-full w-full",
2710
+ root: () => "relative inline-flex items-center w-full",
2703
2711
  base: () => [
2704
2712
  "relative inline-flex items-center group",
2705
- "min-w-full w-full py-0 border-0 focus:outline-none",
2713
+ "py-0 border-0 focus:outline-none",
2706
2714
  "cursor-pointer disabled:cursor-not-allowed",
2707
2715
  "disabled:bg-base-30/37 disabled:text-base-500",
2708
2716
  "dark:disabled:bg-base-900/37 dark:disabled:text-base-800",
@@ -2712,7 +2720,7 @@ const select = () => {
2712
2720
  "dark:ring-base-800",
2713
2721
  "text-base-master bg-white hover:text-base-900 focus:text-base-900 active:text-base-900",
2714
2722
  "dark:text-base-150 dark:bg-transparent dark:hover:text-base-350 dark:focus:text-base-350 dark:active:text-base-350",
2715
- "font-b24-primary font-regular text-sm",
2723
+ "font-b24-primary font-regular text-sm leading-none",
2716
2724
  "align-middle",
2717
2725
  "text-ellipsis whitespace-nowrap"
2718
2726
  ].join(" "),
@@ -260,6 +260,73 @@ const avatarGroup = {
260
260
  }
261
261
  };
262
262
 
263
+ const buttonGroupVariant = {
264
+ buttonGroup: {
265
+ horizontal: [
266
+ "focus-visible:outline-none",
267
+ "ring ring-inset ring-0 focus-visible:ring-2",
268
+ "group-[.is-button-group]/items:not-only:first:rounded-e-none group-[.is-button-group]/items:not-only:last:rounded-s-none group-[.is-button-group]/items:not-last:not-first:rounded-none",
269
+ "group-[.is-button-group]/items:not-only:first:border-e-0 group-[.is-button-group]/items:not-only:not-first:border-s-0"
270
+ ].join(" "),
271
+ vertical: [
272
+ "focus-visible:outline-none",
273
+ "ring ring-inset ring-0 focus-visible:ring-2",
274
+ "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
275
+ ].join(" ")
276
+ },
277
+ noSplit: {
278
+ false: [
279
+ "group-[.is-button-group]/items:not-only:not-first:after:content-[''] group-[.is-button-group]/items:not-only:not-first:after:absolute",
280
+ "group-[.is-button-group]/items:not-only:not-first:after:top-[7px] group-[.is-button-group]/items:not-only:not-first:after:bottom-[6px] group-[.is-button-group]/items:not-only:not-first:after:left-0 group-[.is-button-group]/items:not-only:not-first:after:w-px",
281
+ "group-[.is-button-group]/items:not-only:not-first:after:bg-current/30"
282
+ ].join(" ")
283
+ }
284
+ };
285
+ const buttonGroupVariantWithRoot = {
286
+ buttonGroup: {
287
+ horizontal: {
288
+ root: "group leading-none",
289
+ base: [
290
+ "focus-visible:outline-none",
291
+ "ring ring-inset ring-1 focus-visible:ring-2",
292
+ "group-not-only:group-first:rounded-e-3xl group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none",
293
+ "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none",
294
+ "group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
295
+ ].join(" ")
296
+ },
297
+ vertical: {
298
+ root: "group",
299
+ base: [
300
+ "focus-visible:outline-none",
301
+ "ring ring-inset ring-1 focus-visible:ring-2",
302
+ "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
303
+ ].join(" ")
304
+ }
305
+ },
306
+ noSplit: {
307
+ false: [
308
+ "group-not-only:not-first:after:content-[''] group-not-only:not-first:after:absolute",
309
+ "group-not-only:not-first:after:top-[7px] group-not-only:not-first:after:bottom-[6px] group-not-only:not-first:after:left-0 group-not-only:not-first:after:w-px",
310
+ "group-not-only:not-first:after:bg-current/30"
311
+ ].join(" ")
312
+ }
313
+ };
314
+ const buttonGroup = {
315
+ base: "relative",
316
+ variants: {
317
+ size: {
318
+ xs: "",
319
+ sm: "",
320
+ md: "",
321
+ lg: ""
322
+ },
323
+ orientation: {
324
+ horizontal: "flex flex-row -space-x-px",
325
+ vertical: "flex flex-col -space-y-px"
326
+ }
327
+ }
328
+ };
329
+
263
330
  const badge = {
264
331
  slots: {
265
332
  base: [
@@ -277,6 +344,7 @@ const badge = {
277
344
  trailingIcon: "shrink-0 cursor-pointer hover:rounded-full hover:bg-current/20 dark:hover:bg-current/35"
278
345
  },
279
346
  variants: {
347
+ ...buttonGroupVariant,
280
348
  useLink: {
281
349
  true: {
282
350
  base: "cursor-pointer",
@@ -368,8 +436,8 @@ const badge = {
368
436
  depth: "normal",
369
437
  class: [
370
438
  "ring ring-inset",
371
- "text-base-800 bg-base-150 ring-base-150",
372
- "dark:text-base-950 dark:bg-base-200 dark:ring-base-200"
439
+ "text-base-800 bg-base-150 ring-base-300",
440
+ "dark:text-base-950 dark:bg-base-200 dark:ring-base-800"
373
441
  ].join(" ")
374
442
  },
375
443
  // LIGHT ////
@@ -624,6 +692,12 @@ const badge = {
624
692
  {
625
693
  useClose: true,
626
694
  class: ""
695
+ },
696
+ // endregion ////
697
+ // region buttonGroup ////
698
+ {
699
+ buttonGroup: ["horizontal", "vertical"],
700
+ class: "rounded-2xs"
627
701
  }
628
702
  // endregion ////
629
703
  ],
@@ -635,72 +709,6 @@ const badge = {
635
709
  }
636
710
  };
637
711
 
638
- const buttonGroupVariant = {
639
- buttonGroup: {
640
- horizontal: [
641
- "focus-visible:outline-none",
642
- "ring ring-inset ring-0 focus-visible:ring-2",
643
- "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
644
- "not-only:first:border-e-0 not-only:not-first:border-s-0"
645
- ].join(" "),
646
- vertical: [
647
- "focus-visible:outline-none",
648
- "ring ring-inset ring-0 focus-visible:ring-2",
649
- "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
650
- ].join(" ")
651
- },
652
- noSplit: {
653
- false: [
654
- "not-only:not-first:after:content-[''] not-only:not-first:after:absolute",
655
- "not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px",
656
- "not-only:not-first:after:bg-current/30"
657
- ].join(" ")
658
- }
659
- };
660
- const buttonGroupVariantWithRoot = {
661
- buttonGroup: {
662
- horizontal: {
663
- root: "group",
664
- base: [
665
- "focus-visible:outline-none",
666
- "ring ring-inset ring-1 focus-visible:ring-2",
667
- "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none",
668
- "group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0"
669
- ].join(" ")
670
- },
671
- vertical: {
672
- root: "group",
673
- base: [
674
- "focus-visible:outline-none",
675
- "ring ring-inset ring-1 focus-visible:ring-2",
676
- "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
677
- ].join(" ")
678
- }
679
- },
680
- noSplit: {
681
- false: [
682
- "not-only:not-first:after:content-[''] not-only:not-first:after:absolute",
683
- "not-only:not-first:after:top-[7px] not-only:not-first:after:bottom-[6px] not-only:not-first:after:left-0 not-only:not-first:after:w-px",
684
- "not-only:not-first:after:bg-current/30"
685
- ].join(" ")
686
- }
687
- };
688
- const buttonGroup = {
689
- base: "relative",
690
- variants: {
691
- size: {
692
- xs: "",
693
- sm: "",
694
- md: "",
695
- lg: ""
696
- },
697
- orientation: {
698
- horizontal: "inline-flex -space-x-px",
699
- vertical: "flex flex-col -space-y-px"
700
- }
701
- }
702
- };
703
-
704
712
  const button = {
705
713
  slots: {
706
714
  base: [
@@ -2697,10 +2705,10 @@ const select = () => {
2697
2705
  return defuFn(
2698
2706
  {
2699
2707
  slots: {
2700
- root: () => "relative inline-flex items-center min-w-full w-full",
2708
+ root: () => "relative inline-flex items-center w-full",
2701
2709
  base: () => [
2702
2710
  "relative inline-flex items-center group",
2703
- "min-w-full w-full py-0 border-0 focus:outline-none",
2711
+ "py-0 border-0 focus:outline-none",
2704
2712
  "cursor-pointer disabled:cursor-not-allowed",
2705
2713
  "disabled:bg-base-30/37 disabled:text-base-500",
2706
2714
  "dark:disabled:bg-base-900/37 dark:disabled:text-base-800",
@@ -2710,7 +2718,7 @@ const select = () => {
2710
2718
  "dark:ring-base-800",
2711
2719
  "text-base-master bg-white hover:text-base-900 focus:text-base-900 active:text-base-900",
2712
2720
  "dark:text-base-150 dark:bg-transparent dark:hover:text-base-350 dark:focus:text-base-350 dark:active:text-base-350",
2713
- "font-b24-primary font-regular text-sm",
2721
+ "font-b24-primary font-regular text-sm leading-none",
2714
2722
  "align-middle",
2715
2723
  "text-ellipsis whitespace-nowrap"
2716
2724
  ].join(" "),
package/dist/unplugin.cjs CHANGED
@@ -3,25 +3,25 @@
3
3
  const node_url = require('node:url');
4
4
  const pathe = require('pathe');
5
5
  const unplugin = require('unplugin');
6
- const AutoImport = require('unplugin-auto-import');
7
6
  const defu = require('defu');
8
7
  const tailwind = require('@tailwindcss/vite');
9
- const templates = require('./shared/b24ui-nuxt.D8eTlsIC.cjs');
8
+ const templates = require('./shared/b24ui-nuxt.BAQG__ma.cjs');
10
9
  const tinyglobby = require('tinyglobby');
11
10
  const knitwork = require('knitwork');
12
11
  const MagicString = require('magic-string');
13
12
  const mlly = require('mlly');
14
13
  const AutoImportComponents = require('unplugin-vue-components');
14
+ const AutoImport = require('unplugin-auto-import');
15
15
  require('scule');
16
16
  require('@nuxt/kit');
17
17
 
18
18
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
19
19
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
20
20
 
21
- const AutoImport__default = /*#__PURE__*/_interopDefaultCompat(AutoImport);
22
21
  const tailwind__default = /*#__PURE__*/_interopDefaultCompat(tailwind);
23
22
  const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
24
23
  const AutoImportComponents__default = /*#__PURE__*/_interopDefaultCompat(AutoImportComponents);
24
+ const AutoImport__default = /*#__PURE__*/_interopDefaultCompat(AutoImport);
25
25
 
26
26
  function TemplatePlugin(options) {
27
27
  const templates$1 = templates.getTemplates(options);
@@ -100,7 +100,7 @@ function AppConfigPlugin(options, appConfig) {
100
100
  };
101
101
  }
102
102
 
103
- function ComponentImportPlugin(framework, options) {
103
+ function ComponentImportPlugin(options, meta) {
104
104
  const components = tinyglobby.globSync("**/*.vue", { cwd: pathe.join(runtimeDir, "components") });
105
105
  const componentNames = new Set(components.map((c) => `B24${c.replace(/\.vue$/, "")}`));
106
106
  const componentsContent = tinyglobby.globSync("**/*.vue", { cwd: pathe.join(runtimeDir, "components/content") });
@@ -109,10 +109,26 @@ function ComponentImportPlugin(framework, options) {
109
109
  const componentProseNames = new Set(componentsProse.map((c) => `B24${c.replace(/\.vue$/, "")}`));
110
110
  const overrides = tinyglobby.globSync("**/*.vue", { cwd: pathe.join(runtimeDir, "vue/components") });
111
111
  const overrideNames = new Set(overrides.map((c) => `B24${c.replace(/\.vue$/, "")}`));
112
+ const pluginOptions = defu.defu(options.components, {
113
+ dts: options.dts ?? true,
114
+ exclude: [/[\\/]node_modules[\\/](?!\.pnpm|@nuxt\/ui)/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
115
+ resolvers: [
116
+ (componentName) => {
117
+ if (overrideNames.has(componentName))
118
+ return { name: "default", from: pathe.join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`) };
119
+ if (componentProseNames.has(componentName))
120
+ return { name: "default", from: pathe.join(runtimeDir, "components/prose", `${componentName.slice("B24".length)}.vue`) };
121
+ if (componentContentNames.has(componentName))
122
+ return { name: "default", from: pathe.join(runtimeDir, "components/content", `${componentName.slice("B24".length)}.vue`) };
123
+ if (componentNames.has(componentName))
124
+ return { name: "default", from: pathe.join(runtimeDir, "components", `${componentName.slice("B24".length)}.vue`) };
125
+ }
126
+ ]
127
+ });
112
128
  return [
113
129
  /**
114
130
  * This plugin aims to ensure we override certain components with Vue-compatible versions:
115
- * <B24Icon> and <B24Link> currently.
131
+ * <B24Link> currently.
116
132
  */
117
133
  {
118
134
  name: "bitrix24:b24ui:components",
@@ -130,38 +146,7 @@ function ComponentImportPlugin(framework, options) {
130
146
  }
131
147
  }
132
148
  },
133
- AutoImportComponents__default[framework]({
134
- dts: options.dts ?? true,
135
- exclude: [/[\\/]node_modules[\\/](?!\.pnpm|@bitrix24\/b24ui)/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
136
- resolvers: [
137
- (componentName) => {
138
- if (overrideNames.has(componentName)) {
139
- return {
140
- name: "default",
141
- from: pathe.join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`)
142
- };
143
- }
144
- if (componentContentNames.has(componentName)) {
145
- return {
146
- name: "default",
147
- from: pathe.join(runtimeDir, "components/content", `${componentName.slice("B24".length)}.vue`)
148
- };
149
- }
150
- if (componentProseNames.has(componentName)) {
151
- return {
152
- name: "default",
153
- from: pathe.join(runtimeDir, "components/prose", `${componentName.slice("B24".length)}.vue`)
154
- };
155
- }
156
- if (componentNames.has(componentName)) {
157
- return {
158
- name: "default",
159
- from: pathe.join(runtimeDir, "components", `${componentName.slice("B24".length)}.vue`)
160
- };
161
- }
162
- }
163
- ]
164
- })
149
+ AutoImportComponents__default.raw(pluginOptions, meta)
165
150
  ];
166
151
  }
167
152
  const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
@@ -194,19 +179,41 @@ function Bitrix24EnvironmentPlugin() {
194
179
  };
195
180
  }
196
181
 
182
+ function AutoImportPlugin(options, meta) {
183
+ const pluginOptions = defu.defu(options.autoImport, {
184
+ dts: options.dts ?? true,
185
+ dirs: [pathe.join(runtimeDir, "composables")]
186
+ });
187
+ return AutoImport__default.raw(pluginOptions, meta);
188
+ }
189
+
197
190
  const runtimeDir = pathe.normalize(node_url.fileURLToPath(new URL("./runtime", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('unplugin.cjs', document.baseURI).href)))));
198
191
  const Bitrix24UIPlugin = unplugin.createUnplugin((_options = {}, meta) => {
199
192
  const options = defu.defu(_options, { fonts: false, devtools: { enabled: false } }, templates.defaultOptions);
200
193
  const appConfig = defu.defu({ b24ui: options.b24ui }, { b24ui: templates.getDefaultUiConfig() });
201
194
  return [
202
195
  Bitrix24EnvironmentPlugin(),
203
- ...ComponentImportPlugin(meta.framework, options),
204
- AutoImport__default[meta.framework]({ dts: options.dts ?? true, dirs: [pathe.join(runtimeDir, "composables")] }),
196
+ ComponentImportPlugin(options, meta),
197
+ AutoImportPlugin(options, meta),
205
198
  tailwind__default(),
206
199
  PluginsPlugin(options),
207
200
  TemplatePlugin(options),
208
- AppConfigPlugin(options, appConfig)
209
- ];
201
+ AppConfigPlugin(options, appConfig),
202
+ {
203
+ name: "bitrix24:b24ui:plugins-duplication-detection",
204
+ vite: {
205
+ configResolved(config) {
206
+ const plugins = config.plugins || [];
207
+ if (plugins.filter((i) => i.name === "unplugin-auto-import").length > 1) {
208
+ throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-auto-import` detected. Nuxt UI includes `unplugin-auto-import` already, and you can configure it using `autoImport` option in Bitrix24 UI module options.");
209
+ }
210
+ if (plugins.filter((i) => i.name === "unplugin-vue-components").length > 1) {
211
+ throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-vue-components` detected. Nuxt UI includes `unplugin-vue-components` already, and you can configure it using `components` option in Bitrix24 UI module options.");
212
+ }
213
+ }
214
+ }
215
+ }
216
+ ].flat(1);
210
217
  });
211
218
 
212
219
  exports.Bitrix24UIPlugin = Bitrix24UIPlugin;
@@ -1,4 +1,6 @@
1
1
  import * as unplugin from 'unplugin';
2
+ import { Options } from 'unplugin-auto-import/types';
3
+ import { Options as Options$1 } from 'unplugin-vue-components/types';
2
4
  import * as b24ui from '#build/b24ui';
3
5
  import { ModuleOptions } from './module.cjs';
4
6
  import { DeepPartial } from '../dist/runtime/types/utils.js';
@@ -15,6 +17,14 @@ interface Bitrix24UIOptions extends Omit<ModuleOptions, 'colorMode'> {
15
17
  * @defaultValue `true`
16
18
  */
17
19
  colorMode?: boolean;
20
+ /**
21
+ * Override options for `unplugin-auto-import`
22
+ */
23
+ autoImport?: Partial<Options>;
24
+ /**
25
+ * Override options for `unplugin-vue-components`
26
+ */
27
+ components?: Partial<Options$1>;
18
28
  }
19
29
  declare const runtimeDir: string;
20
30
  declare const Bitrix24UIPlugin: unplugin.UnpluginInstance<Bitrix24UIOptions | undefined, boolean>;
@@ -1,4 +1,6 @@
1
1
  import * as unplugin from 'unplugin';
2
+ import { Options } from 'unplugin-auto-import/types';
3
+ import { Options as Options$1 } from 'unplugin-vue-components/types';
2
4
  import * as b24ui from '#build/b24ui';
3
5
  import { ModuleOptions } from './module.mjs';
4
6
  import { DeepPartial } from '../dist/runtime/types/utils.js';
@@ -15,6 +17,14 @@ interface Bitrix24UIOptions extends Omit<ModuleOptions, 'colorMode'> {
15
17
  * @defaultValue `true`
16
18
  */
17
19
  colorMode?: boolean;
20
+ /**
21
+ * Override options for `unplugin-auto-import`
22
+ */
23
+ autoImport?: Partial<Options>;
24
+ /**
25
+ * Override options for `unplugin-vue-components`
26
+ */
27
+ components?: Partial<Options$1>;
18
28
  }
19
29
  declare const runtimeDir: string;
20
30
  declare const Bitrix24UIPlugin: unplugin.UnpluginInstance<Bitrix24UIOptions | undefined, boolean>;
@@ -1,4 +1,6 @@
1
1
  import * as unplugin from 'unplugin';
2
+ import { Options } from 'unplugin-auto-import/types';
3
+ import { Options as Options$1 } from 'unplugin-vue-components/types';
2
4
  import * as b24ui from '#build/b24ui';
3
5
  import { ModuleOptions } from './module.js';
4
6
  import { DeepPartial } from '../dist/runtime/types/utils.js';
@@ -15,6 +17,14 @@ interface Bitrix24UIOptions extends Omit<ModuleOptions, 'colorMode'> {
15
17
  * @defaultValue `true`
16
18
  */
17
19
  colorMode?: boolean;
20
+ /**
21
+ * Override options for `unplugin-auto-import`
22
+ */
23
+ autoImport?: Partial<Options>;
24
+ /**
25
+ * Override options for `unplugin-vue-components`
26
+ */
27
+ components?: Partial<Options$1>;
18
28
  }
19
29
  declare const runtimeDir: string;
20
30
  declare const Bitrix24UIPlugin: unplugin.UnpluginInstance<Bitrix24UIOptions | undefined, boolean>;
package/dist/unplugin.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import { join, normalize } from 'pathe';
3
3
  import { createUnplugin } from 'unplugin';
4
- import AutoImport from 'unplugin-auto-import';
5
4
  import { defu } from 'defu';
6
5
  import tailwind from '@tailwindcss/vite';
7
- import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.CGBDJv97.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.n3bAiAAD.mjs';
8
7
  import { globSync } from 'tinyglobby';
9
8
  import { genSafeVariableName } from 'knitwork';
10
9
  import MagicString from 'magic-string';
11
10
  import { resolvePathSync } from 'mlly';
12
11
  import AutoImportComponents from 'unplugin-vue-components';
12
+ import AutoImport from 'unplugin-auto-import';
13
13
  import 'scule';
14
14
  import '@nuxt/kit';
15
15
 
@@ -90,7 +90,7 @@ function AppConfigPlugin(options, appConfig) {
90
90
  };
91
91
  }
92
92
 
93
- function ComponentImportPlugin(framework, options) {
93
+ function ComponentImportPlugin(options, meta) {
94
94
  const components = globSync("**/*.vue", { cwd: join(runtimeDir, "components") });
95
95
  const componentNames = new Set(components.map((c) => `B24${c.replace(/\.vue$/, "")}`));
96
96
  const componentsContent = globSync("**/*.vue", { cwd: join(runtimeDir, "components/content") });
@@ -99,10 +99,26 @@ function ComponentImportPlugin(framework, options) {
99
99
  const componentProseNames = new Set(componentsProse.map((c) => `B24${c.replace(/\.vue$/, "")}`));
100
100
  const overrides = globSync("**/*.vue", { cwd: join(runtimeDir, "vue/components") });
101
101
  const overrideNames = new Set(overrides.map((c) => `B24${c.replace(/\.vue$/, "")}`));
102
+ const pluginOptions = defu(options.components, {
103
+ dts: options.dts ?? true,
104
+ exclude: [/[\\/]node_modules[\\/](?!\.pnpm|@nuxt\/ui)/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
105
+ resolvers: [
106
+ (componentName) => {
107
+ if (overrideNames.has(componentName))
108
+ return { name: "default", from: join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`) };
109
+ if (componentProseNames.has(componentName))
110
+ return { name: "default", from: join(runtimeDir, "components/prose", `${componentName.slice("B24".length)}.vue`) };
111
+ if (componentContentNames.has(componentName))
112
+ return { name: "default", from: join(runtimeDir, "components/content", `${componentName.slice("B24".length)}.vue`) };
113
+ if (componentNames.has(componentName))
114
+ return { name: "default", from: join(runtimeDir, "components", `${componentName.slice("B24".length)}.vue`) };
115
+ }
116
+ ]
117
+ });
102
118
  return [
103
119
  /**
104
120
  * This plugin aims to ensure we override certain components with Vue-compatible versions:
105
- * <B24Icon> and <B24Link> currently.
121
+ * <B24Link> currently.
106
122
  */
107
123
  {
108
124
  name: "bitrix24:b24ui:components",
@@ -120,38 +136,7 @@ function ComponentImportPlugin(framework, options) {
120
136
  }
121
137
  }
122
138
  },
123
- AutoImportComponents[framework]({
124
- dts: options.dts ?? true,
125
- exclude: [/[\\/]node_modules[\\/](?!\.pnpm|@bitrix24\/b24ui)/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
126
- resolvers: [
127
- (componentName) => {
128
- if (overrideNames.has(componentName)) {
129
- return {
130
- name: "default",
131
- from: join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`)
132
- };
133
- }
134
- if (componentContentNames.has(componentName)) {
135
- return {
136
- name: "default",
137
- from: join(runtimeDir, "components/content", `${componentName.slice("B24".length)}.vue`)
138
- };
139
- }
140
- if (componentProseNames.has(componentName)) {
141
- return {
142
- name: "default",
143
- from: join(runtimeDir, "components/prose", `${componentName.slice("B24".length)}.vue`)
144
- };
145
- }
146
- if (componentNames.has(componentName)) {
147
- return {
148
- name: "default",
149
- from: join(runtimeDir, "components", `${componentName.slice("B24".length)}.vue`)
150
- };
151
- }
152
- }
153
- ]
154
- })
139
+ AutoImportComponents.raw(pluginOptions, meta)
155
140
  ];
156
141
  }
157
142
  const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
@@ -184,19 +169,41 @@ function Bitrix24EnvironmentPlugin() {
184
169
  };
185
170
  }
186
171
 
172
+ function AutoImportPlugin(options, meta) {
173
+ const pluginOptions = defu(options.autoImport, {
174
+ dts: options.dts ?? true,
175
+ dirs: [join(runtimeDir, "composables")]
176
+ });
177
+ return AutoImport.raw(pluginOptions, meta);
178
+ }
179
+
187
180
  const runtimeDir = normalize(fileURLToPath(new URL("./runtime", import.meta.url)));
188
181
  const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
189
182
  const options = defu(_options, { fonts: false, devtools: { enabled: false } }, defaultOptions);
190
183
  const appConfig = defu({ b24ui: options.b24ui }, { b24ui: getDefaultUiConfig() });
191
184
  return [
192
185
  Bitrix24EnvironmentPlugin(),
193
- ...ComponentImportPlugin(meta.framework, options),
194
- AutoImport[meta.framework]({ dts: options.dts ?? true, dirs: [join(runtimeDir, "composables")] }),
186
+ ComponentImportPlugin(options, meta),
187
+ AutoImportPlugin(options, meta),
195
188
  tailwind(),
196
189
  PluginsPlugin(options),
197
190
  TemplatePlugin(options),
198
- AppConfigPlugin(options, appConfig)
199
- ];
191
+ AppConfigPlugin(options, appConfig),
192
+ {
193
+ name: "bitrix24:b24ui:plugins-duplication-detection",
194
+ vite: {
195
+ configResolved(config) {
196
+ const plugins = config.plugins || [];
197
+ if (plugins.filter((i) => i.name === "unplugin-auto-import").length > 1) {
198
+ throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-auto-import` detected. Nuxt UI includes `unplugin-auto-import` already, and you can configure it using `autoImport` option in Bitrix24 UI module options.");
199
+ }
200
+ if (plugins.filter((i) => i.name === "unplugin-vue-components").length > 1) {
201
+ throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-vue-components` detected. Nuxt UI includes `unplugin-vue-components` already, and you can configure it using `components` option in Bitrix24 UI module options.");
202
+ }
203
+ }
204
+ }
205
+ }
206
+ ].flat(1);
200
207
  });
201
208
 
202
209
  export { Bitrix24UIPlugin, runtimeDir };
package/dist/vite.cjs CHANGED
@@ -4,10 +4,9 @@ const unplugin = require('./unplugin.cjs');
4
4
  require('node:url');
5
5
  require('pathe');
6
6
  require('unplugin');
7
- require('unplugin-auto-import');
8
7
  require('defu');
9
8
  require('@tailwindcss/vite');
10
- require('./shared/b24ui-nuxt.D8eTlsIC.cjs');
9
+ require('./shared/b24ui-nuxt.BAQG__ma.cjs');
11
10
  require('scule');
12
11
  require('@nuxt/kit');
13
12
  require('tinyglobby');
@@ -15,6 +14,7 @@ require('knitwork');
15
14
  require('magic-string');
16
15
  require('mlly');
17
16
  require('unplugin-vue-components');
17
+ require('unplugin-auto-import');
18
18
 
19
19
  const vite = unplugin.Bitrix24UIPlugin.vite;
20
20
 
package/dist/vite.d.cts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as vite from 'vite';
2
2
  import { Bitrix24UIOptions } from './unplugin.cjs';
3
3
  import 'unplugin';
4
+ import 'unplugin-auto-import/types';
5
+ import 'unplugin-vue-components/types';
4
6
  import '#build/b24ui';
5
7
  import './module.cjs';
6
8
  import '@nuxt/schema';
package/dist/vite.d.mts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as vite from 'vite';
2
2
  import { Bitrix24UIOptions } from './unplugin.mjs';
3
3
  import 'unplugin';
4
+ import 'unplugin-auto-import/types';
5
+ import 'unplugin-vue-components/types';
4
6
  import '#build/b24ui';
5
7
  import './module.mjs';
6
8
  import '@nuxt/schema';
package/dist/vite.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as vite from 'vite';
2
2
  import { Bitrix24UIOptions } from './unplugin.js';
3
3
  import 'unplugin';
4
+ import 'unplugin-auto-import/types';
5
+ import 'unplugin-vue-components/types';
4
6
  import '#build/b24ui';
5
7
  import './module.js';
6
8
  import '@nuxt/schema';
package/dist/vite.mjs CHANGED
@@ -2,10 +2,9 @@ import { Bitrix24UIPlugin } from './unplugin.mjs';
2
2
  import 'node:url';
3
3
  import 'pathe';
4
4
  import 'unplugin';
5
- import 'unplugin-auto-import';
6
5
  import 'defu';
7
6
  import '@tailwindcss/vite';
8
- import './shared/b24ui-nuxt.CGBDJv97.mjs';
7
+ import './shared/b24ui-nuxt.n3bAiAAD.mjs';
9
8
  import 'scule';
10
9
  import '@nuxt/kit';
11
10
  import 'tinyglobby';
@@ -13,6 +12,7 @@ import 'knitwork';
13
12
  import 'magic-string';
14
13
  import 'mlly';
15
14
  import 'unplugin-vue-components';
15
+ import 'unplugin-auto-import';
16
16
 
17
17
  const vite = Bitrix24UIPlugin.vite;
18
18
 
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": "0.1.4",
4
+ "version": "0.1.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/bitrix24/b24ui.git"
@@ -65,8 +65,8 @@
65
65
  "@nuxt/kit": "^3.15.4",
66
66
  "@nuxt/schema": "^3.15.4",
67
67
  "@nuxtjs/color-mode": "^3.5.2",
68
- "@tailwindcss/postcss": "^4.0.0",
69
- "@tailwindcss/vite": "^4.0.0",
68
+ "@tailwindcss/postcss": "^4.0.3",
69
+ "@tailwindcss/vite": "^4.0.3",
70
70
  "@tanstack/vue-table": "^8.20.5",
71
71
  "@unhead/vue": "^1.11.18",
72
72
  "@vueuse/core": "^12.5.0",
@@ -81,7 +81,7 @@
81
81
  "embla-carousel-fade": "^8.5.2",
82
82
  "embla-carousel-vue": "^8.5.2",
83
83
  "embla-carousel-wheel-gestures": "^8.0.1",
84
- "fuse.js": "^7.0.0",
84
+ "fuse.js": "^7.1.0",
85
85
  "knitwork": "^1.2.0",
86
86
  "magic-string": "^0.30.17",
87
87
  "mlly": "^1.7.4",
@@ -90,18 +90,18 @@
90
90
  "reka-ui": "1.0.0-alpha.9",
91
91
  "scule": "^1.3.0",
92
92
  "tailwind-variants": "^0.3.1",
93
- "tailwindcss": "^4.0.0",
93
+ "tailwindcss": "^4.0.3",
94
94
  "tinyglobby": "^0.2.10",
95
95
  "unplugin": "^2.1.2",
96
96
  "unplugin-auto-import": "^19.0.0",
97
97
  "unplugin-vue-components": "^28.0.0",
98
- "vaul-vue": "^0.2.0"
98
+ "vaul-vue": "^0.2.1"
99
99
  },
100
100
  "devDependencies": {
101
- "@nuxt/eslint-config": "^0.7.5",
101
+ "@nuxt/eslint-config": "^1.0.0",
102
102
  "@nuxt/module-builder": "^0.8.4",
103
103
  "@nuxt/test-utils": "^3.15.4",
104
- "@standard-schema/spec": "1.0.0",
104
+ "@standard-schema/spec": "^1.0.0",
105
105
  "@vue/test-utils": "^2.4.6",
106
106
  "embla-carousel": "^8.5.2",
107
107
  "eslint": "^9.19.0",
@@ -138,7 +138,6 @@
138
138
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && vite build playground-vue && nuxt-component-meta playground --outputDir ../src/.component-meta/",
139
139
  "dev:prepare_short": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && vite build playground-vue",
140
140
  "build": "nuxt-module-build build",
141
- "build_short": "nuxt-module-build build",
142
141
  "dev": "set DEV=true && nuxi dev playground",
143
142
  "dev:build": "nuxi build playground",
144
143
  "dev:generate": "nuxt generate playground",