@bitrix24/b24ui-nuxt 0.5.8 → 0.5.10

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 (197) hide show
  1. package/.nuxt/b24ui/navigation-menu.ts +0 -2
  2. package/.nuxt/b24ui/popover.ts +1 -1
  3. package/.nuxt/b24ui/textarea.ts +43 -0
  4. package/dist/meta.d.mts +5090 -4900
  5. package/dist/meta.mjs +5090 -4900
  6. package/dist/module.json +5 -5
  7. package/dist/module.mjs +11 -7
  8. package/dist/runtime/components/Advice.vue +47 -54
  9. package/dist/runtime/components/Advice.vue.d.ts +170 -0
  10. package/dist/runtime/components/Alert.vue +71 -96
  11. package/dist/runtime/components/Alert.vue.d.ts +464 -0
  12. package/dist/runtime/components/App.vue +37 -34
  13. package/dist/runtime/components/App.vue.d.ts +23 -0
  14. package/dist/runtime/components/Avatar.vue +69 -81
  15. package/dist/runtime/components/Avatar.vue.d.ts +281 -0
  16. package/dist/runtime/components/AvatarGroup.vue +53 -76
  17. package/dist/runtime/components/AvatarGroup.vue.d.ts +204 -0
  18. package/dist/runtime/components/Badge.vue +83 -83
  19. package/dist/runtime/components/Badge.vue.d.ts +517 -0
  20. package/dist/runtime/components/Button.vue +219 -149
  21. package/dist/runtime/components/Button.vue.d.ts +640 -0
  22. package/dist/runtime/components/ButtonGroup.vue +35 -51
  23. package/dist/runtime/components/ButtonGroup.vue.d.ts +116 -0
  24. package/dist/runtime/components/Calendar.vue +186 -152
  25. package/dist/runtime/components/Calendar.vue.d.ts +437 -0
  26. package/dist/runtime/components/Checkbox.vue +84 -73
  27. package/dist/runtime/components/Checkbox.vue.d.ts +354 -0
  28. package/dist/runtime/components/Chip.vue +59 -74
  29. package/dist/runtime/components/Chip.vue.d.ts +271 -0
  30. package/dist/runtime/components/Collapsible.vue +44 -41
  31. package/dist/runtime/components/Collapsible.vue.d.ts +118 -0
  32. package/dist/runtime/components/Container.vue +18 -27
  33. package/dist/runtime/components/Container.vue.d.ts +27 -0
  34. package/dist/runtime/components/Countdown.vue +198 -378
  35. package/dist/runtime/components/Countdown.vue.d.ts +356 -0
  36. package/dist/runtime/components/DescriptionList.vue +102 -149
  37. package/dist/runtime/components/DescriptionList.vue.d.ts +379 -0
  38. package/dist/runtime/components/DropdownMenu.vue +83 -139
  39. package/dist/runtime/components/DropdownMenu.vue.d.ts +533 -0
  40. package/dist/runtime/components/DropdownMenuContent.vue +137 -81
  41. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +228 -0
  42. package/dist/runtime/components/Form.vue +162 -216
  43. package/dist/runtime/components/Form.vue.d.ts +55 -0
  44. package/dist/runtime/components/FormField.vue +76 -80
  45. package/dist/runtime/components/FormField.vue.d.ts +282 -0
  46. package/dist/runtime/components/Input.vue +166 -185
  47. package/dist/runtime/components/Input.vue.d.ts +755 -0
  48. package/dist/runtime/components/InputMenu.vue +300 -381
  49. package/dist/runtime/components/InputMenu.vue.d.ts +1504 -0
  50. package/dist/runtime/components/InputNumber.vue +180 -177
  51. package/dist/runtime/components/InputNumber.vue.d.ts +658 -0
  52. package/dist/runtime/components/Kbd.vue +33 -45
  53. package/dist/runtime/components/Kbd.vue.d.ts +109 -0
  54. package/dist/runtime/components/Link.vue +179 -173
  55. package/dist/runtime/components/Link.vue.d.ts +129 -0
  56. package/dist/runtime/components/LinkBase.vue +64 -42
  57. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  58. package/dist/runtime/components/Modal.vue +105 -127
  59. package/dist/runtime/components/Modal.vue.d.ts +327 -0
  60. package/dist/runtime/components/ModalDialogClose.vue +4 -8
  61. package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
  62. package/dist/runtime/components/Navbar.vue +24 -33
  63. package/dist/runtime/components/Navbar.vue.d.ts +101 -0
  64. package/dist/runtime/components/NavbarDivider.vue +24 -33
  65. package/dist/runtime/components/NavbarDivider.vue.d.ts +101 -0
  66. package/dist/runtime/components/NavbarSection.vue +24 -33
  67. package/dist/runtime/components/NavbarSection.vue.d.ts +101 -0
  68. package/dist/runtime/components/NavbarSpacer.vue +24 -33
  69. package/dist/runtime/components/NavbarSpacer.vue.d.ts +101 -0
  70. package/dist/runtime/components/NavigationMenu.vue +152 -216
  71. package/dist/runtime/components/NavigationMenu.vue.d.ts +824 -0
  72. package/dist/runtime/components/OverlayProvider.vue +13 -17
  73. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  74. package/dist/runtime/components/Popover.vue +81 -81
  75. package/dist/runtime/components/Popover.vue.d.ts +147 -0
  76. package/dist/runtime/components/Progress.vue +109 -136
  77. package/dist/runtime/components/Progress.vue.d.ts +592 -0
  78. package/dist/runtime/components/RadioGroup.vue +120 -134
  79. package/dist/runtime/components/RadioGroup.vue.d.ts +723 -0
  80. package/dist/runtime/components/Range.vue +94 -85
  81. package/dist/runtime/components/Range.vue.d.ts +417 -0
  82. package/dist/runtime/components/Select.vue +212 -260
  83. package/dist/runtime/components/Select.vue.d.ts +1200 -0
  84. package/dist/runtime/components/SelectMenu.vue +272 -366
  85. package/dist/runtime/components/SelectMenu.vue.d.ts +1298 -0
  86. package/dist/runtime/components/Separator.vue +61 -71
  87. package/dist/runtime/components/Separator.vue.d.ts +400 -0
  88. package/dist/runtime/components/Sidebar.vue +24 -33
  89. package/dist/runtime/components/Sidebar.vue.d.ts +101 -0
  90. package/dist/runtime/components/SidebarBody.vue +30 -38
  91. package/dist/runtime/components/SidebarBody.vue.d.ts +90 -0
  92. package/dist/runtime/components/SidebarFooter.vue +24 -33
  93. package/dist/runtime/components/SidebarFooter.vue.d.ts +101 -0
  94. package/dist/runtime/components/SidebarHeader.vue +24 -33
  95. package/dist/runtime/components/SidebarHeader.vue.d.ts +101 -0
  96. package/dist/runtime/components/SidebarHeading.vue +24 -33
  97. package/dist/runtime/components/SidebarHeading.vue.d.ts +101 -0
  98. package/dist/runtime/components/SidebarLayout.vue +40 -70
  99. package/dist/runtime/components/SidebarLayout.vue.d.ts +222 -0
  100. package/dist/runtime/components/SidebarSection.vue +24 -33
  101. package/dist/runtime/components/SidebarSection.vue.d.ts +101 -0
  102. package/dist/runtime/components/SidebarSpacer.vue +24 -33
  103. package/dist/runtime/components/SidebarSpacer.vue.d.ts +101 -0
  104. package/dist/runtime/components/Skeleton.vue +17 -22
  105. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  106. package/dist/runtime/components/Slideover.vue +108 -131
  107. package/dist/runtime/components/Slideover.vue.d.ts +360 -0
  108. package/dist/runtime/components/StackedLayout.vue +40 -73
  109. package/dist/runtime/components/StackedLayout.vue.d.ts +192 -0
  110. package/dist/runtime/components/Switch.vue +100 -95
  111. package/dist/runtime/components/Switch.vue.d.ts +587 -0
  112. package/dist/runtime/components/Tabs.vue +83 -105
  113. package/dist/runtime/components/Tabs.vue.d.ts +453 -0
  114. package/dist/runtime/components/Textarea.vue +215 -203
  115. package/dist/runtime/components/Textarea.vue.d.ts +601 -0
  116. package/dist/runtime/components/Toast.vue +94 -105
  117. package/dist/runtime/components/Toast.vue.d.ts +438 -0
  118. package/dist/runtime/components/Toaster.vue +94 -111
  119. package/dist/runtime/components/Toaster.vue.d.ts +219 -0
  120. package/dist/runtime/components/Tooltip.vue +78 -64
  121. package/dist/runtime/components/Tooltip.vue.d.ts +186 -0
  122. package/dist/runtime/components/content/TableWrapper.vue +58 -70
  123. package/dist/runtime/components/content/TableWrapper.vue.d.ts +237 -0
  124. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  125. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  126. package/dist/runtime/composables/useComponentIcons.d.ts +3 -3
  127. package/dist/runtime/composables/useFormField.d.ts +1 -1
  128. package/dist/runtime/prose/A.vue +18 -23
  129. package/dist/runtime/prose/A.vue.d.ts +84 -0
  130. package/dist/runtime/prose/Blockquote.vue +18 -23
  131. package/dist/runtime/prose/Blockquote.vue.d.ts +84 -0
  132. package/dist/runtime/prose/Code.vue +23 -31
  133. package/dist/runtime/prose/Code.vue.d.ts +97 -0
  134. package/dist/runtime/prose/Em.vue +18 -23
  135. package/dist/runtime/prose/Em.vue.d.ts +84 -0
  136. package/dist/runtime/prose/H1.vue +18 -23
  137. package/dist/runtime/prose/H1.vue.d.ts +97 -0
  138. package/dist/runtime/prose/H2.vue +18 -23
  139. package/dist/runtime/prose/H2.vue.d.ts +123 -0
  140. package/dist/runtime/prose/H3.vue +18 -23
  141. package/dist/runtime/prose/H3.vue.d.ts +123 -0
  142. package/dist/runtime/prose/H4.vue +18 -23
  143. package/dist/runtime/prose/H4.vue.d.ts +123 -0
  144. package/dist/runtime/prose/H5.vue +18 -23
  145. package/dist/runtime/prose/H5.vue.d.ts +123 -0
  146. package/dist/runtime/prose/H6.vue +18 -23
  147. package/dist/runtime/prose/H6.vue.d.ts +123 -0
  148. package/dist/runtime/prose/Hr.vue +18 -19
  149. package/dist/runtime/prose/Hr.vue.d.ts +74 -0
  150. package/dist/runtime/prose/Img.vue +18 -23
  151. package/dist/runtime/prose/Img.vue.d.ts +77 -0
  152. package/dist/runtime/prose/Li.vue +18 -23
  153. package/dist/runtime/prose/Li.vue.d.ts +84 -0
  154. package/dist/runtime/prose/Ol.vue +18 -23
  155. package/dist/runtime/prose/Ol.vue.d.ts +84 -0
  156. package/dist/runtime/prose/P.vue +18 -23
  157. package/dist/runtime/prose/P.vue.d.ts +84 -0
  158. package/dist/runtime/prose/Pre.vue +28 -33
  159. package/dist/runtime/prose/Pre.vue.d.ts +117 -0
  160. package/dist/runtime/prose/Strong.vue +18 -23
  161. package/dist/runtime/prose/Strong.vue.d.ts +84 -0
  162. package/dist/runtime/prose/Table.vue +44 -54
  163. package/dist/runtime/prose/Table.vue.d.ts +144 -0
  164. package/dist/runtime/prose/Tbody.vue +18 -23
  165. package/dist/runtime/prose/Tbody.vue.d.ts +84 -0
  166. package/dist/runtime/prose/Td.vue +18 -23
  167. package/dist/runtime/prose/Td.vue.d.ts +84 -0
  168. package/dist/runtime/prose/Th.vue +18 -23
  169. package/dist/runtime/prose/Th.vue.d.ts +84 -0
  170. package/dist/runtime/prose/Thead.vue +18 -23
  171. package/dist/runtime/prose/Thead.vue.d.ts +84 -0
  172. package/dist/runtime/prose/Tr.vue +18 -23
  173. package/dist/runtime/prose/Tr.vue.d.ts +84 -0
  174. package/dist/runtime/prose/Ul.vue +18 -23
  175. package/dist/runtime/prose/Ul.vue.d.ts +84 -0
  176. package/dist/runtime/vue/components/Link.vue +201 -202
  177. package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
  178. package/dist/runtime/vue/stubs.d.ts +2 -2
  179. package/dist/shared/{b24ui-nuxt.DBFS6LH7.mjs → b24ui-nuxt.CS9Lf0os.mjs} +54 -4
  180. package/dist/types.d.mts +3 -5
  181. package/dist/unplugin.mjs +1 -1
  182. package/dist/vite.mjs +1 -1
  183. package/package.json +62 -35
  184. package/dist/meta.cjs +0 -71922
  185. package/dist/meta.d.cts +0 -71920
  186. package/dist/meta.d.ts +0 -71920
  187. package/dist/module.cjs +0 -59
  188. package/dist/module.d.cts +0 -15
  189. package/dist/module.d.ts +0 -15
  190. package/dist/shared/b24ui-nuxt.B9fPD5yO.cjs +0 -7671
  191. package/dist/types.d.ts +0 -7
  192. package/dist/unplugin.cjs +0 -236
  193. package/dist/unplugin.d.cts +0 -33
  194. package/dist/unplugin.d.ts +0 -33
  195. package/dist/vite.cjs +0 -21
  196. package/dist/vite.d.cts +0 -14
  197. package/dist/vite.d.ts +0 -14
