@bitrix24/b24ui-nuxt 0.1.3 → 0.1.5

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.
@@ -13,17 +13,17 @@ const advice = {
13
13
  root: "flex items-end",
14
14
  descriptionWrapper: [
15
15
  "relative"
16
- ],
16
+ ].join(" "),
17
17
  descriptionBorder: [
18
18
  "fill-blue-500 dark:fill-blue-300"
19
- ],
19
+ ].join(" "),
20
20
  descriptionBg: [
21
21
  "fill-white dark:fill-base-900"
22
- ],
22
+ ].join(" "),
23
23
  descriptionAngle: [
24
24
  "absolute",
25
25
  "w-[14px] h-[12px]"
26
- ],
26
+ ].join(" "),
27
27
  description: [
28
28
  "grow",
29
29
  "w-11/12 py-3 px-md2 ms-2",
@@ -33,7 +33,7 @@ const advice = {
33
33
  "border-1",
34
34
  "border-blue-500 bg-white text-base-950",
35
35
  "dark:border-blue-300 dark:bg-base-900 dark:text-base-200"
36
- ],
36
+ ].join(" "),
37
37
  leading: "me-1.5 ms-2",
38
38
  leadingIcon: "shrink-0 size-[42px]",
39
39
  leadingAvatar: "shrink-0",
@@ -267,8 +267,7 @@ const badge = {
267
267
  "inline-flex items-center",
268
268
  "transition-all duration-200 ease-linear",
269
269
  "px-2 leading-normal rounded-md"
270
- // 'text-base-800 dark:text-base-250'
271
- ],
270
+ ].join(" "),
272
271
  wrapper: "inline-flex items-center",
273
272
  label: "max-w-full whitespace-nowrap text-ellipsis",
274
273
  // truncate ////
@@ -713,7 +712,7 @@ const button = {
713
712
  ],
714
713
  baseLine: [
715
714
  "inline-flex items-center"
716
- ],
715
+ ].join(" "),
717
716
  label: "truncate",
718
717
  leadingIcon: "shrink-0",
719
718
  leadingAvatar: "shrink-0",
@@ -1503,7 +1502,7 @@ const countdown = {
1503
1502
  base: [
1504
1503
  "relative flex flex-row flex-nowrap items-center justify-between",
1505
1504
  "text-base-500 dark:text-base-600"
1506
- ],
1505
+ ].join(" "),
1507
1506
  label: "",
1508
1507
  leadingIcon: "shrink-0",
1509
1508
  leadingAvatar: "shrink-0",
@@ -1513,7 +1512,7 @@ const countdown = {
1513
1512
  circleElement: "stroke-transparent stroke-1",
1514
1513
  circlePath: [
1515
1514
  "stroke-[7px] rotate-90 origin-center stroke-current transition-all duration-1000 ease-linear"
1516
- ]
1515
+ ].join(" ")
1517
1516
  },
1518
1517
  variants: {
1519
1518
  size: {
@@ -1641,7 +1640,7 @@ const input = {
1641
1640
  "font-b24-primary font-regular text-md leading-none",
1642
1641
  "align-middle",
1643
1642
  "text-ellipsis whitespace-nowrap"
1644
- ],
1643
+ ].join(" "),
1645
1644
  leading: "absolute inset-y-0 start-0 flex items-center",
1646
1645
  leadingIcon: "shrink-0 text-base-400",
1647
1646
  leadingAvatar: "shrink-0",
@@ -1652,7 +1651,7 @@ const input = {
1652
1651
  "pointer-events-none select-none",
1653
1652
  "absolute z-10 -top-1.5 right-3 h-sm px-1.5 flex flex-col justify-center items-center",
1654
1653
  "font-b24-primary font-bold text-6xs leading-none uppercase rounded-full"
1655
- ]
1654
+ ].join(" ")
1656
1655
  },
1657
1656
  variants: {
1658
1657
  ...buttonGroupVariantWithRoot,
@@ -2714,7 +2713,7 @@ const select = () => {
2714
2713
  "font-b24-primary font-regular text-sm",
2715
2714
  "align-middle",
2716
2715
  "text-ellipsis whitespace-nowrap"
2717
- ],
2716
+ ].join(" "),
2718
2717
  value: "truncate pointer-events-none",
