@bitrix24/b24ui-nuxt 0.5.10 → 0.5.11
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.
- package/dist/meta.cjs +72112 -0
- package/dist/meta.d.cts +72110 -0
- package/dist/meta.d.mts +5060 -5060
- package/dist/meta.d.ts +72110 -0
- package/dist/meta.mjs +5060 -5060
- package/dist/module.cjs +63 -0
- package/dist/module.d.cts +15 -0
- package/dist/module.d.ts +15 -0
- package/dist/module.json +3 -3
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Advice.vue +54 -47
- package/dist/runtime/components/Alert.vue +96 -71
- package/dist/runtime/components/App.vue +34 -37
- package/dist/runtime/components/Avatar.vue +81 -69
- package/dist/runtime/components/AvatarGroup.vue +76 -53
- package/dist/runtime/components/Badge.vue +83 -83
- package/dist/runtime/components/Button.vue +157 -220
- package/dist/runtime/components/ButtonGroup.vue +51 -35
- package/dist/runtime/components/Calendar.vue +152 -186
- package/dist/runtime/components/Checkbox.vue +73 -84
- package/dist/runtime/components/Chip.vue +74 -59
- package/dist/runtime/components/Collapsible.vue +41 -44
- package/dist/runtime/components/Container.vue +27 -18
- package/dist/runtime/components/Countdown.vue +378 -198
- package/dist/runtime/components/DescriptionList.vue +149 -102
- package/dist/runtime/components/DropdownMenu.vue +139 -83
- package/dist/runtime/components/DropdownMenuContent.vue +84 -137
- package/dist/runtime/components/Form.vue +216 -162
- package/dist/runtime/components/FormField.vue +80 -76
- package/dist/runtime/components/Input.vue +179 -160
- package/dist/runtime/components/InputMenu.vue +380 -300
- package/dist/runtime/components/InputNumber.vue +175 -178
- package/dist/runtime/components/Kbd.vue +45 -33
- package/dist/runtime/components/Link.vue +173 -179
- package/dist/runtime/components/LinkBase.vue +42 -64
- package/dist/runtime/components/Modal.vue +127 -105
- package/dist/runtime/components/ModalDialogClose.vue +8 -4
- package/dist/runtime/components/Navbar.vue +33 -24
- package/dist/runtime/components/NavbarDivider.vue +33 -24
- package/dist/runtime/components/NavbarSection.vue +33 -24
- package/dist/runtime/components/NavbarSpacer.vue +33 -24
- package/dist/runtime/components/NavigationMenu.vue +210 -144
- package/dist/runtime/components/OverlayProvider.vue +17 -13
- package/dist/runtime/components/Popover.vue +81 -81
- package/dist/runtime/components/Progress.vue +136 -109
- package/dist/runtime/components/RadioGroup.vue +134 -120
- package/dist/runtime/components/Range.vue +85 -94
- package/dist/runtime/components/Select.vue +260 -212
- package/dist/runtime/components/SelectMenu.vue +365 -272
- package/dist/runtime/components/Separator.vue +71 -61
- package/dist/runtime/components/Sidebar.vue +33 -24
- package/dist/runtime/components/SidebarBody.vue +38 -30
- package/dist/runtime/components/SidebarFooter.vue +33 -24
- package/dist/runtime/components/SidebarHeader.vue +33 -24
- package/dist/runtime/components/SidebarHeading.vue +33 -24
- package/dist/runtime/components/SidebarLayout.vue +70 -40
- package/dist/runtime/components/SidebarSection.vue +33 -24
- package/dist/runtime/components/SidebarSpacer.vue +33 -24
- package/dist/runtime/components/Skeleton.vue +22 -17
- package/dist/runtime/components/Slideover.vue +131 -108
- package/dist/runtime/components/StackedLayout.vue +73 -40
- package/dist/runtime/components/Switch.vue +95 -100
- package/dist/runtime/components/Tabs.vue +107 -81
- package/dist/runtime/components/Textarea.vue +201 -177
- package/dist/runtime/components/Toast.vue +105 -94
- package/dist/runtime/components/Toaster.vue +116 -94
- package/dist/runtime/components/Tooltip.vue +64 -78
- package/dist/runtime/components/content/TableWrapper.vue +70 -58
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useComponentIcons.d.ts +3 -3
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/prose/A.vue +23 -18
- package/dist/runtime/prose/Blockquote.vue +23 -18
- package/dist/runtime/prose/Code.vue +31 -23
- package/dist/runtime/prose/Em.vue +23 -18
- package/dist/runtime/prose/H1.vue +23 -18
- package/dist/runtime/prose/H2.vue +23 -18
- package/dist/runtime/prose/H3.vue +23 -18
- package/dist/runtime/prose/H4.vue +23 -18
- package/dist/runtime/prose/H5.vue +23 -18
- package/dist/runtime/prose/H6.vue +23 -18
- package/dist/runtime/prose/Hr.vue +19 -18
- package/dist/runtime/prose/Img.vue +23 -18
- package/dist/runtime/prose/Li.vue +23 -18
- package/dist/runtime/prose/Ol.vue +23 -18
- package/dist/runtime/prose/P.vue +23 -18
- package/dist/runtime/prose/Pre.vue +33 -28
- package/dist/runtime/prose/Strong.vue +23 -18
- package/dist/runtime/prose/Table.vue +54 -44
- package/dist/runtime/prose/Tbody.vue +23 -18
- package/dist/runtime/prose/Td.vue +23 -18
- package/dist/runtime/prose/Th.vue +23 -18
- package/dist/runtime/prose/Thead.vue +23 -18
- package/dist/runtime/prose/Tr.vue +23 -18
- package/dist/runtime/prose/Ul.vue +23 -18
- package/dist/runtime/vue/components/Link.vue +202 -201
- package/dist/shared/b24ui-nuxt.DrKwIWoc.cjs +7721 -0
- package/dist/types.d.mts +5 -3
- package/dist/types.d.ts +7 -0
- package/dist/unplugin.cjs +236 -0
- package/dist/unplugin.d.cts +33 -0
- package/dist/unplugin.d.ts +33 -0
- package/dist/vite.cjs +21 -0
- package/dist/vite.d.cts +14 -0
- package/dist/vite.d.ts +14 -0
- package/package.json +25 -13
- package/dist/runtime/components/Advice.vue.d.ts +0 -170
- package/dist/runtime/components/Alert.vue.d.ts +0 -464
- package/dist/runtime/components/App.vue.d.ts +0 -23
- package/dist/runtime/components/Avatar.vue.d.ts +0 -281
- package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -204
- package/dist/runtime/components/Badge.vue.d.ts +0 -517
- package/dist/runtime/components/Button.vue.d.ts +0 -640
- package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -116
- package/dist/runtime/components/Calendar.vue.d.ts +0 -437
- package/dist/runtime/components/Checkbox.vue.d.ts +0 -354
- package/dist/runtime/components/Chip.vue.d.ts +0 -271
- package/dist/runtime/components/Collapsible.vue.d.ts +0 -118
- package/dist/runtime/components/Container.vue.d.ts +0 -27
- package/dist/runtime/components/Countdown.vue.d.ts +0 -356
- package/dist/runtime/components/DescriptionList.vue.d.ts +0 -379
- package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -533
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -228
- package/dist/runtime/components/Form.vue.d.ts +0 -55
- package/dist/runtime/components/FormField.vue.d.ts +0 -282
- package/dist/runtime/components/Input.vue.d.ts +0 -755
- package/dist/runtime/components/InputMenu.vue.d.ts +0 -1504
- package/dist/runtime/components/InputNumber.vue.d.ts +0 -658
- package/dist/runtime/components/Kbd.vue.d.ts +0 -109
- package/dist/runtime/components/Link.vue.d.ts +0 -129
- package/dist/runtime/components/LinkBase.vue.d.ts +0 -48
- package/dist/runtime/components/Modal.vue.d.ts +0 -327
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +0 -10
- package/dist/runtime/components/Navbar.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarDivider.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarSection.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +0 -101
- package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -824
- package/dist/runtime/components/OverlayProvider.vue.d.ts +0 -2
- package/dist/runtime/components/Popover.vue.d.ts +0 -147
- package/dist/runtime/components/Progress.vue.d.ts +0 -592
- package/dist/runtime/components/RadioGroup.vue.d.ts +0 -723
- package/dist/runtime/components/Range.vue.d.ts +0 -417
- package/dist/runtime/components/Select.vue.d.ts +0 -1200
- package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1298
- package/dist/runtime/components/Separator.vue.d.ts +0 -400
- package/dist/runtime/components/Sidebar.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarBody.vue.d.ts +0 -90
- package/dist/runtime/components/SidebarFooter.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarHeader.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarHeading.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarLayout.vue.d.ts +0 -222
- package/dist/runtime/components/SidebarSection.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +0 -101
- package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
- package/dist/runtime/components/Slideover.vue.d.ts +0 -360
- package/dist/runtime/components/StackedLayout.vue.d.ts +0 -192
- package/dist/runtime/components/Switch.vue.d.ts +0 -587
- package/dist/runtime/components/Tabs.vue.d.ts +0 -453
- package/dist/runtime/components/Textarea.vue.d.ts +0 -601
- package/dist/runtime/components/Toast.vue.d.ts +0 -438
- package/dist/runtime/components/Toaster.vue.d.ts +0 -219
- package/dist/runtime/components/Tooltip.vue.d.ts +0 -186
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +0 -237
- package/dist/runtime/prose/A.vue.d.ts +0 -84
- package/dist/runtime/prose/Blockquote.vue.d.ts +0 -84
- package/dist/runtime/prose/Code.vue.d.ts +0 -97
- package/dist/runtime/prose/Em.vue.d.ts +0 -84
- package/dist/runtime/prose/H1.vue.d.ts +0 -97
- package/dist/runtime/prose/H2.vue.d.ts +0 -123
- package/dist/runtime/prose/H3.vue.d.ts +0 -123
- package/dist/runtime/prose/H4.vue.d.ts +0 -123
- package/dist/runtime/prose/H5.vue.d.ts +0 -123
- package/dist/runtime/prose/H6.vue.d.ts +0 -123
- package/dist/runtime/prose/Hr.vue.d.ts +0 -74
- package/dist/runtime/prose/Img.vue.d.ts +0 -77
- package/dist/runtime/prose/Li.vue.d.ts +0 -84
- package/dist/runtime/prose/Ol.vue.d.ts +0 -84
- package/dist/runtime/prose/P.vue.d.ts +0 -84
- package/dist/runtime/prose/Pre.vue.d.ts +0 -117
- package/dist/runtime/prose/Strong.vue.d.ts +0 -84
- package/dist/runtime/prose/Table.vue.d.ts +0 -144
- package/dist/runtime/prose/Tbody.vue.d.ts +0 -84
- package/dist/runtime/prose/Td.vue.d.ts +0 -84
- package/dist/runtime/prose/Th.vue.d.ts +0 -84
- package/dist/runtime/prose/Thead.vue.d.ts +0 -84
- package/dist/runtime/prose/Tr.vue.d.ts +0 -84
- package/dist/runtime/prose/Ul.vue.d.ts +0 -84
- package/dist/runtime/vue/components/Link.vue.d.ts +0 -129
|
@@ -1,92 +1,114 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { ToastProviderProps } from 'reka-ui'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/b24ui/toaster'
|
|
7
|
+
import { tv } from '../utils/tv'
|
|
8
|
+
|
|
9
|
+
const appConfigToaster = _appConfig as AppConfig & { b24ui: { toaster: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const toaster = tv({ extend: tv(theme), ...(appConfigToaster.b24ui?.toaster || {}) })
|
|
12
|
+
|
|
13
|
+
type ToasterVariants = VariantProps<typeof toaster>
|
|
14
|
+
|
|
15
|
+
export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
|
|
16
|
+
/**
|
|
17
|
+
* The position on the screen to display the toasts.
|
|
18
|
+
* @defaultValue 'top-right'
|
|
19
|
+
*/
|
|
20
|
+
position?: ToasterVariants['position']
|
|
21
|
+
/**
|
|
22
|
+
* Expand the toasts to show multiple toasts at once.
|
|
23
|
+
* @defaultValue true
|
|
24
|
+
*/
|
|
25
|
+
expand?: boolean
|
|
26
|
+
/**
|
|
27
|
+
* Render the toaster in a portal.
|
|
28
|
+
* @defaultValue true
|
|
29
|
+
*/
|
|
30
|
+
portal?: boolean
|
|
31
|
+
/**
|
|
32
|
+
* @defaultValue 5000
|
|
33
|
+
*/
|
|
34
|
+
duration?: number
|
|
35
|
+
class?: any
|
|
36
|
+
b24ui?: Partial<typeof toaster.slots>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ToasterSlots {
|
|
40
|
+
default(props?: {}): any
|
|
41
|
+
}
|
|
42
|
+
|
|
7
43
|
export default {
|
|
8
|
-
name:
|
|
9
|
-
}
|
|
44
|
+
name: 'Toaster'
|
|
45
|
+
}
|
|
10
46
|
</script>
|
|
11
47
|
|
|
12
|
-
<script setup>
|
|
13
|
-
import { ref, computed } from
|
|
14
|
-
import { useForwardProps } from
|
|
15
|
-
import { reactivePick } from
|
|
16
|
-
import { useToast } from
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
expand:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
class: {
|
|
39
|
-
type: null,
|
|
40
|
-
required: false
|
|
41
|
-
},
|
|
42
|
-
b24ui: {
|
|
43
|
-
type: Object,
|
|
44
|
-
required: false
|
|
45
|
-
},
|
|
46
|
-
label: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: false
|
|
49
|
-
},
|
|
50
|
-
swipeThreshold: {
|
|
51
|
-
type: Number,
|
|
52
|
-
required: false
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
defineSlots();
|
|
56
|
-
const providerProps = useForwardProps(reactivePick(props, "duration", "label", "swipeThreshold"));
|
|
57
|
-
const { toasts, remove } = useToast();
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import { ref, computed } from 'vue'
|
|
50
|
+
import { ToastProvider, ToastViewport, ToastPortal, useForwardProps } from 'reka-ui'
|
|
51
|
+
import { reactivePick } from '@vueuse/core'
|
|
52
|
+
import { useToast } from '../composables/useToast'
|
|
53
|
+
import type { Toast } from '../composables/useToast'
|
|
54
|
+
import { omit } from '../utils'
|
|
55
|
+
import B24Toast from './Toast.vue'
|
|
56
|
+
|
|
57
|
+
const props = withDefaults(defineProps<ToasterProps>(), {
|
|
58
|
+
position: 'top-right' as const,
|
|
59
|
+
expand: true,
|
|
60
|
+
duration: 5000,
|
|
61
|
+
portal: true
|
|
62
|
+
})
|
|
63
|
+
defineSlots<ToasterSlots>()
|
|
64
|
+
|
|
65
|
+
const providerProps = useForwardProps(reactivePick(props, 'duration', 'label', 'swipeThreshold'))
|
|
66
|
+
|
|
67
|
+
const proxyToastProps = (toast: Toast) => {
|
|
68
|
+
return omit(toast, ['id', 'close'])
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const { toasts, remove } = useToast()
|
|
72
|
+
|
|
58
73
|
const swipeDirection = computed(() => {
|
|
59
74
|
switch (props.position) {
|
|
60
|
-
case
|
|
61
|
-
return
|
|
62
|
-
case
|
|
63
|
-
case
|
|
64
|
-
return
|
|
65
|
-
case
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
case
|
|
69
|
-
return
|
|
75
|
+
case 'top-center':
|
|
76
|
+
return 'up'
|
|
77
|
+
case 'top-right':
|
|
78
|
+
case 'bottom-right':
|
|
79
|
+
return 'right'
|
|
80
|
+
case 'bottom-center':
|
|
81
|
+
return 'down'
|
|
82
|
+
case 'top-left':
|
|
83
|
+
case 'bottom-left':
|
|
84
|
+
return 'left'
|
|
70
85
|
}
|
|
71
|
-
return
|
|
72
|
-
})
|
|
86
|
+
return 'right'
|
|
87
|
+
})
|
|
88
|
+
|
|
73
89
|
const b24ui = computed(() => toaster({
|
|
74
90
|
position: props.position,
|
|
75
91
|
swipeDirection: swipeDirection.value
|
|
76
|
-
}))
|
|
77
|
-
|
|
92
|
+
}))
|
|
93
|
+
|
|
94
|
+
function onUpdateOpen(value: boolean, id: string | number) {
|
|
78
95
|
if (value) {
|
|
79
|
-
return
|
|
96
|
+
return
|
|
80
97
|
}
|
|
81
|
-
|
|
98
|
+
|
|
99
|
+
remove(id)
|
|
82
100
|
}
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
101
|
+
|
|
102
|
+
const hovered = ref(false)
|
|
103
|
+
const expanded = computed(() => props.expand || hovered.value)
|
|
104
|
+
|
|
105
|
+
const refs = ref<{ height: number }[]>([])
|
|
106
|
+
|
|
107
|
+
const height = computed(() => refs.value.reduce((acc, { height }) => acc + height + 16, 0))
|
|
108
|
+
const frontHeight = computed(() => refs.value[refs.value.length - 1]?.height || 0)
|
|
109
|
+
|
|
110
|
+
function getOffset(index: number) {
|
|
111
|
+
return refs.value.slice(index + 1).reduce((acc, { height }) => acc + height + 16, 0)
|
|
90
112
|
}
|
|
91
113
|
</script>
|
|
92
114
|
|
|
@@ -98,21 +120,21 @@ function getOffset(index) {
|
|
|
98
120
|
v-for="(toast, index) in toasts"
|
|
99
121
|
:key="toast.id"
|
|
100
122
|
ref="refs"
|
|
101
|
-
v-bind="
|
|
102
|
-
:close="toast.close"
|
|
123
|
+
v-bind="proxyToastProps(toast)"
|
|
124
|
+
:close="(toast.close as boolean)"
|
|
103
125
|
:data-expanded="expanded"
|
|
104
126
|
:data-front="!expanded && index === toasts.length - 1"
|
|
105
127
|
:style="{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}"
|
|
128
|
+
'--index': (index - toasts.length) + toasts.length,
|
|
129
|
+
'--before': toasts.length - 1 - index,
|
|
130
|
+
'--offset': getOffset(index),
|
|
131
|
+
'--scale': expanded ? '1' : 'calc(1 - var(--before) * var(--scale-factor))',
|
|
132
|
+
'--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
|
|
133
|
+
'--transform': 'translateY(var(--translate)) scale(var(--scale))'
|
|
134
|
+
}"
|
|
113
135
|
:class="[b24ui.base(), {
|
|
114
|
-
|
|
115
|
-
}]"
|
|
136
|
+
'cursor-pointer': !!toast.onClick
|
|
137
|
+
}]"
|
|
116
138
|
@update:open="onUpdateOpen($event, toast.id)"
|
|
117
139
|
@click="toast.onClick && toast.onClick(toast)"
|
|
118
140
|
/>
|
|
@@ -122,12 +144,12 @@ function getOffset(index) {
|
|
|
122
144
|
:data-expanded="expanded"
|
|
123
145
|
:class="b24ui.viewport({ class: [props.class, props.b24ui?.viewport] })"
|
|
124
146
|
:style="{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}"
|
|
147
|
+
'--scale-factor': '0.05',
|
|
148
|
+
'--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
|
|
149
|
+
'--gap': position?.startsWith('top') ? '16px' : '-16px',
|
|
150
|
+
'--front-height': `${frontHeight}px`,
|
|
151
|
+
'--height': `${height}px`
|
|
152
|
+
}"
|
|
131
153
|
@mouseenter="hovered = true"
|
|
132
154
|
@mouseleave="hovered = false"
|
|
133
155
|
/>
|
|
@@ -1,83 +1,69 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps } from 'reka-ui'
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
+
import _appConfig from '#build/app.config'
|
|
5
|
+
import theme from '#build/b24ui/tooltip'
|
|
6
|
+
import { tv } from '../utils/tv'
|
|
7
|
+
import type { KbdProps } from '../types'
|
|
8
|
+
import type { EmitsToProps } from '../types/utils'
|
|
9
|
+
|
|
10
|
+
const appConfigTooltip = _appConfig as AppConfig & { b24ui: { tooltip: Partial<typeof theme> } }
|
|
11
|
+
|
|
12
|
+
const tooltip = tv({ extend: tv(theme), ...(appConfigTooltip.b24ui?.tooltip || {}) })
|
|
13
|
+
|
|
14
|
+
export interface TooltipProps extends TooltipRootProps {
|
|
15
|
+
/** The text content of the tooltip. */
|
|
16
|
+
text?: string
|
|
17
|
+
/** The keyboard keys to display in the tooltip. */
|
|
18
|
+
kbds?: KbdProps['value'][] | KbdProps[]
|
|
19
|
+
/**
|
|
20
|
+
* The content of the tooltip.
|
|
21
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
22
|
+
*/
|
|
23
|
+
content?: Omit<TooltipContentProps, 'as' | 'asChild'> & Partial<EmitsToProps<TooltipContentEmits>>
|
|
24
|
+
/**
|
|
25
|
+
* Display an arrow alongside the tooltip.
|
|
26
|
+
* @defaultValue false
|
|
27
|
+
*/
|
|
28
|
+
arrow?: boolean | Omit<TooltipArrowProps, 'as' | 'asChild'>
|
|
29
|
+
/**
|
|
30
|
+
* Render the tooltip in a portal.
|
|
31
|
+
* @defaultValue true
|
|
32
|
+
*/
|
|
33
|
+
portal?: boolean
|
|
34
|
+
class?: any
|
|
35
|
+
b24ui?: Partial<typeof tooltip.slots>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TooltipEmits extends TooltipRootEmits {}
|
|
39
|
+
|
|
40
|
+
export interface TooltipSlots {
|
|
41
|
+
default(props: { open: boolean }): any
|
|
42
|
+
content(props?: {}): any
|
|
43
|
+
}
|
|
7
44
|
</script>
|
|
8
45
|
|
|
9
|
-
<script setup>
|
|
10
|
-
import { computed, toRef } from
|
|
11
|
-
import { defu } from
|
|
12
|
-
import { useForwardPropsEmits } from
|
|
13
|
-
import { reactivePick } from
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
arrow: {
|
|
28
|
-
type: [Boolean, Object],
|
|
29
|
-
required: false
|
|
30
|
-
},
|
|
31
|
-
portal: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
required: false,
|
|
34
|
-
default: true
|
|
35
|
-
},
|
|
36
|
-
class: {
|
|
37
|
-
type: null,
|
|
38
|
-
required: false
|
|
39
|
-
},
|
|
40
|
-
b24ui: {
|
|
41
|
-
type: Object,
|
|
42
|
-
required: false
|
|
43
|
-
},
|
|
44
|
-
defaultOpen: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
required: false
|
|
47
|
-
},
|
|
48
|
-
open: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
required: false
|
|
51
|
-
},
|
|
52
|
-
delayDuration: {
|
|
53
|
-
type: Number,
|
|
54
|
-
required: false
|
|
55
|
-
},
|
|
56
|
-
disableHoverableContent: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
required: false
|
|
59
|
-
},
|
|
60
|
-
disableClosingTrigger: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
required: false
|
|
63
|
-
},
|
|
64
|
-
disabled: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
required: false
|
|
67
|
-
},
|
|
68
|
-
ignoreNonKeyboardFocus: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
required: false
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const emits = defineEmits(["update:open"]);
|
|
74
|
-
const slots = defineSlots();
|
|
75
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "delayDuration", "disableHoverableContent", "disableClosingTrigger", "disabled", "ignoreNonKeyboardFocus"), emits);
|
|
76
|
-
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
|
|
77
|
-
const arrowProps = toRef(() => props.arrow);
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { computed, toRef } from 'vue'
|
|
48
|
+
import { defu } from 'defu'
|
|
49
|
+
import { TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow, useForwardPropsEmits } from 'reka-ui'
|
|
50
|
+
import { reactivePick } from '@vueuse/core'
|
|
51
|
+
import B24Kbd from './Kbd.vue'
|
|
52
|
+
|
|
53
|
+
const props = withDefaults(defineProps<TooltipProps>(), {
|
|
54
|
+
portal: true
|
|
55
|
+
})
|
|
56
|
+
const emits = defineEmits<TooltipEmits>()
|
|
57
|
+
const slots = defineSlots<TooltipSlots>()
|
|
58
|
+
|
|
59
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultOpen', 'open', 'delayDuration', 'disableHoverableContent', 'disableClosingTrigger', 'disabled', 'ignoreNonKeyboardFocus'), emits)
|
|
60
|
+
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as TooltipContentProps)
|
|
61
|
+
const arrowProps = toRef(() => props.arrow as TooltipArrowProps)
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
78
64
|
const b24ui = computed(() => tooltip({
|
|
79
65
|
side: contentProps.value.side
|
|
80
|
-
}))
|
|
66
|
+
}))
|
|
81
67
|
</script>
|
|
82
68
|
|
|
83
69
|
<template>
|
|
@@ -95,8 +81,8 @@ const b24ui = computed(() => tooltip({
|
|
|
95
81
|
<B24Kbd
|
|
96
82
|
v-for="(kbd, index) in kbds"
|
|
97
83
|
:key="index"
|
|
98
|
-
:size="props.b24ui?.kbdsSize || b24ui.kbdsSize()"
|
|
99
|
-
:depth="props.b24ui?.kbdsDepth || b24ui.kbdsDepth()"
|
|
84
|
+
:size="((props.b24ui?.kbdsSize || b24ui.kbdsSize()) as KbdProps['size'])"
|
|
85
|
+
:depth="((props.b24ui?.kbdsDepth || b24ui.kbdsDepth()) as KbdProps['depth'])"
|
|
100
86
|
v-bind="typeof kbd === 'string' ? { value: kbd } : kbd"
|
|
101
87
|
/>
|
|
102
88
|
</span>
|
|
@@ -1,62 +1,74 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
+
import _appConfig from '#build/app.config'
|
|
5
|
+
import theme from '#build/b24ui/content/table-wrapper'
|
|
6
|
+
import { tv } from '../../utils/tv'
|
|
7
|
+
|
|
8
|
+
const appConfigTableWrapper = _appConfig as AppConfig & { b24ui: { content: { tableWrapper: Partial<typeof theme> } } }
|
|
9
|
+
|
|
10
|
+
const tableWrapper = tv({ extend: tv(theme), ...(appConfigTableWrapper.b24ui?.content?.tableWrapper || {}) })
|
|
11
|
+
|
|
12
|
+
type TableWrapperVariants = VariantProps<typeof tableWrapper>
|
|
13
|
+
|
|
14
|
+
export interface TableWrapperProps {
|
|
15
|
+
/**
|
|
16
|
+
* The element or component this component should render as.
|
|
17
|
+
* @defaultValue 'div'
|
|
18
|
+
*/
|
|
19
|
+
as?: any
|
|
20
|
+
/**
|
|
21
|
+
* @defaultValue 'md'
|
|
22
|
+
*/
|
|
23
|
+
size?: TableWrapperVariants['size']
|
|
24
|
+
/**
|
|
25
|
+
* @defaultValue false
|
|
26
|
+
*/
|
|
27
|
+
rounded?: boolean
|
|
28
|
+
/**
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
31
|
+
zebra?: boolean
|
|
32
|
+
/**
|
|
33
|
+
* @defaultValue false
|
|
34
|
+
*/
|
|
35
|
+
pinRows?: boolean
|
|
36
|
+
/**
|
|
37
|
+
* @defaultValue false
|
|
38
|
+
*/
|
|
39
|
+
pinCols?: boolean
|
|
40
|
+
/**
|
|
41
|
+
* @defaultValue false
|
|
42
|
+
*/
|
|
43
|
+
rowHover?: boolean
|
|
44
|
+
/**
|
|
45
|
+
* @defaultValue false
|
|
46
|
+
*/
|
|
47
|
+
bordered?: boolean
|
|
48
|
+
/**
|
|
49
|
+
* @defaultValue true
|
|
50
|
+
*/
|
|
51
|
+
scrollbarThin?: boolean
|
|
52
|
+
class?: any
|
|
53
|
+
b24ui?: Partial<typeof tableWrapper.slots>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface TableWrapperSlots {
|
|
57
|
+
default(props?: {}): any
|
|
58
|
+
}
|
|
7
59
|
</script>
|
|
8
60
|
|
|
9
|
-
<script setup>
|
|
10
|
-
import { computed } from
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
required: false
|
|
21
|
-
},
|
|
22
|
-
rounded: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
required: false
|
|
25
|
-
},
|
|
26
|
-
zebra: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
required: false
|
|
29
|
-
},
|
|
30
|
-
pinRows: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
required: false
|
|
33
|
-
},
|
|
34
|
-
pinCols: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
rowHover: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
required: false
|
|
41
|
-
},
|
|
42
|
-
bordered: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
required: false
|
|
45
|
-
},
|
|
46
|
-
scrollbarThin: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
required: false,
|
|
49
|
-
default: true
|
|
50
|
-
},
|
|
51
|
-
class: {
|
|
52
|
-
type: null,
|
|
53
|
-
required: false
|
|
54
|
-
},
|
|
55
|
-
b24ui: {
|
|
56
|
-
type: Object,
|
|
57
|
-
required: false
|
|
58
|
-
}
|
|
59
|
-
});
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { computed } from 'vue'
|
|
63
|
+
import { Primitive } from 'reka-ui'
|
|
64
|
+
|
|
65
|
+
defineOptions({ inheritAttrs: false })
|
|
66
|
+
|
|
67
|
+
const props = withDefaults(defineProps<TableWrapperProps>(), {
|
|
68
|
+
as: 'div',
|
|
69
|
+
scrollbarThin: true
|
|
70
|
+
})
|
|
71
|
+
|
|
60
72
|
const b24ui = computed(() => tableWrapper({
|
|
61
73
|
size: props.size,
|
|
62
74
|
rounded: Boolean(props.rounded),
|
|
@@ -66,7 +78,7 @@ const b24ui = computed(() => tableWrapper({
|
|
|
66
78
|
rowHover: Boolean(props.rowHover),
|
|
67
79
|
bordered: Boolean(props.bordered),
|
|
68
80
|
scrollbarThin: Boolean(props.scrollbarThin)
|
|
69
|
-
}))
|
|
81
|
+
}))
|
|
70
82
|
</script>
|
|
71
83
|
|
|
72
84
|
<template>
|
|
@@ -6,5 +6,5 @@ export declare const avatarGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
|
6
6
|
export declare function useAvatarGroup(props: {
|
|
7
7
|
size: AvatarGroupProps['size'];
|
|
8
8
|
}): {
|
|
9
|
-
size: ComputedRef<
|
|
9
|
+
size: ComputedRef<any>;
|
|
10
10
|
};
|
|
@@ -10,8 +10,8 @@ type Props<T> = {
|
|
|
10
10
|
size?: GetObjectField<T, 'size'>;
|
|
11
11
|
};
|
|
12
12
|
export declare function useButtonGroup<T>(props: Props<T>): {
|
|
13
|
-
orientation: ComputedRef<
|
|
14
|
-
size: ComputedRef<
|
|
13
|
+
orientation: ComputedRef<any>;
|
|
14
|
+
size: ComputedRef<any>;
|
|
15
15
|
noSplit: ComputedRef<boolean>;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
|
@@ -20,8 +20,8 @@ export interface UseComponentIconsProps {
|
|
|
20
20
|
trailingIcon?: IconComponent;
|
|
21
21
|
}
|
|
22
22
|
export declare function useComponentIcons(componentProps: MaybeRefOrGetter<UseComponentIconsProps>): {
|
|
23
|
-
isLeading: import("vue").ComputedRef<
|
|
23
|
+
isLeading: import("vue").ComputedRef<any>;
|
|
24
24
|
isTrailing: import("vue").ComputedRef<boolean>;
|
|
25
|
-
leadingIconName: import("vue").ComputedRef<
|
|
26
|
-
trailingIconName: import("vue").ComputedRef<
|
|
25
|
+
leadingIconName: import("vue").ComputedRef<IconComponent | undefined>;
|
|
26
|
+
trailingIconName: import("vue").ComputedRef<IconComponent | undefined>;
|
|
27
27
|
};
|
|
@@ -26,7 +26,7 @@ export declare function useFormField<T>(props?: Props<T>, opts?: {
|
|
|
26
26
|
}): {
|
|
27
27
|
id: ComputedRef<string | undefined>;
|
|
28
28
|
name: ComputedRef<string | undefined>;
|
|
29
|
-
size: ComputedRef<
|
|
29
|
+
size: ComputedRef<any>;
|
|
30
30
|
color: ComputedRef<"danger" | GetObjectField<T, "color"> | undefined>;
|
|
31
31
|
highlight: ComputedRef<boolean | undefined>;
|
|
32
32
|
disabled: ComputedRef<boolean | undefined>;
|
package/dist/runtime/prose/A.vue
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
3
|
+
import _appConfig from '#build/app.config'
|
|
4
|
+
import theme from '#build/b24ui/prose/a'
|
|
5
|
+
import { tv } from '../utils/tv'
|
|
6
|
+
|
|
7
|
+
const appConfigProseA = _appConfig as AppConfig & { b24ui: { prose: { a: Partial<typeof theme> } } }
|
|
8
|
+
|
|
9
|
+
const proseA = tv({ extend: tv(theme), ...(appConfigProseA.b24ui?.prose?.a || {}) })
|
|
10
|
+
|
|
11
|
+
export interface proseAProps {
|
|
12
|
+
class?: any
|
|
13
|
+
b24ui?: Partial<typeof proseA.slots>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface proseASlots {
|
|
17
|
+
default(props?: {}): any
|
|
18
|
+
}
|
|
7
19
|
</script>
|
|
8
20
|
|
|
9
|
-
<script setup>
|
|
10
|
-
const props = defineProps(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
b24ui: {
|
|
16
|
-
type: Object,
|
|
17
|
-
required: false
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const b24ui = proseA({});
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
const props = defineProps<proseAProps>()
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
25
|
+
const b24ui = proseA({})
|
|
21
26
|
</script>
|
|
22
27
|
|
|
23
28
|
<template>
|