@aleph-alpha/ui-library 1.21.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/system/index.d.ts +1520 -674
- package/dist/system/lib.js +21142 -19505
- package/package.json +3 -3
- package/src/components/UiAlertDialog/UiAlertDialog.stories.ts +135 -13
- package/src/components/UiAlertDialog/UiAlertDialog.vue +8 -7
- package/src/components/UiAlertDialog/UiAlertDialogHeader.vue +1 -1
- package/src/components/UiAlertDialog/__tests__/UiAlertDialog.test.ts +16 -16
- package/src/components/UiAlertDialog/types.ts +18 -0
- package/src/components/UiDialog/UiDialog.stories.ts +717 -0
- package/src/components/UiDialog/UiDialog.vue +19 -0
- package/src/components/UiDialog/UiDialogClose.vue +16 -0
- package/src/components/UiDialog/UiDialogContent.vue +108 -0
- package/src/components/UiDialog/UiDialogDescription.vue +16 -0
- package/src/components/UiDialog/UiDialogFooter.vue +16 -0
- package/src/components/UiDialog/UiDialogHeader.vue +16 -0
- package/src/components/UiDialog/UiDialogTitle.vue +16 -0
- package/src/components/UiDialog/UiDialogTrigger.vue +16 -0
- package/src/components/UiDialog/__tests__/UiDialog.test.ts +328 -0
- package/src/components/UiDialog/index.ts +13 -0
- package/src/components/UiDialog/types.ts +136 -0
- package/src/components/UiFileItem/UiFileItem.stories.ts +268 -0
- package/src/components/UiFileItem/UiFileItem.vue +119 -0
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +66 -0
- package/src/components/UiFileItem/index.ts +2 -0
- package/src/components/UiFileItem/types.ts +27 -0
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +117 -0
- package/src/components/UiFileUploadBox/UiFileUploadBox.vue +230 -0
- package/src/components/UiFileUploadBox/__tests__/file-validation.test.ts +46 -0
- package/src/components/UiFileUploadBox/file-validation.ts +73 -0
- package/src/components/UiFileUploadBox/index.ts +7 -0
- package/src/components/UiFileUploadBox/types.ts +96 -0
- package/src/components/UiIconButton/UiIconButton.vue +5 -1
- package/src/components/UiIconButton/types.ts +1 -1
- package/src/components/UiItem/UiItem.vue +7 -1
- package/src/components/UiItem/types.ts +7 -0
- package/src/components/core/alert-dialog/AlertDialog.vue +1 -1
- package/src/components/core/alert-dialog/AlertDialogAction.vue +2 -6
- package/src/components/core/alert-dialog/AlertDialogCancel.vue +3 -7
- package/src/components/core/alert-dialog/AlertDialogContent.vue +15 -7
- package/src/components/core/alert-dialog/AlertDialogDescription.vue +3 -7
- package/src/components/core/alert-dialog/AlertDialogFooter.vue +1 -6
- package/src/components/core/alert-dialog/AlertDialogHeader.vue +1 -9
- package/src/components/core/alert-dialog/AlertDialogTitle.vue +3 -7
- package/src/components/core/button/index.ts +6 -4
- package/src/components/core/dialog/Dialog.vue +15 -0
- package/src/components/core/dialog/DialogClose.vue +12 -0
- package/src/components/core/dialog/DialogContent.vue +48 -0
- package/src/components/core/dialog/DialogDescription.vue +17 -0
- package/src/components/core/dialog/DialogFooter.vue +12 -0
- package/src/components/core/dialog/DialogHeader.vue +9 -0
- package/src/components/core/dialog/DialogOverlay.vue +23 -0
- package/src/components/core/dialog/DialogTitle.vue +17 -0
- package/src/components/core/dialog/DialogTrigger.vue +12 -0
- package/src/components/core/dialog/index.ts +9 -0
- package/src/components/core/drawer/DrawerContent.vue +1 -1
- package/src/components/core/item/Item.vue +7 -4
- package/src/components/core/progress/Progress.vue +7 -2
- package/src/components/core/sheet/SheetOverlay.vue +1 -1
- package/src/components/core/sidebar/SidebarContent.vue +11 -3
- package/src/components/core/sidebar/SidebarFooter.vue +10 -2
- package/src/components/core/sidebar/SidebarGroup.vue +10 -2
- package/src/components/core/sidebar/SidebarGroupLabel.vue +1 -1
- package/src/components/core/sidebar/SidebarHeader.vue +10 -2
- package/src/components/core/sidebar/SidebarMenu.vue +12 -2
- package/src/components/core/sidebar/SidebarMenuButton.vue +2 -2
- package/src/components/core/sidebar/SidebarSeparator.vue +10 -2
- package/src/components/core/sidebar/SidebarTrigger.vue +2 -2
- package/src/components/core/sidebar/index.ts +1 -1
- package/src/components/core/sidebar/utils.ts +11 -2
- package/src/components/index.ts +3 -1
- package/src/directives/index.ts +1 -0
- package/src/directives/vOverlay.ts +94 -0
- package/src/patterns/UiFileUpload/UiFileUpload.stories.ts +768 -0
- package/src/patterns/UiFileUpload/UiFileUpload.vue +46 -0
- package/src/patterns/UiFileUpload/__tests__/UiFileUpload.test.ts +123 -0
- package/src/patterns/UiFileUpload/index.ts +8 -0
- package/src/patterns/UiFileUpload/types.ts +12 -0
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +346 -0
- package/src/{components → patterns}/UiSidebar/UiSidebar.vue +9 -3
- package/src/patterns/UiSidebar/UiSidebarChatHistory.stories.ts +77 -0
- package/src/patterns/UiSidebar/UiSidebarChatHistory.vue +35 -0
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.stories.ts +85 -0
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.vue +139 -0
- package/src/patterns/UiSidebar/UiSidebarContent.vue +11 -0
- package/src/patterns/UiSidebar/UiSidebarFooter.vue +11 -0
- package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +91 -0
- package/src/patterns/UiSidebar/UiSidebarGroup.vue +42 -0
- package/src/patterns/UiSidebar/UiSidebarGroupContent.vue +15 -0
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +163 -0
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +131 -0
- package/src/patterns/UiSidebar/UiSidebarHeader.vue +48 -0
- package/src/patterns/UiSidebar/UiSidebarInset.vue +11 -0
- package/src/patterns/UiSidebar/UiSidebarMenu.vue +11 -0
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +205 -0
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +121 -0
- package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +67 -0
- package/src/patterns/UiSidebar/UiSidebarMenuItem.vue +11 -0
- package/src/patterns/UiSidebar/UiSidebarMenuSub.vue +38 -0
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.stories.ts +66 -0
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +67 -0
- package/src/patterns/UiSidebar/UiSidebarPopover.vue +43 -0
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.stories.ts +56 -0
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.vue +56 -0
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.stories.ts +42 -0
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +79 -0
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +61 -0
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +81 -0
- package/src/patterns/UiSidebar/UiSidebarProvider.vue +11 -0
- package/src/patterns/UiSidebar/UiSidebarRail.vue +9 -0
- package/src/patterns/UiSidebar/UiSidebarTrigger.vue +35 -0
- package/src/patterns/UiSidebar/groupContext.ts +9 -0
- package/src/patterns/UiSidebar/index.ts +42 -0
- package/src/patterns/UiSidebar/types.ts +375 -0
- package/src/patterns/index.ts +2 -0
- package/src/components/UiSidebar/UiSidebar.stories.ts +0 -1188
- package/src/components/UiSidebar/UiSidebarGroupAction.vue +0 -18
- package/src/components/UiSidebar/UiSidebarGroupLabel.vue +0 -18
- package/src/components/UiSidebar/UiSidebarHeaderTrigger.vue +0 -53
- package/src/components/UiSidebar/UiSidebarInput.vue +0 -14
- package/src/components/UiSidebar/UiSidebarMenuAction.vue +0 -19
- package/src/components/UiSidebar/UiSidebarMenuButton.vue +0 -27
- package/src/components/UiSidebar/UiSidebarMenuSkeleton.vue +0 -16
- package/src/components/UiSidebar/UiSidebarMenuSubButton.vue +0 -24
- package/src/components/UiSidebar/UiSidebarProvider.vue +0 -16
- package/src/components/UiSidebar/UiSidebarSeparator.vue +0 -13
- package/src/components/UiSidebar/__tests__/UiSidebar.test.ts +0 -221
- package/src/components/UiSidebar/index.ts +0 -34
- package/src/components/UiSidebar/types.ts +0 -165
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { AlertDialogContentEmits, AlertDialogContentProps } from 'reka-ui';
|
|
3
|
-
import type { HTMLAttributes } from 'vue';
|
|
4
3
|
import { reactiveOmit } from '@vueuse/core';
|
|
5
4
|
import {
|
|
6
5
|
AlertDialogContent,
|
|
@@ -9,15 +8,24 @@
|
|
|
9
8
|
useForwardPropsEmits,
|
|
10
9
|
} from 'reka-ui';
|
|
11
10
|
import { cn } from '@/lib/utils';
|
|
11
|
+
import { UiDialogContentMaxWidth } from '@/components/UiDialog';
|
|
12
12
|
|
|
13
13
|
defineOptions({
|
|
14
14
|
inheritAttrs: false,
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
const props = defineProps<
|
|
17
|
+
const props = defineProps<
|
|
18
|
+
AlertDialogContentProps & {
|
|
19
|
+
/**
|
|
20
|
+
* Tailwind max-width utility applied to the panel (e.g. `max-w-lg` for compact alerts).
|
|
21
|
+
* Omit for full-bleed width within the horizontal margin (`max-w-none`).
|
|
22
|
+
*/
|
|
23
|
+
maxWidth?: UiDialogContentMaxWidth;
|
|
24
|
+
}
|
|
25
|
+
>();
|
|
18
26
|
const emits = defineEmits<AlertDialogContentEmits>();
|
|
19
27
|
|
|
20
|
-
const delegatedProps = reactiveOmit(props, '
|
|
28
|
+
const delegatedProps = reactiveOmit(props, 'maxWidth');
|
|
21
29
|
|
|
22
30
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
23
31
|
</script>
|
|
@@ -26,15 +34,15 @@
|
|
|
26
34
|
<AlertDialogPortal>
|
|
27
35
|
<AlertDialogOverlay
|
|
28
36
|
data-slot="alert-dialog-overlay"
|
|
29
|
-
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-modal-overlay"
|
|
37
|
+
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-overlay-surface-modal-overlay"
|
|
30
38
|
/>
|
|
31
39
|
<AlertDialogContent
|
|
32
40
|
data-slot="alert-dialog-content"
|
|
33
|
-
v-bind="{ ...$attrs
|
|
41
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
34
42
|
:class="
|
|
35
43
|
cn(
|
|
36
|
-
'bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-
|
|
37
|
-
props.
|
|
44
|
+
'bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border-surface-default p-6 shadow-lg duration-200',
|
|
45
|
+
props.maxWidth ?? 'max-w-none',
|
|
38
46
|
)
|
|
39
47
|
"
|
|
40
48
|
>
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { AlertDialogDescriptionProps } from 'reka-ui';
|
|
3
|
-
import type { HTMLAttributes } from 'vue';
|
|
4
|
-
import { reactiveOmit } from '@vueuse/core';
|
|
5
3
|
import { AlertDialogDescription } from 'reka-ui';
|
|
6
4
|
import { cn } from '@/lib/utils';
|
|
7
5
|
|
|
8
|
-
const props = defineProps<AlertDialogDescriptionProps
|
|
9
|
-
|
|
10
|
-
const delegatedProps = reactiveOmit(props, 'class');
|
|
6
|
+
const props = defineProps<AlertDialogDescriptionProps>();
|
|
11
7
|
</script>
|
|
12
8
|
|
|
13
9
|
<template>
|
|
14
10
|
<AlertDialogDescription
|
|
15
11
|
data-slot="alert-dialog-description"
|
|
16
|
-
v-bind="
|
|
17
|
-
:class="cn('
|
|
12
|
+
v-bind="props"
|
|
13
|
+
:class="cn('body-14-normal font-normal text-content-on-surface-muted')"
|
|
18
14
|
>
|
|
19
15
|
<slot />
|
|
20
16
|
</AlertDialogDescription>
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'vue';
|
|
3
2
|
import { cn } from '@/lib/utils';
|
|
4
|
-
|
|
5
|
-
const props = defineProps<{
|
|
6
|
-
class?: HTMLAttributes['class'];
|
|
7
|
-
}>();
|
|
8
3
|
</script>
|
|
9
4
|
|
|
10
5
|
<template>
|
|
11
6
|
<div
|
|
12
7
|
data-slot="alert-dialog-footer"
|
|
13
|
-
:class="cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'
|
|
8
|
+
:class="cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end')"
|
|
14
9
|
>
|
|
15
10
|
<slot />
|
|
16
11
|
</div>
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'vue';
|
|
3
2
|
import { cn } from '@/lib/utils';
|
|
4
|
-
|
|
5
|
-
const props = defineProps<{
|
|
6
|
-
class?: HTMLAttributes['class'];
|
|
7
|
-
}>();
|
|
8
3
|
</script>
|
|
9
4
|
|
|
10
5
|
<template>
|
|
11
|
-
<div
|
|
12
|
-
data-slot="alert-dialog-header"
|
|
13
|
-
:class="cn('flex flex-col gap-2 text-center sm:text-left', props.class)"
|
|
14
|
-
>
|
|
6
|
+
<div data-slot="alert-dialog-header" :class="cn('flex flex-col gap-2 text-center sm:text-left')">
|
|
15
7
|
<slot />
|
|
16
8
|
</div>
|
|
17
9
|
</template>
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { AlertDialogTitleProps } from 'reka-ui';
|
|
3
|
-
import type { HTMLAttributes } from 'vue';
|
|
4
|
-
import { reactiveOmit } from '@vueuse/core';
|
|
5
3
|
import { AlertDialogTitle } from 'reka-ui';
|
|
6
4
|
import { cn } from '@/lib/utils';
|
|
7
5
|
|
|
8
|
-
const props = defineProps<AlertDialogTitleProps
|
|
9
|
-
|
|
10
|
-
const delegatedProps = reactiveOmit(props, 'class');
|
|
6
|
+
const props = defineProps<AlertDialogTitleProps>();
|
|
11
7
|
</script>
|
|
12
8
|
|
|
13
9
|
<template>
|
|
14
10
|
<AlertDialogTitle
|
|
15
11
|
data-slot="alert-dialog-title"
|
|
16
|
-
v-bind="
|
|
17
|
-
:class="cn('text-lg font-semibold'
|
|
12
|
+
v-bind="props"
|
|
13
|
+
:class="cn('text-lg font-semibold text-content-on-surface-primary')"
|
|
18
14
|
>
|
|
19
15
|
<slot />
|
|
20
16
|
</AlertDialogTitle>
|
|
@@ -14,7 +14,7 @@ export const buttonVariants = cva(
|
|
|
14
14
|
outline: 'border border-input bg-transparent text-foreground shadow-xs',
|
|
15
15
|
secondary: 'bg-secondary text-secondary-foreground',
|
|
16
16
|
ghost:
|
|
17
|
-
'text-foreground hover:border-border-button-outlined focus-visible:border-border-button-outlined',
|
|
17
|
+
'rounded-sm text-foreground hover:border-border-button-outlined focus-visible:border-border-button-outlined',
|
|
18
18
|
link: 'text-link overlay-link-hover-subtle',
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
@@ -24,13 +24,15 @@ export const buttonVariants = cva(
|
|
|
24
24
|
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
|
25
25
|
icon: 'size-9',
|
|
26
26
|
'icon-sm': 'size-8',
|
|
27
|
+
'icon-sm-no-padding': 'size-4',
|
|
27
28
|
'icon-lg': 'size-10',
|
|
28
29
|
},
|
|
29
30
|
},
|
|
30
31
|
compoundVariants: [
|
|
31
|
-
{ variant: 'ghost', size: 'icon', class: 'size-auto' },
|
|
32
|
-
{ variant: 'ghost', size: 'icon-sm', class: 'size-
|
|
33
|
-
{ variant: 'ghost', size: 'icon-
|
|
32
|
+
{ variant: 'ghost', size: 'icon', class: 'size-auto p-2' },
|
|
33
|
+
{ variant: 'ghost', size: 'icon-sm', class: 'size-6 p-1' },
|
|
34
|
+
{ variant: 'ghost', size: 'icon-sm-no-padding', class: 'size-4 p-0' },
|
|
35
|
+
{ variant: 'ghost', size: 'icon-lg', class: 'size-auto p-3' },
|
|
34
36
|
],
|
|
35
37
|
defaultVariants: {
|
|
36
38
|
variant: 'default',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogRootEmits, DialogRootProps } from 'reka-ui';
|
|
3
|
+
import { DialogRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogRootProps>();
|
|
6
|
+
const emits = defineEmits<DialogRootEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DialogRoot v-slot="slotProps" data-slot="dialog" v-bind="forwarded">
|
|
13
|
+
<slot v-bind="slotProps" />
|
|
14
|
+
</DialogRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogCloseProps } from 'reka-ui';
|
|
3
|
+
import { DialogClose } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogCloseProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogClose data-slot="dialog-close" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DialogClose>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
4
|
+
import {
|
|
5
|
+
DialogContent as DialogContentPrimitive,
|
|
6
|
+
DialogPortal,
|
|
7
|
+
useForwardPropsEmits,
|
|
8
|
+
} from 'reka-ui';
|
|
9
|
+
import { cn } from '@/lib/utils';
|
|
10
|
+
import DialogOverlay from './DialogOverlay.vue';
|
|
11
|
+
|
|
12
|
+
defineOptions({
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const props = defineProps<
|
|
17
|
+
DialogContentProps & {
|
|
18
|
+
/**
|
|
19
|
+
* Tailwind max-width utility applied to the panel (e.g. `max-w-lg`).
|
|
20
|
+
* @default 'max-w-[50vw]' when omitted (see `UiDialogContent` for the typed preset list).
|
|
21
|
+
*/
|
|
22
|
+
maxWidth?: string;
|
|
23
|
+
}
|
|
24
|
+
>();
|
|
25
|
+
const emits = defineEmits<DialogContentEmits>();
|
|
26
|
+
|
|
27
|
+
const delegatedProps = reactiveOmit(props, 'maxWidth');
|
|
28
|
+
|
|
29
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<DialogPortal>
|
|
34
|
+
<DialogOverlay />
|
|
35
|
+
<DialogContentPrimitive
|
|
36
|
+
data-slot="dialog-content"
|
|
37
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
38
|
+
:class="
|
|
39
|
+
cn(
|
|
40
|
+
'bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border border-border-surface-default p-6 shadow-lg duration-200',
|
|
41
|
+
props.maxWidth ?? 'max-w-[50vw]',
|
|
42
|
+
)
|
|
43
|
+
"
|
|
44
|
+
>
|
|
45
|
+
<slot />
|
|
46
|
+
</DialogContentPrimitive>
|
|
47
|
+
</DialogPortal>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogDescriptionProps } from 'reka-ui';
|
|
3
|
+
import { DialogDescription as DialogDescriptionPrimitive } from 'reka-ui';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
const props = defineProps<DialogDescriptionProps>();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DialogDescriptionPrimitive
|
|
11
|
+
data-slot="dialog-description"
|
|
12
|
+
v-bind="props"
|
|
13
|
+
:class="cn('body-14-normal font-normal text-content-on-surface-muted')"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</DialogDescriptionPrimitive>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogOverlayProps } from 'reka-ui';
|
|
3
|
+
import { DialogOverlay, useForwardProps } from 'reka-ui';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
const props = defineProps<DialogOverlayProps>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardProps(props);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DialogOverlay
|
|
13
|
+
data-slot="dialog-overlay"
|
|
14
|
+
v-bind="forwarded"
|
|
15
|
+
:class="
|
|
16
|
+
cn(
|
|
17
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-overlay-surface-modal-overlay',
|
|
18
|
+
)
|
|
19
|
+
"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</DialogOverlay>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTitleProps } from 'reka-ui';
|
|
3
|
+
import { DialogTitle as DialogTitlePrimitive } from 'reka-ui';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
const props = defineProps<DialogTitleProps>();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DialogTitlePrimitive
|
|
11
|
+
data-slot="dialog-title"
|
|
12
|
+
v-bind="props"
|
|
13
|
+
:class="cn('text-lg font-semibold text-content-on-surface-primary')"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</DialogTitlePrimitive>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTriggerProps } from 'reka-ui';
|
|
3
|
+
import { DialogTrigger } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogTriggerProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogTrigger data-slot="dialog-trigger" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DialogTrigger>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Dialog } from './Dialog.vue';
|
|
2
|
+
export { default as DialogClose } from './DialogClose.vue';
|
|
3
|
+
export { default as DialogContent } from './DialogContent.vue';
|
|
4
|
+
export { default as DialogDescription } from './DialogDescription.vue';
|
|
5
|
+
export { default as DialogFooter } from './DialogFooter.vue';
|
|
6
|
+
export { default as DialogHeader } from './DialogHeader.vue';
|
|
7
|
+
export { default as DialogOverlay } from './DialogOverlay.vue';
|
|
8
|
+
export { default as DialogTitle } from './DialogTitle.vue';
|
|
9
|
+
export { default as DialogTrigger } from './DialogTrigger.vue';
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<DialogPortal>
|
|
30
30
|
<DialogOverlay
|
|
31
31
|
data-slot="drawer-overlay"
|
|
32
|
-
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-modal-overlay"
|
|
32
|
+
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-overlay-surface-modal-overlay"
|
|
33
33
|
/>
|
|
34
34
|
<DialogContent
|
|
35
35
|
data-slot="drawer-content"
|
|
@@ -12,10 +12,13 @@
|
|
|
12
12
|
class?: HTMLAttributes['class'];
|
|
13
13
|
variant?: ItemVariants['variant'];
|
|
14
14
|
size?: ItemVariants['size'];
|
|
15
|
+
/** When false, omits `role="listitem"` (e.g. item is already inside an `<li>`). */
|
|
16
|
+
withListSemantics?: boolean;
|
|
15
17
|
}
|
|
16
18
|
>(),
|
|
17
19
|
{
|
|
18
20
|
as: 'div',
|
|
21
|
+
withListSemantics: true,
|
|
19
22
|
},
|
|
20
23
|
);
|
|
21
24
|
</script>
|
|
@@ -23,10 +26,10 @@
|
|
|
23
26
|
<template>
|
|
24
27
|
<Primitive
|
|
25
28
|
data-slot="item"
|
|
26
|
-
:as="as"
|
|
27
|
-
:as-child="asChild"
|
|
28
|
-
:class="cn(itemVariants({ variant, size }), props.class)"
|
|
29
|
-
role="listitem"
|
|
29
|
+
:as="props.as"
|
|
30
|
+
:as-child="props.asChild"
|
|
31
|
+
:class="cn(itemVariants({ variant: props.variant, size: props.size }), props.class)"
|
|
32
|
+
:role="props.withListSemantics ? 'listitem' : undefined"
|
|
30
33
|
>
|
|
31
34
|
<slot />
|
|
32
35
|
</Primitive>
|
|
@@ -19,11 +19,16 @@
|
|
|
19
19
|
<ProgressRoot
|
|
20
20
|
data-slot="progress"
|
|
21
21
|
v-bind="delegatedProps"
|
|
22
|
-
:class="
|
|
22
|
+
:class="
|
|
23
|
+
cn(
|
|
24
|
+
'bg-background-surface-muted relative h-2 w-full overflow-hidden rounded-full',
|
|
25
|
+
props.class,
|
|
26
|
+
)
|
|
27
|
+
"
|
|
23
28
|
>
|
|
24
29
|
<ProgressIndicator
|
|
25
30
|
data-slot="progress-indicator"
|
|
26
|
-
class="bg-
|
|
31
|
+
class="bg-background-accent-default h-full w-full flex-1 transition-all"
|
|
27
32
|
:style="`transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
|
|
28
33
|
/>
|
|
29
34
|
</ProgressRoot>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
data-slot="sheet-overlay"
|
|
14
14
|
:class="
|
|
15
15
|
cn(
|
|
16
|
-
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-modal-overlay',
|
|
16
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-overlay-surface-modal-overlay',
|
|
17
17
|
$attrs.class ?? '',
|
|
18
18
|
)
|
|
19
19
|
"
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
2
3
|
import { cn } from '@/lib/utils';
|
|
3
4
|
|
|
4
5
|
defineOptions({ inheritAttrs: false });
|
|
6
|
+
|
|
7
|
+
const attrs = useAttrs();
|
|
8
|
+
const passthroughAttrs = computed(() => {
|
|
9
|
+
const { class: _c, ...rest } = attrs as Record<string, unknown>;
|
|
10
|
+
return rest;
|
|
11
|
+
});
|
|
12
|
+
const attrClass = computed(() => (attrs.class as string | undefined) ?? '');
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<template>
|
|
8
16
|
<div
|
|
9
|
-
v-bind="
|
|
17
|
+
v-bind="passthroughAttrs"
|
|
10
18
|
data-slot="sidebar-content"
|
|
11
19
|
data-sidebar="content"
|
|
12
20
|
:class="
|
|
13
21
|
cn(
|
|
14
|
-
'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',
|
|
15
|
-
|
|
22
|
+
'flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-2 group-data-[collapsible=icon]:overflow-hidden',
|
|
23
|
+
attrClass,
|
|
16
24
|
)
|
|
17
25
|
"
|
|
18
26
|
>
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
2
3
|
import { cn } from '@/lib/utils';
|
|
3
4
|
|
|
4
5
|
defineOptions({ inheritAttrs: false });
|
|
6
|
+
|
|
7
|
+
const attrs = useAttrs();
|
|
8
|
+
const passthroughAttrs = computed(() => {
|
|
9
|
+
const { class: _c, ...rest } = attrs as Record<string, unknown>;
|
|
10
|
+
return rest;
|
|
11
|
+
});
|
|
12
|
+
const attrClass = computed(() => (attrs.class as string | undefined) ?? '');
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<template>
|
|
8
16
|
<div
|
|
9
|
-
v-bind="
|
|
17
|
+
v-bind="passthroughAttrs"
|
|
10
18
|
data-slot="sidebar-footer"
|
|
11
19
|
data-sidebar="footer"
|
|
12
|
-
:class="cn('flex flex-col gap-2 p-2',
|
|
20
|
+
:class="cn('flex flex-col gap-2 p-2', attrClass)"
|
|
13
21
|
>
|
|
14
22
|
<slot />
|
|
15
23
|
</div>
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
2
3
|
import { cn } from '@/lib/utils';
|
|
3
4
|
|
|
4
5
|
defineOptions({ inheritAttrs: false });
|
|
6
|
+
|
|
7
|
+
const attrs = useAttrs();
|
|
8
|
+
const passthroughAttrs = computed(() => {
|
|
9
|
+
const { class: _c, ...rest } = attrs as Record<string, unknown>;
|
|
10
|
+
return rest;
|
|
11
|
+
});
|
|
12
|
+
const attrClass = computed(() => (attrs.class as string | undefined) ?? '');
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<template>
|
|
8
16
|
<div
|
|
9
|
-
v-bind="
|
|
17
|
+
v-bind="passthroughAttrs"
|
|
10
18
|
data-slot="sidebar-group"
|
|
11
19
|
data-sidebar="group"
|
|
12
|
-
:class="cn('relative flex w-full min-w-0 flex-col p-
|
|
20
|
+
:class="cn('relative flex w-full min-w-0 flex-col gap-2 p-0', attrClass)"
|
|
13
21
|
>
|
|
14
22
|
<slot />
|
|
15
23
|
</div>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
:class="
|
|
14
14
|
cn(
|
|
15
15
|
'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
16
|
-
'group-data-[collapsible=icon]
|
|
16
|
+
'group-data-[collapsible=icon]:hidden',
|
|
17
17
|
$attrs.class ?? '',
|
|
18
18
|
)
|
|
19
19
|
"
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
2
3
|
import { cn } from '@/lib/utils';
|
|
3
4
|
|
|
4
5
|
defineOptions({ inheritAttrs: false });
|
|
6
|
+
|
|
7
|
+
const attrs = useAttrs();
|
|
8
|
+
const passthroughAttrs = computed(() => {
|
|
9
|
+
const { class: _c, ...rest } = attrs as Record<string, unknown>;
|
|
10
|
+
return rest;
|
|
11
|
+
});
|
|
12
|
+
const attrClass = computed(() => (attrs.class as string | undefined) ?? '');
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<template>
|
|
8
16
|
<div
|
|
9
|
-
v-bind="
|
|
17
|
+
v-bind="passthroughAttrs"
|
|
10
18
|
data-slot="sidebar-header"
|
|
11
19
|
data-sidebar="header"
|
|
12
|
-
:class="cn('flex flex-col gap-2 p-2',
|
|
20
|
+
:class="cn('flex flex-col gap-2 p-2', attrClass)"
|
|
13
21
|
>
|
|
14
22
|
<slot />
|
|
15
23
|
</div>
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
2
3
|
import { cn } from '@/lib/utils';
|
|
3
4
|
|
|
4
5
|
defineOptions({ inheritAttrs: false });
|
|
6
|
+
|
|
7
|
+
const attrs = useAttrs();
|
|
8
|
+
const passthroughAttrs = computed(() => {
|
|
9
|
+
const { class: _c, ...rest } = attrs as Record<string, unknown>;
|
|
10
|
+
return rest;
|
|
11
|
+
});
|
|
12
|
+
const attrClass = computed(() => (attrs.class as string | undefined) ?? '');
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<template>
|
|
8
16
|
<ul
|
|
9
|
-
v-bind="
|
|
17
|
+
v-bind="passthroughAttrs"
|
|
10
18
|
data-slot="sidebar-menu"
|
|
11
19
|
data-sidebar="menu"
|
|
12
|
-
:class="
|
|
20
|
+
:class="
|
|
21
|
+
cn('flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center', attrClass)
|
|
22
|
+
"
|
|
13
23
|
>
|
|
14
24
|
<slot />
|
|
15
25
|
</ul>
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
<slot />
|
|
34
34
|
</SidebarMenuButtonChild>
|
|
35
35
|
|
|
36
|
-
<Tooltip
|
|
36
|
+
<Tooltip :disabled="state !== 'collapsed' || isMobile" :delay-duration="0">
|
|
37
37
|
<TooltipTrigger as-child>
|
|
38
38
|
<SidebarMenuButtonChild v-bind="{ ...delegatedProps, ...$attrs }">
|
|
39
39
|
<slot />
|
|
40
40
|
</SidebarMenuButtonChild>
|
|
41
41
|
</TooltipTrigger>
|
|
42
|
-
<TooltipContent side="right" align="center"
|
|
42
|
+
<TooltipContent side="right" align="center">
|
|
43
43
|
<template v-if="typeof tooltip === 'string'">
|
|
44
44
|
{{ tooltip }}
|
|
45
45
|
</template>
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
2
3
|
import { cn } from '@/lib/utils';
|
|
3
4
|
import { Separator } from '@/components/core/separator';
|
|
4
5
|
|
|
5
6
|
defineOptions({ inheritAttrs: false });
|
|
7
|
+
|
|
8
|
+
const attrs = useAttrs();
|
|
9
|
+
const passthroughAttrs = computed(() => {
|
|
10
|
+
const { class: _c, ...rest } = attrs as Record<string, unknown>;
|
|
11
|
+
return rest;
|
|
12
|
+
});
|
|
13
|
+
const attrClass = computed(() => (attrs.class as string | undefined) ?? '');
|
|
6
14
|
</script>
|
|
7
15
|
|
|
8
16
|
<template>
|
|
9
17
|
<Separator
|
|
10
|
-
v-bind="
|
|
18
|
+
v-bind="passthroughAttrs"
|
|
11
19
|
data-slot="sidebar-separator"
|
|
12
20
|
data-sidebar="separator"
|
|
13
|
-
:class="cn('bg-sidebar-border mx-2 w-auto',
|
|
21
|
+
:class="cn('bg-sidebar-border mx-2 w-auto group-data-[collapsible=icon]:hidden', attrClass)"
|
|
14
22
|
>
|
|
15
23
|
<slot />
|
|
16
24
|
</Separator>
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
data-slot="sidebar-trigger"
|
|
17
17
|
variant="ghost"
|
|
18
18
|
size="icon"
|
|
19
|
+
aria-label="Toggle Sidebar"
|
|
19
20
|
:class="cn('h-7 w-7', $attrs.class ?? '')"
|
|
20
21
|
@click="toggleSidebar"
|
|
21
22
|
>
|
|
22
|
-
<PanelLeft />
|
|
23
|
-
<span class="sr-only">Toggle Sidebar</span>
|
|
23
|
+
<PanelLeft :size="16" />
|
|
24
24
|
</Button>
|
|
25
25
|
</template>
|
|
@@ -34,7 +34,7 @@ export { default as SidebarTrigger } from './SidebarTrigger.vue';
|
|
|
34
34
|
export { useSidebar } from './utils';
|
|
35
35
|
|
|
36
36
|
export const sidebarMenuButtonVariants = cva(
|
|
37
|
-
'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
|
|
37
|
+
'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:justify-center! group-data-[collapsible=icon]:p-2! group-data-[collapsible=icon]:[&>svg~span]:hidden group-data-[collapsible=icon]:[&>span~svg]:hidden group-data-[collapsible=icon]:[&>div~*]:hidden [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
|
|
38
38
|
{
|
|
39
39
|
variants: {
|
|
40
40
|
variant: {
|