2719
2718
  placeholder: "truncate text-base-400 dark:text-base-300",
2720
2719
  arrow: "fill-base-master/10 dark:fill-base-100/20",
@@ -2725,12 +2724,12 @@ const select = () => {
2725
2724
  "overflow-hidden",
2726
2725
  "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
2727
2726
  "pointer-events-auto"
2728
- ],
2727
+ ].join(" "),
2729
2728
  scrollUpDownButton: [
2730
2729
  "flex items-center justify-center h-[25px] cursor-default backdrop-blur",
2731
2730
  "text-base-800 bg-white",
2732
2731
  "dark:text-base-100 dark:bg-base-dark"
2733
- ],
2732
+ ].join(" "),
2734
2733
  scrollUpDownButtonIcon: "",
2735
2734
  viewport: "divide-y divide-base-master/10 dark:divide-base-100/20 scroll-py-1",
2736
2735
  group: "p-1 isolate",
@@ -2738,7 +2737,7 @@ const select = () => {
2738
2737
  label: [
2739
2738
  "flex items-center",
2740
2739
  "font-semibold text-base-900 dark:text-base-200"
2741
- ],
2740
+ ].join(" "),
2742
2741
  separator: "-mx-1 my-1 h-px bg-base-master/10 dark:bg-base-100/20",
2743
2742
  item: [
2744
2743
  "group relative w-full flex items-center select-none outline-none",
@@ -2747,11 +2746,11 @@ const select = () => {
2747
2746
  "data-disabled:cursor-not-allowed data-disabled:opacity-75",
2748
2747
  "text-base-master dark:text-base-150 data-highlighted:text-base-900 dark:data-highlighted:text-base-200 data-highlighted:before:bg-base-100/50 dark:data-highlighted:before:bg-base-900",
2749
2748
  "transition-colors before:transition-colors"
2750
- ],
2749
+ ].join(" "),
2751
2750
  itemLeadingIcon: [
2752
2751
  "shrink-0 text-base-500 dark:text-base-700 group-data-highlighted:text-base-master dark:group-data-highlighted:text-base-150",
2753
2752
  "transition-colors"
2754
- ],
2753
+ ].join(" "),
2755
2754
  itemLeadingAvatar: "shrink-0",
2756
2755
  itemLeadingAvatarSize: "",
2757
2756
  itemLeadingChip: "shrink-0",
@@ -2896,10 +2895,16 @@ const skeleton = {
2896
2895
  const _switch = {
2897
2896
  slots: {
2898
2897
  root: "relative flex items-start",
2899
- base: ["cursor-pointer inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-base-200 dark:data-[state=unchecked]:bg-base-800", "transition-colors duration-200"],
2898
+ base: [
2899
+ "cursor-pointer inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-base-200 dark:data-[state=unchecked]:bg-base-800",
2900
+ "transition-colors duration-200"
2901
+ ].join(" "),
2900
2902
  container: "flex items-center",
2901
2903
  thumb: "group pointer-events-none rounded-full bg-white dark:bg-base-100 shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center",
2902
- icon: ["absolute shrink-0 group-data-[state=unchecked]:text-base-400 dark:group-data-[state=unchecked]:text-base-700 opacity-0 p-0.5 size-10/10", "transition-[color,opacity] duration-200"],
2904
+ icon: [
2905
+ "absolute shrink-0 group-data-[state=unchecked]:text-base-400 dark:group-data-[state=unchecked]:text-base-700 opacity-0 p-0.5 size-10/10",
2906
+ "transition-[color,opacity] duration-200"
2907
+ ].join(" "),
2903
2908
  wrapper: "font-b24-primary font-regular ms-2",
2904
2909
  label: "cursor-pointer block text-base-master dark:text-base-400",
2905
2910
  description: "text-base-500 dark:text-base-600"
@@ -3016,7 +3021,7 @@ const tabs = {
3016
3021
  "font-medium rounded-xl",
3017
3022
  "cursor-pointer disabled:cursor-not-allowed disabled:opacity-75 focus:outline-hidden",
3018
3023
  "transition-colors"
3019
- ],
3024
+ ].join(" "),
3020
3025
  content: "focus:outline-none w-full",
3021
3026
  leadingIcon: "shrink-0",
3022
3027
  leadingAvatar: "shrink-0",
@@ -3360,12 +3365,12 @@ const textarea = {
3360
3365
  "dark:text-base-150 dark:bg-transparent dark:placeholder:text-base-300 dark:hover:text-base-350 dark:focus:text-base-350 dark:active:text-base-350",
3361
3366
  "font-b24-primary font-regular text-md leading-normal",
3362
3367
  "align-middle"
3363
- ],
3368
+ ].join(" "),
3364
3369
  tag: [
3365
3370
  "pointer-events-none select-none",
3366
3371
  "absolute z-10 -top-1.5 right-3 h-sm px-1.5 flex flex-col justify-center items-center",
3367
3372
  "font-b24-primary font-bold text-6xs leading-none uppercase rounded-full"
3368
- ]
3373
+ ].join(" ")
3369
3374
  },
