@bitrix24/b24ui-nuxt 0.6.8 → 0.7.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 (201) hide show
  1. package/.nuxt/b24ui/accordion.ts +20 -0
  2. package/.nuxt/b24ui/advice.ts +2 -10
  3. package/.nuxt/b24ui/alert.ts +2 -15
  4. package/.nuxt/b24ui/avatar-group.ts +2 -10
  5. package/.nuxt/b24ui/avatar.ts +3 -11
  6. package/.nuxt/b24ui/badge.ts +48 -13
  7. package/.nuxt/b24ui/button-group.ts +2 -22
  8. package/.nuxt/b24ui/button.ts +4 -17
  9. package/.nuxt/b24ui/calendar.ts +3 -11
  10. package/.nuxt/b24ui/checkbox.ts +75 -11
  11. package/.nuxt/b24ui/chip.ts +2 -10
  12. package/.nuxt/b24ui/collapsible.ts +2 -10
  13. package/.nuxt/b24ui/container.ts +2 -10
  14. package/.nuxt/b24ui/countdown.ts +2 -10
  15. package/.nuxt/b24ui/description-list.ts +2 -15
  16. package/.nuxt/b24ui/dropdown-menu.ts +4 -11
  17. package/.nuxt/b24ui/form-field.ts +3 -10
  18. package/.nuxt/b24ui/form.ts +2 -10
  19. package/.nuxt/b24ui/index.ts +1 -0
  20. package/.nuxt/b24ui/input-menu.ts +6 -30
  21. package/.nuxt/b24ui/input-number.ts +15 -10
  22. package/.nuxt/b24ui/input.ts +4 -17
  23. package/.nuxt/b24ui/kbd.ts +2 -10
  24. package/.nuxt/b24ui/link.ts +11 -17
  25. package/.nuxt/b24ui/modal.ts +3 -11
  26. package/.nuxt/b24ui/navbar-divider.ts +2 -10
  27. package/.nuxt/b24ui/navbar-section.ts +2 -10
  28. package/.nuxt/b24ui/navbar-spacer.ts +2 -10
  29. package/.nuxt/b24ui/navbar.ts +2 -10
  30. package/.nuxt/b24ui/navigation-menu.ts +69 -60
  31. package/.nuxt/b24ui/popover.ts +2 -10
  32. package/.nuxt/b24ui/progress.ts +2 -10
  33. package/.nuxt/b24ui/radio-group.ts +3 -11
  34. package/.nuxt/b24ui/range.ts +2 -10
  35. package/.nuxt/b24ui/select-menu.ts +10 -40
  36. package/.nuxt/b24ui/select.ts +10 -40
  37. package/.nuxt/b24ui/separator.ts +2 -10
  38. package/.nuxt/b24ui/sidebar-body.ts +2 -10
  39. package/.nuxt/b24ui/sidebar-footer.ts +2 -10
  40. package/.nuxt/b24ui/sidebar-header.ts +2 -10
  41. package/.nuxt/b24ui/sidebar-heading.ts +2 -10
  42. package/.nuxt/b24ui/sidebar-layout.ts +3 -11
  43. package/.nuxt/b24ui/sidebar-section.ts +2 -10
  44. package/.nuxt/b24ui/sidebar-spacer.ts +2 -10
  45. package/.nuxt/b24ui/sidebar.ts +2 -10
  46. package/.nuxt/b24ui/skeleton.ts +2 -10
  47. package/.nuxt/b24ui/slideover.ts +2 -10
  48. package/.nuxt/b24ui/stacked-layout.ts +2 -10
  49. package/.nuxt/b24ui/switch.ts +2 -10
  50. package/.nuxt/b24ui/tabs.ts +6 -13
  51. package/.nuxt/b24ui/textarea.ts +4 -17
  52. package/.nuxt/b24ui/toast.ts +2 -15
  53. package/.nuxt/b24ui/toaster.ts +3 -11
  54. package/.nuxt/b24ui/tooltip.ts +3 -11
  55. package/.nuxt/b24ui.css +1 -1
  56. package/cli/templates.mjs +2 -2
  57. package/dist/meta.d.mts +35333 -15836
  58. package/dist/meta.mjs +35333 -15836
  59. package/dist/module.json +1 -1
  60. package/dist/module.mjs +11 -3
  61. package/dist/runtime/air-design-tokens.css +1 -0
  62. package/dist/runtime/components/Accordion.vue +96 -0
  63. package/dist/runtime/components/Accordion.vue.d.ts +78 -0
  64. package/dist/runtime/components/Advice.vue +1 -1
  65. package/dist/runtime/components/Alert.vue +1 -1
  66. package/dist/runtime/components/App.vue +1 -1
  67. package/dist/runtime/components/Avatar.vue +11 -3
  68. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  69. package/dist/runtime/components/AvatarGroup.vue +1 -1
  70. package/dist/runtime/components/Badge.vue +5 -3
  71. package/dist/runtime/components/Badge.vue.d.ts +2 -0
  72. package/dist/runtime/components/Button.vue +2 -3
  73. package/dist/runtime/components/Button.vue.d.ts +1 -1
  74. package/dist/runtime/components/Calendar.vue +1 -1
  75. package/dist/runtime/components/Checkbox.vue +13 -4
  76. package/dist/runtime/components/Checkbox.vue.d.ts +9 -0
  77. package/dist/runtime/components/Chip.vue +1 -1
  78. package/dist/runtime/components/Collapsible.vue +1 -1
  79. package/dist/runtime/components/Countdown.vue +1 -1
  80. package/dist/runtime/components/Countdown.vue.d.ts +2 -2
  81. package/dist/runtime/components/DescriptionList.vue +3 -2
  82. package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
  83. package/dist/runtime/components/DropdownMenu.vue +1 -1
  84. package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
  85. package/dist/runtime/components/DropdownMenuContent.vue +74 -72
  86. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +4 -20
  87. package/dist/runtime/components/Form.vue +6 -6
  88. package/dist/runtime/components/Form.vue.d.ts +12 -11
  89. package/dist/runtime/components/FormField.vue +4 -4
  90. package/dist/runtime/components/Input.vue +12 -8
  91. package/dist/runtime/components/Input.vue.d.ts +31 -30
  92. package/dist/runtime/components/InputMenu.vue +23 -20
  93. package/dist/runtime/components/InputMenu.vue.d.ts +6 -4
  94. package/dist/runtime/components/InputNumber.vue +17 -10
  95. package/dist/runtime/components/InputNumber.vue.d.ts +6 -3
  96. package/dist/runtime/components/Link.vue +5 -13
  97. package/dist/runtime/components/Modal.vue +22 -14
  98. package/dist/runtime/components/Modal.vue.d.ts +18 -5
  99. package/dist/runtime/components/Navbar.vue +1 -1
  100. package/dist/runtime/components/NavbarDivider.vue +1 -1
  101. package/dist/runtime/components/NavbarSection.vue +1 -1
  102. package/dist/runtime/components/NavbarSpacer.vue +1 -1
  103. package/dist/runtime/components/NavigationMenu.vue +186 -44
  104. package/dist/runtime/components/NavigationMenu.vue.d.ts +39 -8
  105. package/dist/runtime/components/OverlayProvider.vue +2 -2
  106. package/dist/runtime/components/Popover.vue +4 -0
  107. package/dist/runtime/components/Popover.vue.d.ts +2 -1
  108. package/dist/runtime/components/Progress.vue +3 -2
  109. package/dist/runtime/components/Progress.vue.d.ts +2 -2
  110. package/dist/runtime/components/RadioGroup.vue +24 -8
  111. package/dist/runtime/components/RadioGroup.vue.d.ts +3 -1
  112. package/dist/runtime/components/Range.vue +2 -2
  113. package/dist/runtime/components/Range.vue.d.ts +19 -20
  114. package/dist/runtime/components/Select.vue +57 -31
  115. package/dist/runtime/components/Select.vue.d.ts +110 -2
  116. package/dist/runtime/components/SelectMenu.vue +77 -23
  117. package/dist/runtime/components/SelectMenu.vue.d.ts +111 -5
  118. package/dist/runtime/components/Separator.vue +3 -3
  119. package/dist/runtime/components/Sidebar.vue +1 -1
  120. package/dist/runtime/components/SidebarBody.vue +1 -1
  121. package/dist/runtime/components/SidebarFooter.vue +1 -1
  122. package/dist/runtime/components/SidebarHeader.vue +1 -1
  123. package/dist/runtime/components/SidebarHeading.vue +1 -1
  124. package/dist/runtime/components/SidebarLayout.vue +1 -1
  125. package/dist/runtime/components/SidebarSection.vue +1 -1
  126. package/dist/runtime/components/SidebarSpacer.vue +1 -1
  127. package/dist/runtime/components/Slideover.vue +23 -15
  128. package/dist/runtime/components/Slideover.vue.d.ts +18 -5
  129. package/dist/runtime/components/StackedLayout.vue +1 -1
  130. package/dist/runtime/components/Switch.vue +1 -1
  131. package/dist/runtime/components/Tabs.vue +28 -7
  132. package/dist/runtime/components/Tabs.vue.d.ts +6 -1
  133. package/dist/runtime/components/Textarea.vue +13 -9
  134. package/dist/runtime/components/Textarea.vue.d.ts +31 -30
  135. package/dist/runtime/components/Toast.vue +7 -6
  136. package/dist/runtime/components/Toast.vue.d.ts +6 -0
  137. package/dist/runtime/components/Toaster.vue +4 -4
  138. package/dist/runtime/components/Toaster.vue.d.ts +6 -0
  139. package/dist/runtime/components/Tooltip.vue +9 -2
  140. package/dist/runtime/components/Tooltip.vue.d.ts +2 -1
  141. package/dist/runtime/components/content/TableWrapper.vue +1 -1
  142. package/dist/runtime/composables/defineLocale.d.ts +2 -0
  143. package/dist/runtime/composables/defineLocale.js +4 -0
  144. package/dist/runtime/composables/defineShortcuts.js +8 -2
  145. package/dist/runtime/composables/useFormField.d.ts +1 -1
  146. package/dist/runtime/composables/useFormField.js +2 -1
  147. package/dist/runtime/composables/useKbd.d.ts +1 -0
  148. package/dist/runtime/composables/useKbd.js +4 -3
  149. package/dist/runtime/composables/useOverlay.d.ts +11 -11
  150. package/dist/runtime/composables/useOverlay.js +17 -11
  151. package/dist/runtime/index.css +1 -1
  152. package/dist/runtime/inertia/components/Link.vue +45 -60
  153. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  154. package/dist/runtime/inertia/components/LinkBase.vue +68 -0
  155. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
  156. package/dist/runtime/inertia/stubs.d.ts +1 -1
  157. package/dist/runtime/inertia/stubs.js +1 -1
  158. package/dist/runtime/prose/A.vue +1 -1
  159. package/dist/runtime/prose/Blockquote.vue +1 -1
  160. package/dist/runtime/prose/Code.vue +1 -1
  161. package/dist/runtime/prose/Em.vue +1 -1
  162. package/dist/runtime/prose/H1.vue +1 -1
  163. package/dist/runtime/prose/H2.vue +1 -1
  164. package/dist/runtime/prose/H3.vue +1 -1
  165. package/dist/runtime/prose/H4.vue +1 -1
  166. package/dist/runtime/prose/H5.vue +1 -1
  167. package/dist/runtime/prose/H6.vue +1 -1
  168. package/dist/runtime/prose/Hr.vue +1 -1
  169. package/dist/runtime/prose/Img.vue +1 -1
  170. package/dist/runtime/prose/Li.vue +1 -1
  171. package/dist/runtime/prose/Ol.vue +1 -1
  172. package/dist/runtime/prose/P.vue +1 -1
  173. package/dist/runtime/prose/Pre.vue +1 -1
  174. package/dist/runtime/prose/Strong.vue +1 -1
  175. package/dist/runtime/prose/Table.vue +1 -1
  176. package/dist/runtime/prose/Tbody.vue +1 -1
  177. package/dist/runtime/prose/Td.vue +1 -1
  178. package/dist/runtime/prose/Th.vue +1 -1
  179. package/dist/runtime/prose/Thead.vue +1 -1
  180. package/dist/runtime/prose/Tr.vue +1 -1
  181. package/dist/runtime/prose/Ul.vue +1 -1
  182. package/dist/runtime/types/form.d.ts +11 -10
  183. package/dist/runtime/types/index.d.ts +1 -0
  184. package/dist/runtime/types/index.js +1 -0
  185. package/dist/runtime/types/locale.d.ts +1 -0
  186. package/dist/runtime/types/tv.d.ts +53 -0
  187. package/dist/runtime/types/tv.js +0 -0
  188. package/dist/runtime/types/utils.d.ts +4 -51
  189. package/dist/runtime/types/utils.js +1 -0
  190. package/dist/runtime/utils/link.d.ts +1 -0
  191. package/dist/runtime/utils/link.js +12 -0
  192. package/dist/runtime/vue/components/Link.vue +26 -40
  193. package/dist/runtime/vue/composables/useAppConfig.js +3 -1
  194. package/dist/runtime/vue/stubs.d.ts +1 -1
  195. package/dist/runtime/vue/stubs.js +1 -1
  196. package/dist/shared/{b24ui-nuxt.jU270f-Q.mjs → b24ui-nuxt.CxsFEY3M.mjs} +268 -122
  197. package/dist/unplugin.d.mts +2 -2
  198. package/dist/unplugin.mjs +6 -3
  199. package/dist/vite.d.mts +1 -1
  200. package/dist/vite.mjs +2 -2
  201. package/package.json +30 -29