@@ -1,19 +1,15 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import { useOverlay, type Overlay } from '../composables/useOverlay'
4
-
5
- const { overlays, unMount, close } = useOverlay()
6
-
7
- const mountedOverlays = computed(() => overlays.filter((overlay: Overlay) => overlay.isMounted))
8
-
9
- const onAfterLeave = (id: symbol) => {
10
- close(id)
11
- unMount(id)
12
- }
13
-
14
- const onClose = (id: symbol, value: any) => {
15
- close(id, value)
16
- }
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { useOverlay } from "../composables/useOverlay";
4
+ const { overlays, unMount, close } = useOverlay();
5
+ const mountedOverlays = computed(() => overlays.filter((overlay) => overlay.isMounted));
6
+ const onAfterLeave = (id) => {
7
+ close(id);
8
+ unMount(id);
9
+ };
10
+ const onClose = (id, value) => {
11
+ close(id, value);
12
+ };
17
13
  </script>
18
14
 
19
15
  <template>
@@ -23,7 +19,7 @@ const onClose = (id: symbol, value: any) => {
23
19
  :key="overlay.id"
24
20
  v-bind="overlay.props"
25
21
  v-model:open="overlay.modelValue"
26
- @close="(value:any) => onClose(overlay.id, value)"
22
+ @close="(value) => onClose(overlay.id, value)"
27
23
  @after:leave="onAfterLeave(overlay.id)"
28
24
  />
29
25
  </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,92 +1,92 @@
1
- <script lang="ts">
2
- import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps } from 'reka-ui'
3
- import type { AppConfig } from '@nuxt/schema'
4
- import _appConfig from '#build/app.config'
5
- import theme from '#build/b24ui/popover'
6
- import { tv } from '../utils/tv'
7
- import type { EmitsToProps } from '../types/utils'
8
-
9
- const appConfigPopover = _appConfig as AppConfig & { b24ui: { popover: Partial<typeof theme> } }
10
-
11
- const popover = tv({ extend: tv(theme), ...(appConfigPopover.b24ui?.popover || {}) })
12
-
13
- export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps, 'openDelay' | 'closeDelay'> {
14
- /**
15
- * The display mode of the popover.
16
- * @defaultValue 'click'
17
- */
18
- mode?: 'click' | 'hover'
19
- /**
20
- * The content of the popover.
21
- * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
22
- */
23
- content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<PopoverContentEmits>>
24
- /**
25
- * Display an arrow alongside the popover.
26
- * @defaultValue false
27
- */
28
- arrow?: boolean | Omit<PopoverArrowProps, 'as' | 'asChild'>
29
- /**
30
- * Render the popover in a portal.
31
- * @defaultValue true
32
- */
33
- portal?: boolean
34
- /**
35
- * When `false`, the popover will not close when clicking outside or pressing escape.
36
- * @defaultValue true
37
- */
38
- dismissible?: boolean
39
- class?: any
40
- b24ui?: Partial<typeof popover.slots>
41
- }
42
-
43
- export interface PopoverEmits extends PopoverRootEmits {}
44
-
45
- export interface PopoverSlots {
46
- default(props: { open: boolean }): any
47
- content(props?: {}): any
48
- }
1
+ <script>
2
+ import _appConfig from "#build/app.config";
3
+ import theme from "#build/b24ui/popover";
4
+ import { tv } from "../utils/tv";
5
+ const appConfigPopover = _appConfig;
6
+ const popover = tv({ extend: tv(theme), ...appConfigPopover.b24ui?.popover || {} });
49
7
  </script>