3370
3375
  variants: {
3371
3376
  ...buttonGroupVariantWithRoot,
@@ -3667,7 +3672,7 @@ const toast = {
3667
3672
  "bg-base-ebony/80 dark:bg-base-dark",
3668
3673
  "text-sm font-normal",
3669
3674
  "text-white dark:text-base-150"
3670
- ],
3675
+ ].join(" "),
3671
3676
  wrapper: "w-0 flex-1 flex flex-col gap-1",
3672
3677
  title: "font-medium",
3673
3678
  description: "",
@@ -3821,7 +3826,7 @@ const tooltip = {
3821
3826
  "bg-base-dark text-white",
3822
3827
  "dark:bg-base-dark dark:text-base-150 dark:ring dark:ring-base-100/20",
3823
3828
  "pointer-events-auto"
3824
- ],
3829
+ ].join(" "),
3825
3830
  arrow: "fill-base-dark dark:fill-base-100/20",
3826
3831
  text: "text-pretty max-w-[200px]",
3827
3832
  // truncate
@@ -15,17 +15,17 @@ const advice = {
15
15
  root: "flex items-end",
16
16
  descriptionWrapper: [
17
17
  "relative"
18
- ],
18
+ ].join(" "),
19
19
  descriptionBorder: [
20
20
  "fill-blue-500 dark:fill-blue-300"
21
- ],
21
+ ].join(" "),
22
22
  descriptionBg: [
23
23
  "fill-white dark:fill-base-900"
24
- ],
24
+ ].join(" "),
25
25
  descriptionAngle: [
26
26
  "absolute",
27
27
  "w-[14px] h-[12px]"
28
- ],
28
+ ].join(" "),
29
29
  description: [
30
30
  "grow",
31
31
  "w-11/12 py-3 px-md2 ms-2",
@@ -35,7 +35,7 @@ const advice = {
35
35
  "border-1",
36
36
  "border-blue-500 bg-white text-base-950",
37
37
  "dark:border-blue-300 dark:bg-base-900 dark:text-base-200"
38
- ],
38
+ ].join(" "),
39
39
  leading: "me-1.5 ms-2",
40
40
  leadingIcon: "shrink-0 size-[42px]",
41
41
  leadingAvatar: "shrink-0",
@@ -269,8 +269,7 @@ const badge = {
269
269
  "inline-flex items-center",
270
270
  "transition-all duration-200 ease-linear",
271
271
  "px-2 leading-normal rounded-md"
272
- // 'text-base-800 dark:text-base-250'
273
- ],
272
+ ].join(" "),
274
273
  wrapper: "inline-flex items-center",
275
274
  label: "max-w-full whitespace-nowrap text-ellipsis",
276
275
  // truncate ////
@@ -715,7 +714,7 @@ const button = {
715
714
  ],
716
715
  baseLine: [
717
716
  "inline-flex items-center"
718
- ],
717
+ ].join(" "),
719
718
  label: "truncate",
720
719
  leadingIcon: "shrink-0",
721
720
  leadingAvatar: "shrink-0",
