@bitrix24/b24ui-nuxt 0.4.11 → 0.5.1

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 (44) hide show
  1. package/.nuxt/b24ui/navigation-menu.ts +301 -68
  2. package/.nuxt/b24ui/sidebar-body.ts +1 -1
  3. package/.nuxt/b24ui/sidebar-footer.ts +1 -1
  4. package/.nuxt/b24ui/sidebar-header.ts +1 -1
  5. package/.nuxt/b24ui/sidebar-heading.ts +1 -1
  6. package/.nuxt/b24ui/sidebar-section.ts +1 -1
  7. package/.nuxt/b24ui.css +1 -1
  8. package/README.md +2 -2
  9. package/dist/meta.cjs +6503 -263
  10. package/dist/meta.d.cts +6503 -263
  11. package/dist/meta.d.mts +6503 -263
  12. package/dist/meta.d.ts +6503 -263
  13. package/dist/meta.mjs +6503 -263
  14. package/dist/module.cjs +1 -1
  15. package/dist/module.json +1 -1
  16. package/dist/module.mjs +1 -1
  17. package/dist/runtime/components/DropdownMenu.vue +5 -5
  18. package/dist/runtime/components/Form.vue +21 -1
  19. package/dist/runtime/components/FormField.vue +5 -0
  20. package/dist/runtime/components/InputMenu.vue +3 -3
  21. package/dist/runtime/components/Modal.vue +10 -7
  22. package/dist/runtime/components/NavigationMenu.vue +44 -36
  23. package/dist/runtime/components/Popover.vue +3 -2
  24. package/dist/runtime/components/RadioGroup.vue +2 -2
  25. package/dist/runtime/components/Select.vue +3 -3
  26. package/dist/runtime/components/SelectMenu.vue +3 -3
  27. package/dist/runtime/components/Slideover.vue +10 -7
  28. package/dist/runtime/components/Toast.vue +1 -1
  29. package/dist/runtime/components/Tooltip.vue +3 -2
  30. package/dist/runtime/composables/useComponentIcons.d.ts +2 -2
  31. package/dist/runtime/index.css +1 -1
  32. package/dist/runtime/plugins/colors.d.ts +3 -0
  33. package/dist/runtime/types/form.d.ts +1 -3
  34. package/dist/runtime/utils/form.d.ts +0 -4
  35. package/dist/runtime/utils/form.js +2 -47
  36. package/dist/runtime/utils/link.d.ts +8 -8
  37. package/dist/runtime/vue/stubs.d.ts +1 -1
  38. package/dist/shared/{b24ui-nuxt.CJqO7fYv.mjs → b24ui-nuxt.CBnBA3PE.mjs} +466 -56
  39. package/dist/shared/{b24ui-nuxt.CltBJi1M.cjs → b24ui-nuxt.ClMXHpMM.cjs} +466 -56
  40. package/dist/unplugin.cjs +1 -1
  41. package/dist/unplugin.mjs +1 -1
  42. package/dist/vite.cjs +1 -1
  43. package/dist/vite.mjs +1 -1
  44. package/package.json +11 -11
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.CltBJi1M.cjs');
5
+ const templates = require('./shared/b24ui-nuxt.ClMXHpMM.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.16.0"
6
6
  },
7
7
  "docs": "https://bitrix24.github.io/b24ui/guide/installation-nuxt-app.html",
8
- "version": "0.4.11",
8
+ "version": "0.5.1",
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.CJqO7fYv.mjs';
3
+ import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.CBnBA3PE.mjs';
4
4
  import 'node:url';
5
5
  import 'scule';
6
6
 
@@ -1,13 +1,13 @@
1
1
  <!-- eslint-disable vue/block-tag-newline -->
2
2
  <script lang="ts">
3
3
  import type { VariantProps } from 'tailwind-variants'
4
- import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps } from 'reka-ui'
4
+ import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuContentEmits, DropdownMenuArrowProps } from 'reka-ui'
5
5
  import type { AppConfig } from '@nuxt/schema'
6
6
  import _appConfig from '#build/app.config'
