@aleph-alpha/ui-library 1.9.0 → 1.10.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/README.md +14 -0
- package/dist/mcp/cli.js +21588 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/scripts/generate-component-meta.js +236 -0
- package/dist/mcp/server.js +21456 -0
- package/dist/system/index-CkH7HQaa.js +7 -0
- package/dist/system/index-CuHwEAQ_.js +7 -0
- package/dist/system/index.d.ts +1322 -318
- package/dist/system/lib.js +8839 -6993
- package/mcp/components-meta.json +1172 -0
- package/package.json +12 -2
- package/src/@types/shims-vue.d.ts +5 -0
- package/src/__tests__/placeholder.test.ts +7 -0
- package/src/compositions/UiCompositionPlaceholder/UiCompositionPlaceholder.vue +9 -0
- package/src/compositions/UiCompositionPlaceholder/index.ts +1 -0
- package/src/compositions/UiCompositionPlaceholder/types.ts +8 -0
- package/src/compositions/UiDataTable/UiDataTable.mock.ts +104 -0
- package/src/compositions/UiDataTable/UiDataTable.stories.ts +1575 -0
- package/src/compositions/UiDataTable/UiDataTable.vue +129 -0
- package/src/compositions/UiDataTable/UiDataTableColumnHeader.vue +97 -0
- package/src/compositions/UiDataTable/UiDataTablePagination.vue +147 -0
- package/src/compositions/UiDataTable/UiDataTableToolbar.vue +85 -0
- package/src/compositions/UiDataTable/__tests__/UiDataTable.test.ts +372 -0
- package/src/compositions/UiDataTable/__tests__/UiDataTableColumnHeader.test.ts +217 -0
- package/src/compositions/UiDataTable/__tests__/UiDataTablePagination.test.ts +274 -0
- package/src/compositions/UiDataTable/__tests__/UiDataTableToolbar.test.ts +198 -0
- package/src/compositions/UiDataTable/constants.ts +77 -0
- package/src/compositions/UiDataTable/index.ts +6 -0
- package/src/compositions/UiDataTable/types.ts +39 -0
- package/src/compositions/UiDatePicker/UiDatePicker.stories.ts +976 -0
- package/src/compositions/UiDatePicker/UiDatePicker.vue +193 -0
- package/src/compositions/UiDatePicker/__tests__/UiDatePicker.test.ts +325 -0
- package/src/compositions/UiDatePicker/index.ts +14 -0
- package/src/compositions/UiDatePicker/types.ts +220 -0
- package/src/compositions/index.ts +8 -0
- package/src/foundations/UiPlaceholder/UiPlaceholder.vue +9 -0
- package/src/foundations/UiPlaceholder/index.ts +1 -0
- package/src/foundations/UiPlaceholder/types.ts +8 -0
- package/src/foundations/index.ts +6 -0
- package/src/index.ts +27 -0
- package/src/lib/utils.ts +6 -0
- package/src/primitives/UiAccordion/UiAccordion.stories.ts +476 -0
- package/src/primitives/UiAccordion/UiAccordion.vue +31 -0
- package/src/primitives/UiAccordion/UiAccordionContent.vue +16 -0
- package/src/primitives/UiAccordion/UiAccordionItem.vue +16 -0
- package/src/primitives/UiAccordion/UiAccordionTrigger.vue +23 -0
- package/src/primitives/UiAccordion/__tests__/UiAccordion.test.ts +198 -0
- package/src/primitives/UiAccordion/index.ts +6 -0
- package/src/primitives/UiAccordion/types.ts +95 -0
- package/src/primitives/UiAlert/UiAlert.stories.ts +199 -0
- package/src/primitives/UiAlert/UiAlert.vue +27 -0
- package/src/primitives/UiAlert/UiAlertDescription.vue +13 -0
- package/src/primitives/UiAlert/UiAlertTitle.vue +13 -0
- package/src/primitives/UiAlert/__tests__/UiAlert.test.ts +20 -0
- package/src/primitives/UiAlert/constants.ts +3 -0
- package/src/primitives/UiAlert/index.ts +5 -0
- package/src/primitives/UiAlert/types.ts +14 -0
- package/src/primitives/UiAlertDialog/UiAlertDialog.stories.ts +186 -0
- package/src/primitives/UiAlertDialog/UiAlertDialog.vue +18 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogAction.vue +16 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogCancel.vue +16 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogContent.vue +26 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogDescription.vue +16 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogFooter.vue +13 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogHeader.vue +16 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogTitle.vue +16 -0
- package/src/primitives/UiAlertDialog/UiAlertDialogTrigger.vue +17 -0
- package/src/primitives/UiAlertDialog/__tests__/UiAlertDialog.test.ts +184 -0
- package/src/primitives/UiAlertDialog/index.ts +9 -0
- package/src/primitives/UiAlertDialog/types.ts +83 -0
- package/src/primitives/UiAvatar/UiAvatar.stories.ts +194 -0
- package/src/primitives/UiAvatar/UiAvatar.vue +13 -0
- package/src/primitives/UiAvatar/UiAvatarFallback.vue +13 -0
- package/src/primitives/UiAvatar/UiAvatarImage.vue +14 -0
- package/src/primitives/UiAvatar/__tests__/UiAvatar.test.ts +36 -0
- package/src/primitives/UiAvatar/index.ts +3 -0
- package/src/primitives/UiAvatar/types.ts +17 -0
- package/src/primitives/UiBadge/UiBadge.stories.ts +373 -0
- package/src/primitives/UiBadge/UiBadge.vue +21 -0
- package/src/primitives/UiBadge/__tests__/UiBadge.test.ts +44 -0
- package/src/primitives/UiBadge/constants.ts +3 -0
- package/src/primitives/UiBadge/index.ts +2 -0
- package/src/primitives/UiBadge/types.ts +48 -0
- package/src/primitives/UiButton/UiButton.stories.ts +537 -0
- package/src/primitives/UiButton/UiButton.vue +72 -0
- package/src/primitives/UiButton/__tests__/UiButton.test.ts +133 -0
- package/src/primitives/UiButton/index.ts +2 -0
- package/src/primitives/UiButton/types.ts +87 -0
- package/src/primitives/UiCalendar/UiCalendar.stories.ts +797 -0
- package/src/primitives/UiCalendar/UiCalendar.vue +67 -0
- package/src/primitives/UiCalendar/__tests__/UiCalendar.test.ts +45 -0
- package/src/primitives/UiCalendar/index.ts +15 -0
- package/src/primitives/UiCalendar/types.ts +236 -0
- package/src/primitives/UiCard/UiCard.stories.ts +197 -0
- package/src/primitives/UiCard/UiCard.vue +13 -0
- package/src/primitives/UiCard/UiCardAction.vue +13 -0
- package/src/primitives/UiCard/UiCardContent.vue +13 -0
- package/src/primitives/UiCard/UiCardDescription.vue +13 -0
- package/src/primitives/UiCard/UiCardFooter.vue +13 -0
- package/src/primitives/UiCard/UiCardHeader.vue +13 -0
- package/src/primitives/UiCard/UiCardTitle.vue +13 -0
- package/src/primitives/UiCard/__tests__/UiCard.test.ts +19 -0
- package/src/primitives/UiCard/__tests__/UiCardAction.test.ts +19 -0
- package/src/primitives/UiCard/__tests__/UiCardContent.test.ts +19 -0
- package/src/primitives/UiCard/__tests__/UiCardDescription.test.ts +19 -0
- package/src/primitives/UiCard/__tests__/UiCardFooter.test.ts +19 -0
- package/src/primitives/UiCard/__tests__/UiCardHeader.test.ts +19 -0
- package/src/primitives/UiCard/__tests__/UiCardTitle.test.ts +19 -0
- package/src/primitives/UiCard/index.ts +7 -0
- package/src/primitives/UiCard/types.ts +10 -0
- package/src/primitives/UiCheckbox/UiCheckbox.stories.ts +231 -0
- package/src/primitives/UiCheckbox/UiCheckbox.vue +19 -0
- package/src/primitives/UiCheckbox/__tests__/UiCheckbox.test.ts +29 -0
- package/src/primitives/UiCheckbox/index.ts +2 -0
- package/src/primitives/UiCheckbox/types.ts +30 -0
- package/src/primitives/UiDrawer/UiDrawer.stories.ts +602 -0
- package/src/primitives/UiDrawer/UiDrawer.vue +19 -0
- package/src/primitives/UiDrawer/UiDrawerClose.vue +16 -0
- package/src/primitives/UiDrawer/UiDrawerContent.vue +29 -0
- package/src/primitives/UiDrawer/UiDrawerDescription.vue +16 -0
- package/src/primitives/UiDrawer/UiDrawerFooter.vue +16 -0
- package/src/primitives/UiDrawer/UiDrawerHeader.vue +16 -0
- package/src/primitives/UiDrawer/UiDrawerTitle.vue +16 -0
- package/src/primitives/UiDrawer/UiDrawerTrigger.vue +16 -0
- package/src/primitives/UiDrawer/__tests__/UiDrawer.test.ts +229 -0
- package/src/primitives/UiDrawer/index.ts +8 -0
- package/src/primitives/UiDrawer/types.ts +96 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenu.stories.ts +760 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenu.vue +25 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuCheckboxItem.vue +29 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuContent.vue +27 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuGroup.vue +13 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuItem.vue +26 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuLabel.vue +18 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuRadioGroup.vue +20 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuRadioItem.vue +26 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuSeparator.vue +11 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuShortcut.vue +13 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuSub.vue +26 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuSubContent.vue +23 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuSubTrigger.vue +24 -0
- package/src/primitives/UiDropdownMenu/UiDropdownMenuTrigger.vue +24 -0
- package/src/primitives/UiDropdownMenu/__tests__/UiDropdownMenu.test.ts +557 -0
- package/src/primitives/UiDropdownMenu/index.ts +16 -0
- package/src/primitives/UiDropdownMenu/types.ts +219 -0
- package/src/primitives/UiField/UiField.stories.ts +1496 -0
- package/src/primitives/UiField/UiField.vue +18 -0
- package/src/primitives/UiField/UiFieldContent.vue +13 -0
- package/src/primitives/UiField/UiFieldDescription.vue +13 -0
- package/src/primitives/UiField/UiFieldError.vue +20 -0
- package/src/primitives/UiField/UiFieldGroup.vue +13 -0
- package/src/primitives/UiField/UiFieldLabel.vue +16 -0
- package/src/primitives/UiField/UiFieldLegend.vue +13 -0
- package/src/primitives/UiField/UiFieldSeparator.vue +13 -0
- package/src/primitives/UiField/UiFieldSet.vue +13 -0
- package/src/primitives/UiField/UiFieldTitle.vue +13 -0
- package/src/primitives/UiField/__tests__/UiFieldError.test.ts +35 -0
- package/src/primitives/UiField/index.ts +10 -0
- package/src/primitives/UiField/types.ts +47 -0
- package/src/primitives/UiIcon/UiIcon.stories.ts +95 -0
- package/src/primitives/UiIcon/UiIcon.vue +14 -0
- package/src/primitives/UiIcon/__tests__/UiIcon.test.ts +24 -0
- package/src/primitives/UiIcon/index.ts +1 -0
- package/src/primitives/UiIcon/types.ts +23 -0
- package/src/primitives/UiIconButton/UiIconButton.stories.ts +446 -0
- package/src/primitives/UiIconButton/UiIconButton.vue +63 -0
- package/src/primitives/UiIconButton/__tests__/UiIconButton.test.ts +102 -0
- package/src/primitives/UiIconButton/index.ts +2 -0
- package/src/primitives/UiIconButton/types.ts +67 -0
- package/src/primitives/UiInput/UiInput.stories.ts +193 -0
- package/src/primitives/UiInput/UiInput.vue +19 -0
- package/src/primitives/UiInput/__tests__/UiInput.test.ts +38 -0
- package/src/primitives/UiInput/index.ts +2 -0
- package/src/primitives/UiInput/types.ts +31 -0
- package/src/primitives/UiPopover/UiPopover.stories.ts +394 -0
- package/src/primitives/UiPopover/UiPopover.vue +17 -0
- package/src/primitives/UiPopover/UiPopoverContent.vue +27 -0
- package/src/primitives/UiPopover/UiPopoverTrigger.vue +16 -0
- package/src/primitives/UiPopover/__tests__/UiPopover.test.ts +87 -0
- package/src/primitives/UiPopover/index.ts +5 -0
- package/src/primitives/UiPopover/types.ts +86 -0
- package/src/primitives/UiProgress/UiProgress.stories.ts +92 -0
- package/src/primitives/UiProgress/UiProgress.vue +25 -0
- package/src/primitives/UiProgress/__tests__/UiProgress.test.ts +46 -0
- package/src/primitives/UiProgress/index.ts +2 -0
- package/src/primitives/UiProgress/types.ts +16 -0
- package/src/primitives/UiRadioGroup/UiRadioGroup.stories.ts +291 -0
- package/src/primitives/UiRadioGroup/UiRadioGroup.vue +43 -0
- package/src/primitives/UiRadioGroup/UiRadioGroupItem.vue +18 -0
- package/src/primitives/UiRadioGroup/__tests__/UiRadioGroup.test.ts +404 -0
- package/src/primitives/UiRadioGroup/index.ts +4 -0
- package/src/primitives/UiRadioGroup/types.ts +66 -0
- package/src/primitives/UiRangeCalendar/UiRangeCalendar.stories.ts +609 -0
- package/src/primitives/UiRangeCalendar/UiRangeCalendar.vue +50 -0
- package/src/primitives/UiRangeCalendar/__tests__/UiRangeCalendar.test.ts +35 -0
- package/src/primitives/UiRangeCalendar/index.ts +13 -0
- package/src/primitives/UiRangeCalendar/types.ts +184 -0
- package/src/primitives/UiSelect/UiSelect.stories.ts +425 -0
- package/src/primitives/UiSelect/UiSelect.vue +47 -0
- package/src/primitives/UiSelect/UiSelectContent.vue +30 -0
- package/src/primitives/UiSelect/UiSelectGroup.vue +13 -0
- package/src/primitives/UiSelect/UiSelectItem.vue +19 -0
- package/src/primitives/UiSelect/UiSelectLabel.vue +13 -0
- package/src/primitives/UiSelect/UiSelectSeparator.vue +11 -0
- package/src/primitives/UiSelect/UiSelectTrigger.vue +30 -0
- package/src/primitives/UiSelect/UiSelectValue.vue +18 -0
- package/src/primitives/UiSelect/__tests__/UiSelect.test.ts +211 -0
- package/src/primitives/UiSelect/__tests__/UiSelectContent.test.ts +30 -0
- package/src/primitives/UiSelect/__tests__/UiSelectGroup.test.ts +85 -0
- package/src/primitives/UiSelect/__tests__/UiSelectItem.test.ts +79 -0
- package/src/primitives/UiSelect/__tests__/UiSelectLabel.test.ts +83 -0
- package/src/primitives/UiSelect/__tests__/UiSelectSeparator.test.ts +82 -0
- package/src/primitives/UiSelect/__tests__/UiSelectTrigger.test.ts +54 -0
- package/src/primitives/UiSelect/__tests__/UiSelectValue.test.ts +39 -0
- package/src/primitives/UiSelect/index.ts +10 -0
- package/src/primitives/UiSelect/types.ts +93 -0
- package/src/primitives/UiSlider/UiSlider.stories.ts +226 -0
- package/src/primitives/UiSlider/UiSlider.vue +44 -0
- package/src/primitives/UiSlider/__tests__/UiSlider.test.ts +76 -0
- package/src/primitives/UiSlider/index.ts +1 -0
- package/src/primitives/UiSlider/types.ts +101 -0
- package/src/primitives/UiSpinner/UiSpinner.stories.ts +143 -0
- package/src/primitives/UiSpinner/UiSpinner.vue +16 -0
- package/src/primitives/UiSpinner/__tests__/UiSpinner.test.ts +19 -0
- package/src/primitives/UiSpinner/index.ts +2 -0
- package/src/primitives/UiSpinner/types.ts +16 -0
- package/src/primitives/UiSwitch/UiSwitch.stories.ts +120 -0
- package/src/primitives/UiSwitch/UiSwitch.vue +21 -0
- package/src/primitives/UiSwitch/__tests__/UiSwitch.test.ts +47 -0
- package/src/primitives/UiSwitch/index.ts +2 -0
- package/src/primitives/UiSwitch/types.ts +25 -0
- package/src/primitives/UiTable/UiTable.stories.ts +505 -0
- package/src/primitives/UiTable/UiTable.vue +13 -0
- package/src/primitives/UiTable/UiTableBody.vue +13 -0
- package/src/primitives/UiTable/UiTableCaption.vue +13 -0
- package/src/primitives/UiTable/UiTableCell.vue +16 -0
- package/src/primitives/UiTable/UiTableEmpty.vue +18 -0
- package/src/primitives/UiTable/UiTableFooter.vue +13 -0
- package/src/primitives/UiTable/UiTableHead.vue +18 -0
- package/src/primitives/UiTable/UiTableHeader.vue +13 -0
- package/src/primitives/UiTable/UiTableRow.vue +18 -0
- package/src/primitives/UiTable/__tests__/UiTable.test.ts +19 -0
- package/src/primitives/UiTable/__tests__/UiTableBody.test.ts +19 -0
- package/src/primitives/UiTable/__tests__/UiTableCaption.test.ts +19 -0
- package/src/primitives/UiTable/__tests__/UiTableCell.test.ts +26 -0
- package/src/primitives/UiTable/__tests__/UiTableEmpty.test.ts +32 -0
- package/src/primitives/UiTable/__tests__/UiTableFooter.test.ts +19 -0
- package/src/primitives/UiTable/__tests__/UiTableHead.test.ts +43 -0
- package/src/primitives/UiTable/__tests__/UiTableHeader.test.ts +19 -0
- package/src/primitives/UiTable/__tests__/UiTableRow.test.ts +32 -0
- package/src/primitives/UiTable/index.ts +16 -0
- package/src/primitives/UiTable/types.ts +68 -0
- package/src/primitives/UiTabs/UiTabs.stories.ts +456 -0
- package/src/primitives/UiTabs/UiTabs.vue +31 -0
- package/src/primitives/UiTabs/UiTabsContent.vue +16 -0
- package/src/primitives/UiTabs/UiTabsList.vue +16 -0
- package/src/primitives/UiTabs/UiTabsTrigger.vue +16 -0
- package/src/primitives/UiTabs/__tests__/UiTabs.test.ts +122 -0
- package/src/primitives/UiTabs/index.ts +6 -0
- package/src/primitives/UiTabs/types.ts +68 -0
- package/src/primitives/UiTextarea/UiTextarea.stories.ts +107 -0
- package/src/primitives/UiTextarea/UiTextarea.vue +19 -0
- package/src/primitives/UiTextarea/__tests__/UiTextarea.test.ts +40 -0
- package/src/primitives/UiTextarea/index.ts +2 -0
- package/src/primitives/UiTextarea/types.ts +30 -0
- package/src/primitives/UiTooltip/UiTooltip.stories.ts +550 -0
- package/src/primitives/UiTooltip/UiTooltip.vue +42 -0
- package/src/primitives/UiTooltip/__tests__/UiTooltip.test.ts +78 -0
- package/src/primitives/UiTooltip/index.ts +2 -0
- package/src/primitives/UiTooltip/types.ts +53 -0
- package/src/primitives/index.ts +33 -0
- package/src/primitives/shadcn/accordion/Accordion.vue +15 -0
- package/src/primitives/shadcn/accordion/AccordionContent.vue +23 -0
- package/src/primitives/shadcn/accordion/AccordionItem.vue +24 -0
- package/src/primitives/shadcn/accordion/AccordionTrigger.vue +35 -0
- package/src/primitives/shadcn/accordion/index.ts +4 -0
- package/src/primitives/shadcn/alert/Alert.vue +17 -0
- package/src/primitives/shadcn/alert/AlertDescription.vue +22 -0
- package/src/primitives/shadcn/alert/AlertTitle.vue +17 -0
- package/src/primitives/shadcn/alert/index.ts +24 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialog.vue +15 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogAction.vue +18 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogCancel.vue +21 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogContent.vue +44 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogDescription.vue +21 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogFooter.vue +17 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogHeader.vue +17 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogTitle.vue +21 -0
- package/src/primitives/shadcn/alert-dialog/AlertDialogTrigger.vue +12 -0
- package/src/primitives/shadcn/alert-dialog/index.ts +9 -0
- package/src/primitives/shadcn/avatar/Avatar.vue +18 -0
- package/src/primitives/shadcn/avatar/AvatarFallback.vue +21 -0
- package/src/primitives/shadcn/avatar/AvatarImage.vue +12 -0
- package/src/primitives/shadcn/avatar/index.ts +3 -0
- package/src/primitives/shadcn/badge/Badge.vue +28 -0
- package/src/primitives/shadcn/badge/index.ts +24 -0
- package/src/primitives/shadcn/button/Button.vue +29 -0
- package/src/primitives/shadcn/button/index.ts +36 -0
- package/src/primitives/shadcn/calendar/Calendar.vue +206 -0
- package/src/primitives/shadcn/calendar/CalendarCell.vue +28 -0
- package/src/primitives/shadcn/calendar/CalendarCellTrigger.vue +44 -0
- package/src/primitives/shadcn/calendar/CalendarGrid.vue +23 -0
- package/src/primitives/shadcn/calendar/CalendarGridBody.vue +12 -0
- package/src/primitives/shadcn/calendar/CalendarGridHead.vue +13 -0
- package/src/primitives/shadcn/calendar/CalendarGridRow.vue +23 -0
- package/src/primitives/shadcn/calendar/CalendarHeadCell.vue +23 -0
- package/src/primitives/shadcn/calendar/CalendarHeader.vue +23 -0
- package/src/primitives/shadcn/calendar/CalendarHeading.vue +30 -0
- package/src/primitives/shadcn/calendar/CalendarNextButton.vue +33 -0
- package/src/primitives/shadcn/calendar/CalendarPrevButton.vue +33 -0
- package/src/primitives/shadcn/calendar/index.ts +14 -0
- package/src/primitives/shadcn/card/Card.vue +22 -0
- package/src/primitives/shadcn/card/CardAction.vue +17 -0
- package/src/primitives/shadcn/card/CardContent.vue +14 -0
- package/src/primitives/shadcn/card/CardDescription.vue +14 -0
- package/src/primitives/shadcn/card/CardFooter.vue +14 -0
- package/src/primitives/shadcn/card/CardHeader.vue +22 -0
- package/src/primitives/shadcn/card/CardTitle.vue +14 -0
- package/src/primitives/shadcn/card/index.ts +7 -0
- package/src/primitives/shadcn/checkbox/Checkbox.vue +38 -0
- package/src/primitives/shadcn/checkbox/index.ts +1 -0
- package/src/primitives/shadcn/drawer/Drawer.vue +15 -0
- package/src/primitives/shadcn/drawer/DrawerClose.vue +12 -0
- package/src/primitives/shadcn/drawer/DrawerContent.vue +52 -0
- package/src/primitives/shadcn/drawer/DrawerDescription.vue +20 -0
- package/src/primitives/shadcn/drawer/DrawerFooter.vue +17 -0
- package/src/primitives/shadcn/drawer/DrawerHeader.vue +17 -0
- package/src/primitives/shadcn/drawer/DrawerTitle.vue +20 -0
- package/src/primitives/shadcn/drawer/DrawerTrigger.vue +12 -0
- package/src/primitives/shadcn/drawer/index.ts +8 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenu.vue +15 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuCheckboxItem.vue +41 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuContent.vue +40 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuItem.vue +41 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuLabel.vue +25 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuRadioGroup.vue +15 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuRadioItem.vue +38 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuSub.vue +15 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuSubContent.vue +29 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/src/primitives/shadcn/dropdown-menu/DropdownMenuTrigger.vue +14 -0
- package/src/primitives/shadcn/dropdown-menu/index.ts +16 -0
- package/src/primitives/shadcn/field/Field.vue +22 -0
- package/src/primitives/shadcn/field/FieldContent.vue +17 -0
- package/src/primitives/shadcn/field/FieldDescription.vue +24 -0
- package/src/primitives/shadcn/field/FieldError.vue +69 -0
- package/src/primitives/shadcn/field/FieldGroup.vue +22 -0
- package/src/primitives/shadcn/field/FieldLabel.vue +28 -0
- package/src/primitives/shadcn/field/FieldLegend.vue +26 -0
- package/src/primitives/shadcn/field/FieldSeparator.vue +28 -0
- package/src/primitives/shadcn/field/FieldSet.vue +23 -0
- package/src/primitives/shadcn/field/FieldTitle.vue +22 -0
- package/src/primitives/shadcn/field/index.ts +39 -0
- package/src/primitives/shadcn/icon/Icon.vue +38 -0
- package/src/primitives/shadcn/icon/index.ts +1 -0
- package/src/primitives/shadcn/index.ts +3 -0
- package/src/primitives/shadcn/input/Input.vue +35 -0
- package/src/primitives/shadcn/input/index.ts +1 -0
- package/src/primitives/shadcn/label/Label.vue +28 -0
- package/src/primitives/shadcn/label/index.ts +1 -0
- package/src/primitives/shadcn/native-select/NativeSelect.vue +56 -0
- package/src/primitives/shadcn/native-select/NativeSelectOptGroup.vue +18 -0
- package/src/primitives/shadcn/native-select/NativeSelectOption.vue +18 -0
- package/src/primitives/shadcn/native-select/index.ts +3 -0
- package/src/primitives/shadcn/popover/Popover.vue +19 -0
- package/src/primitives/shadcn/popover/PopoverContent.vue +41 -0
- package/src/primitives/shadcn/popover/PopoverTrigger.vue +11 -0
- package/src/primitives/shadcn/popover/index.ts +4 -0
- package/src/primitives/shadcn/progress/Progress.vue +30 -0
- package/src/primitives/shadcn/progress/index.ts +1 -0
- package/src/primitives/shadcn/radio-group/RadioGroup.vue +25 -0
- package/src/primitives/shadcn/radio-group/RadioGroupItem.vue +38 -0
- package/src/primitives/shadcn/radio-group/index.ts +2 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendar.vue +73 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarCell.vue +28 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarCellTrigger.vue +46 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarGrid.vue +23 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarGridBody.vue +12 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarGridHead.vue +12 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarGridRow.vue +23 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarHeadCell.vue +23 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarHeader.vue +23 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarHeading.vue +30 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarNextButton.vue +34 -0
- package/src/primitives/shadcn/range-calendar/RangeCalendarPrevButton.vue +34 -0
- package/src/primitives/shadcn/range-calendar/index.ts +12 -0
- package/src/primitives/shadcn/select/Select.vue +15 -0
- package/src/primitives/shadcn/select/SelectContent.vue +55 -0
- package/src/primitives/shadcn/select/SelectGroup.vue +12 -0
- package/src/primitives/shadcn/select/SelectItem.vue +39 -0
- package/src/primitives/shadcn/select/SelectItemText.vue +12 -0
- package/src/primitives/shadcn/select/SelectLabel.vue +17 -0
- package/src/primitives/shadcn/select/SelectScrollDownButton.vue +26 -0
- package/src/primitives/shadcn/select/SelectScrollUpButton.vue +26 -0
- package/src/primitives/shadcn/select/SelectSeparator.vue +19 -0
- package/src/primitives/shadcn/select/SelectTrigger.vue +37 -0
- package/src/primitives/shadcn/select/SelectValue.vue +12 -0
- package/src/primitives/shadcn/select/index.ts +11 -0
- package/src/primitives/shadcn/separator/Separator.vue +27 -0
- package/src/primitives/shadcn/separator/index.ts +1 -0
- package/src/primitives/shadcn/slider/Slider.vue +45 -0
- package/src/primitives/shadcn/slider/index.ts +1 -0
- package/src/primitives/shadcn/spinner/Spinner.vue +18 -0
- package/src/primitives/shadcn/spinner/index.ts +1 -0
- package/src/primitives/shadcn/switch/Switch.vue +40 -0
- package/src/primitives/shadcn/switch/index.ts +1 -0
- package/src/primitives/shadcn/table/Table.vue +16 -0
- package/src/primitives/shadcn/table/TableBody.vue +14 -0
- package/src/primitives/shadcn/table/TableCaption.vue +14 -0
- package/src/primitives/shadcn/table/TableCell.vue +26 -0
- package/src/primitives/shadcn/table/TableEmpty.vue +29 -0
- package/src/primitives/shadcn/table/TableFooter.vue +17 -0
- package/src/primitives/shadcn/table/TableHead.vue +28 -0
- package/src/primitives/shadcn/table/TableHeader.vue +14 -0
- package/src/primitives/shadcn/table/TableRow.vue +21 -0
- package/src/primitives/shadcn/table/index.ts +9 -0
- package/src/primitives/shadcn/table/utils.ts +8 -0
- package/src/primitives/shadcn/tabs/Tabs.vue +24 -0
- package/src/primitives/shadcn/tabs/TabsContent.vue +21 -0
- package/src/primitives/shadcn/tabs/TabsList.vue +26 -0
- package/src/primitives/shadcn/tabs/TabsTrigger.vue +28 -0
- package/src/primitives/shadcn/tabs/index.ts +4 -0
- package/src/primitives/shadcn/textarea/Textarea.vue +33 -0
- package/src/primitives/shadcn/textarea/index.ts +1 -0
- package/src/primitives/shadcn/tooltip/Tooltip.vue +15 -0
- package/src/primitives/shadcn/tooltip/TooltipContent.vue +40 -0
- package/src/primitives/shadcn/tooltip/TooltipProvider.vue +12 -0
- package/src/primitives/shadcn/tooltip/TooltipTrigger.vue +12 -0
- package/src/primitives/shadcn/tooltip/index.ts +4 -0
- package/src/styles/global.css +1 -0
- package/src/templates/UiTemplatePlaceholder/UiTemplatePlaceholder.vue +9 -0
- package/src/templates/UiTemplatePlaceholder/index.ts +1 -0
- package/src/templates/UiTemplatePlaceholder/types.ts +8 -0
- package/src/templates/index.ts +6 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// mcp/scripts/generate-component-meta.ts
|
|
4
|
+
import * as fs4 from "node:fs";
|
|
5
|
+
import * as path3 from "node:path";
|
|
6
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7
|
+
|
|
8
|
+
// mcp/constants.ts
|
|
9
|
+
import * as fs3 from "node:fs";
|
|
10
|
+
import * as path2 from "node:path";
|
|
11
|
+
|
|
12
|
+
// mcp/utils/paths.ts
|
|
13
|
+
import * as fs from "node:fs";
|
|
14
|
+
import * as path from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
var __dirname = path.dirname(__filename);
|
|
18
|
+
function getLibrarySourcePath() {
|
|
19
|
+
const possiblePaths = [
|
|
20
|
+
// Bundled: from dist/mcp/ -> ../../src
|
|
21
|
+
path.resolve(__dirname, "../../src"),
|
|
22
|
+
// Fallback: running from package root
|
|
23
|
+
path.join(process.cwd(), "src")
|
|
24
|
+
];
|
|
25
|
+
for (const srcPath of possiblePaths) {
|
|
26
|
+
if (fs.existsSync(srcPath)) {
|
|
27
|
+
return srcPath;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
throw new Error(
|
|
31
|
+
"Could not find UI library source directory. Is the package installed correctly?"
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// mcp/utils/file-utils.ts
|
|
36
|
+
import * as fs2 from "node:fs";
|
|
37
|
+
|
|
38
|
+
// mcp/constants.ts
|
|
39
|
+
function detectCategoryDirs() {
|
|
40
|
+
const srcPath = getSrcPath();
|
|
41
|
+
if (!srcPath || !fs3.existsSync(srcPath)) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const entries = fs3.readdirSync(srcPath, { withFileTypes: true });
|
|
45
|
+
return entries.filter((entry) => entry.isDirectory()).filter((entry) => !entry.name.startsWith(".") && entry.name !== "node_modules").filter((entry) => {
|
|
46
|
+
try {
|
|
47
|
+
const dirPath = path2.join(srcPath, entry.name);
|
|
48
|
+
const subEntries = fs3.readdirSync(dirPath, { withFileTypes: true });
|
|
49
|
+
return subEntries.some((sub) => sub.isDirectory() && sub.name.startsWith("Ui"));
|
|
50
|
+
} catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}).map((entry) => entry.name);
|
|
54
|
+
}
|
|
55
|
+
var cachedCategoryDirs = null;
|
|
56
|
+
function getCategoryDirs() {
|
|
57
|
+
if (cachedCategoryDirs) return cachedCategoryDirs;
|
|
58
|
+
cachedCategoryDirs = detectCategoryDirs();
|
|
59
|
+
return cachedCategoryDirs;
|
|
60
|
+
}
|
|
61
|
+
function getSrcPath() {
|
|
62
|
+
try {
|
|
63
|
+
return getLibrarySourcePath();
|
|
64
|
+
} catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// mcp/scripts/generate-component-meta.ts
|
|
70
|
+
function escapeRegex(str) {
|
|
71
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
72
|
+
}
|
|
73
|
+
var __filename2 = fileURLToPath2(import.meta.url);
|
|
74
|
+
var __dirname2 = path3.dirname(__filename2);
|
|
75
|
+
var PACKAGE_ROOT = path3.resolve(__dirname2, "../../..");
|
|
76
|
+
var SRC_PATH = path3.join(PACKAGE_ROOT, "src");
|
|
77
|
+
var OUTPUT_PATH = path3.join(PACKAGE_ROOT, "mcp", "components-meta.json");
|
|
78
|
+
function extractJSDocTags(content, interfaceName) {
|
|
79
|
+
const declarationRegex = new RegExp(
|
|
80
|
+
`export\\s+(?:interface|type)\\s+${escapeRegex(interfaceName)}\\b`
|
|
81
|
+
);
|
|
82
|
+
const declarationMatch = content.match(declarationRegex);
|
|
83
|
+
if (!declarationMatch || declarationMatch.index === void 0) {
|
|
84
|
+
return { description: "", useCases: [], keywords: [], related: [] };
|
|
85
|
+
}
|
|
86
|
+
const contentBefore = content.substring(0, declarationMatch.index);
|
|
87
|
+
const jsdocEndIndex = contentBefore.lastIndexOf("*/");
|
|
88
|
+
if (jsdocEndIndex === -1) {
|
|
89
|
+
return { description: "", useCases: [], keywords: [], related: [] };
|
|
90
|
+
}
|
|
91
|
+
const betweenJsdocAndDeclaration = contentBefore.substring(jsdocEndIndex + 2);
|
|
92
|
+
if (betweenJsdocAndDeclaration.trim() !== "") {
|
|
93
|
+
return { description: "", useCases: [], keywords: [], related: [] };
|
|
94
|
+
}
|
|
95
|
+
const jsdocStartIndex = contentBefore.lastIndexOf("/**");
|
|
96
|
+
if (jsdocStartIndex === -1 || jsdocStartIndex > jsdocEndIndex) {
|
|
97
|
+
return { description: "", useCases: [], keywords: [], related: [] };
|
|
98
|
+
}
|
|
99
|
+
const jsdoc = contentBefore.substring(jsdocStartIndex + 3, jsdocEndIndex);
|
|
100
|
+
const lines = jsdoc.split("\n").map((l) => l.replace(/^\s*\*\s?/, "").trim());
|
|
101
|
+
let description = "";
|
|
102
|
+
const useCases = [];
|
|
103
|
+
const keywords = [];
|
|
104
|
+
const related = [];
|
|
105
|
+
let category;
|
|
106
|
+
for (const line of lines) {
|
|
107
|
+
if (line.startsWith("@useCases") || line.startsWith("@use-cases")) {
|
|
108
|
+
const values = line.replace(/@use-?[cC]ases\s*/, "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
109
|
+
useCases.push(...values);
|
|
110
|
+
} else if (line.startsWith("@keywords")) {
|
|
111
|
+
const values = line.replace(/@keywords\s*/, "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
112
|
+
keywords.push(...values);
|
|
113
|
+
} else if (line.startsWith("@related")) {
|
|
114
|
+
const values = line.replace(/@related\s*/, "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
115
|
+
related.push(...values);
|
|
116
|
+
} else if (line.startsWith("@category")) {
|
|
117
|
+
category = line.replace(/@category\s*/, "").trim();
|
|
118
|
+
} else if (!line.startsWith("@") && line) {
|
|
119
|
+
description += (description ? " " : "") + line;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { description, useCases, keywords, related, category };
|
|
123
|
+
}
|
|
124
|
+
function extractKeywordsFromName(componentName) {
|
|
125
|
+
const name = componentName.replace(/^Ui/, "");
|
|
126
|
+
return name.replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase().split(/\s+/).filter((word) => word.length > 2);
|
|
127
|
+
}
|
|
128
|
+
function extractProps(content, interfaceName) {
|
|
129
|
+
const regex = new RegExp(
|
|
130
|
+
`export\\s+interface\\s+${escapeRegex(interfaceName)}\\s*\\{([\\s\\S]*?)\\n\\}`,
|
|
131
|
+
"m"
|
|
132
|
+
);
|
|
133
|
+
const match = content.match(regex);
|
|
134
|
+
if (!match) return [];
|
|
135
|
+
const interfaceBody = match[1].replace(/\/\*\*[\s\S]*?\*\//g, "");
|
|
136
|
+
const propRegex = /^\s*(\w+)\??:/gm;
|
|
137
|
+
const props = [];
|
|
138
|
+
let propMatch;
|
|
139
|
+
while ((propMatch = propRegex.exec(interfaceBody)) !== null) {
|
|
140
|
+
props.push(propMatch[1]);
|
|
141
|
+
}
|
|
142
|
+
return [...new Set(props)];
|
|
143
|
+
}
|
|
144
|
+
function extractExamples(storiesPath) {
|
|
145
|
+
if (!fs4.existsSync(storiesPath)) return [];
|
|
146
|
+
const content = fs4.readFileSync(storiesPath, "utf-8");
|
|
147
|
+
const examples = [];
|
|
148
|
+
const storyRegex = /export\s+const\s+(\w+):\s*Story/g;
|
|
149
|
+
let match;
|
|
150
|
+
while ((match = storyRegex.exec(content)) !== null) {
|
|
151
|
+
if (match[1] !== "default") {
|
|
152
|
+
examples.push(match[1]);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return examples;
|
|
156
|
+
}
|
|
157
|
+
function processComponent(componentDir, componentName) {
|
|
158
|
+
const typesPath = path3.join(componentDir, "types.ts");
|
|
159
|
+
const storiesPath = path3.join(componentDir, `${componentName}.stories.ts`);
|
|
160
|
+
let typesContent = "";
|
|
161
|
+
if (fs4.existsSync(typesPath)) {
|
|
162
|
+
typesContent = fs4.readFileSync(typesPath, "utf-8");
|
|
163
|
+
}
|
|
164
|
+
const escapedName = escapeRegex(componentName);
|
|
165
|
+
const exactPropsRegex = new RegExp(`export\\s+(?:interface|type)\\s+(${escapedName}Props)\\b`);
|
|
166
|
+
const exactMatch = typesContent.match(exactPropsRegex);
|
|
167
|
+
const subComponentPropsRegex = new RegExp(
|
|
168
|
+
`export\\s+(?:interface|type)\\s+(${escapedName}\\w*Props)\\b`
|
|
169
|
+
);
|
|
170
|
+
const subComponentMatch = typesContent.match(subComponentPropsRegex);
|
|
171
|
+
const anyPropsMatch = typesContent.match(/export\s+(?:interface|type)\s+(Ui\w+Props)/);
|
|
172
|
+
const interfaceName = exactMatch?.[1] || subComponentMatch?.[1] || anyPropsMatch?.[1] || `${componentName}Props`;
|
|
173
|
+
const jsdocData = extractJSDocTags(typesContent, interfaceName);
|
|
174
|
+
const nameKeywords = extractKeywordsFromName(componentName);
|
|
175
|
+
const keywords = jsdocData.keywords.length > 0 ? jsdocData.keywords : nameKeywords;
|
|
176
|
+
const category = jsdocData.category || "Uncategorized";
|
|
177
|
+
if (!jsdocData.category) {
|
|
178
|
+
console.warn(
|
|
179
|
+
` \u26A0\uFE0F ${componentName}: Missing @category in types.ts. See docs/CONTRIBUTION_GUIDELINES.md`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
const props = extractProps(typesContent, interfaceName);
|
|
183
|
+
const examples = extractExamples(storiesPath);
|
|
184
|
+
return {
|
|
185
|
+
description: jsdocData.description || `${componentName} component`,
|
|
186
|
+
category,
|
|
187
|
+
useCases: jsdocData.useCases,
|
|
188
|
+
keywords: [.../* @__PURE__ */ new Set([...keywords, ...nameKeywords])],
|
|
189
|
+
related: jsdocData.related,
|
|
190
|
+
props,
|
|
191
|
+
examples,
|
|
192
|
+
_autoGenerated: true
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function scanComponents() {
|
|
196
|
+
const meta = {};
|
|
197
|
+
for (const category of getCategoryDirs()) {
|
|
198
|
+
const categoryPath = path3.join(SRC_PATH, category);
|
|
199
|
+
if (!fs4.existsSync(categoryPath)) continue;
|
|
200
|
+
const entries = fs4.readdirSync(categoryPath, { withFileTypes: true });
|
|
201
|
+
for (const entry of entries) {
|
|
202
|
+
if (!entry.isDirectory()) continue;
|
|
203
|
+
if (!entry.name.startsWith("Ui")) continue;
|
|
204
|
+
if (entry.name === "shadcn") continue;
|
|
205
|
+
const componentDir = path3.join(categoryPath, entry.name);
|
|
206
|
+
const componentMeta = processComponent(componentDir, entry.name);
|
|
207
|
+
if (componentMeta) {
|
|
208
|
+
meta[entry.name] = componentMeta;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return meta;
|
|
213
|
+
}
|
|
214
|
+
function main() {
|
|
215
|
+
console.log("Scanning components...");
|
|
216
|
+
const meta = scanComponents();
|
|
217
|
+
console.log(`Found ${Object.keys(meta).length} components`);
|
|
218
|
+
console.log(`Writing to ${OUTPUT_PATH}...`);
|
|
219
|
+
fs4.writeFileSync(OUTPUT_PATH, JSON.stringify(meta, null, 2));
|
|
220
|
+
console.log("Done!");
|
|
221
|
+
const withUseCases = Object.values(meta).filter((m) => m.useCases.length > 0).length;
|
|
222
|
+
const withKeywords = Object.values(meta).filter((m) => m.keywords.length > 0).length;
|
|
223
|
+
console.log(`
|
|
224
|
+
Summary:`);
|
|
225
|
+
console.log(` Components with @useCases: ${withUseCases}/${Object.keys(meta).length}`);
|
|
226
|
+
console.log(` Components with keywords: ${withKeywords}/${Object.keys(meta).length}`);
|
|
227
|
+
}
|
|
228
|
+
var isMain = import.meta.url === `file://${process.argv[1]}`;
|
|
229
|
+
if (isMain) {
|
|
230
|
+
main();
|
|
231
|
+
}
|
|
232
|
+
export {
|
|
233
|
+
extractJSDocTags,
|
|
234
|
+
extractKeywordsFromName,
|
|
235
|
+
extractProps
|
|
236
|
+
};
|