@@ -1505,7 +1504,7 @@ const countdown = {
1505
1504
  base: [
1506
1505
  "relative flex flex-row flex-nowrap items-center justify-between",
1507
1506
  "text-base-500 dark:text-base-600"
1508
- ],
1507
+ ].join(" "),
1509
1508
  label: "",
1510
1509
  leadingIcon: "shrink-0",
1511
1510
  leadingAvatar: "shrink-0",
@@ -1515,7 +1514,7 @@ const countdown = {
1515
1514
  circleElement: "stroke-transparent stroke-1",
1516
1515
  circlePath: [
1517
1516
  "stroke-[7px] rotate-90 origin-center stroke-current transition-all duration-1000 ease-linear"
1518
- ]
1517
+ ].join(" ")
1519
1518
  },
1520
1519
  variants: {
1521
1520
  size: {
@@ -1643,7 +1642,7 @@ const input = {
1643
1642
  "font-b24-primary font-regular text-md leading-none",
1644
1643
  "align-middle",
1645
1644
  "text-ellipsis whitespace-nowrap"
1646
- ],
1645
+ ].join(" "),
1647
1646
  leading: "absolute inset-y-0 start-0 flex items-center",
1648
1647
  leadingIcon: "shrink-0 text-base-400",
1649
1648
  leadingAvatar: "shrink-0",
@@ -1654,7 +1653,7 @@ const input = {
1654
1653
  "pointer-events-none select-none",
1655
1654
  "absolute z-10 -top-1.5 right-3 h-sm px-1.5 flex flex-col justify-center items-center",
1656
1655
  "font-b24-primary font-bold text-6xs leading-none uppercase rounded-full"
1657
- ]
1656
+ ].join(" ")
1658
1657
  },
1659
1658
  variants: {
1660
1659
  ...buttonGroupVariantWithRoot,
@@ -2716,7 +2715,7 @@ const select = () => {
2716
2715
  "font-b24-primary font-regular text-sm",
2717
2716
  "align-middle",
2718
2717
  "text-ellipsis whitespace-nowrap"
2719
- ],
2718
+ ].join(" "),
2720
2719
  value: "truncate pointer-events-none",
2721
2720
  placeholder: "truncate text-base-400 dark:text-base-300",
2722
2721
  arrow: "fill-base-master/10 dark:fill-base-100/20",
@@ -2727,12 +2726,12 @@ const select = () => {
2727
2726
  "overflow-hidden",
2728
2727
  "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
2729
2728
  "pointer-events-auto"
2730
- ],
2729
+ ].join(" "),
2731
2730
  scrollUpDownButton: [
2732
2731
  "flex items-center justify-center h-[25px] cursor-default backdrop-blur",
2733
2732
  "text-base-800 bg-white",
2734
2733
  "dark:text-base-100 dark:bg-base-dark"
2735
- ],
2734
+ ].join(" "),
2736
2735
  scrollUpDownButtonIcon: "",
2737
2736
  viewport: "divide-y divide-base-master/10 dark:divide-base-100/20 scroll-py-1",
2738
2737
  group: "p-1 isolate",
@@ -2740,7 +2739,7 @@ const select = () => {
2740
2739
  label: [
2741
2740
  "flex items-center",
2742
2741
  "font-semibold text-base-900 dark:text-base-200"
2743
- ],
2742
+ ].join(" "),
2744
2743
  separator: "-mx-1 my-1 h-px bg-base-master/10 dark:bg-base-100/20",
2745
2744
  item: [
2746
2745
  "group relative w-full flex items-center select-none outline-none",
@@ -2749,11 +2748,11 @@ const select = () => {
2749
2748
  "data-disabled:cursor-not-allowed data-disabled:opacity-75",
2750
2749
  "text-base-master dark:text-base-150 data-highlighted:text-base-900 dark:data-highlighted:text-base-200 data-highlighted:before:bg-base-100/50 dark:data-highlighted:before:bg-base-900",
2751
2750
  "transition-colors before:transition-colors"
2752
- ],
2751
+ ].join(" "),
2753
2752
  itemLeadingIcon: [
2754
2753
  "shrink-0 text-base-500 dark:text-base-700 group-data-highlighted:text-base-master dark:group-data-highlighted:text-base-150",
2755
2754
  "transition-colors"
2756
- ],
2755
+ ].join(" "),
2757
2756
  itemLeadingAvatar: "shrink-0",