7
7
  import theme from '#build/b24ui/dropdown-menu'
8
8
  import { tv } from '../utils/tv'
9
9
  import type { AvatarProps, KbdProps, LinkProps, IconComponent } from '../types'
10
- import type { DynamicSlots, PartialString } from '../types/utils'
10
+ import type { DynamicSlots, PartialString, EmitsToProps } from '../types/utils'
11
11
 
12
12
  const appConfigDropdownMenu = _appConfig as AppConfig & { b24ui: { dropdownMenu: Partial<typeof theme> } }
13
13
 
@@ -24,7 +24,7 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cust
24
24
  icon?: IconComponent
25
25
  color?: DropdownMenuVariants['color']
26
26
  avatar?: AvatarProps
27
- content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
27
+ content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
28
28
  kbds?: KbdProps['value'][] | KbdProps[]
29
29
  /**
30
30
  * The item type.
@@ -65,7 +65,7 @@ export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>
65
65
  * The content of the menu.
66
66
  * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
67
67
  */
68
- content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
68
+ content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
69
69
  /**
70
70
  * Display an arrow alongside the menu.
71
71
  * @defaultValue false
@@ -147,7 +147,7 @@ const b24ui = computed(() => dropdownMenu({
147
147
  :checked-icon="checkedIcon"
148
148
  :external-icon="externalIcon"
149
149
  >
150
- <template v-for="(_, name) in proxySlots" #[name]="slotData: any">
150
+ <template v-for="(_, name) in proxySlots" #[name]="slotData">
151
151
  <slot :name="name" v-bind="slotData" />
152
152
  </template>
153
153
 
@@ -12,14 +12,34 @@ const form = tv({ extend: tv(theme), ...(appConfigForm.b24ui?.form || {}) })
12
12
 
13
13
  export interface FormProps<T extends object> {
14
14
  id?: string | number
15
+ /** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */
15
16
  schema?: FormSchema<T>
17
+ /** An object representing the current state of the form. */
16
18
  state: Partial<T>
19
+ /**
20
+ * Custom validation function to validate the form state.
21
+ * @param state - The current state of the form.
22
+ * @returns A promise that resolves to an array of FormError objects, or an array of FormError objects directly.
23
+ */
17
24
  validate?: (state: Partial<T>) => Promise<FormError[]> | FormError[]
25
+ /**
26
+ * The list of input events that trigger the form validation.
27
+ * @defaultValue `['blur', 'change', 'input']`
28
+ */
18
29
  validateOn?: FormInputEvents[]
30
+ /** Disable all inputs inside the form. */
19
31
  disabled?: boolean
32
+ /**
33
+ * Delay in milliseconds before validating the form on input events.
34
+ * @defaultValue `300`
35
+ */
20
36
  validateOnInputDelay?: number
21
- class?: any
37
+ /**
38
+ * If true, schema transformations will be applied to the state on submit.
39
+ * @defaultValue `true`
40
+ */
22
41
  transform?: boolean
42
+ class?: any
23
43
  onSubmit?: ((event: FormSubmitEvent<T>) => void | Promise<void>) | (() => void | Promise<void>)
24
44
  }
25
45
 
@@ -34,7 +34,12 @@ export interface FormFieldProps {
34
34
  * @defaultValue false
35
35
  */
36
36
  required?: boolean
37
+ /** If true, validation on input will be active immediately instead of waiting for a blur event. */
37
38
  eagerValidation?: boolean
39
+ /**
40
+ * Delay in milliseconds before validating the form on input events.
41
+ * @defaultValue `300`
42
+ */
38
43
  validateOnInputDelay?: number
39
44
  class?: any
40
45
  b24ui?: Partial<typeof formField.slots>
@@ -1,14 +1,14 @@
1
1
  <script lang="ts">
2
2
  import type { InputHTMLAttributes } from 'vue'
3
3
  import type { VariantProps } from 'tailwind-variants'
4
- import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxArrowProps, AcceptableValue } from 'reka-ui'
4
+ import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps, AcceptableValue } from 'reka-ui'
5
5
  import type { AppConfig } from '@nuxt/schema'