@@ -133,14 +133,13 @@ const b24ui = computed(() => tv({
133
133
  v-slot="{ active, ...slotProps }"
134
134
  :type="type"
135
135
  :disabled="disabled || isLoading"
136
- :class="b24ui.base({ class: [props.class, props.b24ui?.base] })"
137
136
  v-bind="proxyLinkProps"
138
137
  custom
139
138
  >
140
139
  <B24LinkBase
141
140
  v-bind="slotProps"
142
141
  :class="b24ui.base({
143
- class: [props.class, props.b24ui?.base],
142
+ class: [props.b24ui?.base, props.class],
144
143
  active,
145
144
  ...active && activeDepth ? { depth: activeDepth } : {},
146
145
  ...active && activeColor ? { color: activeColor } : {}
@@ -176,7 +175,7 @@ const b24ui = computed(() => tv({
176
175
  </slot>
177
176
 
178
177
  <slot>
179
- <span v-if="label" :class="b24ui.label({ class: props.b24ui?.label, active })">
178
+ <span v-if="label !== void 0 && label !== null" :class="b24ui.label({ class: props.b24ui?.label, active })">
180
179
  {{ label }}
181
180
  </span>
182
181
  </slot>
@@ -1,7 +1,7 @@
1
1
  import type { AppConfig } from '@nuxt/schema';
2
2
  import theme from '#build/b24ui/button';
3
- import type { LinkProps } from './Link.vue';
4
3
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
4
+ import type { LinkProps } from '../types';
5
5
  import type { ComponentConfig } from '../types/utils';
6
6
  type Button = ComponentConfig<typeof theme, AppConfig, 'button'>;
7
7
  export interface ButtonProps extends Omit<UseComponentIconsProps, 'trailing' | 'trailingIcon'>, Omit<LinkProps, 'raw' | 'custom'> {
@@ -93,7 +93,7 @@ const btnSize = computed(() => {
93
93
  :default-value="defaultValue"
94
94
  :locale="locale"
95
95
  :dir="dir"
96
- :class="b24ui.root({ class: [props.class, props.b24ui?.root] })"
96
+ :class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
97
97
  >
98
98
  <Calendar.Header :class="b24ui.header({ class: props.b24ui?.header })">
99
99
  <Calendar.Prev v-if="props.yearControls" :prev-page="(date) => paginateYear(date, -1)" :aria-label="t('calendar.prevYear')" as-child>
@@ -17,7 +17,9 @@ const props = defineProps({
17
17
  label: { type: String, required: false },
18
18
  description: { type: String, required: false },
19
19
  color: { type: null, required: false },
20
+ variant: { type: null, required: false },
20
21
  size: { type: null, required: false },
22
+ indicator: { type: null, required: false },
21
23
  class: { type: null, required: false },
22
24
  b24ui: { type: null, required: false },
23
25
  disabled: { type: Boolean, required: false },
@@ -37,6 +39,8 @@ const id = _id.value ?? useId();
37
39
  const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.checkbox || {} })({
38
40
  size: size.value,
39
41
  color: color.value,
42
+ variant: props.variant,
43
+ indicator: props.indicator,
40
44
  required: props.required,
41
45
  disabled: disabled.value,
42
46
  checked: Boolean(modelValue.value ?? props.defaultValue)
@@ -50,7 +54,7 @@ function onUpdate(value) {
50
54
  </script>
51
55
 
52
56
  <template>
53
- <Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
57
+ <Primitive :as="!variant || variant === 'list' ? as : Label" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
54
58
  <div :class="b24ui.container({ class: props.b24ui?.container })">
55
59
  <CheckboxRoot
56
60
  :id="id"
@@ -62,7 +66,7 @@ function onUpdate(value) {
62
66
  @update:model-value="onUpdate"
63
67
  >
64
68
  <template #default="{ modelValue }">
65
- <CheckboxIndicator as-child>
69
+ <CheckboxIndicator :class="b24ui.indicator({ class: props.b24ui?.indicator })">
66
70
  <Minus20Icon v-if="modelValue === 'indeterminate'" :class="b24ui.icon({ class: props.b24ui?.icon })" />
67
71
  <CheckIcon v-else :class="b24ui.icon({ class: props.b24ui?.icon })" />
68
72
  </CheckboxIndicator>
@@ -71,11 +75,16 @@ function onUpdate(value) {
71
75
  </div>
72
76
 
73
77
  <div v-if="label || !!slots.label || (description || !!slots.description)" :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
74
- <Label v-if="label || !!slots.label" :for="id" :class="b24ui.label({ class: props.b24ui?.label })">
78
+ <component
79
+ :is="!variant || variant === 'list' ? Label : 'p'"
80
+ v-if="label || !!slots.label"
81
+ :for="id"
82
+ :class="b24ui.label({ class: props.b24ui?.label })"
83
+ >
75
84
  <slot name="label" :label="label">
76
85
  {{ label }}
77
86
  </slot>
78
- </Label>
87
+ </component>
79
88
  <p v-if="description || !!slots.description" :class="b24ui.description({ class: props.b24ui?.description })">
80
89
  <slot name="description" :description="description">
81
90
  {{ description }}
@@ -15,10 +15,19 @@ export interface CheckboxProps extends Pick<CheckboxRootProps, 'disabled' | 'req
15
15
  * @defaultValue 'primary'
16
16
  */
17
17
  color?: Checkbox['variants']['color'];
18
+ /**
19
+ * @defaultValue 'list'
20
+ */
21
+ variant?: Checkbox['variants']['variant'];
18
22
  /**
19
23
  * @defaultValue 'md'
20
24
  */
21
25
  size?: Checkbox['variants']['size'];
26
+ /**
27
+ * Position of the indicator.
28
+ * @defaultValue 'start'
29
+ */
30
+ indicator?: Checkbox['variants']['indicator'];
22
31
  class?: any;
23
32
  b24ui?: Checkbox['slots'];
24
33
  }
@@ -34,7 +34,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.chip ||
34
34
  </script>
35
35
 
36
36
  <template>
37
- <Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
37
+ <Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
38
38
  <Slot v-bind="$attrs">
39
39
  <slot />
40
40
  </Slot>
@@ -25,7 +25,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.collaps
25
25
  </script>
26
26
 
27
27
  <template>
28
- <CollapsibleRoot v-slot="{ open }" v-bind="rootProps" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
28
+ <CollapsibleRoot v-slot="{ open }" v-bind="rootProps" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
29
29
  <CollapsibleTrigger v-if="!!slots.default" as-child>
30
30
  <slot :open="open" />
31
31
  </CollapsibleTrigger>
@@ -238,7 +238,7 @@ defineExpose({
238
238
  <Primitive
239
239
  :as="as"
240
240
  v-bind="$attrs"
241
- :class="b24ui.base({ class: [props.class, props.b24ui?.base] })"
241
+ :class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
242
242
  >
243
243
  <svg
244
244
  v-if="props.useCircle"
@@ -79,15 +79,15 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CountdownP
79
79
  stop: () => void;
80
80
  restart: () => void;
81
81
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
82
+ end: () => any;
82
83
  abort: () => any;
83
84
  progress: (payload: CountdownData) => any;
84
85
  start: () => any;
85
- end: () => any;
86
86
  }, string, import("vue").PublicProps, Readonly<CountdownProps> & Readonly<{
87
+ onEnd?: (() => any) | undefined;
87
88
  onAbort?: (() => any) | undefined;
88
89
  onProgress?: ((payload: CountdownData) => any) | undefined;
89
90
  onStart?: (() => any) | undefined;
90
- onEnd?: (() => any) | undefined;
91
91
  }>, {
92
92
  as: any;
93
93
  emitEvents: boolean;
@@ -51,7 +51,7 @@ const normalizedItems = computed(() => {
51
51
  </script>
52
52
 
53
53
  <template>
54
- <div :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
54
+ <div :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
55
55
  <h2 v-if="legend || !!slots.legend" :class="b24ui.legend({ class: props.b24ui?.legend })">
56
56
  <slot name="legend">
57
57
  {{ legend }}
@@ -129,7 +129,8 @@ const normalizedItems = computed(() => {
129
129
  :class="b24ui.descriptionWrapper({
130
130
  class: [
131
131
  props.b24ui?.descriptionWrapper,
132
- item?.b24ui?.descriptionWrapper
132
+ item?.b24ui?.descriptionWrapper,
133
+ item?.b24ui?.class
133
134
  ],
134
135
  orientation: item.orientation
135
136
  })"
@@ -26,7 +26,7 @@ export interface DescriptionListItem {
26
26
  */
27
27
  actions?: ButtonProps[];
28
28
  class?: any;
29
- b24ui?: DescriptionList['slots'];
29
+ b24ui?: Pick<DescriptionList['slots'], 'labelWrapper' | 'icon' | 'avatar' | 'label' | 'descriptionWrapper' | 'description' | 'actions'>;
30
30
  [key: string]: any;
31
31
  }
32
32
  export interface DescriptionListProps<T extends DescriptionListItem = DescriptionListItem> {
@@ -46,7 +46,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.dropdow
46
46
  </DropdownMenuTrigger>
47
47
 
48
48
  <B24DropdownMenuContent
49
- :class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })"
49
+ :class="b24ui.content({ class: [!slots.default && props.b24ui?.content, props.class] })"
50
50
  :b24ui="b24ui"
51
51
  :b24ui-override="props.b24ui"
52
52
  v-bind="contentProps"
@@ -29,6 +29,8 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cust
29
29
  children?: ArrayOrNested<DropdownMenuItem>;
30
30
  onSelect?(e: Event): void;
31
31
  onUpdateChecked?(checked: boolean): void;
32
+ class?: any;
33
+ b24ui?: Pick<DropdownMenu['slots'], 'item' | 'label' | 'separator' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLabel' | 'itemLabelExternalIcon' | 'itemTrailing' | 'itemTrailingIcon' | 'itemTrailingKbds' | 'itemTrailingKbdsSize'>;
32
34
  [key: string]: any;
33
35
  }
34
36
  export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
@@ -67,48 +67,48 @@ const groups = computed(
67
67
  <Component
68
68
  :is="icons.loading"
69
69
  v-if="item.loading"
70
- :class="b24ui.itemLeadingIcon({ class: b24uiOverride?.itemLeadingIcon, color: item?.color, loading: true })"
70
+ :class="b24ui.itemLeadingIcon({ class: [b24uiOverride?.itemLeadingIcon, item.b24ui?.itemLeadingIcon], color: item?.color, loading: true })"
71
71
  />
72
72
  <Component
73
73
  :is="item.icon"
74
74
  v-else-if="item.icon"
75
- :class="b24ui.itemLeadingIcon({ class: b24uiOverride?.itemLeadingIcon, color: item?.color, active })"
75
+ :class="b24ui.itemLeadingIcon({ class: [b24uiOverride?.itemLeadingIcon, item.b24ui?.itemLeadingIcon], color: item?.color, active })"
76
76
  />
77
77
  <B24Avatar
78
78
  v-else-if="item.avatar"
79
- :size="props.b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
79
+ :size="item.b24ui?.itemLeadingAvatarSize || props.b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
80
80
  v-bind="item.avatar"
81
- :class="b24ui.itemLeadingAvatar({ class: b24uiOverride?.itemLeadingAvatar, active })"
81
+ :class="b24ui.itemLeadingAvatar({ class: [b24uiOverride?.itemLeadingAvatar, item.b24ui?.itemLeadingAvatar], active })"
82
82
  />
83
83
  </slot>
84
84
 
85
- <span v-if="getLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="b24ui.itemLabel({ class: b24uiOverride?.itemLabel, active })">
85
+ <span v-if="getLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="b24ui.itemLabel({ class: [b24uiOverride?.itemLabel, item.b24ui?.itemLabel], active })">
86
86
  <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
87
87
  {{ getLabel(item) }}
88
88
  </slot>
89
89
  <Component
90
90
  :is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
91
91
  v-if="item.target === '_blank' && externalIcon !== false"
92
- :class="b24ui.itemLabelExternalIcon({ class: b24uiOverride?.itemLabelExternalIcon, color: item?.color, active })"
92
+ :class="b24ui.itemLabelExternalIcon({ class: [b24uiOverride?.itemLabelExternalIcon, item.b24ui?.itemLabelExternalIcon], color: item?.color, active })"
93
93
  />
94
94
  </span>
95
95
 
96
- <span :class="b24ui.itemTrailing({ class: b24uiOverride?.itemTrailing })">
96
+ <span :class="b24ui.itemTrailing({ class: [b24uiOverride?.itemTrailing, item.b24ui?.itemTrailing] })">
97
97
  <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
98
98
  <Component
99
99
  :is="childrenIcon"
100
100
  v-if="item.children?.length"
101
- :class="b24ui.itemTrailingIcon({ class: b24uiOverride?.itemTrailingIcon, color: item?.color, active })"
101
+ :class="b24ui.itemTrailingIcon({ class: [b24uiOverride?.itemTrailingIcon, item.b24ui?.itemTrailingIcon], color: item?.color, active })"
102
102
  />
103
- <span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: b24uiOverride?.itemTrailingKbds })">
104
- <B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.b24uiOverride?.itemTrailingKbdsSize || b24ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
103
+ <span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: [b24uiOverride?.itemTrailingKbds, item.b24ui?.itemTrailingKbds] })">
104
+ <B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.b24ui?.itemTrailingKbdsSize || props.b24uiOverride?.itemTrailingKbdsSize || b24ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
105
105
  </span>
106
106
  </slot>
107
107
 
108
108
  <DropdownMenu.ItemIndicator as-child>
109
109
  <Component
110
110
  :is="checkedIcon || icons.check"
111
- :class="b24ui.itemTrailingIcon({ class: b24uiOverride?.itemTrailingIcon, color: item?.color })"
111
+ :class="b24ui.itemTrailingIcon({ class: [b24uiOverride?.itemTrailingIcon, item.b24ui?.itemTrailingIcon], color: item?.color })"
112
112
  />
113
113
  </DropdownMenu.ItemIndicator>
114
114
  </span>
@@ -119,72 +119,74 @@ const groups = computed(
119
119
  <component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
120
120
  <slot name="content-top" />
121
121
 
122
- <DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="b24ui.group({ class: b24uiOverride?.group })">
123
- <template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
124
- <DropdownMenu.Label v-if="item.type === 'label'" :class="b24ui.label({ class: b24uiOverride?.label })">
125
- <ReuseItemTemplate :item="item" :index="index" />
126
- </DropdownMenu.Label>
127
- <DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="b24ui.separator({ class: b24uiOverride?.separator })" />
128
- <DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
129
- <DropdownMenu.SubTrigger
130
- as="button"
131
- type="button"
122
+ <div role="presentation" :class="b24ui.viewport({ class: props.b24ui?.viewport })">
123
+ <DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="b24ui.group({ class: b24uiOverride?.group })">
124
+ <template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
125
+ <DropdownMenu.Label v-if="item.type === 'label'" :class="b24ui.label({ class: [b24uiOverride?.label, item.b24ui?.label, item.class] })">
126
+ <ReuseItemTemplate :item="item" :index="index" />
127
+ </DropdownMenu.Label>
128
+ <DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="b24ui.separator({ class: [b24uiOverride?.separator, item.b24ui?.separator, item.class] })" />
129
+ <DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
130
+ <DropdownMenu.SubTrigger
131
+ as="button"
132
+ type="button"
133
+ :disabled="item.disabled"
134
+ :text-value="getLabel(item)"
135
+ :class="b24ui.item({ class: [b24uiOverride?.item, item.b24ui?.item, item.class], color: item?.color })"
136
+ >
137
+ <ReuseItemTemplate :item="item" :index="index" />
138
+ </DropdownMenu.SubTrigger>
139
+
140
+ <B24DropdownMenuContent
141
+ sub
142
+ :class="props.class"
143
+ :b24ui="b24ui"
144
+ :b24ui-override="b24uiOverride"
145
+ :portal="portal"
146
+ :items="item.children"
147
+ align="start"
148
+ :align-offset="-4"
149
+ :side-offset="3"
150
+ :label-key="labelKey"
151
+ :checked-icon="checkedIcon"
152
+ :external-icon="externalIcon"
153
+ v-bind="item.content"
154
+ >
155
+ <template v-for="(_, name) in proxySlots" #[name]="slotData">
156
+ <slot :name="name" v-bind="slotData" />
157
+ </template>
158
+ </B24DropdownMenuContent>
159
+ </DropdownMenu.Sub>
160
+ <DropdownMenu.CheckboxItem
161
+ v-else-if="item.type === 'checkbox'"
162
+ :model-value="item.checked"
132
163
  :disabled="item.disabled"
133
164
  :text-value="getLabel(item)"
134
- :class="b24ui.item({ class: b24uiOverride?.item, color: item?.color })"
165
+ :class="b24ui.item({ class: [b24uiOverride?.item, item.b24ui?.item, item.class], color: item?.color })"
166
+ @update:model-value="item.onUpdateChecked"
167
+ @select="item.onSelect"
135
168
  >
136
169
  <ReuseItemTemplate :item="item" :index="index" />
137
- </DropdownMenu.SubTrigger>
138
-
139
- <B24DropdownMenuContent
140
- sub
141
- :class="props.class"
142
- :b24ui="b24ui"
143
- :b24ui-override="b24uiOverride"
144
- :portal="portal"
145
- :items="item.children"
146
- align="start"
147
- :align-offset="-4"
148
- :side-offset="3"
149
- :label-key="labelKey"
150
- :checked-icon="checkedIcon"
151
- :external-icon="externalIcon"
152
- v-bind="item.content"
170
+ </DropdownMenu.CheckboxItem>
171
+ <DropdownMenu.Item
172
+ v-else
173
+ as-child
174
+ :disabled="item.disabled"
175
+ :text-value="getLabel(item)"
176
+ @select="item.onSelect"
153
177
  >
154
- <template v-for="(_, name) in proxySlots" #[name]="slotData">
155
- <slot :name="name" v-bind="slotData" />
156
- </template>
157
- </B24DropdownMenuContent>
158
- </DropdownMenu.Sub>
159
- <DropdownMenu.CheckboxItem
160
- v-else-if="item.type === 'checkbox'"
161
- :model-value="item.checked"
162
- :disabled="item.disabled"
163
- :text-value="getLabel(item)"
164
- :class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color })"
165
- @update:model-value="item.onUpdateChecked"
166
- @select="item.onSelect"
167
- >
168
- <ReuseItemTemplate :item="item" :index="index" />
169
- </DropdownMenu.CheckboxItem>
170
- <DropdownMenu.Item
171
- v-else
172
- as-child
173
- :disabled="item.disabled"
174
- :text-value="getLabel(item)"
175
- @select="item.onSelect"
176
- >
177
- <B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
178
- <B24LinkBase
179
- v-bind="slotProps"
180
- :class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color, active })"
181
- >
182
- <ReuseItemTemplate :item="item" :active="active" :index="index" />
183
- </B24LinkBase>
184
- </B24Link>
185
- </DropdownMenu.Item>
186
- </template>
187
- </DropdownMenu.Group>
178
+ <B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
179
+ <B24LinkBase
180
+ v-bind="slotProps"
181
+ :class="b24ui.item({ class: [b24uiOverride?.item, item.b24ui?.item, item.class], color: item?.color, active })"
182
+ >
183
+ <ReuseItemTemplate :item="item" :active="active" :index="index" />
184
+ </B24LinkBase>
185
+ </B24Link>
186
+ </DropdownMenu.Item>
187
+ </template>
188
+ </DropdownMenu.Group>
189
+ </div>
188
190
 
189
191
  <slot />
190
192
 
@@ -30,31 +30,15 @@ type DropdownMenuContentSlots<T extends ArrayOrNested<DropdownMenuItem>> = Omit<
30
30
  declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
31
31
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
32
32
  readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
33
- readonly onPointerDownOutside?: ((event: CustomEvent<{
34
- originalEvent: PointerEvent;
35
- }>) => any) | undefined;
36
- readonly onFocusOutside?: ((event: CustomEvent<{
37
- originalEvent: FocusEvent;
38
- }>) => any) | undefined;
39
- readonly onInteractOutside?: ((event: CustomEvent<{
40
- originalEvent: PointerEvent;
41
- }> | CustomEvent<{
42
- originalEvent: FocusEvent;
43
- }>) => any) | undefined;
33
+ readonly onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
34
+ readonly onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
35
+ readonly onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
44
36
  readonly onCloseAutoFocus?: ((event: Event) => any) | undefined;
45
37
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus"> & DropdownMenuContentProps<T> & Partial<{}>> & import("vue").PublicProps;
46
38
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
47
39
  attrs: any;
48
40
  slots: DropdownMenuContentSlots<T>;
49
- emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: CustomEvent<{
50
- originalEvent: PointerEvent;
51
- }>) => void) & ((evt: "focusOutside", event: CustomEvent<{
52
- originalEvent: FocusEvent;
53
- }>) => void) & ((evt: "interactOutside", event: CustomEvent<{
54
- originalEvent: PointerEvent;
55
- }> | CustomEvent<{
56
- originalEvent: FocusEvent;
57
- }>) => void) & ((evt: "closeAutoFocus", event: Event) => void);
41
+ emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: import("reka-ui").PointerDownOutsideEvent) => void) & ((evt: "focusOutside", event: import("reka-ui").FocusOutsideEvent) => void) & ((evt: "interactOutside", event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => void) & ((evt: "closeAutoFocus", event: Event) => void);
58
42
  }>) => import("vue").VNode & {
59
43
  __ctx?: Awaited<typeof __VLS_setup>;
60
44
  };
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/form";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { provide, inject, nextTick, ref, onUnmounted, onMounted, computed, useId, readonly } from "vue";
6
+ import { provide, inject, nextTick, ref, onUnmounted, onMounted, computed, useId, readonly, reactive } from "vue";
7
7
  import { useEventBus } from "@vueuse/core";
8
8
  import { useAppConfig } from "#imports";
9
9
  import { formOptionsInjectionKey, formInputsInjectionKey, formBusInjectionKey, formLoadingInjectionKey } from "../composables/useFormField";
@@ -20,7 +20,7 @@ const props = defineProps({
20
20
  } },
21
21
  disabled: { type: Boolean, required: false },
22
22
  validateOnInputDelay: { type: Number, required: false, default: 300 },
23
- transform: { type: Boolean, required: false, default: true },
23
+ transform: { type: null, required: false, default: () => true },
24
24
  attach: { type: Boolean, required: false, default: true },
25
25
  loadingAuto: { type: Boolean, required: false, default: true },
26
26
  class: { type: null, required: false },
@@ -80,9 +80,9 @@ const errors = ref([]);
80
80
  provide("form-errors", errors);
81
81
  const inputs = ref({});
82
82
  provide(formInputsInjectionKey, inputs);
83
- const dirtyFields = /* @__PURE__ */ new Set();
84
- const touchedFields = /* @__PURE__ */ new Set();
85
- const blurredFields = /* @__PURE__ */ new Set();
83
+ const dirtyFields = reactive(/* @__PURE__ */ new Set());
84
+ const touchedFields = reactive(/* @__PURE__ */ new Set());
85
+ const blurredFields = reactive(/* @__PURE__ */ new Set());
86
86
  function resolveErrorIds(errs) {
87
87
  return errs.map((err) => ({
88
88
  ...err,
@@ -205,6 +205,6 @@ defineExpose({
205
205
  :class="b24ui({ class: props.class })"
206
206
  @submit.prevent="onSubmitWrapper"
207
207
  >
208
- <slot :errors="errors" />
208
+ <slot :errors="errors" :loading="loading" />
209
209
  </component>
210
210
  </template>
@@ -1,5 +1,5 @@
1
- import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, Form, InferInput, InferOutput } from '../types/form';
2
- export interface FormProps<S extends FormSchema> {
1
+ import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, Form, InferInput, FormData } from '../types/form';
2
+ export interface FormProps<S extends FormSchema, T extends boolean = true> {
3
3
  id?: string | number;
4
4
  /** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */
5
5
  schema?: S;
@@ -27,7 +27,7 @@ export interface FormProps<S extends FormSchema> {
27
27
  * If true, schema transformations will be applied to the state on submit.
28
28
  * @defaultValue `true`
29
29
  */
30
- transform?: boolean;
30
+ transform?: T;
31
31
  /**
32
32
  * If true, this form will attach to its parent Form (if any) and validate at the same time.
33
33
  * @defaultValue `true`
@@ -40,26 +40,27 @@ export interface FormProps<S extends FormSchema> {
40
40
  */
41
41
  loadingAuto?: boolean;
42
42
  class?: any;
43
- onSubmit?: ((event: FormSubmitEvent<InferOutput<S>>) => void | Promise<void>) | (() => void | Promise<void>);
43
+ onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => void | Promise<void>) | (() => void | Promise<void>);
44
44
  }
45
- export interface FormEmits<S extends FormSchema> {
46
- (e: 'submit', payload: FormSubmitEvent<InferOutput<S>>): void;
45
+ export interface FormEmits<S extends FormSchema, T extends boolean = true> {
46
+ (e: 'submit', payload: FormSubmitEvent<FormData<S, T>>): void;
47
47
  (e: 'error', payload: FormErrorEvent): void;
48
48
  }
49
49
  export interface FormSlots {
50
50
  default(props?: {
51
51
  errors: FormError[];
52
+ loading: boolean;
52
53
  }): any;
53
54
  }
54
- declare const _default: <S extends FormSchema>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
55
+ declare const _default: <S extends FormSchema, T extends boolean = true>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
55
56
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
56
57
  readonly onError?: ((payload: FormErrorEvent) => any) | undefined;
57
- readonly onSubmit?: ((payload: FormSubmitEvent<InferOutput<S>>) => any) | undefined;
58
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onError" | "onSubmit"> & FormProps<S> & Partial<{}>> & import("vue").PublicProps;
59
- expose(exposed: import("vue").ShallowUnwrapRef<Form<InferInput<S>>>): void;
58
+ readonly onSubmit?: ((payload: FormSubmitEvent<FormData<S, T>>) => any) | undefined;
59
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onSubmit" | "onError"> & FormProps<S, T> & Partial<{}>> & import("vue").PublicProps;
60
+ expose(exposed: import("vue").ShallowUnwrapRef<Form<S>>): void;
60
61
  attrs: any;
61
62
  slots: FormSlots;
62
- emit: FormEmits<S>;
63
+ emit: FormEmits<S, T>;
63
64
  }>) => import("vue").VNode & {
64
65
  __ctx?: Awaited<typeof __VLS_setup>;
65
66
  };
@@ -52,7 +52,7 @@ provide(formFieldInjectionKey, computed(() => ({
52
52
  </script>
53
53
 
54
54
  <template>
55
- <Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
55
+ <Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
56
56
  <div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
57
57
  <div v-if="label || !!slots.label" :class="b24ui.labelWrapper({ class: props.b24ui?.labelWrapper })">
58
58
  <Label :for="id" :class="b24ui.label({ class: props.b24ui?.label })">
@@ -79,17 +79,17 @@ provide(formFieldInjectionKey, computed(() => ({
79
79
 
80
80
  <div v-if="typeof error === 'string' && error || !!slots.error" :id="`${ariaId}-error`" :class="b24ui.error({ class: props.b24ui?.error })">
81
81
  <slot name="error" :error="error">
82
- <div class="flex flex-row flex-nowrap gap-0.5">
82
+ <div :class="b24ui.errorWrapper({ class: props.b24ui?.errorWrapper })">
83
83
  <WarningIcon :class="b24ui.errorIcon()" />
84
84
  <div>{{ error }}</div>
85
85
  </div>
86
86
  </slot>
87
87
  </div>
88
- <p v-else-if="help || !!slots.help" :class="b24ui.help({ class: props.b24ui?.help })">
88
+ <div v-else-if="help || !!slots.help" :class="b24ui.help({ class: props.b24ui?.help })">
89
89
  <slot name="help" :help="help">
90
90
  {{ help }}
91
91
  </slot>
92
- </p>
92
+ </div>
93
93
  </div>
94
94
  </Primitive>
95
95
  </template>