50
8
 
51
- <script setup lang="ts">
52
- import { computed, toRef } from 'vue'
53
- import { defu } from 'defu'
54
- import { useForwardPropsEmits } from 'reka-ui'
55
- import { Popover, HoverCard } from 'reka-ui/namespaced'
56
- import { reactivePick } from '@vueuse/core'
57
-
58
- const props = withDefaults(defineProps<PopoverProps>(), {
59
- portal: true,
60
- mode: 'click',
61
- openDelay: 0,
62
- closeDelay: 0,
63
- dismissible: true
64
- })
65
- const emits = defineEmits<PopoverEmits>()
66
- const slots = defineSlots<PopoverSlots>()
67
-
68
- const pick = props.mode === 'hover' ? reactivePick(props, 'defaultOpen', 'open', 'openDelay', 'closeDelay') : reactivePick(props, 'defaultOpen', 'open', 'modal')
69
- const rootProps = useForwardPropsEmits(pick, emits)
70
- const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as PopoverContentProps)
9
+ <script setup>
10
+ import { computed, toRef } from "vue";
11
+ import { defu } from "defu";
12
+ import { useForwardPropsEmits } from "reka-ui";
13
+ import { Popover, HoverCard } from "reka-ui/namespaced";
14
+ import { reactivePick } from "@vueuse/core";
15
+ const props = defineProps({
16
+ mode: {
17
+ type: String,
18
+ required: false,
19
+ default: "click"
20
+ },
21
+ content: {
22
+ type: Object,
23
+ required: false
24
+ },
25
+ arrow: {
26
+ type: [Boolean, Object],
27
+ required: false
28
+ },
29
+ portal: {
30
+ type: Boolean,
31
+ required: false,
32
+ default: true
33
+ },
34
+ dismissible: {
35
+ type: Boolean,
36
+ required: false,
37
+ default: true
38
+ },
39
+ class: {
40
+ type: null,
41
+ required: false
42
+ },
43
+ b24ui: {
44
+ type: Object,
45
+ required: false
46
+ },
47
+ defaultOpen: {
48
+ type: Boolean,
49
+ required: false
50
+ },
51
+ open: {
52
+ type: Boolean,
53
+ required: false
54
+ },
55
+ modal: {
56
+ type: Boolean,
57
+ required: false
58
+ },
59
+ openDelay: {
60
+ type: Number,
61
+ required: false,
62
+ default: 0
63
+ },
64
+ closeDelay: {
65
+ type: Number,
66
+ required: false,
67
+ default: 0
68
+ }
69
+ });
70
+ const emits = defineEmits(["update:open"]);
71
+ const slots = defineSlots();
72
+ const pick = props.mode === "hover" ? reactivePick(props, "defaultOpen", "open", "openDelay", "closeDelay") : reactivePick(props, "defaultOpen", "open", "modal");
73
+ const rootProps = useForwardPropsEmits(pick, emits);
74
+ const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
71
75
  const contentEvents = computed(() => {
72
76
  if (!props.dismissible) {
73
77
  return {
74
- pointerDownOutside: (e: Event) => e.preventDefault(),
75
- interactOutside: (e: Event) => e.preventDefault(),
76
- escapeKeyDown: (e: Event) => e.preventDefault()
77
- }
78
+ pointerDownOutside: (e) => e.preventDefault(),
79
+ interactOutside: (e) => e.preventDefault(),
80
+ escapeKeyDown: (e) => e.preventDefault()
81
+ };
78
82
  }
79
-
80
- return {}
81
- })
82
- const arrowProps = toRef(() => props.arrow as PopoverArrowProps)
83
-
84
- // eslint-disable-next-line vue/no-dupe-keys
83
+ return {};
84
+ });
85
+ const arrowProps = toRef(() => props.arrow);
85
86
  const b24ui = computed(() => popover({
86
87
  side: contentProps.value.side
87
- }))
88
-
89
- const Component = computed(() => props.mode === 'hover' ? HoverCard : Popover)
88
+ }));
89
+ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
90
90
  </script>