6
6
  import _appConfig from '#build/app.config'
7
7
  import theme from '#build/b24ui/input-menu'
8
8
  import type { UseComponentIconsProps } from '../composables/useComponentIcons'
9
9
  import { tv } from '../utils/tv'
10
10
  import type { AvatarProps, ChipProps, InputProps, IconComponent } from '../types'
11
- import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey } from '../types/utils'
11
+ import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey, EmitsToProps } from '../types/utils'
12
12
 
13
13
  const appConfigInputMenu = _appConfig as AppConfig & { b24ui: { inputMenu: Partial<typeof theme> } }
14
14
 
@@ -113,7 +113,7 @@ export interface InputMenuProps<T extends MaybeArrayOfArrayItem<I>, I extends Ma
113
113
  * The content of the menu.
114
114
  * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }
115
115
  */
116
- content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'>
116
+ content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ComboboxContentEmits>>
117
117
  /**
118
118
  * Display an arrow alongside the menu.
119
119
  * @defaultValue false
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'reka-ui'
2
+ import type { DialogRootProps, DialogRootEmits, DialogContentProps, DialogContentEmits } from 'reka-ui'
3
3
  import type { VariantProps } from 'tailwind-variants'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/b24ui/modal'
7
7
  import { tv } from '../utils/tv'
8
8
  import type { ButtonProps, IconComponent } from '../types'
9
+ import type { EmitsToProps } from '../types/utils'
9
10
 
10
11
  const appConfigModal = _appConfig as AppConfig & { b24ui: { modal: Partial<typeof theme> } }
11
12
 
@@ -19,7 +20,7 @@ export interface ModalProps extends DialogRootProps {
19
20
  /**
20
21
  * The content of the modal
21
22
  */
22
- content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
23
+ content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>
23
24
  /**
24
25
  * Render an overlay behind the modal.
25
26
  * @defaultValue true
@@ -113,18 +114,20 @@ const { t } = useLocale()
113
114
  const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
114
115
  const contentProps = toRef(() => props.content)
115
116
  const contentEvents = computed(() => {
117
+ const events = {
118
+ closeAutoFocus: (e: Event) => e.preventDefault()
119
+ }
120
+
116
121
  if (!props.dismissible) {
117
122
  return {
118
123
  pointerDownOutside: (e: Event) => e.preventDefault(),
119
124
  interactOutside: (e: Event) => e.preventDefault(),
120
125
  escapeKeyDown: (e: Event) => e.preventDefault(),
121
- closeAutoFocus: (e: Event) => e.preventDefault()
126
+ ...events
122
127
  }
123
128
  }
124
129
 
125
- return {
126
- closeAutoFocus: (e: Event) => e.preventDefault()
127
- }
130
+ return events
128
131
  })
129
132
 
130
133
  const b24ui = computed(() => modal({
@@ -175,7 +178,7 @@ const b24ui = computed(() => modal({
175
178
  </DialogDescription>
176
179
  </div>
177
180
 
178
- <DialogClose as-child>
181
+ <DialogClose v-if="close || !!slots.close" as-child>
179
182
  <slot name="close" :b24ui="b24ui">
180
183
  <B24Button
181
184
  v-if="close"
@@ -1,13 +1,13 @@
1
1
  <!-- eslint-disable vue/block-tag-newline -->
2
2
  <script lang="ts">
3
3
  import type { VariantProps } from 'tailwind-variants'
4
- import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, CollapsibleRootProps } from 'reka-ui'
4
+ import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, CollapsibleRootProps } from 'reka-ui'
5
5
  import type { AppConfig } from '@nuxt/schema'
6
6
  import _appConfig from '#build/app.config'
7
7
  import theme from '#build/b24ui/navigation-menu'
8
8
  import { tv } from '../utils/tv'
9
9
  import type { AvatarProps, BadgeProps, LinkProps, IconComponent } from '../types'
10
- import type { DynamicSlots, MaybeArrayOfArray, MaybeArrayOfArrayItem, PartialString } from '../types/utils'
10
+ import type { DynamicSlots, MaybeArrayOfArray, MaybeArrayOfArrayItem, PartialString, EmitsToProps } from '../types/utils'
11
11
 
12
12
  const appConfigNavigationMenu = _appConfig as AppConfig & { b24ui: { navigationMenu: Partial<typeof theme> } }
13
13
 
@@ -93,8 +93,10 @@ export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'm
93
93
  * @defaultValue 'primary'
94
94
  */
