@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
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/toast";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { ref, computed, onMounted, nextTick } from "vue";
6
+ import { ref, computed, onMounted, nextTick, useTemplateRef } from "vue";
7
7
  import { ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose, useForwardPropsEmits } from "reka-ui";
8
8
  import { reactivePick } from "@vueuse/core";
9
9
  import { useAppConfig } from "#imports";
@@ -42,14 +42,14 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.toast |
42
42
  orientation: props.orientation,
43
43
  title: !!props.title || !!slots.title
44
44
  }));
45
- const el = ref();
45
+ const rootRef = useTemplateRef("rootRef");
46
46
  const height = ref(0);
47
47
  onMounted(() => {
48
- if (!el.value) {
48
+ if (!rootRef.value) {
49
49
  return;
50
50
  }
51
51
  nextTick(() => {
52
- height.value = el.value?.$el?.getBoundingClientRect()?.height;
52
+ height.value = rootRef.value?.$el?.getBoundingClientRect()?.height;
53
53
  });
54
54
  });
55
55
  defineExpose({
@@ -59,7 +59,7 @@ defineExpose({
59
59
 
60
60
  <template>
61
61
  <ToastRoot
62
- ref="el"
62
+ ref="rootRef"
63
63
  v-slot="{ remaining, duration, open }"
64
64
  v-bind="rootProps"
65
65
  :data-orientation="orientation"
@@ -43,8 +43,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Toaste
43
43
  progress: boolean;
44
44
  duration: number;
45
45
  position: Toaster["variants"]["position"];
46
- expand: boolean;
47
46
  max: number;
47
+ expand: boolean;
48
48
  portal: boolean | string | HTMLElement;
49
49
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToasterSlots>;
50
50
  declare const _default: typeof __VLS_export;
@@ -43,8 +43,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Toaste
43
43
  progress: boolean;
44
44
  duration: number;
45
45
  position: Toaster["variants"]["position"];
46
- expand: boolean;
47
46
  max: number;
47
+ expand: boolean;
48
48
  portal: boolean | string | HTMLElement;
49
49
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToasterSlots>;
50
50
  declare const _default: typeof __VLS_export;
@@ -1,8 +1,8 @@
1
- import type { AvatarProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeAvatarProps extends /** @vue-ignore */ Omit<AvatarProps, 'src'> {
1
+ import type { AvatarProps } from '../../types';
2
+ export interface ColorModeAvatarProps extends Omit<AvatarProps, 'src'> {
3
3
  light: string;
4
4
  dark: string;
5
5
  }
6
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const __VLS_export: import("vue").DefineComponent<ColorModeAvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeAvatarProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -3,15 +3,27 @@
3
3
  </script>
4
4
 
5
5
  <script setup>
6
+ import { useForwardProps } from "reka-ui";
7
+ import { reactiveOmit } from "@vueuse/core";
6
8
  import B24Avatar from "../Avatar.vue";
7
9
  defineOptions({ inheritAttrs: false });
8
- defineProps({
10
+ const props = defineProps({
9
11
  light: { type: String, required: true },
10
- dark: { type: String, required: true }
12
+ dark: { type: String, required: true },
13
+ as: { type: null, required: false },
14
+ alt: { type: String, required: false },
15
+ icon: { type: [Function, Object], required: false },
16
+ text: { type: String, required: false },
17
+ size: { type: null, required: false },
18
+ chip: { type: [Boolean, Object], required: false },
19
+ class: { type: null, required: false },
20
+ style: { type: null, required: false },
21
+ b24ui: { type: null, required: false }
11
22
  });
23
+ const avatarProps = useForwardProps(reactiveOmit(props, "light", "dark"));
12
24
  </script>
13
25
 
14
26
  <template>
15
- <B24Avatar :src="light" class="dark:hidden" v-bind="$attrs" />
16
- <B24Avatar :src="dark" class="hidden dark:block" v-bind="$attrs" />
27
+ <B24Avatar v-bind="{ ...avatarProps, ...$attrs }" :src="light" class="dark:hidden" />
28
+ <B24Avatar v-bind="{ ...avatarProps, ...$attrs }" :src="dark" class="hidden dark:block" />
17
29
  </template>
@@ -1,8 +1,8 @@
1
- import type { AvatarProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeAvatarProps extends /** @vue-ignore */ Omit<AvatarProps, 'src'> {
1
+ import type { AvatarProps } from '../../types';
2
+ export interface ColorModeAvatarProps extends Omit<AvatarProps, 'src'> {
3
3
  light: string;
4
4
  dark: string;
5
5
  }
6
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const __VLS_export: import("vue").DefineComponent<ColorModeAvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeAvatarProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -1,12 +1,12 @@
1
- import type { ButtonProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeButtonProps extends /** @vue-ignore */ Pick<ButtonProps, 'as' | 'size' | 'disabled' | 'b24ui'> {
1
+ import type { ButtonProps } from '../../types';
2
+ export interface ColorModeButtonProps extends Omit<ButtonProps, 'color'> {
3
3
  /**
4
4
  * @defaultValue 'air-tertiary-no-accent'
5
5
  */
6
6
  color?: ButtonProps['color'];
7
7
  }
8
8
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorModeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeButtonProps> & Readonly<{}>, {
9
- color: ButtonProps["color"];
9
+ color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
10
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
11
11
  fallback(props?: {}): any;
12
12
  }>;
@@ -4,17 +4,63 @@
4
4
 
5
5
  <script setup>
6
6
  import { computed } from "vue";
7
+ import { useForwardProps } from "reka-ui";
8
+ import { reactiveOmit } from "@vueuse/core";
7
9
  import { useColorMode } from "#imports";
8
10
  import { useLocale } from "../../composables/useLocale";
9
11
  import icons from "../../dictionary/icons";
10
12
  import B24Button from "../Button.vue";
11
13
  defineOptions({ inheritAttrs: false });
12
- defineProps({
13
- color: { type: null, required: false, default: "air-tertiary-no-accent" }
14
+ const props = defineProps({
15
+ color: { type: null, required: false, default: "air-tertiary-no-accent" },
16
+ label: { type: String, required: false },
17
+ activeColor: { type: null, required: false },
18
+ depth: { type: null, required: false },
19
+ activeDepth: { type: null, required: false },
20
+ size: { type: null, required: false },
21
+ rounded: { type: Boolean, required: false },
22
+ block: { type: Boolean, required: false },
23
+ loadingAuto: { type: Boolean, required: false },
24
+ normalCase: { type: Boolean, required: false },
25
+ useWait: { type: Boolean, required: false },
26
+ useClock: { type: Boolean, required: false },
27
+ useDropdown: { type: Boolean, required: false },
28
+ onClick: { type: [Function, Array], required: false },
29
+ class: { type: null, required: false },
30
+ activeClass: { type: String, required: false },
31
+ inactiveClass: { type: String, required: false },
32
+ b24ui: { type: null, required: false },
33
+ icon: { type: [Function, Object], required: false },
34
+ avatar: { type: Object, required: false },
35
+ loading: { type: Boolean, required: false },
36
+ as: { type: null, required: false },
37
+ type: { type: null, required: false },
38
+ disabled: { type: Boolean, required: false },
39
+ active: { type: Boolean, required: false },
40
+ exact: { type: Boolean, required: false },
41
+ exactQuery: { type: [Boolean, String], required: false },
42
+ exactHash: { type: Boolean, required: false },
43
+ isAction: { type: Boolean, required: false },
44
+ to: { type: null, required: false },
45
+ href: { type: null, required: false },
46
+ external: { type: Boolean, required: false },
47
+ target: { type: [String, Object, null], required: false },
48
+ rel: { type: [String, Object, null], required: false },
49
+ noRel: { type: Boolean, required: false },
50
+ prefetchedClass: { type: String, required: false },
51
+ prefetch: { type: Boolean, required: false },
52
+ prefetchOn: { type: [String, Object], required: false },
53
+ noPrefetch: { type: Boolean, required: false },
54
+ trailingSlash: { type: String, required: false },
55
+ exactActiveClass: { type: String, required: false },
56
+ ariaCurrentValue: { type: String, required: false },
57
+ viewTransition: { type: Boolean, required: false },
58
+ replace: { type: Boolean, required: false }
14
59
  });
15
60
  defineSlots();
16
61
  const { t } = useLocale();
17
62
  const colorMode = useColorMode();
63
+ const buttonProps = useForwardProps(reactiveOmit(props, "icon"));
18
64
  const isDark = computed({
19
65
  get() {
20
66
  return colorMode.value === "dark";
@@ -28,10 +74,12 @@ const isDark = computed({
28
74
  <template>
29
75
  <ClientOnly v-if="!colorMode?.forced">
30
76
  <B24Button
31
- :icon="isDark ? icons.dark : icons.light"
32
- :color="color"
33
- :aria-label="isDark ? t('colorMode.switchToLight') : t('colorMode.switchToDark')"
34
- v-bind="$attrs"
77
+ v-bind="{
78
+ ...buttonProps,
79
+ 'icon': props.icon || (isDark ? icons.dark : icons.light),
80
+ 'aria-label': isDark ? t('colorMode.switchToLight') : t('colorMode.switchToDark'),
81
+ ...$attrs
82
+ }"
35
83
  @click="isDark = !isDark"
36
84
  />
37
85
 
@@ -1,12 +1,12 @@
1
- import type { ButtonProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeButtonProps extends /** @vue-ignore */ Pick<ButtonProps, 'as' | 'size' | 'disabled' | 'b24ui'> {
1
+ import type { ButtonProps } from '../../types';
2
+ export interface ColorModeButtonProps extends Omit<ButtonProps, 'color'> {
3
3
  /**
4
4
  * @defaultValue 'air-tertiary-no-accent'
5
5
  */
6
6
  color?: ButtonProps['color'];
7
7
  }
8
8
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorModeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeButtonProps> & Readonly<{}>, {
9
- color: ButtonProps["color"];
9
+ color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
10
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
11
11
  fallback(props?: {}): any;
12
12
  }>;
@@ -1,7 +1,8 @@
1
- type __VLS_Props = {
1
+ import type { ImgHTMLAttributes } from '../../types/html';
2
+ export interface ColorModeImageProps extends /** @vue-ignore */ Omit<ImgHTMLAttributes, 'src'> {
2
3
  dark: string;
3
4
  light: string;
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ }
6
+ declare const __VLS_export: import("vue").DefineComponent<ColorModeImageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeImageProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
7
  declare const _default: typeof __VLS_export;
7
8
  export default _default;
@@ -1,3 +1,7 @@
1
+ <script>
2
+
3
+ </script>
4
+
1
5
  <script setup>
2
6
  import ImageComponent from "#build/b24ui-image-component";
3
7
  defineOptions({ inheritAttrs: false });
@@ -1,7 +1,8 @@
1
- type __VLS_Props = {
1
+ import type { ImgHTMLAttributes } from '../../types/html';
2
+ export interface ColorModeImageProps extends /** @vue-ignore */ Omit<ImgHTMLAttributes, 'src'> {
2
3
  dark: string;
3
4
  light: string;
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ }
6
+ declare const __VLS_export: import("vue").DefineComponent<ColorModeImageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeImageProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
7
  declare const _default: typeof __VLS_export;
7
8
  export default _default;
@@ -1,6 +1,8 @@
1
- import type { SelectMenuProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeSelectProps extends /** @vue-ignore */ Pick<SelectMenuProps<any>, 'color' | 'size' | 'trailingIcon' | 'selectedIcon' | 'content' | 'arrow' | 'portal' | 'disabled' | 'b24ui'> {
1
+ import type { SelectMenuProps, SelectMenuItem } from '../../types';
2
+ export interface ColorModeSelectProps extends Omit<SelectMenuProps<SelectMenuItem[]>, 'icon' | 'items' | 'modelValue'> {
3
3
  }
4
- declare const __VLS_export: import("vue").DefineComponent<ColorModeSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSelectProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("vue").DefineComponent<ColorModeSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSelectProps> & Readonly<{}>, {
5
+ searchInput: boolean | import("../Input.vue").InputProps;
6
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
7
  declare const _default: typeof __VLS_export;
6
8
  export default _default;
@@ -4,14 +4,58 @@
4
4
 
5
5
  <script setup>
6
6
  import { computed } from "vue";
7
+ import { useForwardProps } from "reka-ui";
7
8
  import { useColorMode } from "#imports";
8
9
  import { useLocale } from "../../composables/useLocale";
9
10
  import icons from "../../dictionary/icons";
10
11
  import B24SelectMenu from "../SelectMenu.vue";
11
12
  defineOptions({ inheritAttrs: false });
12
- defineProps({});
13
+ const props = defineProps({
14
+ id: { type: String, required: false },
15
+ placeholder: { type: String, required: false },
16
+ searchInput: { type: [Boolean, Object], required: false, default: false },
17
+ color: { type: null, required: false },
18
+ size: { type: null, required: false },
19
+ noPadding: { type: Boolean, required: false },
20
+ noBorder: { type: Boolean, required: false },
21
+ underline: { type: Boolean, required: false },
22
+ rounded: { type: Boolean, required: false },
23
+ tag: { type: String, required: false },
24
+ tagColor: { type: null, required: false },
25
+ required: { type: Boolean, required: false },
26
+ trailingIcon: { type: [Function, Object], required: false },
27
+ selectedIcon: { type: [Function, Object], required: false },
28
+ content: { type: Object, required: false },
29
+ arrow: { type: [Boolean, Object], required: false },
30
+ portal: { type: [Boolean, String], required: false, skipCheck: true },
31
+ virtualize: { type: [Boolean, Object], required: false },
32
+ valueKey: { type: null, required: false },
33
+ labelKey: { type: null, required: false },
34
+ descriptionKey: { type: null, required: false },
35
+ defaultValue: { type: null, required: false },
36
+ multiple: { type: Boolean, required: false },
37
+ highlight: { type: Boolean, required: false },
38
+ createItem: { type: [Boolean, String, Object], required: false },
39
+ filterFields: { type: Array, required: false },
40
+ ignoreFilter: { type: Boolean, required: false },
41
+ autofocus: { type: Boolean, required: false },
42
+ autofocusDelay: { type: Number, required: false },
43
+ class: { type: null, required: false },
44
+ b24ui: { type: null, required: false },
45
+ open: { type: Boolean, required: false },
46
+ defaultOpen: { type: Boolean, required: false },
47
+ disabled: { type: Boolean, required: false },
48
+ name: { type: String, required: false },
49
+ resetSearchTermOnBlur: { type: Boolean, required: false },
50
+ resetSearchTermOnSelect: { type: Boolean, required: false },
51
+ highlightOnHover: { type: Boolean, required: false },
52
+ avatar: { type: Object, required: false },
53
+ loading: { type: Boolean, required: false },
54
+ trailing: { type: Boolean, required: false }
55
+ });
13
56
  const { t } = useLocale();
14
57
  const colorMode = useColorMode();
58
+ const selectMenuProps = useForwardProps(props);
15
59
  const items = computed(() => [
16
60
  { label: t("colorMode.system"), value: "system", icon: icons.system },
17
61
  { label: t("colorMode.light"), value: "light", icon: icons.light },
@@ -31,18 +75,16 @@ const preference = computed({
31
75
  <ClientOnly v-if="!colorMode?.forced">
32
76
  <B24SelectMenu
33
77
  v-model="preference"
34
- :search-input="false"
35
78
  :icon="preference?.icon"
36
- v-bind="$attrs"
79
+ v-bind="{ ...selectMenuProps, ...$attrs }"
37
80
  :items="items"
38
81
  />
39
82
 
40
83
  <template #fallback>
41
84
  <B24SelectMenu
42
- :search-input="false"
43
85
  :icon="items[0]?.icon"
44
- v-bind="$attrs"
45
86
  :model-value="items[0]"
87
+ v-bind="{ ...selectMenuProps, ...$attrs }"
46
88
  :items="items"
47
89
  disabled
48
90
  />
@@ -1,6 +1,8 @@
1
- import type { SelectMenuProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeSelectProps extends /** @vue-ignore */ Pick<SelectMenuProps<any>, 'color' | 'size' | 'trailingIcon' | 'selectedIcon' | 'content' | 'arrow' | 'portal' | 'disabled' | 'b24ui'> {
1
+ import type { SelectMenuProps, SelectMenuItem } from '../../types';
2
+ export interface ColorModeSelectProps extends Omit<SelectMenuProps<SelectMenuItem[]>, 'icon' | 'items' | 'modelValue'> {
3
3
  }
4
- declare const __VLS_export: import("vue").DefineComponent<ColorModeSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSelectProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("vue").DefineComponent<ColorModeSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSelectProps> & Readonly<{}>, {
5
+ searchInput: boolean | import("../Input.vue").InputProps;
6
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
7
  declare const _default: typeof __VLS_export;
6
8
  export default _default;
@@ -1,5 +1,5 @@
1
- import type { SwitchProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeSwitchProps extends /** @vue-ignore */ Pick<SwitchProps, 'as' | 'color' | 'size' | 'disabled' | 'b24ui'> {
1
+ import type { SwitchProps } from '../../types';
2
+ export interface ColorModeSwitchProps extends Omit<SwitchProps, 'checkedIcon' | 'uncheckedIcon' | 'modelValue'> {
3
3
  }
4
4
  declare const __VLS_export: import("vue").DefineComponent<ColorModeSwitchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSwitchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
@@ -4,14 +4,32 @@
4
4
 
5
5
  <script setup>
6
6
  import { computed } from "vue";
7
+ import { useForwardProps } from "reka-ui";
7
8
  import { useColorMode } from "#imports";
8
9
  import { useLocale } from "../../composables/useLocale";
9
10
  import icons from "../../dictionary/icons";
10
11
  import B24Switch from "../Switch.vue";
11
12
  defineOptions({ inheritAttrs: false });
12
- defineProps({});
13
+ const props = defineProps({
14
+ as: { type: null, required: false },
15
+ color: { type: null, required: false },
16
+ size: { type: null, required: false },
17
+ loading: { type: Boolean, required: false },
18
+ loadingIcon: { type: [Function, Object], required: false },
19
+ label: { type: String, required: false },
20
+ description: { type: String, required: false },
21
+ class: { type: null, required: false },
22
+ b24ui: { type: null, required: false },
23
+ disabled: { type: Boolean, required: false },
24
+ id: { type: String, required: false },
25
+ name: { type: String, required: false },
26
+ required: { type: Boolean, required: false },
27
+ value: { type: String, required: false },
28
+ defaultValue: { type: Boolean, required: false }
29
+ });
13
30
  const { t } = useLocale();
14
31
  const colorMode = useColorMode();
32
+ const switchProps = useForwardProps(props);
15
33
  const isDark = computed({
16
34
  get() {
17
35
  return colorMode.value === "dark";
@@ -28,16 +46,22 @@ const isDark = computed({
28
46
  v-model="isDark"
29
47
  :checked-icon="icons.dark"
30
48
  :unchecked-icon="icons.light"
31
- :aria-label="isDark ? t('colorMode.switchToLight') : t('colorMode.switchToDark')"
32
- v-bind="$attrs"
49
+ v-bind="{
50
+ ...switchProps,
51
+ 'aria-label': isDark ? t('colorMode.switchToLight') : t('colorMode.switchToDark'),
52
+ ...$attrs
53
+ }"
33
54
  />
34
55
 
35
56
  <template #fallback>
36
57
  <B24Switch
37
58
  :checked-icon="icons.dark"
38
59
  :unchecked-icon="icons.light"
39
- :aria-label="isDark ? t('colorMode.switchToLight') : t('colorMode.switchToDark')"
40
- v-bind="$attrs"
60
+ v-bind="{
61
+ ...switchProps,
62
+ 'aria-label': isDark ? t('colorMode.switchToLight') : t('colorMode.switchToDark'),
63
+ ...$attrs
64
+ }"
41
65
  disabled
42
66
  />
43
67
  </template>
@@ -1,5 +1,5 @@
1
- import type { SwitchProps } from '@bitrix24/b24ui-nuxt';
2
- export interface ColorModeSwitchProps extends /** @vue-ignore */ Pick<SwitchProps, 'as' | 'color' | 'size' | 'disabled' | 'b24ui'> {
1
+ import type { SwitchProps } from '../../types';
2
+ export interface ColorModeSwitchProps extends Omit<SwitchProps, 'checkedIcon' | 'uncheckedIcon' | 'modelValue'> {
3
3
  }
4
4
  declare const __VLS_export: import("vue").DefineComponent<ColorModeSwitchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSwitchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
@@ -28,6 +28,9 @@ export interface ContentSearchItem extends Omit<LinkProps, 'custom'>, CommandPal
28
28
  */
29
29
  icon?: IconComponent;
30
30
  }
31
+ /**
32
+ * @memo not use loadingIcon
33
+ */
31
34
  export interface ContentSearchProps<T extends ContentSearchLink = ContentSearchLink> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'> {
32
35
  /**
33
36
  * The icon displayed in the input.
@@ -47,12 +50,6 @@ export interface ContentSearchProps<T extends ContentSearchLink = ContentSearchL
47
50
  autofocus?: boolean;
48
51
  /** When `true`, the loading icon will be displayed. */
49
52
  loading?: boolean;
50
- /**
51
- * The icon when the `loading` prop is `true`.
52
- * @defaultValue icons.loading
53
- * @IconComponent
54
- */
55
- loadingIcon?: IconComponent;
56
53
  /**
57
54
  * Display a close button in the input (useful when inside a Modal for example).
58
55
  * `{ size: 'sm', color: 'air-tertiary-no-accent' }`{lang="ts-type"}
@@ -20,7 +20,6 @@ const props = defineProps({
20
20
  placeholder: { type: String, required: false },
21
21
  autofocus: { type: Boolean, required: false },
22
22
  loading: { type: Boolean, required: false },
23
- loadingIcon: { type: [Function, Object], required: false },
24
23
  close: { type: [Boolean, Object], required: false, default: true },
25
24
  closeIcon: { type: [Function, Object], required: false },
26
25
  shortcut: { type: String, required: false, default: "meta_k" },
@@ -48,7 +47,7 @@ const { t } = useLocale();
48
47
  const { open } = useContentSearch();
49
48
  const colorMode = useColorMode();
50
49
  const appConfig = useAppConfig();
51
- const commandPaletteProps = useForwardProps(reactivePick(props, "icon", "placeholder", "autofocus", "loading", "loadingIcon", "close", "closeIcon"));
50
+ const commandPaletteProps = useForwardProps(reactivePick(props, "icon", "placeholder", "autofocus", "loading", "close", "closeIcon"));
52
51
  const modalProps = useForwardProps(reactivePick(props, "overlay", "transition", "content", "dismissible", "fullscreen", "modal", "portal"));
53
52
  const getProxySlots = () => omit(slots, ["content"]);
54
53
  const fuse = computed(() => defu({}, props.fuse, {
@@ -59,6 +58,7 @@ const fuse = computed(() => defu({}, props.fuse, {
59
58
  const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.contentSearch || {} })({
60
59
  fullscreen: props.fullscreen
61
60
  }));
61
+ const commandPaletteRef = useTemplateRef("commandPaletteRef");
62
62
  function mapLinksItems(links) {
63
63
  return links.flatMap((link) => [{
64
64
  ...link,
@@ -158,7 +158,6 @@ defineShortcuts({
158
158
  handler: () => open.value = !open.value
159
159
  }
160
160
  });
161
- const commandPaletteRef = useTemplateRef("commandPaletteRef");
162
161
  defineExpose({
163
162
  commandPaletteRef
164
163
  });
@@ -28,6 +28,9 @@ export interface ContentSearchItem extends Omit<LinkProps, 'custom'>, CommandPal
28
28
  */
29
29
  icon?: IconComponent;
30
30
  }
31
+ /**
32
+ * @memo not use loadingIcon
33
+ */
31
34
  export interface ContentSearchProps<T extends ContentSearchLink = ContentSearchLink> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'> {
32
35
  /**
33
36
  * The icon displayed in the input.
@@ -47,12 +50,6 @@ export interface ContentSearchProps<T extends ContentSearchLink = ContentSearchL
47
50
  autofocus?: boolean;
48
51
  /** When `true`, the loading icon will be displayed. */
49
52
  loading?: boolean;
50
- /**
51
- * The icon when the `loading` prop is `true`.
52
- * @defaultValue icons.loading
53
- * @IconComponent
54
- */
55
- loadingIcon?: IconComponent;
56
53
  /**
57
54
  * Display a close button in the input (useful when inside a Modal for example).
58
55
  * `{ size: 'sm', color: 'air-tertiary-no-accent' }`{lang="ts-type"}
@@ -3,7 +3,7 @@ import theme from '#build/b24ui/content/content-search-button';
3
3
  import type { ButtonProps, ButtonSlots, IconComponent, KbdProps, TooltipProps } from '../../types';
4
4
  import type { ComponentConfig } from '../../types/tv';
5
5
  type ContentSearchButton = ComponentConfig<typeof theme, AppConfig, 'contentSearchButton'>;
6
- export interface ContentSearchButtonProps {
6
+ export interface ContentSearchButtonProps extends Omit<ButtonProps, 'icon' | 'label' | 'color'> {
7
7
  /**
8
8
  * The icon displayed in the button.
9
9
  * @defaultValue icons.search
@@ -20,7 +20,6 @@ export interface ContentSearchButtonProps {
20
20
  * @defaultValue 'air-tertiary-no-accent'
21
21
  */
22
22
  color?: ButtonProps['color'];
23
- size?: ButtonProps['size'];
24
23
  /**
25
24
  * Whether the button is collapsed.
26
25
  * @defaultValue true
@@ -41,7 +40,7 @@ export interface ContentSearchButtonProps {
41
40
  class?: any;
42
41
  }
43
42
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ContentSearchButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContentSearchButtonProps> & Readonly<{}>, {
44
- color: "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "default" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
43
+ color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
45
44
  tooltip: boolean | TooltipProps;
46
45
  kbds: KbdProps["value"][] | KbdProps[];
47
46
  collapsed: boolean;