91
91
 
92
92
  <template>
@@ -0,0 +1,147 @@
1
+ import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps } from 'reka-ui';
2
+ import type { EmitsToProps } from '../types/utils';
3
+ declare const popover: import("tailwind-variants").TVReturnType<{
4
+ [key: string]: {
5
+ [key: string]: import("tailwind-variants").ClassValue | {
6
+ content?: import("tailwind-variants").ClassValue;
7
+ arrow?: import("tailwind-variants").ClassValue;
8
+ };
9
+ };
10
+ } | {
11
+ [x: string]: {
12
+ [x: string]: import("tailwind-variants").ClassValue | {
13
+ content?: import("tailwind-variants").ClassValue;
14
+ arrow?: import("tailwind-variants").ClassValue;
15
+ };
16
+ };
17
+ } | {
18
+ [x: string]: {
19
+ [x: string]: import("tailwind-variants").ClassValue | {
20
+ content?: import("tailwind-variants").ClassValue;
21
+ arrow?: import("tailwind-variants").ClassValue;
22
+ };
23
+ };
24
+ } | {}, {
25
+ content: string;
26
+ arrow: string;
27
+ }, undefined, {
28
+ [key: string]: {
29
+ [key: string]: import("tailwind-variants").ClassValue | {
30
+ content?: import("tailwind-variants").ClassValue;
31
+ arrow?: import("tailwind-variants").ClassValue;
32
+ };
33
+ };
34
+ } | {
35
+ [x: string]: {
36
+ [x: string]: import("tailwind-variants").ClassValue | {
37
+ content?: import("tailwind-variants").ClassValue;
38
+ arrow?: import("tailwind-variants").ClassValue;
39
+ };
40
+ };
41
+ } | {}, {
42
+ content: string;
43
+ arrow: string;
44
+ }, import("tailwind-variants").TVReturnType<{
45
+ [key: string]: {
46
+ [key: string]: import("tailwind-variants").ClassValue | {
47
+ content?: import("tailwind-variants").ClassValue;
48
+ arrow?: import("tailwind-variants").ClassValue;
49
+ };
50
+ };
51
+ } | {
52
+ [x: string]: {
53
+ [x: string]: import("tailwind-variants").ClassValue | {
54
+ content?: import("tailwind-variants").ClassValue;
55
+ arrow?: import("tailwind-variants").ClassValue;
56
+ };
57
+ };
58
+ } | {}, {
59
+ content: string;
60
+ arrow: string;
61
+ }, undefined, {
62
+ [key: string]: {
63
+ [key: string]: import("tailwind-variants").ClassValue | {
64
+ content?: import("tailwind-variants").ClassValue;
65
+ arrow?: import("tailwind-variants").ClassValue;
66
+ };
67
+ };
68
+ } | {}, {
69
+ content: string;
70
+ arrow: string;
71
+ }, import("tailwind-variants").TVReturnType<unknown, {
72
+ content: string;
73
+ arrow: string;
74
+ }, undefined, unknown, unknown, undefined>>>;
75
+ export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps, 'openDelay' | 'closeDelay'> {
76
+ /**
77
+ * The display mode of the popover.
78
+ * @defaultValue 'click'
79
+ */
80
+ mode?: 'click' | 'hover';
81
+ /**
82
+ * The content of the popover.
83
+ * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
84
+ */
85
+ content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<PopoverContentEmits>>;
86
+ /**
87
+ * Display an arrow alongside the popover.
88
+ * @defaultValue false
89
+ */
90
+ arrow?: boolean | Omit<PopoverArrowProps, 'as' | 'asChild'>;
91
+ /**
92
+ * Render the popover in a portal.
93
+ * @defaultValue true
94
+ */
95
+ portal?: boolean;
96
+ /**
97
+ * When `false`, the popover will not close when clicking outside or pressing escape.
98
+ * @defaultValue true
99
+ */
100
+ dismissible?: boolean;
101
+ class?: any;
102
+ b24ui?: Partial<typeof popover.slots>;
103
+ }
104
+ export interface PopoverEmits extends PopoverRootEmits {
105
+ }
106
+ export interface PopoverSlots {
107
+ default(props: {
108
+ open: boolean;
109
+ }): any;
110
+ content(props?: {}): any;
111
+ }
112
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<PopoverProps>, {
113
+ portal: boolean;
114
+ mode: string;
115
+ openDelay: number;
116
+ closeDelay: number;
117
+ dismissible: boolean;
118
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
119
+ portal: boolean;
120
+ dismissible: boolean;
121
+ openDelay: number;
122
+ closeDelay: number;
123
+ mode: "click" | "hover";
124
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<PopoverSlots> & PopoverSlots>;
125
+ export default _default;
126
+ type __VLS_WithDefaults<P, D> = {
127
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
128
+ default: D[K];
129
+ }> : P[K];
130
+ };
131
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
132
+ type __VLS_TypePropsToOption<T> = {
133
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
134
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
135
+ } : {
136
+ type: import('vue').PropType<T[K]>;
137
+ required: true;
138
+ };
139
+ };
140
+ type __VLS_WithTemplateSlots<T, S> = T & {
141
+ new (): {
142
+ $slots: S;
143
+ };
144
+ };
145
+ type __VLS_PrettifyLocal<T> = {
146
+ [K in keyof T]: T[K];
147
+ } & {};
@@ -1,178 +1,151 @@
1
- <!-- eslint-disable vue/block-tag-newline -->
2
- <script lang="ts">
3
- import type { VariantProps } from 'tailwind-variants'
4
- import type { ProgressRootProps, ProgressRootEmits } from 'reka-ui'
5
- import type { AppConfig } from '@nuxt/schema'
6
- import _appConfig from '#build/app.config'
7
- import theme from '#build/b24ui/progress'
8
- import { tv } from '../utils/tv'
9
-
10
- const appConfigProgress = _appConfig as AppConfig & { b24ui: { progress: Partial<typeof theme> } }
11
-
12
- const progress = tv({ extend: tv(theme), ...(appConfigProgress.b24ui?.progress || {}) })
13
-
14
- type ProgressVariants = VariantProps<typeof progress>
15
-
16
- export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' | 'modelValue'> {
17
- /**
18
- * The element or component this component should render as.
19
- * @defaultValue 'div'
20
- */
21
- as?: any
22
- /**
23
- * The maximum progress value
24
- */
25
- max?: number | Array<any>
26
- /**
27
- * Display the current progress value
28
- */
29
- status?: boolean
30
- /**
31
- * Whether the progress is visually inverted
32
- * @defaultValue false
33
- */
34
- inverted?: boolean
35
- /**
36
- * @defaultValue 'md'
37
- */
38
- size?: ProgressVariants['size']
39
- /**
40
- * @defaultValue 'primary'
41
- */
42
- color?: ProgressVariants['color']
43
- /**
44
- * The orientation of the progress bar.
45
- * @defaultValue 'horizontal'
46
- */
47
- orientation?: ProgressVariants['orientation']
48
- /**
49
- * @defaultValue 'loading'
50
- */
51
- animation?: ProgressVariants['animation']
52
- class?: any
53
- b24ui?: Partial<typeof progress.slots>
54
- }
55
-
56
- export interface ProgressEmits extends ProgressRootEmits {}
57
-
58
- export type ProgressSlots = {
59
- status(props: { percent?: number }): any
60
- } & {
61
- [key: string]: (props: { step: number }) => any
62
- }
63
-
1
+ <script>
2
+ import _appConfig from "#build/app.config";
3
+ import theme from "#build/b24ui/progress";
4
+ import { tv } from "../utils/tv";
5
+ const appConfigProgress = _appConfig;
6
+ const progress = tv({ extend: tv(theme), ...appConfigProgress.b24ui?.progress || {} });
64
7
  </script>