95
95
  highlightColor?: NavigationMenuVariants['highlightColor']
96
- /** The content of the menu. */
97
- content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'>
96
+ /**
97
+ * The content of the menu.
98
+ */
99
+ content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<NavigationMenuContentEmits>>
98
100
  /**
99
101
  * The orientation of the content.
100
102
  * Only works when `orientation` is `horizontal`.
@@ -193,42 +195,33 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]
193
195
  <template>
194
196
  <DefineLinkTemplate v-slot="{ item, active, index }">
195
197
  <slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
196
- <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="(item as T)" :active="active" :index="index">
197
- <Component
198
- :is="item.icon"
199
- v-if="item.icon"
200
- :class="b24ui.linkLeadingIcon({ class: props.b24ui?.linkLeadingIcon, active, disabled: !!item.disabled })"
201
- />
202
- <B24Avatar v-else-if="item.avatar" :size="((props.b24ui?.linkLeadingAvatarSize || b24ui.linkLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="b24ui.linkLeadingAvatar({ class: props.b24ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
203
- </slot>
204
-
205
- <span
206
- v-if="(!collapsed || orientation !== 'vertical') && (get(item, props.labelKey as string) || !!slots[item.slot ? `${item.slot}-label` : 'item-label'])"
207
- :class="b24ui.linkLabel({ class: props.b24ui?.linkLabel })"
208
- >
209
- <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="(item as T)" :active="active" :index="index">
210
- {{ get(item, props.labelKey as string) }}
198
+ <span :class="b24ui.linkLabelWrapper({ class: props.b24ui?.linkLabelWrapper, active })">
199
+ <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="(item as T)" :active="active" :index="index">
200
+ <Component
201
+ :is="item.icon"
202
+ v-if="item.icon"
203
+ :class="b24ui.linkLeadingIcon({ class: props.b24ui?.linkLeadingIcon, active, disabled: !!item.disabled })"
204
+ />
205
+ <B24Avatar v-else-if="item.avatar" :size="((props.b24ui?.linkLeadingAvatarSize || b24ui.linkLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="b24ui.linkLeadingAvatar({ class: props.b24ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
211
206
  </slot>
212
207
 
213
- <Component
214
- :is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
215
- v-if="item.target === '_blank' && externalIcon !== false"
216
- :class="b24ui.linkLabelExternalIcon({ class: props.b24ui?.linkLabelExternalIcon, active })"
217
- />
218
- </span>
208
+ <span
209
+ v-if="(!collapsed || orientation !== 'vertical') && (get(item, props.labelKey as string) || !!slots[item.slot ? `${item.slot}-label` : 'item-label'])"
210
+ :class="b24ui.linkLabel({ class: props.b24ui?.linkLabel, active })"
211
+ >
212
+ <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="(item as T)" :active="active" :index="index">
213
+ {{ get(item, props.labelKey as string) }}
214
+ </slot>
219
215
 
216
+ <Component
217
+ :is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
218
+ v-if="item.target === '_blank' && externalIcon !== false"
219
+ :class="b24ui.linkLabelExternalIcon({ class: props.b24ui?.linkLabelExternalIcon, active })"
220
+ />
221
+ </span>
222
+ </span>
220
223
  <span v-if="(!collapsed || orientation !== 'vertical') && (item.badge || (orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])) || (orientation === 'vertical' && item.children?.length) || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing'])" :class="b24ui.linkTrailing({ class: props.b24ui?.linkTrailing })">
221
224
  <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="(item as T)" :active="active" :index="index">
222
- <B24Badge
223
- v-if="item.badge"
224
- color="default"
225
- depth="normal"
226
- :use-fill="false"
227
- :size="((props.b24ui?.linkTrailingBadgeSize || b24ui.linkTrailingBadgeSize()) as BadgeProps['size'])"
228
- v-bind="(typeof item.badge === 'string' || typeof item.badge === 'number') ? { label: item.badge } : item.badge"
229
- :class="b24ui.linkTrailingBadge({ class: props.b24ui?.linkTrailingBadge })"
230
- />
231
-
232
225
  <Component
233
226
  :is="item.trailingIcon || trailingIcon || icons.chevronDown"
234
227
  v-if="(orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])) || (orientation === 'vertical' && item.children?.length)"
@@ -239,6 +232,16 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]
239
232
  v-else-if="item.trailingIcon"
240
233
  :class="b24ui.linkTrailingIcon({ class: props.b24ui?.linkTrailingIcon, active })"
241
234
  />
235
+
236
+ <B24Badge
237
+ v-if="item.badge"
238
+ color="danger"
239
+ depth="dark"
240
+ :use-fill="true"
241
+ :size="((props.b24ui?.linkTrailingBadgeSize || b24ui.linkTrailingBadgeSize()) as BadgeProps['size'])"
242
+ v-bind="(typeof item.badge === 'string' || typeof item.badge === 'number') ? { label: item.badge } : item.badge"
243
+ :class="b24ui.linkTrailingBadge({ class: props.b24ui?.linkTrailingBadge })"
244
+ />
242
245
  </slot>
243
246
  </span>
244
247
  </slot>
@@ -320,7 +323,12 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]
320
323
  </component>
321
324
  </DefineItemTemplate>
322
325
 
323
- <NavigationMenuRoot v-bind="rootProps" :data-collapsed="collapsed" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
326
+ <NavigationMenuRoot
327
+ v-bind="rootProps"
328
+ :data-collapsed="collapsed"
329
+ :class="b24ui.root({ class: [props.class, props.b24ui?.root] })"
330
+ data-slot="section"
331
+ >
324
332
  <template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
325
333
  <NavigationMenuList :class="b24ui.list({ class: props.b24ui?.list })">
326
334
  <ReuseItemTemplate v-for="(item, index) in list" :key="`list-${listIndex}-${index}`" :item="item" :index="index" :class="b24ui.item({ class: props.b24ui?.item })" />
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
- import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverArrowProps } from 'reka-ui'
2
+ import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps } from 'reka-ui'
3
3
  import type { AppConfig } from '@nuxt/schema'
4
4
  import _appConfig from '#build/app.config'
5
5
  import theme from '#build/b24ui/popover'
6
6
  import { tv } from '../utils/tv'
7
+ import type { EmitsToProps } from '../types/utils'
7
8
 
8
9
  const appConfigPopover = _appConfig as AppConfig & { b24ui: { popover: Partial<typeof theme> } }
9
10
 
@@ -19,7 +20,7 @@ export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps,
19
20
  * The content of the popover.
20
21
  * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
21
22
  */