2758
2757
  itemLeadingAvatarSize: "",
2759
2758
  itemLeadingChip: "shrink-0",
@@ -2898,10 +2897,16 @@ const skeleton = {
2898
2897
  const _switch = {
2899
2898
  slots: {
2900
2899
  root: "relative flex items-start",
2901
- base: ["cursor-pointer inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-base-200 dark:data-[state=unchecked]:bg-base-800", "transition-colors duration-200"],
2900
+ base: [
2901
+ "cursor-pointer inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-base-200 dark:data-[state=unchecked]:bg-base-800",
2902
+ "transition-colors duration-200"
2903
+ ].join(" "),
2902
2904
  container: "flex items-center",
2903
2905
  thumb: "group pointer-events-none rounded-full bg-white dark:bg-base-100 shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center",
2904
- icon: ["absolute shrink-0 group-data-[state=unchecked]:text-base-400 dark:group-data-[state=unchecked]:text-base-700 opacity-0 p-0.5 size-10/10", "transition-[color,opacity] duration-200"],
2906
+ icon: [
2907
+ "absolute shrink-0 group-data-[state=unchecked]:text-base-400 dark:group-data-[state=unchecked]:text-base-700 opacity-0 p-0.5 size-10/10",
2908
+ "transition-[color,opacity] duration-200"
2909
+ ].join(" "),
2905
2910
  wrapper: "font-b24-primary font-regular ms-2",
2906
2911
  label: "cursor-pointer block text-base-master dark:text-base-400",
2907
2912
  description: "text-base-500 dark:text-base-600"
@@ -3018,7 +3023,7 @@ const tabs = {
3018
3023
  "font-medium rounded-xl",
3019
3024
  "cursor-pointer disabled:cursor-not-allowed disabled:opacity-75 focus:outline-hidden",
3020
3025
  "transition-colors"
3021
- ],
3026
+ ].join(" "),
3022
3027
  content: "focus:outline-none w-full",
3023
3028
  leadingIcon: "shrink-0",
3024
3029
  leadingAvatar: "shrink-0",
@@ -3362,12 +3367,12 @@ const textarea = {
3362
3367
  "dark:text-base-150 dark:bg-transparent dark:placeholder:text-base-300 dark:hover:text-base-350 dark:focus:text-base-350 dark:active:text-base-350",
3363
3368
  "font-b24-primary font-regular text-md leading-normal",
3364
3369
  "align-middle"
3365
- ],
3370
+ ].join(" "),
3366
3371
  tag: [
3367
3372
  "pointer-events-none select-none",
3368
3373
  "absolute z-10 -top-1.5 right-3 h-sm px-1.5 flex flex-col justify-center items-center",
3369
3374
  "font-b24-primary font-bold text-6xs leading-none uppercase rounded-full"
3370
- ]
3375
+ ].join(" ")
3371
3376
  },
3372
3377
  variants: {
3373
3378
  ...buttonGroupVariantWithRoot,
@@ -3669,7 +3674,7 @@ const toast = {
3669
3674
  "bg-base-ebony/80 dark:bg-base-dark",
3670
3675
  "text-sm font-normal",
3671
3676
  "text-white dark:text-base-150"
3672
- ],
3677
+ ].join(" "),
3673
3678
  wrapper: "w-0 flex-1 flex flex-col gap-1",
3674
3679
  title: "font-medium",
3675
3680
  description: "",
@@ -3823,7 +3828,7 @@ const tooltip = {
3823
3828
  "bg-base-dark text-white",
3824
3829
  "dark:bg-base-dark dark:text-base-150 dark:ring dark:ring-base-100/20",
3825
3830
  "pointer-events-auto"
3826
- ],
3831
+ ].join(" "),
3827
3832
  arrow: "fill-base-dark dark:fill-base-100/20",
3828
3833
  text: "text-pretty max-w-[200px]",
3829
3834
  // truncate
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.DKayP3fG.cjs');
8
+ const templates = require('./shared/b24ui-nuxt.D8eTlsIC.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>;