65
8
 
66
- <script setup lang="ts">
67
- import { computed } from 'vue'
68
- import { Primitive, ProgressRoot, ProgressIndicator, useForwardPropsEmits } from 'reka-ui'
69
- import { reactivePick } from '@vueuse/core'
70
- import { useLocale } from '../composables/useLocale'
71
-
72
- const props = withDefaults(defineProps<ProgressProps>(), {
73
- inverted: false,
74
- modelValue: null,
75
- orientation: 'horizontal'
76
- })
77
- const emits = defineEmits<ProgressEmits>()
78
- const slots = defineSlots<ProgressSlots>()
79
-
80
- const { dir } = useLocale()
81
-
82
- const rootProps = useForwardPropsEmits(reactivePick(props, 'getValueLabel', 'modelValue'), emits)
83
-
84
- const isIndeterminate = computed(() => rootProps.value.modelValue === null)
85
- const hasSteps = computed(() => Array.isArray(props.max))
86
-
9
+ <script setup>
10
+ import { computed } from "vue";
11
+ import { useForwardPropsEmits } from "reka-ui";
12
+ import { reactivePick } from "@vueuse/core";
13
+ import { useLocale } from "../composables/useLocale";
14
+ const props = defineProps({
15
+ as: {
16
+ type: null,
17
+ required: false
18
+ },
19
+ max: {
20
+ type: [Number, Array],
21
+ required: false
22
+ },
23
+ status: {
24
+ type: Boolean,
25
+ required: false
26
+ },
27
+ inverted: {
28
+ type: Boolean,
29
+ required: false,
30
+ default: false
31
+ },
32
+ size: {
33
+ type: null,
34
+ required: false
35
+ },
36
+ color: {
37
+ type: null,
38
+ required: false
39
+ },
40
+ orientation: {
41
+ type: null,
42
+ required: false,
43
+ default: "horizontal"
44
+ },
45
+ animation: {
46
+ type: null,
47
+ required: false
48
+ },
49
+ class: {
50
+ type: null,
51
+ required: false
52
+ },
53
+ b24ui: {
54
+ type: Object,
55
+ required: false
56
+ },
57
+ getValueLabel: {
58
+ type: Function,
59
+ required: false
60
+ },
61
+ modelValue: {
62
+ type: [Number, null],
63
+ required: false,
64
+ default: null
65
+ }
66
+ });
67
+ const emits = defineEmits(["update:modelValue", "update:max"]);
68
+ const slots = defineSlots();
69
+ const { dir } = useLocale();
70
+ const rootProps = useForwardPropsEmits(reactivePick(props, "getValueLabel", "modelValue"), emits);
71
+ const isIndeterminate = computed(() => rootProps.value.modelValue === null);
72
+ const hasSteps = computed(() => Array.isArray(props.max));
87
73
  const realMax = computed(() => {
88
74
  if (isIndeterminate.value || !props.max) {
89
- return undefined
75
+ return void 0;
90
76
  }
91
-
92
77
  if (Array.isArray(props.max)) {
93
- return props.max.length - 1
78
+ return props.max.length - 1;
94
79
  }
95
-
96
- return Number(props.max)
97
- })
98
-
80
+ return Number(props.max);
81
+ });
99
82
  const percent = computed(() => {
100
83
  if (isIndeterminate.value) {
101
- return undefined
84
+ return void 0;
102
85
  }
103
-
104
86
  switch (true) {
105
- case rootProps.value.modelValue! < 0: return 0
106
- case rootProps.value.modelValue! > (realMax.value ?? 100): return 100
107
- default: return Math.round((rootProps.value.modelValue! / (realMax.value ?? 100)) * 100)
87
+ case rootProps.value.modelValue < 0:
88
+ return 0;
89
+ case rootProps.value.modelValue > (realMax.value ?? 100):
90
+ return 100;
91
+ default:
92
+ return Math.round(rootProps.value.modelValue / (realMax.value ?? 100) * 100);
108
93
  }
109
- })
110
-
94
+ });
111
95
  const indicatorStyle = computed(() => {
112
- if (percent.value === undefined) {
113
- return
96
+ if (percent.value === void 0) {
97
+ return;
114
98
  }
115
-
116
- if (props.orientation === 'vertical') {
99
+ if (props.orientation === "vertical") {
117
100
  return {
118
- transform: `translateY(${props.inverted ? '' : '-'}${100 - percent.value}%)`
119
- }
101
+ transform: `translateY(${props.inverted ? "" : "-"}${100 - percent.value}%)`
102
+ };
120
103
  } else {
121
- if (dir.value === 'rtl') {
104
+ if (dir.value === "rtl") {
122
105
  return {
123
- transform: `translateX(${props.inverted ? '-' : ''}${100 - percent.value}%)`
124
- }
106
+ transform: `translateX(${props.inverted ? "-" : ""}${100 - percent.value}%)`
107
+ };
125
108
  } else {
126
109
  return {
127
- transform: `translateX(${props.inverted ? '' : '-'}${100 - percent.value}%)`
128
- }
110
+ transform: `translateX(${props.inverted ? "" : "-"}${100 - percent.value}%)`
111
+ };
129
112
  }
130
113
  }
131
- })
132
-
114
+ });
133
115
  const statusStyle = computed(() => {
134
116
  return {
135
- [props.orientation === 'vertical' ? 'height' : 'width']: percent.value ? `${percent.value}%` : 'fit-content'
136
- }
137
- })
138
-
139
- function isActive(index: number) {
140
- return index === Number(props.modelValue)
117
+ [props.orientation === "vertical" ? "height" : "width"]: percent.value ? `${percent.value}%` : "fit-content"
118
+ };
119
+ });
120
+ function isActive(index) {
121
+ return index === Number(props.modelValue);
141
122
  }
142
-
143
- function isFirst(index: number) {
144
- return index === 0
123
+ function isFirst(index) {
124
+ return index === 0;
145
125
  }
146
-
147
- function isLast(index: number) {
148
- return index === realMax.value
126
+ function isLast(index) {
127
+ return index === realMax.value;
149
128
  }
150
-
151
- function stepVariant(index: number | string) {
152
- index = Number(index)
153
-
129
+ function stepVariant(index) {
130
+ index = Number(index);
154
131
  if (isActive(index) && !isFirst(index)) {
155
- return 'active'
132
+ return "active";
156
133
  }
157
-
158
134
  if (isFirst(index) && isActive(index)) {
159
- return 'first'
135
+ return "first";
160
136
  }
161
-
162
137
  if (isLast(index) && isActive(index)) {
163
- return 'last'
138
+ return "last";
164
139
  }
165
-
166
- return 'other'
140
+ return "other";
167
141
  }
168
-
169
142
  const b24ui = computed(() => progress({
170
143
  animation: props.animation,
171
144
  size: props.size,
172
145
  color: props.color,
173
146
  orientation: props.orientation,
174
147
  inverted: props.inverted
175
- }))
148
+ }));
176
149
  </script>
177
150
 
178
151
  <template>