22
- content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'>
23
+ content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<PopoverContentEmits>>
23
24
  /**
24
25
  * Display an arrow alongside the popover.
25
26
  * @defaultValue false
@@ -161,8 +161,8 @@ function onUpdate(value: any) {
161
161
  <RadioGroupItem
162
162
  :id="item.id"
163
163
  :value="item.value"
164
- :disabled="disabled"
165
- :class="b24ui.base({ class: props.b24ui?.base })"
164
+ :disabled="item.disabled"
165
+ :class="b24ui.base({ class: props.b24ui?.base, disabled: item.disabled })"
166
166
  >
167
167
  <RadioGroupIndicator :class="b24ui.indicator({ class: props.b24ui?.indicator })" />
168
168
  </RadioGroupItem>
@@ -1,13 +1,13 @@
1
1
  <script lang="ts">
2
2
  import type { VariantProps } from 'tailwind-variants'
3
- import type { SelectRootProps, SelectRootEmits, SelectContentProps, SelectArrowProps, AcceptableValue } from 'reka-ui'
3
+ import type { SelectRootProps, SelectRootEmits, SelectContentProps, SelectContentEmits, SelectArrowProps, AcceptableValue } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/b24ui/select'
7
7
  import type { UseComponentIconsProps } from '../composables/useComponentIcons'
8
8
  import { tv } from '../utils/tv'
9
9
  import type { AvatarProps, ChipProps, InputProps, IconComponent } from '../types'
10
- import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey } from '../types/utils'
10
+ import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey, EmitsToProps } from '../types/utils'
11
11
 
12
12
  const appConfigSelect = _appConfig as AppConfig & { b24ui: { select: Partial<typeof theme> } }
13
13
 
@@ -87,7 +87,7 @@ export interface SelectProps<T extends MaybeArrayOfArrayItem<I>, I extends Maybe
87
87
  * The content of the menu.
88
88
  * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }
89
89
  */
