@khsura/sui 0.0.0-stage → 1.18.3
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/.claude-plugin/marketplace.json +18 -0
- package/@types/components/badge/index.d.ts +1 -0
- package/@types/components/badge/sBadge.vue.d.ts +18 -0
- package/@types/components/badge/sBadgeContent.vue.d.ts +14 -0
- package/@types/components/calendar/index.d.ts +1 -0
- package/@types/components/calendar/sCalendar.vue.d.ts +52 -0
- package/@types/components/calendar/sCalendarMonthly.vue.d.ts +51 -0
- package/@types/components/calendar/sCalendarWeekly.vue.d.ts +75 -0
- package/@types/components/cards/index.d.ts +5 -0
- package/@types/components/cards/sCard.vue.d.ts +14 -0
- package/@types/components/cards/sCardActions.vue.d.ts +15 -0
- package/@types/components/cards/sCardSubtitle.vue.d.ts +15 -0
- package/@types/components/cards/sCardText.vue.d.ts +15 -0
- package/@types/components/cards/sCardTitle.vue.d.ts +15 -0
- package/@types/components/carousel/index.d.ts +2 -0
- package/@types/components/carousel/sCarousel.vue.d.ts +34 -0
- package/@types/components/carousel/sCarouselItem.vue.d.ts +14 -0
- package/@types/components/datePicker/index.d.ts +2 -0
- package/@types/components/datePicker/sDatePicker.vue.d.ts +22 -0
- package/@types/components/datePicker/sDatePickerDate.vue.d.ts +12 -0
- package/@types/components/datePicker/sDatePickerInput.vue.d.ts +31 -0
- package/@types/components/datePicker/sDatePickerMonth.vue.d.ts +12 -0
- package/@types/components/datePicker/sDatePickerSwitch.vue.d.ts +15 -0
- package/@types/components/datePicker/sDatePickerTitle.vue.d.ts +16 -0
- package/@types/components/datePicker/sDatePickerYear.vue.d.ts +12 -0
- package/@types/components/expansionPanel/index.d.ts +4 -0
- package/@types/components/expansionPanel/sExpansionPanel.vue.d.ts +17 -0
- package/@types/components/expansionPanel/sExpansionPanelContent.vue.d.ts +15 -0
- package/@types/components/expansionPanel/sExpansionPanelHeader.vue.d.ts +21 -0
- package/@types/components/expansionPanel/sExpansionPanels.vue.d.ts +24 -0
- package/@types/components/form/common/index.d.ts +1 -0
- package/@types/components/form/common/sFormInputError.vue.d.ts +25 -0
- package/@types/components/form/index.d.ts +7 -0
- package/@types/components/form/radio/index.d.ts +2 -0
- package/@types/components/form/radio/sRadio.vue.d.ts +32 -0
- package/@types/components/form/radio/sRadioGroup.vue.d.ts +35 -0
- package/@types/components/form/sCheckbox.vue.d.ts +22 -0
- package/@types/components/form/sForm.vue.d.ts +31 -0
- package/@types/components/form/sInput.vue.d.ts +73 -0
- package/@types/components/form/sSelect.vue.d.ts +64 -0
- package/@types/components/form/sTextarea.vue.d.ts +38 -0
- package/@types/components/grids/index.d.ts +4 -0
- package/@types/components/grids/sColumn.vue.d.ts +14 -0
- package/@types/components/grids/sContainer.vue.d.ts +14 -0
- package/@types/components/grids/sRow.vue.d.ts +14 -0
- package/@types/components/grids/sSpacer.vue.d.ts +13 -0
- package/@types/components/index.d.ts +36 -0
- package/@types/components/layout/index.d.ts +8 -0
- package/@types/components/layout/sApp.vue.d.ts +15 -0
- package/@types/components/layout/sAppBar.vue.d.ts +22 -0
- package/@types/components/layout/sAppBarTitle.vue.d.ts +16 -0
- package/@types/components/layout/sBottomNavigation.vue.d.ts +24 -0
- package/@types/components/layout/sFooter.vue.d.ts +18 -0
- package/@types/components/layout/sLayout.vue.d.ts +14 -0
- package/@types/components/layout/sMain.vue.d.ts +14 -0
- package/@types/components/layout/sNavigationDrawer.vue.d.ts +45 -0
- package/@types/components/list/index.d.ts +8 -0
- package/@types/components/list/sList.vue.d.ts +14 -0
- package/@types/components/list/sListItem.vue.d.ts +18 -0
- package/@types/components/list/sListItemAction.vue.d.ts +14 -0
- package/@types/components/list/sListItemContent.vue.d.ts +13 -0
- package/@types/components/list/sListItemGroup.vue.d.ts +47 -0
- package/@types/components/list/sListItemIcon.vue.d.ts +14 -0
- package/@types/components/list/sListItemSubtitle.vue.d.ts +13 -0
- package/@types/components/list/sListItemTitle.vue.d.ts +13 -0
- package/@types/components/progress/index.d.ts +2 -0
- package/@types/components/progress/sProgressCircular.vue.d.ts +18 -0
- package/@types/components/progress/sProgressLinear.vue.d.ts +17 -0
- package/@types/components/sAlert.vue.d.ts +14 -0
- package/@types/components/sAutocomplete.vue.d.ts +57 -0
- package/@types/components/sBreadcrumbs.vue.d.ts +16 -0
- package/@types/components/sButton.vue.d.ts +20 -0
- package/@types/components/sChip.vue.d.ts +24 -0
- package/@types/components/sDialog.vue.d.ts +33 -0
- package/@types/components/sDivider.vue.d.ts +4 -0
- package/@types/components/sDroppable.vue.d.ts +28 -0
- package/@types/components/sIcon.vue.d.ts +4 -0
- package/@types/components/sImage.vue.d.ts +14 -0
- package/@types/components/sMenu.vue.d.ts +36 -0
- package/@types/components/sOverlay.vue.d.ts +26 -0
- package/@types/components/sSheet.vue.d.ts +14 -0
- package/@types/components/sSnackbar.vue.d.ts +35 -0
- package/@types/components/sSubheader.vue.d.ts +13 -0
- package/@types/components/sSwitch.vue.d.ts +23 -0
- package/@types/components/sTooltip.vue.d.ts +25 -0
- package/@types/components/slideGroup/index.d.ts +2 -0
- package/@types/components/slideGroup/sSlideGroup.vue.d.ts +42 -0
- package/@types/components/slideGroup/sSlideItem.vue.d.ts +17 -0
- package/@types/components/splitViews/index.d.ts +2 -0
- package/@types/components/splitViews/sSplitView.vue.d.ts +17 -0
- package/@types/components/splitViews/sSplitViewItem.vue.d.ts +13 -0
- package/@types/components/stepper/index.d.ts +2 -0
- package/@types/components/stepper/sStepper.vue.d.ts +26 -0
- package/@types/components/stepper/sStepperStep.vue.d.ts +14 -0
- package/@types/components/table/index.d.ts +3 -0
- package/@types/components/table/sTable.vue.d.ts +153 -0
- package/@types/components/table/sTableBodyCell.vue.d.ts +22 -0
- package/@types/components/table/sTableHeadCell.vue.d.ts +24 -0
- package/@types/components/table/sTablePagination.vue.d.ts +33 -0
- package/@types/components/tabs/index.d.ts +2 -0
- package/@types/components/tabs/sTab.vue.d.ts +14 -0
- package/@types/components/tabs/sTabs.vue.d.ts +20 -0
- package/@types/components/toggleButtonGroup/index.d.ts +2 -0
- package/@types/components/toggleButtonGroup/sToggleButton.vue.d.ts +14 -0
- package/@types/components/toggleButtonGroup/sToggleButtonGroup.vue.d.ts +31 -0
- package/@types/components/toolbar/index.d.ts +3 -0
- package/@types/components/toolbar/sToolbar.vue.d.ts +23 -0
- package/@types/components/toolbar/sToolbarItem.vue.d.ts +5 -0
- package/@types/components/toolbar/sToolbarTitle.vue.d.ts +16 -0
- package/@types/components/window/index.d.ts +2 -0
- package/@types/components/window/sWindow.vue.d.ts +57 -0
- package/@types/components/window/sWindowItem.vue.d.ts +13 -0
- package/@types/componentsTypes.d.ts +8 -0
- package/@types/configs/app.d.ts +72 -0
- package/@types/configs/color.d.ts +2 -0
- package/@types/configs/core/breakpoint.d.ts +9 -0
- package/@types/configs/core/index.d.ts +1 -0
- package/@types/configs/datePicker.d.ts +34 -0
- package/@types/configs/grids.d.ts +3 -0
- package/@types/configs/i18n.d.ts +73 -0
- package/@types/configs/iconSizes.d.ts +7 -0
- package/@types/configs/index.d.ts +11 -0
- package/@types/configs/provider.d.ts +42 -0
- package/@types/configs/size.d.ts +2 -0
- package/@types/configs/toolbar.d.ts +11 -0
- package/@types/configs/transitions.d.ts +2 -0
- package/@types/constants/alert.d.ts +52 -0
- package/@types/constants/app.d.ts +7 -0
- package/@types/constants/button.d.ts +5 -0
- package/@types/constants/color.d.ts +318 -0
- package/@types/constants/cssVariables.d.ts +4 -0
- package/@types/constants/datePicker.d.ts +14 -0
- package/@types/constants/form.d.ts +9 -0
- package/@types/constants/grids.d.ts +14 -0
- package/@types/constants/i18n.d.ts +68 -0
- package/@types/constants/imageLoader.d.ts +13 -0
- package/@types/constants/index.d.ts +20 -0
- package/@types/constants/layout.d.ts +10 -0
- package/@types/constants/lazyLoad.d.ts +5 -0
- package/@types/constants/materialDesignIcon.d.ts +3 -0
- package/@types/constants/menuDimensions.d.ts +2 -0
- package/@types/constants/navigationDrawer.d.ts +8 -0
- package/@types/constants/overlay.d.ts +1 -0
- package/@types/constants/position.d.ts +1 -0
- package/@types/constants/size.d.ts +7 -0
- package/@types/constants/toolbar.d.ts +7 -0
- package/@types/constants/transition.d.ts +6 -0
- package/@types/definitions/app.d.ts +22 -0
- package/@types/definitions/emits/emitsTable.d.ts +18 -0
- package/@types/definitions/emits/index.d.ts +1 -0
- package/@types/definitions/index.d.ts +4 -0
- package/@types/definitions/props/core/index.d.ts +18 -0
- package/@types/definitions/props/core/propsActivator.d.ts +6 -0
- package/@types/definitions/props/core/propsBorder.d.ts +5 -0
- package/@types/definitions/props/core/propsButtonVariant.d.ts +3 -0
- package/@types/definitions/props/core/propsColor.d.ts +6 -0
- package/@types/definitions/props/core/propsComponentTheme.d.ts +4 -0
- package/@types/definitions/props/core/propsContent.d.ts +5 -0
- package/@types/definitions/props/core/propsDisabled.d.ts +4 -0
- package/@types/definitions/props/core/propsElevation.d.ts +3 -0
- package/@types/definitions/props/core/propsGroup.d.ts +6 -0
- package/@types/definitions/props/core/propsGroupItem.d.ts +6 -0
- package/@types/definitions/props/core/propsLayoutBase.d.ts +3 -0
- package/@types/definitions/props/core/propsLink.d.ts +7 -0
- package/@types/definitions/props/core/propsLocation.d.ts +6 -0
- package/@types/definitions/props/core/propsMeasurableStyles.d.ts +8 -0
- package/@types/definitions/props/core/propsPosition.d.ts +4 -0
- package/@types/definitions/props/core/propsTag.d.ts +4 -0
- package/@types/definitions/props/core/propsTextColor.d.ts +3 -0
- package/@types/definitions/props/core/propsToggleButtonGroupVariant.d.ts +3 -0
- package/@types/definitions/props/index.d.ts +70 -0
- package/@types/definitions/props/propsAlert.d.ts +7 -0
- package/@types/definitions/props/propsApp.d.ts +2 -0
- package/@types/definitions/props/propsAppBar.d.ts +9 -0
- package/@types/definitions/props/propsAutocomplete.d.ts +40 -0
- package/@types/definitions/props/propsBadge.d.ts +19 -0
- package/@types/definitions/props/propsBottomNavigation.d.ts +14 -0
- package/@types/definitions/props/propsBreadcrumbs.d.ts +7 -0
- package/@types/definitions/props/propsButton.d.ts +10 -0
- package/@types/definitions/props/propsCalendar.d.ts +27 -0
- package/@types/definitions/props/propsCard.d.ts +2 -0
- package/@types/definitions/props/propsCarousel.d.ts +12 -0
- package/@types/definitions/props/propsCarouselItem.d.ts +3 -0
- package/@types/definitions/props/propsCheckbox.d.ts +9 -0
- package/@types/definitions/props/propsChip.d.ts +7 -0
- package/@types/definitions/props/propsColumn.d.ts +10 -0
- package/@types/definitions/props/propsContainer.d.ts +8 -0
- package/@types/definitions/props/propsDatePicker.d.ts +15 -0
- package/@types/definitions/props/propsDatePickerFormat.d.ts +5 -0
- package/@types/definitions/props/propsDatePickerInput.d.ts +18 -0
- package/@types/definitions/props/propsDatePickerItem.d.ts +18 -0
- package/@types/definitions/props/propsDatePickerItemSwitch.d.ts +9 -0
- package/@types/definitions/props/propsDatePickerItemTitle.d.ts +3 -0
- package/@types/definitions/props/propsDialog.d.ts +10 -0
- package/@types/definitions/props/propsDivider.d.ts +3 -0
- package/@types/definitions/props/propsDroppable.d.ts +2 -0
- package/@types/definitions/props/propsExpansionPanels.d.ts +8 -0
- package/@types/definitions/props/propsFooter.d.ts +6 -0
- package/@types/definitions/props/propsFormInput.d.ts +10 -0
- package/@types/definitions/props/propsIcon.d.ts +10 -0
- package/@types/definitions/props/propsImage.d.ts +9 -0
- package/@types/definitions/props/propsImageLoader.d.ts +11 -0
- package/@types/definitions/props/propsInput.d.ts +32 -0
- package/@types/definitions/props/propsLayout.d.ts +6 -0
- package/@types/definitions/props/propsLayoutProvider.d.ts +4 -0
- package/@types/definitions/props/propsLink.d.ts +7 -0
- package/@types/definitions/props/propsList.d.ts +10 -0
- package/@types/definitions/props/propsListItem.d.ts +7 -0
- package/@types/definitions/props/propsListMediaItem.d.ts +4 -0
- package/@types/definitions/props/propsMain.d.ts +4 -0
- package/@types/definitions/props/propsMenu.d.ts +9 -0
- package/@types/definitions/props/propsNavigationDrawer.d.ts +20 -0
- package/@types/definitions/props/propsOverlay.d.ts +8 -0
- package/@types/definitions/props/propsProgressCircular.d.ts +8 -0
- package/@types/definitions/props/propsProgressLinear.d.ts +9 -0
- package/@types/definitions/props/propsRadioGroup.d.ts +9 -0
- package/@types/definitions/props/propsRow.d.ts +11 -0
- package/@types/definitions/props/propsScrollable.d.ts +5 -0
- package/@types/definitions/props/propsSelect.d.ts +13 -0
- package/@types/definitions/props/propsSheet.d.ts +2 -0
- package/@types/definitions/props/propsSingleGroup.d.ts +6 -0
- package/@types/definitions/props/propsSingleGroupItem.d.ts +5 -0
- package/@types/definitions/props/propsSizePreset.d.ts +4 -0
- package/@types/definitions/props/propsSizeUnion.d.ts +4 -0
- package/@types/definitions/props/propsSlideGroup.d.ts +11 -0
- package/@types/definitions/props/propsSnackbar.d.ts +6 -0
- package/@types/definitions/props/propsSplitView.d.ts +9 -0
- package/@types/definitions/props/propsStepper.d.ts +10 -0
- package/@types/definitions/props/propsStepperStep.d.ts +6 -0
- package/@types/definitions/props/propsSwitch.d.ts +5 -0
- package/@types/definitions/props/propsTab.d.ts +5 -0
- package/@types/definitions/props/propsTable.d.ts +58 -0
- package/@types/definitions/props/propsTabs.d.ts +12 -0
- package/@types/definitions/props/propsTextarea.d.ts +25 -0
- package/@types/definitions/props/propsToggleButton.d.ts +3 -0
- package/@types/definitions/props/propsToggleButtonGroup.d.ts +8 -0
- package/@types/definitions/props/propsToolbar.d.ts +11 -0
- package/@types/definitions/props/propsToolbarTitle.d.ts +4 -0
- package/@types/definitions/props/propsTooltip.d.ts +9 -0
- package/@types/definitions/props/propsWindow.d.ts +13 -0
- package/@types/definitions/props/propsWindowItem.d.ts +2 -0
- package/@types/definitions/provider.d.ts +20 -0
- package/@types/directives/index.d.ts +2 -0
- package/@types/directives/resize.d.ts +2 -0
- package/@types/directives/scroll.d.ts +2 -0
- package/@types/helpers/autocompleteHelpers.d.ts +7 -0
- package/@types/helpers/colorHelpers.d.ts +3 -0
- package/@types/helpers/createAppStore.d.ts +77 -0
- package/@types/helpers/display.d.ts +1 -0
- package/@types/helpers/index.d.ts +6 -0
- package/@types/helpers/selectItemHelpers.d.ts +4 -0
- package/@types/helpers/tableHelpers.d.ts +9 -0
- package/@types/helpers/themeHelpers.d.ts +2 -0
- package/@types/index.d.ts +10 -0
- package/@types/lib/browser.d.ts +26 -0
- package/@types/lib/button.d.ts +3 -0
- package/@types/lib/color.d.ts +19 -0
- package/@types/lib/compositionApi.d.ts +2 -0
- package/@types/lib/formatNumber.d.ts +1 -0
- package/@types/lib/getCleanSetObject.d.ts +5 -0
- package/@types/lib/getNumericCssAttribute.d.ts +1 -0
- package/@types/lib/getNumericValue.d.ts +13 -0
- package/@types/lib/getPluginName.d.ts +1 -0
- package/@types/lib/htmlClass.d.ts +1 -0
- package/@types/lib/htmlToText.d.ts +2 -0
- package/@types/lib/index.d.ts +12 -0
- package/@types/lib/isEmpty.d.ts +1 -0
- package/@types/lib/retry.d.ts +1 -0
- package/@types/lib/scroll.d.ts +13 -0
- package/@types/lib/wait.d.ts +1 -0
- package/@types/modules/index.d.ts +1 -0
- package/@types/modules/sUI.d.ts +2 -0
- package/@types/repositories/calendarRepository.d.ts +3 -0
- package/@types/repositories/colorRepository.d.ts +14 -0
- package/@types/repositories/columnRepository.d.ts +9 -0
- package/@types/repositories/core/appProviderRepository.d.ts +4 -0
- package/@types/repositories/datePicker.d.ts +18 -0
- package/@types/repositories/form.d.ts +66 -0
- package/@types/repositories/htmlClassRepository.d.ts +1 -0
- package/@types/repositories/index.d.ts +9 -0
- package/@types/repositories/positionRepository.d.ts +10 -0
- package/@types/repositories/tableRepository.d.ts +2 -0
- package/@types/repositories/touchRepository.d.ts +4 -0
- package/@types/services/appBarService.d.ts +41 -0
- package/@types/services/appService.d.ts +6 -0
- package/@types/services/autocompleteService.d.ts +42 -0
- package/@types/services/backgroundScrollService.d.ts +4 -0
- package/@types/services/borderService.d.ts +12 -0
- package/@types/services/calendar/calendarEventService.d.ts +5 -0
- package/@types/services/calendar/calendarMonthlyService.d.ts +14 -0
- package/@types/services/calendar/calendarService.d.ts +8 -0
- package/@types/services/calendar/calendarWeeklyService.d.ts +28 -0
- package/@types/services/calendar/index.d.ts +8 -0
- package/@types/services/calendar/useCalendarDateFormatters.d.ts +6 -0
- package/@types/services/calendar/useCalendarEventHandlers.d.ts +19 -0
- package/@types/services/calendar/useCalendarWeeklyAllDayEvents.d.ts +20 -0
- package/@types/services/calendar/useCalendarWeeklyEventPositioning.d.ts +23 -0
- package/@types/services/colorService.d.ts +19 -0
- package/@types/services/columnService.d.ts +8 -0
- package/@types/services/componentDefaultsService.d.ts +1 -0
- package/@types/services/componentThemeService.d.ts +6 -0
- package/@types/services/core/activatorService.d.ts +16 -0
- package/@types/services/core/clickOutsideService.d.ts +9 -0
- package/@types/services/core/contentService.d.ts +13 -0
- package/@types/services/core/expandableItemCoreService.d.ts +4 -0
- package/@types/services/core/groupCoreItemService.d.ts +11 -0
- package/@types/services/core/groupCoreService.d.ts +16 -0
- package/@types/services/core/index.d.ts +9 -0
- package/@types/services/core/layoutCoreService.d.ts +21 -0
- package/@types/services/core/locationService.d.ts +11 -0
- package/@types/services/core/tableCellCommonService.d.ts +8 -0
- package/@types/services/datePicker/datePickerInputService.d.ts +9 -0
- package/@types/services/datePicker/datePickerItemCoreService.d.ts +30 -0
- package/@types/services/datePicker/datePickerItemDateService.d.ts +18 -0
- package/@types/services/datePicker/datePickerItemMonthService.d.ts +17 -0
- package/@types/services/datePicker/datePickerItemSwitchService.d.ts +11 -0
- package/@types/services/datePicker/datePickerItemTitleService.d.ts +8 -0
- package/@types/services/datePicker/datePickerItemYearService.d.ts +17 -0
- package/@types/services/datePicker/datePickerService.d.ts +7 -0
- package/@types/services/datePicker/index.d.ts +7 -0
- package/@types/services/dialogService.d.ts +32 -0
- package/@types/services/disabledService.d.ts +12 -0
- package/@types/services/displayService.d.ts +24 -0
- package/@types/services/elevationService.d.ts +6 -0
- package/@types/services/expandableItemService.d.ts +5 -0
- package/@types/services/expandableService.d.ts +5 -0
- package/@types/services/formInputService.d.ts +8 -0
- package/@types/services/groupItemService.d.ts +10 -0
- package/@types/services/groupService.d.ts +16 -0
- package/@types/services/index.d.ts +43 -0
- package/@types/services/layoutProviderService.d.ts +28 -0
- package/@types/services/layoutService.d.ts +24 -0
- package/@types/services/linkService.d.ts +21 -0
- package/@types/services/listMediaItemService.d.ts +8 -0
- package/@types/services/measurableStylesService.d.ts +11 -0
- package/@types/services/menuService.d.ts +35 -0
- package/@types/services/navigationDrawerResizeService.d.ts +10 -0
- package/@types/services/navigationDrawerService.d.ts +6 -0
- package/@types/services/positionService.d.ts +10 -0
- package/@types/services/resizeService.d.ts +4 -0
- package/@types/services/scrollService.d.ts +8 -0
- package/@types/services/scrollableService.d.ts +15 -0
- package/@types/services/singleGroupItemService.d.ts +10 -0
- package/@types/services/singleGroupService.d.ts +34 -0
- package/@types/services/sizeService.d.ts +12 -0
- package/@types/services/slideGroupService.d.ts +19 -0
- package/@types/services/table/index.d.ts +3 -0
- package/@types/services/table/tableBodyCellService.d.ts +9 -0
- package/@types/services/table/tableHeadCellService.d.ts +8 -0
- package/@types/services/table/tableService.d.ts +179 -0
- package/@types/services/tagService.d.ts +9 -0
- package/@types/services/textColorService.d.ts +15 -0
- package/@types/services/themeService.d.ts +5 -0
- package/@types/services/toolbarService.d.ts +7 -0
- package/@types/services/touchService.d.ts +2 -0
- package/@types/store/index.d.ts +5 -0
- package/@types/types/app.d.ts +36 -0
- package/@types/types/autocomplete.d.ts +7 -0
- package/@types/types/breadcrumbs.d.ts +8 -0
- package/@types/types/button.d.ts +1 -0
- package/@types/types/calendar.d.ts +61 -0
- package/@types/types/core/color.d.ts +2 -0
- package/@types/types/core/emit.d.ts +1 -0
- package/@types/types/core/form.d.ts +2 -0
- package/@types/types/core/group.d.ts +1 -0
- package/@types/types/core/index.d.ts +4 -0
- package/@types/types/datePicker.d.ts +12 -0
- package/@types/types/display.d.ts +9 -0
- package/@types/types/emits.d.ts +17 -0
- package/@types/types/form.d.ts +9 -0
- package/@types/types/grids.d.ts +2 -0
- package/@types/types/html.d.ts +1 -0
- package/@types/types/icon.d.ts +1 -0
- package/@types/types/index.d.ts +24 -0
- package/@types/types/input.d.ts +3 -0
- package/@types/types/location.d.ts +2 -0
- package/@types/types/materialDesignIcon.d.ts +2 -0
- package/@types/types/menu.d.ts +9 -0
- package/@types/types/resize.d.ts +12 -0
- package/@types/types/scroll.d.ts +26 -0
- package/@types/types/select.d.ts +6 -0
- package/@types/types/size.d.ts +2 -0
- package/@types/types/table.d.ts +39 -0
- package/@types/types/tag.d.ts +1 -0
- package/@types/types/toolbar.d.ts +2 -0
- package/@types/types/touch.d.ts +28 -0
- package/@types/validators/index.d.ts +1 -0
- package/@types/validators/numeric.d.ts +1 -0
- package/@types/vendors/dayjs.d.ts +2 -0
- package/@types/vendors/merge.d.ts +2 -0
- package/@types/vite.config.d.ts +2 -0
- package/@types/vitest.config.d.ts +2 -0
- package/README.md +210 -2
- package/dist/base.css +7282 -0
- package/dist/base.css.map +1 -0
- package/dist/s-ui.css +2 -0
- package/dist/s-ui.js +8976 -0
- package/dist/s-ui.umd.cjs +1 -0
- package/dist/styles/_helpers.scss +9 -0
- package/dist/styles/components/appBar/_variables.scss +4 -0
- package/dist/styles/components/appBar/index.scss +1 -0
- package/dist/styles/components/button/_variables.scss +51 -0
- package/dist/styles/components/button/index.scss +2 -0
- package/dist/styles/components/button/mixins.scss +60 -0
- package/dist/styles/components/cards/index.scss +1 -0
- package/dist/styles/components/cards/variables.scss +5 -0
- package/dist/styles/components/icon/_variables.scss +14 -0
- package/dist/styles/components/icon/index.scss +1 -0
- package/dist/styles/components/index.scss +10 -0
- package/dist/styles/components/layout/_mixins.scss +7 -0
- package/dist/styles/components/layout/_variables.scss +6 -0
- package/dist/styles/components/layout/index.scss +2 -0
- package/dist/styles/components/list/_mixins.scss +53 -0
- package/dist/styles/components/list/index.scss +1 -0
- package/dist/styles/components/menu/_mixins.scss +11 -0
- package/dist/styles/components/menu/index.scss +1 -0
- package/dist/styles/components/table/_mixins.scss +51 -0
- package/dist/styles/components/table/index.scss +1 -0
- package/dist/styles/components/toggleButton/_variables.scss +4 -0
- package/dist/styles/components/toggleButton/index.scss +1 -0
- package/dist/styles/components/window/_variables.scss +2 -0
- package/dist/styles/components/window/index.scss +1 -0
- package/dist/styles/generic/_common.scss +95 -0
- package/dist/styles/generic/_reset.scss +357 -0
- package/dist/styles/generic/_transitions.scss +83 -0
- package/dist/styles/generic/index.scss +3 -0
- package/dist/styles/index.scss +6 -0
- package/dist/styles/lib/_functions.scss +86 -0
- package/dist/styles/lib/index.scss +1 -0
- package/dist/styles/mixins/_app.scss +13 -0
- package/dist/styles/mixins/_border.scss +104 -0
- package/dist/styles/mixins/_dark.scss +31 -0
- package/dist/styles/mixins/_display.scss +9 -0
- package/dist/styles/mixins/_elevation.scss +15 -0
- package/dist/styles/mixins/_grids.scss +66 -0
- package/dist/styles/mixins/_media.scss +14 -0
- package/dist/styles/mixins/_text.scss +44 -0
- package/dist/styles/mixins/_utilities.scss +68 -0
- package/dist/styles/mixins/index.scss +10 -0
- package/dist/styles/modules/breakpoints.module.scss +10 -0
- package/dist/styles/tools/_breakpoint.scss +20 -0
- package/dist/styles/tools/_color.scss +35 -0
- package/dist/styles/tools/index.scss +2 -0
- package/dist/styles/variables/_border.scss +19 -0
- package/dist/styles/variables/_colors.scss +34 -0
- package/dist/styles/variables/_elevations.scss +98 -0
- package/dist/styles/variables/_font.scss +8 -0
- package/dist/styles/variables/_grid.scss +36 -0
- package/dist/styles/variables/_headings.scss +100 -0
- package/dist/styles/variables/_spacers.scss +17 -0
- package/dist/styles/variables/_transitions.scss +16 -0
- package/dist/styles/variables/_utilities.scss +360 -0
- package/dist/styles/variables/index.scss +9 -0
- package/package.json +68 -4
- package/sui-plugin/.claude-plugin/plugin.json +10 -0
- package/sui-plugin/README.md +73 -0
- package/sui-plugin/skills/sui-component/SKILL.md +133 -0
- package/sui-plugin/skills/sui-component/references/alert.md +53 -0
- package/sui-plugin/skills/sui-component/references/autocomplete.md +110 -0
- package/sui-plugin/skills/sui-component/references/badge.md +80 -0
- package/sui-plugin/skills/sui-component/references/breadcrumbs.md +67 -0
- package/sui-plugin/skills/sui-component/references/button.md +74 -0
- package/sui-plugin/skills/sui-component/references/calendar.md +120 -0
- package/sui-plugin/skills/sui-component/references/cards.md +97 -0
- package/sui-plugin/skills/sui-component/references/carousel.md +113 -0
- package/sui-plugin/skills/sui-component/references/chip.md +68 -0
- package/sui-plugin/skills/sui-component/references/date-picker.md +140 -0
- package/sui-plugin/skills/sui-component/references/dialog.md +82 -0
- package/sui-plugin/skills/sui-component/references/divider.md +52 -0
- package/sui-plugin/skills/sui-component/references/droppable.md +68 -0
- package/sui-plugin/skills/sui-component/references/expansion-panels.md +108 -0
- package/sui-plugin/skills/sui-component/references/form.md +175 -0
- package/sui-plugin/skills/sui-component/references/icon.md +61 -0
- package/sui-plugin/skills/sui-component/references/image.md +56 -0
- package/sui-plugin/skills/sui-component/references/layout.md +226 -0
- package/sui-plugin/skills/sui-component/references/list.md +153 -0
- package/sui-plugin/skills/sui-component/references/menu.md +74 -0
- package/sui-plugin/skills/sui-component/references/overlay.md +48 -0
- package/sui-plugin/skills/sui-component/references/progress.md +78 -0
- package/sui-plugin/skills/sui-component/references/sheet.md +58 -0
- package/sui-plugin/skills/sui-component/references/slide-group.md +123 -0
- package/sui-plugin/skills/sui-component/references/snackbar.md +59 -0
- package/sui-plugin/skills/sui-component/references/split-view.md +59 -0
- package/sui-plugin/skills/sui-component/references/stepper.md +92 -0
- package/sui-plugin/skills/sui-component/references/table.md +151 -0
- package/sui-plugin/skills/sui-component/references/tabs.md +88 -0
- package/sui-plugin/skills/sui-component/references/toggle-button-group.md +109 -0
- package/sui-plugin/skills/sui-component/references/toolbar.md +101 -0
- package/sui-plugin/skills/sui-component/references/tooltip.md +65 -0
- package/sui-plugin/skills/sui-component/references/window.md +75 -0
- package/sui-plugin/skills/sui-form/SKILL.md +225 -0
- package/sui-plugin/skills/sui-getting-started/SKILL.md +374 -0
- package/sui-plugin/skills/sui-layout/SKILL.md +111 -0
- package/sui-plugin/skills/sui-utilities/SKILL.md +40 -0
- package/sui-plugin/skills/sui-utilities/docs/classes.md +487 -0
- package/sui-plugin/skills/sui-utilities/docs/directives.md +200 -0
- package/sui-plugin/skills/sui-utilities/docs/helpers.md +583 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sui-form
|
|
3
|
+
description: Build validated forms in a Vue or Nuxt app with @khsura/sui — SForm, SInput, STextarea, SSelect, SAutocomplete, SCheckbox, SRadioGroup/SRadio, SSwitch, SDatePickerInput. Use when creating a form, login/registration/settings/data-entry UI, adding validation rules (inline or the i18n-backed getFormInputModelValueRules), handling submit with SForm.validate(), async/searchable selects, or fixing a SUI form whose validation, error display or v-model doesn't behave.
|
|
4
|
+
argument-hint: [describe the form fields and purpose]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Build a SUI form for: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Ask the user the following if not already clear from $ARGUMENTS:
|
|
10
|
+
|
|
11
|
+
1. What fields are needed? (text, email, password, select, checkbox, radio, switch, textarea)
|
|
12
|
+
2. What validation rules apply to each field?
|
|
13
|
+
3. What happens on submit? (API call, emit, router push, etc.)
|
|
14
|
+
4. Any layout preferences? (single column, two columns, inside a card, etc.)
|
|
15
|
+
|
|
16
|
+
Then generate a complete Vue SFC using these rules:
|
|
17
|
+
|
|
18
|
+
**Form rules:**
|
|
19
|
+
|
|
20
|
+
- Wrap everything in `<SForm ref="formRef" @submit.prevent="submit">` and validate in `submit` (see **SForm.validate()** below — its return value is inverted from what you'd expect)
|
|
21
|
+
- Use `SInput` for text/email/password/number — always include `label` and `v-model`
|
|
22
|
+
- Use `STextarea` for multi-line text (add `autogrow` if height should expand — all lowercase, not `auto-grow`)
|
|
23
|
+
- Use `SSelect` for a plain single-value dropdown — `items` must be `SelectItem[]` or `string[]`. Type `SelectItem` from `@khsura/sui` (`text`, `value`, optional `disabled`). **SSelect has no `multiple`, `chips`, `clearable` or `placeholder`** — when you need any of those, use `SAutocomplete`.
|
|
24
|
+
- Use `SAutocomplete` for searchable, clearable or multi-select — same `items` shape, add `multiple chips closable-chips` for multi-select. **It has no `rules` and does not register with `SForm`** — check its value yourself in `submit`
|
|
25
|
+
- Use `SCheckbox` for a single boolean — `label` prop, not slot. It has no `value`/`indeterminate`, so build checkbox groups from several boolean models
|
|
26
|
+
- Use `SRadioGroup` with `<SRadio value="..." label="...">` children (slot-based); use `column` for vertical layout
|
|
27
|
+
- Use `SSwitch` for on/off toggles — it never runs `rules`, shows no error and is not validated by `SForm`
|
|
28
|
+
- Submit: `<SButton type="submit" color="primary" :loading="submitting">Submit</SButton>`
|
|
29
|
+
- `:loading` on `SButton` implicitly disables it — do not also set `:disabled`
|
|
30
|
+
|
|
31
|
+
**Validation rules signature:** `(value: unknown) => true | string`
|
|
32
|
+
|
|
33
|
+
- Return `true` to pass, return an error string to fail. Returning `false` does **not** show an error (non-string results are dropped) — always return a message string
|
|
34
|
+
- Pass arrays to `:rules="[rule1, rule2]"`
|
|
35
|
+
- Rules run when the value changes and on `SForm.validate()`. Setting `dirty` does **not** run them — call `validate()` to show errors on untouched fields
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## SForm.validate() returns `true` when the form is INVALID
|
|
40
|
+
|
|
41
|
+
`validate()` returns **whether there are errors**, not whether the form is valid. This is the most common SUI form bug.
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
const formRef = ref<InstanceType<typeof SForm> | null>(null)
|
|
45
|
+
|
|
46
|
+
// ❌ Wrong — submits invalid forms and blocks valid ones
|
|
47
|
+
if (!formRef.value?.validate()) return
|
|
48
|
+
|
|
49
|
+
// ✅ Correct
|
|
50
|
+
const hasErrors = formRef.value?.validate()
|
|
51
|
+
if (hasErrors) return
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`SForm` also exposes its state as models, updated whenever an input validates:
|
|
55
|
+
|
|
56
|
+
- `v-model="isValid"` — `true` when there are no errors
|
|
57
|
+
- `v-model:error="hasError"` — `true` while any input has an error
|
|
58
|
+
- `v-model:errors="messages"` — all current error strings
|
|
59
|
+
|
|
60
|
+
Use them to disable the submit button; `resetValidation()` (exposed) clears every input's errors.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## `hideDetails` vs `hideError`
|
|
65
|
+
|
|
66
|
+
| Prop | Hides the label | Hides the error message | Red error frame |
|
|
67
|
+
| ------------- | --------------- | ----------------------- | --------------------- |
|
|
68
|
+
| _(neither)_ | no | no | shown |
|
|
69
|
+
| `hideError` | no | **yes** | shown |
|
|
70
|
+
| `hideDetails` | **yes** | **yes** | shown |
|
|
71
|
+
|
|
72
|
+
- Use **`hideError`** when you only want to drop the message line (dense tables, inline filters) but keep the label.
|
|
73
|
+
- Use **`hideDetails`** only when the field should have no label either — it is not a "compact" switch.
|
|
74
|
+
- The field frame turns red on error even with either flag set (`SInput`, `STextarea`, `SSelect`, `SCheckbox`, `SRadioGroup`, `SDatePickerInput`), so users can still see which field is invalid. Don't add your own `:deep()` error border.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Predefined form rules (app)
|
|
79
|
+
|
|
80
|
+
**`getFormInputModelValueRules(i18n)`** is exported from `@khsura/sui`. Use it when the form should use i18n for error messages. Predefined message strings for these rules (e.g. `required`, `maxLength`, `numeric`) live in **`i18nMessages`** from `@khsura/sui`. Import `i18nMessages` and merge it with your app's i18n messages so validation errors use the same copy; see **sui-getting-started** for a full example. Each rule returns a `FormInputModelValueRule` and takes an `options` object.
|
|
81
|
+
|
|
82
|
+
**Setup:**
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { useI18n } from 'vue-i18n'
|
|
86
|
+
import { getFormInputModelValueRules } from '@khsura/sui'
|
|
87
|
+
|
|
88
|
+
const { t } = useI18n()
|
|
89
|
+
const rules = getFormInputModelValueRules({ t })
|
|
90
|
+
// Then use e.g. rules.required({ target: 'Email' })
|
|
91
|
+
|
|
92
|
+
// Nuxt with @khsura/sui-nuxt + @nuxtjs/i18n: the same object is prebuilt
|
|
93
|
+
// const rules = useNuxtApp().$suiFormRules
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
| Rule | Options | Use when |
|
|
97
|
+
| --------------- | --------------------------------------------------------------------- | -------------------------------------------------- |
|
|
98
|
+
| `required` | `{ target: string }` | Field must not be empty |
|
|
99
|
+
| `maxLength` | `{ target: string; maxLength: number }` | String length ≤ maxLength |
|
|
100
|
+
| `length` | `{ target: string; length: number }` | String length must equal length |
|
|
101
|
+
| `lengthNumeric` | `{ target: string; length: number }` | Numeric string length must equal length |
|
|
102
|
+
| `match` | `{ target: string; comparator: string; matchTo: RegExp }` | Value must match regex |
|
|
103
|
+
| `maxUnit` | `{ target: string; multiplier?: number; max: number; unit?: string }` | Numeric value × multiplier ≤ max (e.g. yen to man) |
|
|
104
|
+
| `max` | `{ target: string; multiplier?: number; max: number }` | Numeric value × multiplier ≤ max |
|
|
105
|
+
| `step` | `{ target: string; multiplier?: number; step: number; unit: string }` | Value must be a multiple of step |
|
|
106
|
+
| `select` | `{ target: string }` | A selection must be chosen (select/autocomplete) |
|
|
107
|
+
| `shouldFix` | `{ target: string; pattern: RegExp }` | Value must match pattern (fix hint) |
|
|
108
|
+
| `badInput` | `{ target: string; pattern: RegExp }` | Value must match pattern (bad input message) |
|
|
109
|
+
| `matchPattern` | `{ target: string; pattern: RegExp }` | Value must match regex |
|
|
110
|
+
| `numeric` | `{ target: string }` | Value must be a valid number |
|
|
111
|
+
| `integer` | `{ target: string }` | Value must be an integer |
|
|
112
|
+
|
|
113
|
+
**Example with predefined rules:**
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
const rules = getFormInputModelValueRules({ t })
|
|
117
|
+
// In template:
|
|
118
|
+
:SInput v-model="form.name" label="Name" :rules="[rules.required({ target: t('labels.name') })]"
|
|
119
|
+
:SInput v-model="form.age" label="Age" :rules="[rules.required({ target: t('labels.age') }), rules.integer({ target: t('labels.age') })]"
|
|
120
|
+
:SSelect v-model="form.role" label="Role" :items="roles" :rules="[rules.select({ target: t('labels.role') })]"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Common inline rule patterns** (when not using app rules):
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
const required = (v: unknown) => !!v || 'Required'
|
|
127
|
+
const email = (v: string) => /.+@.+\..+/.test(v) || 'Invalid email'
|
|
128
|
+
const minLength = (n: number) => (v: string) => v.length >= n || `Min ${n} characters`
|
|
129
|
+
const maxLength = (n: number) => (v: string) => v.length <= n || `Max ${n} characters`
|
|
130
|
+
const numeric = (v: string) => /^\d+$/.test(v) || 'Must be a number'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Form component props (quick reference)
|
|
136
|
+
|
|
137
|
+
Use this to choose the right component and props for each field.
|
|
138
|
+
|
|
139
|
+
**Common to the validated inputs** (`SInput`, `STextarea`, `SSelect`, `SCheckbox`, `SRadioGroup`, `SDatePickerInput`): `label`, `rules`, `disabled`, `hideDetails`, `hideError`, `error`, `dirty`, `id`. `SAutocomplete` and `SSwitch` don't run rules.
|
|
140
|
+
|
|
141
|
+
| Component | v-model | Key props | When to use |
|
|
142
|
+
| ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
|
|
143
|
+
| **SInput** | `string \| number` | `label`, `type` (`text` \| `email` \| `password` \| `number` \| `tel` \| `url` \| `search`), `placeholder`, `suffix`, `dense`, `readonly`, `max`/`min`, `maxlength`/`minlength`, `inputmode` (`numeric` \| `decimal` \| `email` \| `tel`), `positive` / `allowDecimal` (numbers), `size` | Single-line text, email, password, number |
|
|
144
|
+
| **STextarea** | `string` | `label`, `placeholder`, `rows`, `cols`, `autogrow`, `resize`, `dense`, `tile`, `maxlength`/`minlength`, `readonly` | Multi-line text |
|
|
145
|
+
| **SSelect** | `string \| number` | `items`: `SelectItem[]` or `string[]` (type from `@khsura/sui`: `text`, `value`, optional `disabled`). Also `label`, `dense`, `grow`, `text`, `divided`, `color`, `outlined`/`underlined`/`borderRadius`. **No** `multiple`/`chips`/`clearable`/`placeholder` | Single-value dropdown |
|
|
146
|
+
| **SAutocomplete** | `any` or `any[]` | Same `items` as SSelect; + `multiple`, `chips`, `closableChips`, `clearable`, `placeholder`, `filter`, `filterMode`, `debounce`, `loading`, `allowUnlisted`, `delimiter`. `debounce` defaults to 500 ms. Events: **`@search-item`** (search text, for async options), **`@create-item`** (with `allowUnlisted`). No `rules`; `disabled` does not disable its text field | Searchable / multi / async select |
|
|
147
|
+
| **SCheckbox** | `boolean` | `label`, `color`, `size` (`'default'` \| `'large'`), `block`, `bordered`, `readonly` | Single boolean |
|
|
148
|
+
| **SRadioGroup** | `any` | Slot content: `<SRadio value="..." label="...">` children (no `items` prop). Props: `column`, `grow`, `color`, `name` | Single choice from list |
|
|
149
|
+
| **SSwitch** | `boolean` | `label`, `color` | On/off toggle |
|
|
150
|
+
| **SDatePickerInput** | `string` | `label`, `placeholder`, `type` (`'date'` \| `'month'` \| `'year'`), `min`/`max`, `dense`, `readonly`, `simple`, `tile`, `size`, `block` (off by default; `maxWidth` caps it), `carousel` (prev/next buttons that step the value by one day / month / year). Without `min`/`max` the selectable range is Jan 1 five years before today to Dec 31 five years after — pass `min` for birth dates | Date, month or year field with a picker popup |
|
|
151
|
+
|
|
152
|
+
**SelectItem** (SSelect, SAutocomplete): from `@khsura/sui` — `{ text: string, value: string | number | null | undefined, disabled?: boolean }` or plain `string`. Use `text` and `value`, not `title` or `label`.
|
|
153
|
+
|
|
154
|
+
**SAutocomplete async search:** listen to `@search-item`, not `@update:search-input` (that name is accepted by the typings but never emitted).
|
|
155
|
+
|
|
156
|
+
**SInput `type="number"`:** bind a plain `v-model` — SInput already writes a `number | null` to the model, so `.number` is unnecessary. Use `min`/`max`/`positive` when the value should be clamped while typing; use a rule when the user should see a message instead. Number inputs are **integer-only by default** — `.` is blocked and pasted decimals are rounded; add `allowDecimal` (with `inputmode="decimal"`) to accept decimals, in which case `min`/`positive` are enforced on blur so values like `0.5` can be typed.
|
|
157
|
+
|
|
158
|
+
**Imports:** form components and `getFormInputModelValueRules` from `@khsura/sui`.
|
|
159
|
+
|
|
160
|
+
For full props, slots, and events per component, read [form.md](../sui-component/references/form.md), [autocomplete.md](../sui-component/references/autocomplete.md) and [date-picker.md](../sui-component/references/date-picker.md). Prop types ship in `node_modules/@khsura/sui/@types/definitions/props/`.
|
|
161
|
+
|
|
162
|
+
**Reference template:**
|
|
163
|
+
|
|
164
|
+
```vue
|
|
165
|
+
<template>
|
|
166
|
+
<SCard :max-width="480">
|
|
167
|
+
<SCardTitle>Form Title</SCardTitle>
|
|
168
|
+
<SCardText>
|
|
169
|
+
<SForm ref="formRef" @submit.prevent="submit">
|
|
170
|
+
<SInput v-model="form.name" label="Full Name" :rules="[required]" />
|
|
171
|
+
|
|
172
|
+
<SInput v-model="form.email" label="Email" type="email" :rules="[required, email]" />
|
|
173
|
+
|
|
174
|
+
<SInput v-model="form.password" label="Password" type="password" :rules="[required, minLength(8)]" />
|
|
175
|
+
|
|
176
|
+
<SSelect v-model="form.role" label="Role" :items="roles" :rules="[required]" />
|
|
177
|
+
|
|
178
|
+
<SCheckbox v-model="form.agree" label="I agree to the terms" :rules="[(v) => !!v || 'You must agree']" />
|
|
179
|
+
|
|
180
|
+
<SButton type="submit" color="primary" block :loading="submitting"> Submit </SButton>
|
|
181
|
+
</SForm>
|
|
182
|
+
</SCardText>
|
|
183
|
+
</SCard>
|
|
184
|
+
</template>
|
|
185
|
+
|
|
186
|
+
<script setup lang="ts">
|
|
187
|
+
import { ref } from 'vue'
|
|
188
|
+
import { type SelectItem, SCard, SCardTitle, SCardText, SForm, SInput, SSelect, SCheckbox, SButton } from '@khsura/sui'
|
|
189
|
+
|
|
190
|
+
const formRef = ref<InstanceType<typeof SForm> | null>(null)
|
|
191
|
+
const submitting = ref(false)
|
|
192
|
+
|
|
193
|
+
const form = ref({
|
|
194
|
+
name: '',
|
|
195
|
+
email: '',
|
|
196
|
+
password: '',
|
|
197
|
+
role: null as string | null,
|
|
198
|
+
agree: false,
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
const roles: SelectItem[] = [
|
|
202
|
+
{ text: 'Admin', value: 'admin' },
|
|
203
|
+
{ text: 'User', value: 'user' },
|
|
204
|
+
]
|
|
205
|
+
|
|
206
|
+
const required = (v: unknown) => !!v || 'Required'
|
|
207
|
+
const email = (v: string) => /.+@.+\..+/.test(v) || 'Invalid email'
|
|
208
|
+
const minLength = (n: number) => (v: string) => v.length >= n || `Min ${n} characters`
|
|
209
|
+
|
|
210
|
+
const submit = async () => {
|
|
211
|
+
// validate() returns true when there ARE errors
|
|
212
|
+
const hasErrors = formRef.value?.validate()
|
|
213
|
+
if (hasErrors) return
|
|
214
|
+
|
|
215
|
+
submitting.value = true
|
|
216
|
+
try {
|
|
217
|
+
// TODO: handle submit (API call, emit, etc.)
|
|
218
|
+
} finally {
|
|
219
|
+
submitting.value = false
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
</script>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Adapt to match the user's fields, validation, submit logic, and layout.
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sui-getting-started
|
|
3
|
+
description: Set up and configure @khsura/sui in a Vue 3 or Nuxt app. Use when installing @khsura/sui (GitHub Packages registry, .npmrc / .yarnrc.yml, read:packages token, CI auth), wiring createSUI and the SApp root, importing the stylesheets and @mdi/font icons, adding @khsura/sui-nuxt, overriding theme colors or switching dark mode with useTheme, setting app-wide component defaults, setting up vue-i18n for SUI messages and form rules, importing SUI TypeScript types, or looking up shared props, the component list, composables and common mistakes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SUI — Getting Started in a consumer app
|
|
7
|
+
|
|
8
|
+
**`@khsura/sui`** is a Vue 3 + TypeScript component library. Every component is prefixed with `S` (`SButton`, `SCard`, `SInput`).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Install (GitHub Packages, not npmjs.com)
|
|
13
|
+
|
|
14
|
+
`@khsura/sui` is published to **`https://npm.pkg.github.com`**. A plain `yarn add @khsura/sui` / `npm i @khsura/sui` fails (404 / 401) until the `@khsura` scope points at that registry **and** a token is supplied.
|
|
15
|
+
|
|
16
|
+
**Token:** a GitHub personal access token (classic) with the **`read:packages`** scope. Keep it in an environment variable (`NPM_GITHUB_TOKEN` below) — never commit it.
|
|
17
|
+
|
|
18
|
+
### Yarn 4 (Berry) — `.yarnrc.yml`
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
npmScopes:
|
|
22
|
+
khsura:
|
|
23
|
+
npmRegistryServer: "https://npm.pkg.github.com"
|
|
24
|
+
npmAlwaysAuth: true
|
|
25
|
+
npmAuthToken: "${NPM_GITHUB_TOKEN}"
|
|
26
|
+
|
|
27
|
+
# optional: read the token from a git-ignored file instead of the shell
|
|
28
|
+
injectEnvironmentFiles:
|
|
29
|
+
- .env.yarn?
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`.env.yarn` (add it to `.gitignore`): `NPM_GITHUB_TOKEN=ghp_xxx`
|
|
33
|
+
|
|
34
|
+
### npm / pnpm — project `.npmrc`
|
|
35
|
+
|
|
36
|
+
```ini
|
|
37
|
+
@khsura:registry=https://npm.pkg.github.com
|
|
38
|
+
//npm.pkg.github.com/:_authToken=${NPM_GITHUB_TOKEN}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The `.npmrc` with the `${...}` placeholder is safe to commit; the token itself is not.
|
|
42
|
+
|
|
43
|
+
### CI
|
|
44
|
+
|
|
45
|
+
Expose the token as an env var from a secret — the config files above read it:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
# GitHub Actions
|
|
49
|
+
- run: yarn install --immutable # or npm ci / pnpm install --frozen-lockfile
|
|
50
|
+
env:
|
|
51
|
+
NPM_GITHUB_TOKEN: ${{ secrets.NPM_GITHUB_TOKEN }}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then install:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
yarn add @khsura/sui @mdi/font # or: npm i / pnpm add
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`vue`, `vue-i18n` and `dayjs` come in as dependencies of `@khsura/sui`. `@mdi/font` is **not** included — install it yourself (see step 3).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 2. Register the plugin and wrap the app in `SApp`
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
// main.ts
|
|
68
|
+
import { createApp } from 'vue'
|
|
69
|
+
import { createSUI } from '@khsura/sui'
|
|
70
|
+
import '@khsura/sui/base.css' // reset, typography, s_* utility classes
|
|
71
|
+
import '@khsura/sui/style.css' // component styles
|
|
72
|
+
import '@mdi/font/css/materialdesignicons.css' // icons for SIcon / icon props
|
|
73
|
+
import App from './App.vue'
|
|
74
|
+
|
|
75
|
+
createApp(App).use(createSUI()).mount('#app')
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<!-- App.vue -->
|
|
80
|
+
<template>
|
|
81
|
+
<SApp>
|
|
82
|
+
<router-view />
|
|
83
|
+
</SApp>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import { SApp } from '@khsura/sui'
|
|
88
|
+
</script>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**`SApp` is required at the root.** It sets the theme CSS variables (`--s-color-*`, `--s-app-color-*`) that every component's colors read, and renders the container that `SDialog`, `SMenu`, `STooltip`, `SSnackbar`, `SOverlay` and the select popups teleport into. Without it colors are missing and popups don't appear.
|
|
92
|
+
|
|
93
|
+
`createSUI()` also registers the `v-scroll` and `v-resize` directives.
|
|
94
|
+
|
|
95
|
+
Import components where you use them (Vue): `import { SButton, SCard } from '@khsura/sui'`.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 3. Styles and icons
|
|
100
|
+
|
|
101
|
+
| Import | Contains | Needed |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| `@khsura/sui/base.css` | Reset, typography, `s_*` utility classes | Yes |
|
|
104
|
+
| `@khsura/sui/style.css` | Styles of the components themselves | Yes |
|
|
105
|
+
| `@khsura/sui/style.scss` | SCSS source of `base.css` (alternative to `base.css`) | Optional |
|
|
106
|
+
| `@khsura/sui/helpers.scss` | SCSS functions / mixins only, emits no CSS | For your own SCSS: `@use '@khsura/sui/helpers.scss' as *;` |
|
|
107
|
+
| `@mdi/font/css/materialdesignicons.css` | Material Design Icons font | Yes, if you use any icon |
|
|
108
|
+
|
|
109
|
+
`SIcon` (and every `icon` / `prependIcon` / `appendIcon` prop) renders an MDI **class name** (`icon="mdi-home"`). Without the `@mdi/font` stylesheet it renders an empty box — no error.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 4. Nuxt — `@khsura/sui-nuxt`
|
|
114
|
+
|
|
115
|
+
`@khsura/sui-nuxt` is a Nuxt module (Nuxt ≥ 4) published to the **same GitHub Packages registry**, so the registry/token setup above covers it.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
yarn add @khsura/sui @khsura/sui-nuxt @mdi/font
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
// nuxt.config.ts
|
|
123
|
+
export default defineNuxtConfig({
|
|
124
|
+
modules: ['@khsura/sui-nuxt'],
|
|
125
|
+
css: ['@mdi/font/css/materialdesignicons.css'],
|
|
126
|
+
sui: {
|
|
127
|
+
// AppStateOptions passed to createSUI(): theme, themes, display, components
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The module:
|
|
133
|
+
|
|
134
|
+
- calls `createSUI(sui options)` for you
|
|
135
|
+
- loads `@khsura/sui/style.css` and `@khsura/sui/style.scss` (you don't import them, but you **do** add `@mdi/font` to `css`)
|
|
136
|
+
- auto-imports `useDisplay`, `useTheme`, `STransition`, and the types `FormInputModelValueRule`, `GroupItemValue`, `SInput`, `SSelect`, `SForm`, `TableHeader`, `TableItem`, `MaterialDesignIcon`
|
|
137
|
+
- provides `useNuxtApp().$suiFormRules` = `getFormInputModelValueRules(nuxtApp.$i18n)` — this needs `@nuxtjs/i18n` installed, or the rules throw when they try to build a message
|
|
138
|
+
- registers every component globally (since `@khsura/sui-nuxt` 1.1.6, which requires `@khsura/sui` ^1.18.0). Older versions did **not** register `SLayout`, `SBottomNavigation`, `SCarousel`, `SCarouselItem`, `SSplitView`, `SSplitViewItem`, `SToolbarItem`, `STableHeadCell`, `STableBodyCell`, `SDroppable`, `SWindow`, `SWindowItem` — on those, import them from `@khsura/sui`
|
|
139
|
+
|
|
140
|
+
You still need `<SApp>` at the root (e.g. in `app.vue` or your layout).
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 5. App options — `createSUI(options)`
|
|
145
|
+
|
|
146
|
+
Options (type `AppStateOptions`) are deep-merged with the built-in defaults (exported as `defaultAppConfig`), so pass only what you change. In Nuxt put the same object under `sui`.
|
|
147
|
+
|
|
148
|
+
| Option | Type | Description |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| `theme` | `'light' \| 'dark'` | Initial theme (default `'light'`) |
|
|
151
|
+
| `themes` | `{ light?: ThemeConfigOptions, dark?: ThemeConfigOptions }` | Per-theme `presetColors` and `appColors` |
|
|
152
|
+
| `display` | `{ thresholds?, scrollBarWidth? }` | Breakpoints and scrollbar width |
|
|
153
|
+
| `components` | `{ [ComponentName]: Record<string, unknown> }` | App-wide default props per component |
|
|
154
|
+
|
|
155
|
+
### Theme colors
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
app.use(
|
|
159
|
+
createSUI({
|
|
160
|
+
themes: {
|
|
161
|
+
light: { presetColors: { primary: '#6200ee', secondary: '#03dac6' } },
|
|
162
|
+
dark: {
|
|
163
|
+
presetColors: { primary: '#bb86fc' },
|
|
164
|
+
appColors: { background: '#121212', card: '#1e1e1e' },
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}),
|
|
168
|
+
)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- **`presetColors` keys:** `primary`, `secondary`, `success`, `info`, `warning`, `important`, `error` — usable as `color="..."` on components. Extra keys you add become usable too.
|
|
172
|
+
- **`appColors` keys:** `appBar`, `title`, `text`, `secondaryText`, `anchor`, `background`, `card`, `button`, `switch`, `border`, `disabled`, `snackbar`, `inputPlaceholderShown`, `textErrorHover`.
|
|
173
|
+
- Use **opaque hex** values (`#ffc107`). An alpha hex (`#ffc10799`) looks washed out everywhere; for translucency use `color-mix(in srgb, #{s_getPresetColor('warning')} 60%, transparent)` in SCSS.
|
|
174
|
+
|
|
175
|
+
### Dark mode — `useTheme()`
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
import { useTheme } from '@khsura/sui'
|
|
179
|
+
|
|
180
|
+
const { theme, setTheme } = useTheme() // theme: ComputedRef<'light' | 'dark'>
|
|
181
|
+
|
|
182
|
+
setTheme('dark')
|
|
183
|
+
setTheme(theme.value === 'dark' ? 'light' : 'dark') // toggle — there is no toggleTheme()
|
|
184
|
+
setTheme(null) // follow the OS setting
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Call it inside a component below `app.use(createSUI())`; it throws if the plugin isn't installed.
|
|
188
|
+
|
|
189
|
+
### Component defaults — `components`
|
|
190
|
+
|
|
191
|
+
Set a prop once for every instance instead of repeating it (or overriding classes with `:deep(.s_*)`):
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
app.use(
|
|
195
|
+
createSUI({
|
|
196
|
+
components: {
|
|
197
|
+
SSelect: { outlined: true },
|
|
198
|
+
SButton: { color: 'primary', size: 'small' },
|
|
199
|
+
SInput: { dense: true },
|
|
200
|
+
},
|
|
201
|
+
}),
|
|
202
|
+
)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Priority: **prop on the element > `components` default > built-in default**. Keys are component names (`SButton`, `SInput`, …).
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 6. vue-i18n — SUI messages and form rules
|
|
210
|
+
|
|
211
|
+
SUI ships messages in **`en`, `mn`, `ja`** for `STable` (`table.itemsPerPage`, `table.noData`) and the predefined form rules (`formRules.*`). `STable` reads them through the global `$t`, so register vue-i18n with the SUI messages merged in. `i18nConfig` (exported) is a ready config: `{ availableLocales: ['en', 'mn', 'ja'], locale: 'en', fallbackLocale: 'en', messages: i18nMessages }`.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { createI18n } from 'vue-i18n'
|
|
215
|
+
import { i18nConfig, i18nMessages, getFormInputModelValueRules } from '@khsura/sui'
|
|
216
|
+
|
|
217
|
+
export const i18n = createI18n({
|
|
218
|
+
...i18nConfig,
|
|
219
|
+
locale: 'ja',
|
|
220
|
+
messages: {
|
|
221
|
+
en: { ...i18nMessages.en, ...appMessages.en },
|
|
222
|
+
mn: { ...i18nMessages.mn, ...appMessages.mn },
|
|
223
|
+
ja: { ...i18nMessages.ja, ...appMessages.ja },
|
|
224
|
+
},
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
app.use(i18n)
|
|
228
|
+
|
|
229
|
+
// Predefined rules with localized messages
|
|
230
|
+
const rules = getFormInputModelValueRules(i18n.global)
|
|
231
|
+
// rules.required({ target: 'Email' }), rules.maxLength({ target: 'Name', maxLength: 50 }), …
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Inside a component: `getFormInputModelValueRules(useI18n())`. In Nuxt use `@nuxtjs/i18n` and merge `i18nMessages` into its messages; `useNuxtApp().$suiFormRules` is prebuilt. Rule list: **sui-form**.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 7. TypeScript types
|
|
239
|
+
|
|
240
|
+
All exported from `@khsura/sui` (`import type { … } from '@khsura/sui'`):
|
|
241
|
+
|
|
242
|
+
| Type | Use |
|
|
243
|
+
|---|---|
|
|
244
|
+
| `TableHeader`, `TableItem`, `TableSortOrder` | `STable` headers (`{ text, value, … }`) and rows |
|
|
245
|
+
| `SelectItem` | `SSelect` / `SAutocomplete` items (`{ text, value, disabled? }`) |
|
|
246
|
+
| `FormInputModelValueRule` | A validation rule `(value) => true \| string` |
|
|
247
|
+
| `FormComponent`, `InputComponent`, `SelectComponent` | Template-ref types (`ref<FormComponent>()`) |
|
|
248
|
+
| `AppStateOptions`, `ThemeConfigOptions`, `AppThemeType` | `createSUI` options |
|
|
249
|
+
| `MaterialDesignIcon`, `GroupItemValue`, `BreadcrumbsItem`, `CalendarEvent` | Icon names, group values, breadcrumb items, calendar events |
|
|
250
|
+
|
|
251
|
+
Prop types for every component ship in `node_modules/@khsura/sui/@types/definitions/props/props<Component>.d.ts` — check there before using a prop you're unsure of.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Critical patterns
|
|
256
|
+
|
|
257
|
+
### Activator slot (SDialog, SMenu, SSnackbar)
|
|
258
|
+
|
|
259
|
+
Bind **both** `v-on="on"` and `v-bind="attrs"`:
|
|
260
|
+
|
|
261
|
+
```vue
|
|
262
|
+
<SMenu location="bottom">
|
|
263
|
+
<template #activator="{ on, attrs }">
|
|
264
|
+
<SButton v-on="on" v-bind="attrs">Open</SButton>
|
|
265
|
+
</template>
|
|
266
|
+
<!-- content -->
|
|
267
|
+
</SMenu>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
`STooltip` is different: its activator slot passes **no** scope — put the trigger in `#activator` without `v-on`/`v-bind`; the tooltip's own wrapper handles hover. See the `sui-component` references.
|
|
271
|
+
|
|
272
|
+
### Named layouts
|
|
273
|
+
|
|
274
|
+
`SLayout name="app"` + children with `for="app"`. Once `SLayout` has a `name`, every child needs the matching `for`. Details: **sui-layout**.
|
|
275
|
+
|
|
276
|
+
### Validation rules
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
type FormInputModelValueRule = (value: unknown) => true | string
|
|
280
|
+
// true = pass, string = error message (false/null show nothing)
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Shared props
|
|
286
|
+
|
|
287
|
+
Available on most components (check the component's reference when unsure):
|
|
288
|
+
|
|
289
|
+
| Prop | Type | Description |
|
|
290
|
+
|---|---|---|
|
|
291
|
+
| `color` | `string` | Preset name (`primary`, `error`, …) or CSS color |
|
|
292
|
+
| `elevation` | `0–24` | Box shadow depth |
|
|
293
|
+
| `size` | `'mini' \| 'small' \| 'default' \| 'large' \| 'extra'` | Preset size |
|
|
294
|
+
| `outlined` / `underlined` / `borderRadius` | `boolean` / `boolean` / `string \| number` | Border styles |
|
|
295
|
+
| `disabled` | `boolean` | Disable interaction |
|
|
296
|
+
| `width` / `height` / `maxWidth` / `minWidth` | `string \| number` | Dimensions |
|
|
297
|
+
| `tag` | `string` | Override root element |
|
|
298
|
+
| `href` / `to` | `string` / `RouteLocationRaw` | Render as `<a>` / `router-link` |
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Components
|
|
303
|
+
|
|
304
|
+
| Family | Components | Reference |
|
|
305
|
+
|---|---|---|
|
|
306
|
+
| App shell | `SApp`, `SLayout`, `SAppBar`, `SAppBarTitle`, `SNavigationDrawer`, `SMain`, `SFooter`, `SBottomNavigation` | **sui-layout** |
|
|
307
|
+
| Grid | `SContainer`, `SRow`, `SColumn` (there is no `SCol`), `SSpacer` | **sui-layout** |
|
|
308
|
+
| Forms | `SForm`, `SInput`, `STextarea`, `SSelect`, `SAutocomplete`, `SCheckbox`, `SRadioGroup` + `SRadio`, `SSwitch`, `SDatePickerInput` | **sui-form** |
|
|
309
|
+
| Everything else | Buttons, cards, lists, tables, dialogs, menus, tabs, steppers, carousels, date pickers, … | **sui-component** (one reference file per family) |
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Composables
|
|
314
|
+
|
|
315
|
+
```typescript
|
|
316
|
+
import { useTheme, useDisplay, useScroll, useClickOutside } from '@khsura/sui'
|
|
317
|
+
|
|
318
|
+
const { theme, setTheme } = useTheme()
|
|
319
|
+
|
|
320
|
+
// Breakpoints (refs): xs, sm, md, lg, xl, xxl, smAndUp, smAndDown, mdAndUp, mdAndDown,
|
|
321
|
+
// lgAndUp, lgAndDown, mobile, name, width, height, isTouchDevice
|
|
322
|
+
const { mdAndUp, mobile } = useDisplay()
|
|
323
|
+
|
|
324
|
+
// Scroll helpers
|
|
325
|
+
const { smoothScrollTo, scrollIntoView, smoothElementScroll, hasScrollFeature } = useScroll()
|
|
326
|
+
|
|
327
|
+
// Click outside: register/unregister yourself
|
|
328
|
+
const el = ref<HTMLElement | null>(null)
|
|
329
|
+
const { register, unregister } = useClickOutside().onClick(el, ({ isOutside }) => {
|
|
330
|
+
if (isOutside) close()
|
|
331
|
+
})
|
|
332
|
+
onMounted(register)
|
|
333
|
+
onBeforeUnmount(unregister)
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Directives (`v-scroll`, `v-resize`) and utility classes: **sui-utilities**.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Common mistakes
|
|
341
|
+
|
|
342
|
+
| ❌ | ✅ |
|
|
343
|
+
|---|---|
|
|
344
|
+
| `yarn add @khsura/sui` with no registry config → 404/401 | Point `@khsura` at `https://npm.pkg.github.com` and supply a `read:packages` token (step 1) |
|
|
345
|
+
| Token pasted into a committed `.npmrc` / `.yarnrc.yml` | `${NPM_GITHUB_TOKEN}` placeholder + env var / CI secret |
|
|
346
|
+
| Icons render as empty boxes | Load `@mdi/font` — `import '@mdi/font/css/materialdesignicons.css'` (Vue) or `css: ['@mdi/font/css/materialdesignicons.css']` (Nuxt) |
|
|
347
|
+
| Only `style.css` (or only `base.css`) imported | Import both in plain Vue; the Nuxt module loads them |
|
|
348
|
+
| No `<SApp>` root → no colors, dialogs/menus never show | Wrap the app in `<SApp>` |
|
|
349
|
+
| `const { toggleTheme, isMobile } = …` | They don't exist: `setTheme(...)`; `useDisplay().mobile` / `mdAndUp` |
|
|
350
|
+
| Nuxt: `<SLayout>` / `<SCarousel>` "failed to resolve component" | Import them from `@khsura/sui` — the module doesn't auto-register them |
|
|
351
|
+
| Birth-date picker without `min` → years older than 5 years can't be picked | Without `min`/`max`, `SDatePicker` / `SDatePickerInput` allow Jan 1 five years before `today` to Dec 31 five years after — pass `min` / `max` for wider ranges |
|
|
352
|
+
| `SDatePicker` model as a `Date` | A string: `'YYYY-MM-DD'`, `'YYYY-MM'` or `'YYYY'` by `type` |
|
|
353
|
+
| Popup activator binds only `v-on="on"` | Bind `v-on="on"` **and** `v-bind="attrs"` (SDialog, SMenu, SSnackbar) |
|
|
354
|
+
| `SMenu` without `location` opens on top of its button | `location="bottom"` |
|
|
355
|
+
| Named `SLayout` with un-`for`ed children | `for` on every child, or `name`/`for` on none |
|
|
356
|
+
| Items as `{ title, value }` / `{ label, id }` | `{ text, value }` or plain strings |
|
|
357
|
+
| `SSelect multiple / chips / clearable / placeholder` | `SAutocomplete` |
|
|
358
|
+
| Rule returns `false` | Return a message string |
|
|
359
|
+
| `if (!formRef.value.validate()) return` | `validate()` returns `true` when there **are** errors |
|
|
360
|
+
| `hideDetails` to hide just the error | `hideError` (`hideDetails` hides the label too) |
|
|
361
|
+
| Unknown props (`SDialog title`, `persistent-hint`, `app`) | Silently ignored — check `@types/definitions/props` |
|
|
362
|
+
| `:deep(.s_*) { … !important }` | A prop, a `createSUI({ components })` default, or theme colors |
|
|
363
|
+
| `alpha` hex in `presetColors` | Opaque hex + `color-mix()` where you need translucency |
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Related skills
|
|
368
|
+
|
|
369
|
+
Use the installed plugin rather than copying these files into a project (`.claude/skills/`) — copies go stale when SUI updates.
|
|
370
|
+
|
|
371
|
+
- **sui-layout** — app shell (app bar, drawer, footer, grid)
|
|
372
|
+
- **sui-form** — validated forms and rules
|
|
373
|
+
- **sui-component** — any component: props, slots, events, examples (per-family references)
|
|
374
|
+
- **sui-utilities** — utility classes, directives, SCSS helpers
|