@aleph-alpha/ui-library 2.0.0 → 2.3.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/config.d.ts +0 -19
- package/config.js +65 -81
- package/dist/system/components/UiSnackbar/UiSnackbar.vue.d.ts +5 -0
- package/dist/system/components/UiSnackbar/index.d.ts +3 -0
- package/dist/system/components/UiSnackbar/types.d.ts +96 -0
- package/dist/system/components/UiToggle/UiToggle.vue.d.ts +5 -0
- package/dist/system/components/UiToggle/types.d.ts +13 -0
- package/dist/system/components/core/sonner/Sonner.vue.d.ts +3 -0
- package/dist/system/components/core/sonner/index.d.ts +1 -0
- package/dist/system/components/index.d.ts +1 -1
- package/dist/system/index.d.ts +3 -4
- package/dist/system/lib/heightTransition.d.ts +5 -0
- package/dist/system/lib/useDrag.d.ts +52 -0
- package/dist/system/lib.js +22130 -20210
- package/dist/system/patterns/UiDataTable/UiDataTable.vue.d.ts +22 -3
- package/dist/system/patterns/UiDataTable/UiDataTableColumnFilter.vue.d.ts +14 -0
- package/dist/system/patterns/UiDataTable/constants.d.ts +13 -0
- package/dist/system/patterns/UiDataTable/index.d.ts +2 -0
- package/dist/system/patterns/UiDataTable/types.d.ts +32 -1
- package/dist/system/patterns/UiSidebar/UiSidebarGroupLabel.vue.d.ts +6 -6
- package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -2
- package/dist/system/patterns/UiSidebar/index.d.ts +1 -3
- package/dist/system/patterns/UiSidebar/types.d.ts +1 -95
- package/docs/public-docs/foundations.md +48 -38
- package/hover-mix.d.ts +8 -11
- package/hover-mix.js +7 -15
- package/package.json +6 -4
- package/src/components/UiAccordion/UiAccordion.stories.ts +2 -2
- package/src/components/UiAlert/UiAlert.stories.ts +4 -4
- package/src/components/UiAvatar/UiAvatar.stories.ts +2 -2
- package/src/components/UiButton/UiButton.stories.ts +1 -1
- package/src/components/UiCalendar/UiCalendar.stories.ts +1 -24
- package/src/components/UiCalendar/UiCalendar.vue +16 -0
- package/src/components/UiCard/UiCard.stories.ts +4 -4
- package/src/components/UiChip/UiChip.vue +1 -1
- package/src/components/UiDrawer/UiDrawer.stories.ts +6 -6
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +4 -4
- package/src/components/UiDropdownMenu/__tests__/UiDropdownMenu.test.ts +70 -3
- package/src/components/UiEmpty/UiEmpty.stories.ts +1 -0
- package/src/components/UiFileItem/UiFileItem.vue +1 -1
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +4 -1
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +2 -2
- package/src/components/UiIcon/UiIcon.stories.ts +90 -18
- package/src/components/UiInput/UiInput.stories.ts +2 -2
- package/src/components/UiKbd/UiKbd.stories.ts +10 -10
- package/src/components/UiLabel/UiLabel.stories.ts +2 -2
- package/src/components/UiListbox/UiListbox.stories.ts +14 -14
- package/src/components/UiListbox/UiListbox.vue +16 -0
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +24 -13
- package/src/components/UiPopover/UiPopover.stories.ts +6 -6
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +22 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.stories.ts +11 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.vue +16 -0
- package/src/components/UiSelect/UiSelectItem.vue +1 -1
- package/src/components/UiSeparator/UiSeparator.stories.ts +8 -8
- package/src/components/UiSheet/UiSheet.stories.ts +12 -12
- package/src/components/UiSkeleton/UiSkeleton.stories.ts +20 -20
- package/src/components/UiSlider/UiSlider.stories.ts +6 -6
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +508 -0
- package/src/components/UiSnackbar/UiSnackbar.vue +286 -0
- package/src/components/UiSnackbar/__tests__/UiSnackbar.test.ts +17 -0
- package/src/components/UiSnackbar/index.ts +4 -0
- package/src/components/UiSnackbar/types.ts +97 -0
- package/src/components/UiSwitch/UiSwitch.stories.ts +4 -4
- package/src/components/UiSwitch/__tests__/UiSwitch.test.ts +9 -2
- package/src/components/UiTable/__tests__/UiTableRow.test.ts +23 -4
- package/src/components/UiTabs/UiTabs.stories.ts +2 -2
- package/src/components/UiTabs/__tests__/UiTabs.test.ts +25 -0
- package/src/components/UiTagsInput/UiTagsInput.stories.ts +2 -0
- package/src/components/UiToggle/UiToggle.vue +18 -1
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +42 -3
- package/src/components/UiToggle/types.ts +13 -0
- package/src/components/UiToggleGroup/__tests__/UiToggleGroup.test.ts +18 -0
- package/src/components/UiTooltip/UiTooltip.stories.ts +7 -7
- package/src/components/core/accordion/AccordionContent.vue +36 -1
- package/src/components/core/alert/index.ts +3 -2
- package/src/components/core/button/index.ts +5 -6
- package/src/components/core/calendar/CalendarGrid.vue +1 -1
- package/src/components/core/card/Card.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +14 -13
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +23 -13
- package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/popover/PopoverContent.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarGrid.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/sidebar/SidebarGroupAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
- package/src/components/core/sidebar/SidebarTrigger.vue +4 -4
- package/src/components/core/sidebar/index.ts +4 -3
- package/src/components/core/sonner/Sonner.vue +43 -0
- package/src/components/core/sonner/index.ts +1 -0
- package/src/components/core/switch/Switch.vue +2 -2
- package/src/components/core/table/TableRow.vue +1 -1
- package/src/components/core/tabs/TabsList.vue +1 -1
- package/src/components/core/tabs/TabsTrigger.vue +1 -1
- package/src/components/core/toggle/index.ts +3 -3
- package/src/components/core/toggle-group/index.ts +1 -1
- package/src/components/index.ts +1 -1
- package/src/directives/vHover.stories.ts +1 -1
- package/src/index.ts +3 -0
- package/src/lib/heightTransition.ts +27 -0
- package/src/lib/useDrag.stories.ts +295 -0
- package/src/lib/useDrag.ts +212 -0
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +363 -15
- package/src/patterns/UiDataTable/UiDataTable.vue +558 -22
- package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +83 -0
- package/src/patterns/UiDataTable/UiDataTableColumnHeader.vue +4 -13
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +3 -3
- package/src/patterns/UiDataTable/UiDataTableToolbar.vue +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +343 -0
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnFilter.test.ts +194 -0
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnHeader.test.ts +11 -0
- package/src/patterns/UiDataTable/constants.ts +15 -0
- package/src/patterns/UiDataTable/index.ts +2 -0
- package/src/patterns/UiDataTable/types.ts +33 -0
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +4 -4
- package/src/patterns/UiDatePicker/UiDatePicker.vue +2 -0
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +27 -258
- package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarGroupContent.vue +13 -36
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +15 -10
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +20 -7
- package/src/patterns/UiSidebar/UiSidebarHeader.vue +0 -1
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +29 -40
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +9 -6
- package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +11 -13
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +8 -5
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.stories.ts +6 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +9 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +3 -3
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +11 -12
- package/src/patterns/UiSidebar/UiSidebarTrigger.vue +1 -1
- package/src/patterns/UiSidebar/activeIndicator.ts +1 -2
- package/src/patterns/UiSidebar/index.ts +0 -5
- package/src/patterns/UiSidebar/types.ts +1 -111
- package/src/theme/Background.stories.ts +5 -5
- package/src/theme/Border.stories.ts +3 -3
- package/src/theme/Extended.stories.ts +6 -6
- package/src/theme/Flex.stories.ts +10 -10
- package/src/theme/Grid.stories.ts +10 -10
- package/src/theme/HoverLayer.stories.ts +215 -0
- package/src/theme/Overlay.stories.ts +2 -2
- package/src/theme/Shadow.stories.ts +1 -1
- package/src/theme/Theme.stories.ts +4 -4
- package/src/theme/Typography.stories.ts +21 -21
- package/tokens.json +4835 -1369
- package/dist/system/components/UiIconButton/UiIconButton.vue.d.ts +0 -25
- package/dist/system/components/UiIconButton/index.d.ts +0 -7
- package/dist/system/components/UiIconButton/types.d.ts +0 -67
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistory.vue.d.ts +0 -20
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistoryItem.vue.d.ts +0 -34
- package/src/components/UiIconButton/UiIconButton.stories.ts +0 -470
- package/src/components/UiIconButton/UiIconButton.vue +0 -76
- package/src/components/UiIconButton/__tests__/UiIconButton.test.ts +0 -105
- package/src/components/UiIconButton/index.ts +0 -13
- package/src/components/UiIconButton/types.ts +0 -87
- package/src/patterns/UiSidebar/UiSidebarChatHistory.stories.ts +0 -104
- package/src/patterns/UiSidebar/UiSidebarChatHistory.vue +0 -43
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.stories.ts +0 -204
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.vue +0 -269
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistory.test.ts +0 -35
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistoryItem.test.ts +0 -49
- package/src/theme/BackgroundHover.stories.ts +0 -182
- package/src/theme/ContentHover.stories.ts +0 -171
|
@@ -219,7 +219,7 @@ export const Interactive: Story = {
|
|
|
219
219
|
},
|
|
220
220
|
template: `
|
|
221
221
|
<div class="flex flex-col items-center gap-6 p-4">
|
|
222
|
-
<div class="text-center
|
|
222
|
+
<div class="text-center gap-y-2">
|
|
223
223
|
<h3 class="heading-s">Interactive Keyboard Shortcuts</h3>
|
|
224
224
|
<p class="body-14-regular text-muted-foreground">Try pressing these keyboard shortcuts:</p>
|
|
225
225
|
</div>
|
|
@@ -256,7 +256,7 @@ export const Interactive: Story = {
|
|
|
256
256
|
<h4 class="body-14-medium">Keyboard Shortcuts Help</h4>
|
|
257
257
|
<UiKbd>Esc</UiKbd>
|
|
258
258
|
</div>
|
|
259
|
-
<div class="
|
|
259
|
+
<div class="gap-y-2 body-14-regular text-muted-foreground">
|
|
260
260
|
<p>Use keyboard shortcuts to navigate quickly through the application.</p>
|
|
261
261
|
<p>Press <UiKbd>Esc</UiKbd> to close this help panel.</p>
|
|
262
262
|
</div>
|
|
@@ -270,15 +270,15 @@ export const Interactive: Story = {
|
|
|
270
270
|
Quick access to common actions. Press <UiKbd size="sm">Esc</UiKbd> to close.
|
|
271
271
|
</UiDrawerDescription>
|
|
272
272
|
</UiDrawerHeader>
|
|
273
|
-
<div class="p-4
|
|
274
|
-
<div class="flex items-center justify-between rounded-md px-3 py-2 hover
|
|
273
|
+
<div class="p-4 gap-y-2">
|
|
274
|
+
<div class="flex items-center justify-between rounded-md px-3 py-2 hover-layer hover-layer-default cursor-pointer">
|
|
275
275
|
<span>New Document</span>
|
|
276
276
|
<UiKbdGroup>
|
|
277
277
|
<UiKbd size="sm">Ctrl</UiKbd>
|
|
278
278
|
<UiKbd size="sm">N</UiKbd>
|
|
279
279
|
</UiKbdGroup>
|
|
280
280
|
</div>
|
|
281
|
-
<div class="flex items-center justify-between rounded-md px-3 py-2 hover
|
|
281
|
+
<div class="flex items-center justify-between rounded-md px-3 py-2 hover-layer hover-layer-default cursor-pointer">
|
|
282
282
|
<span>Search Files</span>
|
|
283
283
|
<UiKbdGroup>
|
|
284
284
|
<UiKbd size="sm">Ctrl</UiKbd>
|
|
@@ -286,7 +286,7 @@ export const Interactive: Story = {
|
|
|
286
286
|
<UiKbd size="sm">F</UiKbd>
|
|
287
287
|
</UiKbdGroup>
|
|
288
288
|
</div>
|
|
289
|
-
<div class="flex items-center justify-between rounded-md px-3 py-2 hover
|
|
289
|
+
<div class="flex items-center justify-between rounded-md px-3 py-2 hover-layer hover-layer-default cursor-pointer">
|
|
290
290
|
<span>Go to Line</span>
|
|
291
291
|
<UiKbdGroup>
|
|
292
292
|
<UiKbd size="sm">Ctrl</UiKbd>
|
|
@@ -347,15 +347,15 @@ export const Group: Story = {
|
|
|
347
347
|
<span class="flex-1 body-14-regular text-muted-foreground">Type a command or search...</span>
|
|
348
348
|
<UiKbd v-bind="args">Esc</UiKbd>
|
|
349
349
|
</div>
|
|
350
|
-
<div class="pt-3
|
|
351
|
-
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-14-regular hover
|
|
350
|
+
<div class="pt-3 gap-y-1">
|
|
351
|
+
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-14-regular hover-layer hover-layer-default cursor-pointer">
|
|
352
352
|
<span>Toggle Sidebar</span>
|
|
353
353
|
<UiKbdGroup>
|
|
354
354
|
<UiKbd v-bind="args">Ctrl</UiKbd>
|
|
355
355
|
<UiKbd v-bind="args">\\</UiKbd>
|
|
356
356
|
</UiKbdGroup>
|
|
357
357
|
</div>
|
|
358
|
-
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-14-regular hover
|
|
358
|
+
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-14-regular hover-layer hover-layer-default cursor-pointer">
|
|
359
359
|
<span>Quick Search</span>
|
|
360
360
|
<UiKbdGroup>
|
|
361
361
|
<UiKbd v-bind="args">Ctrl</UiKbd>
|
|
@@ -363,7 +363,7 @@ export const Group: Story = {
|
|
|
363
363
|
<UiKbd v-bind="args">F</UiKbd>
|
|
364
364
|
</UiKbdGroup>
|
|
365
365
|
</div>
|
|
366
|
-
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-14-regular hover
|
|
366
|
+
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-14-regular hover-layer hover-layer-default cursor-pointer">
|
|
367
367
|
<span>Go to Line</span>
|
|
368
368
|
<UiKbdGroup>
|
|
369
369
|
<UiKbd v-bind="args">Ctrl</UiKbd>
|
|
@@ -88,7 +88,7 @@ import { UiLabel, UiCheckbox } from '@aleph-alpha/ui-library'
|
|
|
88
88
|
</script>
|
|
89
89
|
|
|
90
90
|
<template>
|
|
91
|
-
<div class="flex items-center
|
|
91
|
+
<div class="flex items-center gap-x-2">
|
|
92
92
|
<UiCheckbox id="terms" name="terms" />
|
|
93
93
|
<UiLabel for="terms">Accept terms and conditions</UiLabel>
|
|
94
94
|
</div>
|
|
@@ -102,7 +102,7 @@ export const WithCheckbox: Story = {
|
|
|
102
102
|
render: () => ({
|
|
103
103
|
components: { UiLabel, UiCheckbox },
|
|
104
104
|
template: `
|
|
105
|
-
<div class="flex items-center
|
|
105
|
+
<div class="flex items-center gap-x-2">
|
|
106
106
|
<UiCheckbox id="terms" name="terms" />
|
|
107
107
|
<UiLabel for="terms">Accept terms and conditions</UiLabel>
|
|
108
108
|
</div>
|
|
@@ -69,7 +69,7 @@ const fruits = [
|
|
|
69
69
|
</script>
|
|
70
70
|
|
|
71
71
|
<template>
|
|
72
|
-
<UiListbox v-model="selected" class="w-[200px]
|
|
72
|
+
<UiListbox v-model="selected" class="w-[200px] p-1">
|
|
73
73
|
<UiListboxContent>
|
|
74
74
|
<UiListboxItem
|
|
75
75
|
v-for="fruit in fruits"
|
|
@@ -101,7 +101,7 @@ export const Default: Story = {
|
|
|
101
101
|
template: `
|
|
102
102
|
<UiListbox
|
|
103
103
|
v-model="selected"
|
|
104
|
-
class="w-[200px]
|
|
104
|
+
class="w-[200px] p-1"
|
|
105
105
|
:disabled="args.disabled"
|
|
106
106
|
:highlight-on-hover="args.highlightOnHover"
|
|
107
107
|
>
|
|
@@ -145,7 +145,7 @@ const fruits = [
|
|
|
145
145
|
</script>
|
|
146
146
|
|
|
147
147
|
<template>
|
|
148
|
-
<UiListbox v-model="selected" multiple class="w-[200px]
|
|
148
|
+
<UiListbox v-model="selected" multiple class="w-[200px] p-1">
|
|
149
149
|
<UiListboxContent>
|
|
150
150
|
<UiListboxItem
|
|
151
151
|
v-for="fruit in fruits"
|
|
@@ -175,7 +175,7 @@ export const Multiple: Story = {
|
|
|
175
175
|
return { selected, fruits };
|
|
176
176
|
},
|
|
177
177
|
template: `
|
|
178
|
-
<UiListbox v-model="selected" multiple class="w-[200px]
|
|
178
|
+
<UiListbox v-model="selected" multiple class="w-[200px] p-1">
|
|
179
179
|
<UiListboxContent>
|
|
180
180
|
<UiListboxItem
|
|
181
181
|
v-for="fruit in fruits"
|
|
@@ -226,7 +226,7 @@ const filteredFruits = computed(() =>
|
|
|
226
226
|
</script>
|
|
227
227
|
|
|
228
228
|
<template>
|
|
229
|
-
<UiListbox v-model="selected" class="w-[200px]
|
|
229
|
+
<UiListbox v-model="selected" class="w-[200px]">
|
|
230
230
|
<UiListboxFilter v-model="searchTerm" placeholder="Search fruits..." class="border-b" />
|
|
231
231
|
<UiListboxContent class="p-1">
|
|
232
232
|
<UiListboxItem
|
|
@@ -267,7 +267,7 @@ export const WithFilter: Story = {
|
|
|
267
267
|
return { selected, searchTerm, filteredFruits };
|
|
268
268
|
},
|
|
269
269
|
template: `
|
|
270
|
-
<UiListbox v-model="selected" class="w-[200px]
|
|
270
|
+
<UiListbox v-model="selected" class="w-[200px]">
|
|
271
271
|
<UiListboxFilter v-model="searchTerm" placeholder="Search fruits..." class="border-b" />
|
|
272
272
|
<UiListboxContent class="p-1">
|
|
273
273
|
<UiListboxItem
|
|
@@ -306,7 +306,7 @@ const selected = ref('apple')
|
|
|
306
306
|
</script>
|
|
307
307
|
|
|
308
308
|
<template>
|
|
309
|
-
<UiListbox v-model="selected" class="w-[200px]
|
|
309
|
+
<UiListbox v-model="selected" class="w-[200px] p-1">
|
|
310
310
|
<UiListboxContent>
|
|
311
311
|
<UiListboxGroup>
|
|
312
312
|
<UiListboxGroupLabel>Fruits</UiListboxGroupLabel>
|
|
@@ -352,7 +352,7 @@ export const WithGroups: Story = {
|
|
|
352
352
|
return { selected };
|
|
353
353
|
},
|
|
354
354
|
template: `
|
|
355
|
-
<UiListbox v-model="selected" class="w-[200px]
|
|
355
|
+
<UiListbox v-model="selected" class="w-[200px] p-1">
|
|
356
356
|
<UiListboxContent>
|
|
357
357
|
<UiListboxGroup>
|
|
358
358
|
<UiListboxGroupLabel>Fruits</UiListboxGroupLabel>
|
|
@@ -407,7 +407,7 @@ const fruits = [
|
|
|
407
407
|
</script>
|
|
408
408
|
|
|
409
409
|
<template>
|
|
410
|
-
<UiListbox v-model="selected" disabled class="w-[200px]
|
|
410
|
+
<UiListbox v-model="selected" disabled class="w-[200px] p-1">
|
|
411
411
|
<UiListboxContent>
|
|
412
412
|
<UiListboxItem
|
|
413
413
|
v-for="fruit in fruits"
|
|
@@ -440,7 +440,7 @@ export const Disabled: Story = {
|
|
|
440
440
|
return { selected, fruits };
|
|
441
441
|
},
|
|
442
442
|
template: `
|
|
443
|
-
<UiListbox v-model="selected" disabled class="w-[200px]
|
|
443
|
+
<UiListbox v-model="selected" disabled class="w-[200px] p-1 opacity-50">
|
|
444
444
|
<UiListboxContent>
|
|
445
445
|
<UiListboxItem
|
|
446
446
|
v-for="fruit in fruits"
|
|
@@ -481,7 +481,7 @@ const fruits = [
|
|
|
481
481
|
</script>
|
|
482
482
|
|
|
483
483
|
<template>
|
|
484
|
-
<UiListbox v-model="selected" highlight-on-hover class="w-[200px]
|
|
484
|
+
<UiListbox v-model="selected" highlight-on-hover class="w-[200px] p-1">
|
|
485
485
|
<UiListboxContent>
|
|
486
486
|
<UiListboxItem
|
|
487
487
|
v-for="fruit in fruits"
|
|
@@ -514,7 +514,7 @@ export const HighlightOnHover: Story = {
|
|
|
514
514
|
return { selected, fruits };
|
|
515
515
|
},
|
|
516
516
|
template: `
|
|
517
|
-
<UiListbox v-model="selected" highlight-on-hover class="w-[200px]
|
|
517
|
+
<UiListbox v-model="selected" highlight-on-hover class="w-[200px] p-1">
|
|
518
518
|
<UiListboxContent>
|
|
519
519
|
<UiListboxItem
|
|
520
520
|
v-for="fruit in fruits"
|
|
@@ -550,7 +550,7 @@ const selected = ref('apple')
|
|
|
550
550
|
</script>
|
|
551
551
|
|
|
552
552
|
<template>
|
|
553
|
-
<UiListbox v-model="selected" class="w-[200px]
|
|
553
|
+
<UiListbox v-model="selected" class="w-[200px] p-1">
|
|
554
554
|
<UiListboxContent>
|
|
555
555
|
<UiListboxItem value="apple">
|
|
556
556
|
<span>Apple</span>
|
|
@@ -584,7 +584,7 @@ export const WithDisabledItems: Story = {
|
|
|
584
584
|
return { selected };
|
|
585
585
|
},
|
|
586
586
|
template: `
|
|
587
|
-
<UiListbox v-model="selected" class="w-[200px]
|
|
587
|
+
<UiListbox v-model="selected" class="w-[200px] p-1">
|
|
588
588
|
<UiListboxContent>
|
|
589
589
|
<UiListboxItem value="apple">
|
|
590
590
|
<span>Apple</span>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { AcceptableValue } from 'reka-ui';
|
|
3
|
+
import { computed, useAttrs } from 'vue';
|
|
3
4
|
import { Listbox as ShadcnListbox } from '@/components/core/listbox';
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
4
6
|
import { UiListboxProps } from './types';
|
|
5
7
|
|
|
6
8
|
defineOptions({
|
|
7
9
|
name: 'UiListbox',
|
|
10
|
+
inheritAttrs: false,
|
|
8
11
|
});
|
|
9
12
|
|
|
10
13
|
const props = withDefaults(defineProps<UiListboxProps>(), {
|
|
@@ -14,11 +17,24 @@ const props = withDefaults(defineProps<UiListboxProps>(), {
|
|
|
14
17
|
});
|
|
15
18
|
|
|
16
19
|
const model = defineModel<AcceptableValue | AcceptableValue[]>();
|
|
20
|
+
|
|
21
|
+
const attrs = useAttrs();
|
|
22
|
+
const forwardedAttrs = computed(() => {
|
|
23
|
+
const { class: _class, ...rest } = attrs;
|
|
24
|
+
return rest;
|
|
25
|
+
});
|
|
17
26
|
</script>
|
|
18
27
|
|
|
19
28
|
<template>
|
|
20
29
|
<ShadcnListbox
|
|
30
|
+
v-bind="forwardedAttrs"
|
|
21
31
|
v-model="model"
|
|
32
|
+
:class="
|
|
33
|
+
cn(
|
|
34
|
+
'rounded-md border border-border-surface-default bg-background-surface-floating shadow-md',
|
|
35
|
+
attrs.class ?? '',
|
|
36
|
+
)
|
|
37
|
+
"
|
|
22
38
|
:default-value="props.defaultValue"
|
|
23
39
|
:multiple="props.multiple"
|
|
24
40
|
:orientation="props.orientation"
|
|
@@ -84,13 +84,24 @@ const meta: Meta<typeof UiNavigationMenu> = {
|
|
|
84
84
|
viewport: true,
|
|
85
85
|
},
|
|
86
86
|
parameters: {
|
|
87
|
+
layout: 'fullscreen',
|
|
87
88
|
docs: {
|
|
88
89
|
story: {
|
|
89
90
|
height: '400px',
|
|
90
|
-
inline: false,
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
|
+
decorators: [
|
|
95
|
+
// NavigationMenu's viewport is inline (not portaled by reka-ui), so it
|
|
96
|
+
// clips whenever the canvas is narrower than the menu + dropdown. Wrap
|
|
97
|
+
// in a full-width flex-center container so both horizontal (mega-menu)
|
|
98
|
+
// and vertical (sidebar) orientations have room to render without
|
|
99
|
+
// clipping on either edge of the canvas.
|
|
100
|
+
() => ({
|
|
101
|
+
template:
|
|
102
|
+
'<div class="w-full p-12 overflow-visible flex justify-center"><story /></div>',
|
|
103
|
+
}),
|
|
104
|
+
],
|
|
94
105
|
};
|
|
95
106
|
|
|
96
107
|
export default meta;
|
|
@@ -466,17 +477,17 @@ const value = ref('')
|
|
|
466
477
|
<UiNavigationMenuContent>
|
|
467
478
|
<ul class="grid gap-2 p-4 w-[200px]">
|
|
468
479
|
<li>
|
|
469
|
-
<UiNavigationMenuLink href="#"
|
|
480
|
+
<UiNavigationMenuLink href="#">
|
|
470
481
|
Profile
|
|
471
482
|
</UiNavigationMenuLink>
|
|
472
483
|
</li>
|
|
473
484
|
<li>
|
|
474
|
-
<UiNavigationMenuLink href="#"
|
|
485
|
+
<UiNavigationMenuLink href="#">
|
|
475
486
|
Account
|
|
476
487
|
</UiNavigationMenuLink>
|
|
477
488
|
</li>
|
|
478
489
|
<li>
|
|
479
|
-
<UiNavigationMenuLink href="#"
|
|
490
|
+
<UiNavigationMenuLink href="#">
|
|
480
491
|
Security
|
|
481
492
|
</UiNavigationMenuLink>
|
|
482
493
|
</li>
|
|
@@ -525,17 +536,17 @@ export const VerticalOrientation: Story = {
|
|
|
525
536
|
<UiNavigationMenuContent>
|
|
526
537
|
<ul class="grid gap-2 p-4 w-[200px]">
|
|
527
538
|
<li>
|
|
528
|
-
<UiNavigationMenuLink href="#"
|
|
539
|
+
<UiNavigationMenuLink href="#">
|
|
529
540
|
Profile
|
|
530
541
|
</UiNavigationMenuLink>
|
|
531
542
|
</li>
|
|
532
543
|
<li>
|
|
533
|
-
<UiNavigationMenuLink href="#"
|
|
544
|
+
<UiNavigationMenuLink href="#">
|
|
534
545
|
Account
|
|
535
546
|
</UiNavigationMenuLink>
|
|
536
547
|
</li>
|
|
537
548
|
<li>
|
|
538
|
-
<UiNavigationMenuLink href="#"
|
|
549
|
+
<UiNavigationMenuLink href="#">
|
|
539
550
|
Security
|
|
540
551
|
</UiNavigationMenuLink>
|
|
541
552
|
</li>
|
|
@@ -789,7 +800,7 @@ function closeAll() {
|
|
|
789
800
|
</script>
|
|
790
801
|
|
|
791
802
|
<template>
|
|
792
|
-
<div class="
|
|
803
|
+
<div class="gap-y-4">
|
|
793
804
|
<div class="flex gap-2">
|
|
794
805
|
<button type="button" @click="openProducts" class="px-3 py-1 text-sm border rounded">
|
|
795
806
|
Open Products
|
|
@@ -860,10 +871,10 @@ const value = ref('')
|
|
|
860
871
|
</script>
|
|
861
872
|
|
|
862
873
|
<template>
|
|
863
|
-
<div class="
|
|
874
|
+
<div class="gap-y-4">
|
|
864
875
|
<div class="p-4 bg-muted rounded-md text-sm">
|
|
865
876
|
<p class="font-medium mb-2">Keyboard Navigation:</p>
|
|
866
|
-
<ul class="
|
|
877
|
+
<ul class="gap-y-1 text-muted-foreground">
|
|
867
878
|
<li><kbd class="px-1 bg-background rounded">Tab</kbd> - Move focus to/from navigation</li>
|
|
868
879
|
<li><kbd class="px-1 bg-background rounded">Arrow Left/Right</kbd> - Navigate between menu items</li>
|
|
869
880
|
<li><kbd class="px-1 bg-background rounded">Enter</kbd> or <kbd class="px-1 bg-background rounded">Space</kbd> - Open dropdown / activate link</li>
|
|
@@ -991,7 +1002,7 @@ export const ControlledState: Story = {
|
|
|
991
1002
|
|
|
992
1003
|
return { args, activeItem, openProducts, closeAll };
|
|
993
1004
|
},
|
|
994
|
-
template: `<div class="
|
|
1005
|
+
template: `<div class="gap-y-4">
|
|
995
1006
|
<div class="flex gap-2 items-center">
|
|
996
1007
|
<button type="button" @click="openProducts" class="px-3 py-1 text-sm border rounded hover:bg-muted">
|
|
997
1008
|
Open Products
|
|
@@ -1079,10 +1090,10 @@ export const KeyboardNavigation: Story = {
|
|
|
1079
1090
|
const value = useStoryModel(args);
|
|
1080
1091
|
return { args, value, navigationMenuTriggerStyle };
|
|
1081
1092
|
},
|
|
1082
|
-
template: `<div class="
|
|
1093
|
+
template: `<div class="gap-y-4">
|
|
1083
1094
|
<div class="p-4 bg-muted rounded-md text-sm">
|
|
1084
1095
|
<p class="font-medium mb-2">Keyboard Navigation:</p>
|
|
1085
|
-
<ul class="
|
|
1096
|
+
<ul class="gap-y-1 text-muted-foreground">
|
|
1086
1097
|
<li><kbd class="px-1 bg-background rounded">Tab</kbd> - Move focus to/from navigation</li>
|
|
1087
1098
|
<li><kbd class="px-1 bg-background rounded">Arrow Left/Right</kbd> - Navigate between menu items</li>
|
|
1088
1099
|
<li><kbd class="px-1 bg-background rounded">Enter</kbd> or <kbd class="px-1 bg-background rounded">Space</kbd> - Open dropdown / activate link</li>
|
|
@@ -40,7 +40,7 @@ import { UiPopover, UiPopoverTrigger, UiPopoverContent, UiButton } from '@aleph-
|
|
|
40
40
|
<UiButton variant="outline">Open Popover</UiButton>
|
|
41
41
|
</UiPopoverTrigger>
|
|
42
42
|
<UiPopoverContent>
|
|
43
|
-
<div class="
|
|
43
|
+
<div class="gap-y-2">
|
|
44
44
|
<h4 class="font-medium leading-none">Dimensions</h4>
|
|
45
45
|
<p class="text-sm text-muted-foreground">
|
|
46
46
|
Set the dimensions for the layer.
|
|
@@ -80,7 +80,7 @@ export const Default: Story = {
|
|
|
80
80
|
<UiButton variant="outline">Open Popover</UiButton>
|
|
81
81
|
</UiPopoverTrigger>
|
|
82
82
|
<UiPopoverContent>
|
|
83
|
-
<div class="
|
|
83
|
+
<div class="gap-y-2">
|
|
84
84
|
<h4 class="font-medium leading-none">Dimensions</h4>
|
|
85
85
|
<p class="text-sm text-muted-foreground">
|
|
86
86
|
Set the dimensions for the layer.
|
|
@@ -114,7 +114,7 @@ const open = ref(false)
|
|
|
114
114
|
</UiButton>
|
|
115
115
|
</UiPopoverTrigger>
|
|
116
116
|
<UiPopoverContent>
|
|
117
|
-
<div class="
|
|
117
|
+
<div class="gap-y-2">
|
|
118
118
|
<h4 class="font-medium leading-none">Controlled Popover</h4>
|
|
119
119
|
<p class="text-sm text-muted-foreground">
|
|
120
120
|
This popover is controlled via v-model:open.
|
|
@@ -144,7 +144,7 @@ export const Controlled: Story = {
|
|
|
144
144
|
</UiButton>
|
|
145
145
|
</UiPopoverTrigger>
|
|
146
146
|
<UiPopoverContent>
|
|
147
|
-
<div class="
|
|
147
|
+
<div class="gap-y-2">
|
|
148
148
|
<h4 class="font-medium leading-none">Controlled Popover</h4>
|
|
149
149
|
<p class="text-sm text-muted-foreground">
|
|
150
150
|
This popover is controlled via v-model:open.
|
|
@@ -363,7 +363,7 @@ const open = ref(true)
|
|
|
363
363
|
<UiButton variant="outline">Toggle Popover</UiButton>
|
|
364
364
|
</UiPopoverTrigger>
|
|
365
365
|
<UiPopoverContent>
|
|
366
|
-
<div class="
|
|
366
|
+
<div class="gap-y-2">
|
|
367
367
|
<h4 class="font-medium leading-none">Popover Content</h4>
|
|
368
368
|
<p class="text-sm text-muted-foreground">
|
|
369
369
|
This popover is open by default for visual testing.
|
|
@@ -392,7 +392,7 @@ export const OpenByDefault: Story = {
|
|
|
392
392
|
<UiButton variant="outline">Toggle Popover</UiButton>
|
|
393
393
|
</UiPopoverTrigger>
|
|
394
394
|
<UiPopoverContent>
|
|
395
|
-
<div class="
|
|
395
|
+
<div class="gap-y-2">
|
|
396
396
|
<h4 class="font-medium leading-none">Popover Content</h4>
|
|
397
397
|
<p class="text-sm text-muted-foreground">
|
|
398
398
|
This popover is open by default for visual testing.
|
|
@@ -47,15 +47,15 @@ const selected = ref('comfortable')
|
|
|
47
47
|
|
|
48
48
|
<template>
|
|
49
49
|
<UiRadioGroup v-model="selected" name="spacing">
|
|
50
|
-
<div class="flex items-center
|
|
50
|
+
<div class="flex items-center gap-x-2">
|
|
51
51
|
<UiRadioGroupItem id="r1" value="default" />
|
|
52
52
|
<label for="r1" class="text-sm font-medium">Default</label>
|
|
53
53
|
</div>
|
|
54
|
-
<div class="flex items-center
|
|
54
|
+
<div class="flex items-center gap-x-2">
|
|
55
55
|
<UiRadioGroupItem id="r2" value="comfortable" />
|
|
56
56
|
<label for="r2" class="text-sm font-medium">Comfortable</label>
|
|
57
57
|
</div>
|
|
58
|
-
<div class="flex items-center
|
|
58
|
+
<div class="flex items-center gap-x-2">
|
|
59
59
|
<UiRadioGroupItem id="r3" value="compact" />
|
|
60
60
|
<label for="r3" class="text-sm font-medium">Compact</label>
|
|
61
61
|
</div>
|
|
@@ -80,15 +80,15 @@ export const Default: Story = {
|
|
|
80
80
|
},
|
|
81
81
|
template: `
|
|
82
82
|
<UiRadioGroup v-model="selected" name="spacing" :disabled="args.disabled" :orientation="args.orientation">
|
|
83
|
-
<div class="flex items-center
|
|
83
|
+
<div class="flex items-center gap-x-2">
|
|
84
84
|
<UiRadioGroupItem id="r1" value="default" />
|
|
85
85
|
<label for="r1" class="text-sm font-medium">Default</label>
|
|
86
86
|
</div>
|
|
87
|
-
<div class="flex items-center
|
|
87
|
+
<div class="flex items-center gap-x-2">
|
|
88
88
|
<UiRadioGroupItem id="r2" value="comfortable" />
|
|
89
89
|
<label for="r2" class="text-sm font-medium">Comfortable</label>
|
|
90
90
|
</div>
|
|
91
|
-
<div class="flex items-center
|
|
91
|
+
<div class="flex items-center gap-x-2">
|
|
92
92
|
<UiRadioGroupItem id="r3" value="compact" />
|
|
93
93
|
<label for="r3" class="text-sm font-medium">Compact</label>
|
|
94
94
|
</div>
|
|
@@ -113,15 +113,15 @@ const selected = ref('default')
|
|
|
113
113
|
|
|
114
114
|
<template>
|
|
115
115
|
<UiRadioGroup v-model="selected" name="spacing">
|
|
116
|
-
<div class="flex items-center
|
|
116
|
+
<div class="flex items-center gap-x-2">
|
|
117
117
|
<UiRadioGroupItem id="r1" value="default" />
|
|
118
118
|
<label for="r1" class="text-sm font-medium">Default</label>
|
|
119
119
|
</div>
|
|
120
|
-
<div class="flex items-center
|
|
120
|
+
<div class="flex items-center gap-x-2">
|
|
121
121
|
<UiRadioGroupItem id="r2" value="comfortable" disabled />
|
|
122
122
|
<label for="r2" class="text-sm font-medium text-muted-foreground">Comfortable</label>
|
|
123
123
|
</div>
|
|
124
|
-
<div class="flex items-center
|
|
124
|
+
<div class="flex items-center gap-x-2">
|
|
125
125
|
<UiRadioGroupItem id="r3" value="compact" />
|
|
126
126
|
<label for="r3" class="text-sm font-medium">Compact</label>
|
|
127
127
|
</div>
|
|
@@ -140,15 +140,15 @@ export const Disabled: Story = {
|
|
|
140
140
|
},
|
|
141
141
|
template: `
|
|
142
142
|
<UiRadioGroup v-model="selected" name="spacing" :orientation="args.orientation">
|
|
143
|
-
<div class="flex items-center
|
|
143
|
+
<div class="flex items-center gap-x-2">
|
|
144
144
|
<UiRadioGroupItem id="r1" value="default" />
|
|
145
145
|
<label for="r1" class="text-sm font-medium">Default</label>
|
|
146
146
|
</div>
|
|
147
|
-
<div class="flex items-center
|
|
147
|
+
<div class="flex items-center gap-x-2">
|
|
148
148
|
<UiRadioGroupItem id="r2" value="comfortable" disabled />
|
|
149
149
|
<label for="r2" class="text-sm font-medium text-muted-foreground">Comfortable</label>
|
|
150
150
|
</div>
|
|
151
|
-
<div class="flex items-center
|
|
151
|
+
<div class="flex items-center gap-x-2">
|
|
152
152
|
<UiRadioGroupItem id="r3" value="compact" />
|
|
153
153
|
<label for="r3" class="text-sm font-medium">Compact</label>
|
|
154
154
|
</div>
|
|
@@ -173,15 +173,15 @@ const selected = ref('small')
|
|
|
173
173
|
|
|
174
174
|
<template>
|
|
175
175
|
<UiRadioGroup v-model="selected" name="size" orientation="horizontal">
|
|
176
|
-
<div class="flex items-center
|
|
176
|
+
<div class="flex items-center gap-x-2">
|
|
177
177
|
<UiRadioGroupItem id="r1" value="small" />
|
|
178
178
|
<label for="r1" class="text-sm font-medium">Small</label>
|
|
179
179
|
</div>
|
|
180
|
-
<div class="flex items-center
|
|
180
|
+
<div class="flex items-center gap-x-2">
|
|
181
181
|
<UiRadioGroupItem id="r2" value="medium" />
|
|
182
182
|
<label for="r2" class="text-sm font-medium">Medium</label>
|
|
183
183
|
</div>
|
|
184
|
-
<div class="flex items-center
|
|
184
|
+
<div class="flex items-center gap-x-2">
|
|
185
185
|
<UiRadioGroupItem id="r3" value="large" />
|
|
186
186
|
<label for="r3" class="text-sm font-medium">Large</label>
|
|
187
187
|
</div>
|
|
@@ -211,15 +211,15 @@ export const HorizontalOrientation: Story = {
|
|
|
211
211
|
},
|
|
212
212
|
template: `
|
|
213
213
|
<UiRadioGroup v-model="selected" name="size" :orientation="args.orientation">
|
|
214
|
-
<div class="flex items-center
|
|
214
|
+
<div class="flex items-center gap-x-2">
|
|
215
215
|
<UiRadioGroupItem id="r1" value="small" />
|
|
216
216
|
<label for="r1" class="text-sm font-medium">Small</label>
|
|
217
217
|
</div>
|
|
218
|
-
<div class="flex items-center
|
|
218
|
+
<div class="flex items-center gap-x-2">
|
|
219
219
|
<UiRadioGroupItem id="r2" value="medium" />
|
|
220
220
|
<label for="r2" class="text-sm font-medium">Medium</label>
|
|
221
221
|
</div>
|
|
222
|
-
<div class="flex items-center
|
|
222
|
+
<div class="flex items-center gap-x-2">
|
|
223
223
|
<UiRadioGroupItem id="r3" value="large" />
|
|
224
224
|
<label for="r3" class="text-sm font-medium">Large</label>
|
|
225
225
|
</div>
|
|
@@ -246,11 +246,11 @@ const selected = ref('default')
|
|
|
246
246
|
<UiRadioGroup v-model="selected" name="options" as-child>
|
|
247
247
|
<fieldset class="rounded-lg border p-4">
|
|
248
248
|
<legend class="px-2 text-sm font-medium">Select an option</legend>
|
|
249
|
-
<div class="flex items-center
|
|
249
|
+
<div class="flex items-center gap-x-2">
|
|
250
250
|
<UiRadioGroupItem id="r1" value="default" />
|
|
251
251
|
<label for="r1" class="text-sm font-medium">Default</label>
|
|
252
252
|
</div>
|
|
253
|
-
<div class="flex items-center
|
|
253
|
+
<div class="flex items-center gap-x-2">
|
|
254
254
|
<UiRadioGroupItem id="r2" value="second" />
|
|
255
255
|
<label for="r2" class="text-sm font-medium">Second</label>
|
|
256
256
|
</div>
|
|
@@ -273,11 +273,11 @@ export const AsChild: Story = {
|
|
|
273
273
|
<UiRadioGroup v-model="selected" name="options" as-child>
|
|
274
274
|
<fieldset class="rounded-lg border p-4">
|
|
275
275
|
<legend class="px-2 text-sm font-medium">Select an option</legend>
|
|
276
|
-
<div class="flex items-center
|
|
276
|
+
<div class="flex items-center gap-x-2">
|
|
277
277
|
<UiRadioGroupItem id="r1" value="default" />
|
|
278
278
|
<label for="r1" class="text-sm font-medium">Default</label>
|
|
279
279
|
</div>
|
|
280
|
-
<div class="flex items-center
|
|
280
|
+
<div class="flex items-center gap-x-2">
|
|
281
281
|
<UiRadioGroupItem id="r2" value="second" />
|
|
282
282
|
<label for="r2" class="text-sm font-medium">Second</label>
|
|
283
283
|
</div>
|