90
- content?: Omit<SelectContentProps, 'as' | 'asChild' | 'forceMount'>
90
+ content?: Omit<SelectContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<SelectContentEmits>>
91
91
  /**
92
92
  * Display an arrow alongside the menu.
93
93
  * @defaultValue false
@@ -1,13 +1,13 @@
1
1
  <script lang="ts">
2
2
  import type { VariantProps } from 'tailwind-variants'
3
- import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxArrowProps, AcceptableValue } from 'reka-ui'
3
+ import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps, AcceptableValue } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/b24ui/select-menu'
7
7
  import type { UseComponentIconsProps } from '../composables/useComponentIcons'
8
8
  import { tv } from '../utils/tv'
9
9
  import type { AvatarProps, ChipProps, InputProps, IconComponent } from '../types'
10
- import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey } from '../types/utils'
10
+ import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey, EmitsToProps } from '../types/utils'
11
11
 
12
12
  const appConfigSelectMenu = _appConfig as AppConfig & { b24ui: { selectMenu: Partial<typeof theme> } }
13
13
 
@@ -98,7 +98,7 @@ export interface SelectMenuProps<T extends MaybeArrayOfArrayItem<I>, I extends M
98
98
  * The content of the menu.
99
99
  * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }
100
100
  */
101
- content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'>
101
+ content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ComboboxContentEmits>>
102
102
  /**
103
103
  * Display an arrow alongside the menu.
104
104
  * @defaultValue false
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
2
  import type { VariantProps } from 'tailwind-variants'
3
- import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'reka-ui'
3
+ import type { DialogRootProps, DialogRootEmits, DialogContentProps, DialogContentEmits } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/b24ui/slideover'
7
7
  import { tv } from '../utils/tv'
8
8
  import type { ButtonProps, IconComponent } from '../types'
9
+ import type { EmitsToProps } from '../types/utils'
9
10
 
10
11
  const appConfigSlideover = _appConfig as AppConfig & { b24ui: { slideover: Partial<typeof theme> } }
11
12
 
@@ -19,7 +20,7 @@ export interface SlideoverProps extends DialogRootProps {
19
20
  /**
20
21
  * The content of the slideover
21
22
  */
22
- content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
23
+ content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>
23
24
  /**
24
25
  * Render an overlay behind the slideover.
25
26
  * @defaultValue true
@@ -115,18 +116,20 @@ const { t } = useLocale()
115
116
  const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
116
117
  const contentProps = toRef(() => props.content)
117
118
  const contentEvents = computed(() => {
119
+ const events = {
120
+ closeAutoFocus: (e: Event) => e.preventDefault()
121
+ }
122
+
118
123
  if (!props.dismissible) {
119
124
  return {
120
125
  pointerDownOutside: (e: Event) => e.preventDefault(),
121
126
  interactOutside: (e: Event) => e.preventDefault(),
122
127
  escapeKeyDown: (e: Event) => e.preventDefault(),
123
- closeAutoFocus: (e: Event) => e.preventDefault()
128
+ ...events
124
129
  }
125
130
  }
126
131
 
127
- return {
128
- closeAutoFocus: (e: Event) => e.preventDefault()
129
- }
132
+ return events
130
133
  })
131
134
 
132
135
  const b24ui = computed(() => slideover({
@@ -177,7 +180,7 @@ const b24ui = computed(() => slideover({
177
180
  </DialogDescription>
178
181
  </div>
179
182
 
180
- <DialogClose as-child>
183
+ <DialogClose v-if="close || !!slots.close" as-child>
181
184
  <slot name="close" :b24ui="b24ui">
182
185
  <B24Button
183
186
  v-if="close"
@@ -170,7 +170,7 @@ defineExpose({
170
170
  </slot>
171
171
  </template>
172
172
 
173
- <ToastClose as-child>
173
+ <ToastClose v-if="close || !!slots.close" as-child>
174
174
  <slot name="close" :b24ui="b24ui">
175
175
  <B24Button
176
176
  v-if="close"
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
- import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipArrowProps } from 'reka-ui'
2
+ import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps } from 'reka-ui'
3
3
  import type { AppConfig } from '@nuxt/schema'
4
4
  import _appConfig from '#build/app.config'
5
5
  import theme from '#build/b24ui/tooltip'
6
6
  import { tv } from '../utils/tv'
7
7
  import type { KbdProps } from '../types'
8
+ import type { EmitsToProps } from '../types/utils'
8
9
 
9
10
  const appConfigTooltip = _appConfig as AppConfig & { b24ui: { tooltip: Partial<typeof theme> } }
10
11
 
@@ -19,7 +20,7 @@ export interface TooltipProps extends TooltipRootProps {
19
20
  * The content of the tooltip.
20
21
  * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
21
22
  */
22
- content?: Omit<TooltipContentProps, 'as' | 'asChild'>
23
+ content?: Omit<TooltipContentProps, 'as' | 'asChild'> & Partial<EmitsToProps<TooltipContentEmits>>
23
24
  /**
24
25
  * Display an arrow alongside the tooltip.
25
26
  * @defaultValue false
@@ -22,6 +22,6 @@ export interface UseComponentIconsProps {
22
22
  export declare function useComponentIcons(componentProps: MaybeRefOrGetter<UseComponentIconsProps>): {
23
23
  isLeading: import("vue").ComputedRef<any>;
24
24
  isTrailing: import("vue").ComputedRef<boolean>;
25
- leadingIconName: import("vue").ComputedRef<import("vue").FunctionalComponent<import("vue").HTMLAttributes & import("vue").VNodeProps, {}, any, {}> | undefined>;
26
- trailingIconName: import("vue").ComputedRef<import("vue").FunctionalComponent<import("vue").HTMLAttributes & import("vue").VNodeProps, {}, any, {}> | undefined>;
25
+ leadingIconName: import("vue").ComputedRef<IconComponent | undefined>;
26
+ trailingIconName: import("vue").ComputedRef<IconComponent | undefined>;
27
27
  };
@@ -1 +1 @@
1
- @plugin "@bitrix24/b24style";@import "#build/b24ui.css";@import "./keyframes.css";@variant light (&:where(.light, .light *));@variant dark (&:where(.dark, .dark *));@layer base{--b24ui-header-height:calc(var(--spacing)*16);body{@apply antialiased scheme-light dark:scheme-dark}}@layer theme{:host,:root{--spacing:.25rem}}.scrollbar-thin{scrollbar-width:thin}.scrollbar-transparent{scrollbar-color:hsla(0,0%,100%,.21) transparent}.scrollbar-transparent:hover{scrollbar-color:rgba(82,92,105,.36) transparent}.dark .scrollbar-transparent{scrollbar-color:rgba(0,0,0,.21) transparent}.dark .scrollbar-transparent:hover{scrollbar-color:#515a67 transparent}
1
+ @plugin "@bitrix24/b24style";@import "#build/b24ui.css";@import "./keyframes.css";@variant light (&:where(.light, .light *));@variant dark (&:where(.dark, .dark *));@layer base{--b24ui-header-height:calc(var(--spacing)*16);body{@apply antialiased scheme-light dark:scheme-dark}}@layer theme{:host,:root{--spacing:.25rem}}.scrollbar-thin{scrollbar-width:thin}.scrollbar-transparent{scrollbar-color:transparent transparent;scrollbar-gutter:stable}.scrollbar-transparent:hover{scrollbar-color:rgba(82,92,105,.36) transparent}.dark .scrollbar-transparent{scrollbar-color:rgba(0,0,0,.21) transparent}.dark .scrollbar-transparent:hover{scrollbar-color:#515a67 transparent}
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @see src/templates.ts -> getTemplates
3
+ */
1
4
  declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
5
  export default _default;
@@ -1,9 +1,7 @@
1
1
  import type { StandardSchemaV1 } from '@standard-schema/spec';
2
2
  import type { ComputedRef, DeepReadonly, Ref } from 'vue';
3
- import type { ZodSchema } from 'zod';
4
3
  import type { Schema as JoiSchema } from 'joi';
5
4
  import type { ObjectSchema as YupObjectSchema } from 'yup';
6
- import type { GenericSchema as ValibotSchema, GenericSchemaAsync as ValibotSchemaAsync, SafeParser as ValibotSafeParser, SafeParserAsync as ValibotSafeParserAsync } from 'valibot';
7
5
  import type { GetObjectField } from './utils';
8
6
  import type { Struct as SuperstructSchema } from 'superstruct';
9
7
  export interface Form<T extends object> {
@@ -24,7 +22,7 @@ export interface Form<T extends object> {
24
22
  touchedFields: DeepReadonly<Set<keyof T>>;
25
23
  blurredFields: DeepReadonly<Set<keyof T>>;
26
24
  }
27
- export type FormSchema<T extends object> = ZodSchema | YupObjectSchema<T> | ValibotSchema | ValibotSchemaAsync | ValibotSafeParser<any, any> | ValibotSafeParserAsync<any, any> | JoiSchema<T> | SuperstructSchema<any, any> | StandardSchemaV1;
25
+ export type FormSchema<T extends object> = YupObjectSchema<T> | JoiSchema<T> | SuperstructSchema<any, any> | StandardSchemaV1;
28
26
  export type FormInputEvents = 'input' | 'blur' | 'change' | 'focus';
29
27
  export interface FormError<P extends string = string> {
30
28
  name?: P;
@@ -1,17 +1,13 @@
1
1
  import type { StandardSchemaV1 } from '@standard-schema/spec';
2
- import type { ZodSchema } from 'zod';
3
2
  import type { ValidationError as JoiError, Schema as JoiSchema } from 'joi';
4
3
  import type { ObjectSchema as YupObjectSchema, ValidationError as YupError } from 'yup';
5
- import type { GenericSchema as ValibotSchema, GenericSchemaAsync as ValibotSchemaAsync, SafeParser as ValibotSafeParser, SafeParserAsync as ValibotSafeParserAsync } from 'valibot';
6
4
  import type { Struct } from 'superstruct';
7
5
  import type { FormSchema, ValidateReturnSchema } from '../types/form';
8
6
  export declare function isYupSchema(schema: any): schema is YupObjectSchema<any>;
9
7
  export declare function isYupError(error: any): error is YupError;
10
8
  export declare function isSuperStructSchema(schema: any): schema is Struct<any, any>;
11
- export declare function isZodSchema(schema: any): schema is ZodSchema;
12
9
  export declare function isJoiSchema(schema: any): schema is JoiSchema;
13
10
  export declare function isJoiError(error: any): error is JoiError;
14
- export declare function isValibotSchema(schema: any): schema is ValibotSchema | ValibotSchemaAsync | ValibotSafeParser<any, any> | ValibotSafeParserAsync<any, any>;
15
11
  export declare function isStandardSchema(schema: any): schema is StandardSchemaV1;
16
12
  export declare function validateStandardSchema(state: any, schema: StandardSchemaV1): Promise<ValidateReturnSchema<typeof state>>;
17
13
  export declare function validateSchema<T extends object>(state: T, schema: FormSchema<T>): Promise<ValidateReturnSchema<typeof state>>;