@nikkory/vibe-engine 4.0.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/PUBLISH-GUIDE.md +250 -0
- package/README.md +1267 -0
- package/bin/vibe.js +22 -0
- package/dist/adapters/index.d.ts +19 -0
- package/dist/browser.d.ts +25 -0
- package/dist/browser.js +15083 -0
- package/dist/browser.mjs +15000 -0
- package/dist/cli/batch-command.d.ts +142 -0
- package/dist/cli/generate-command.d.ts +119 -0
- package/dist/cli/index.d.ts +34 -0
- package/dist/constants/ComponentTypes.d.ts +65 -0
- package/dist/constants/DesignSystems.d.ts +64 -0
- package/dist/constants/Frameworks.d.ts +71 -0
- package/dist/constants/Tiers.d.ts +72 -0
- package/dist/constants/index.d.ts +10 -0
- package/dist/converters/index.d.ts +12 -0
- package/dist/converters/section-converter.d.ts +176 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +19819 -0
- package/dist/index.mjs +19496 -0
- package/dist/resolution/basic/groups-basic.d.ts +80 -0
- package/dist/resolution/basic/index.d.ts +21 -0
- package/dist/resolution/basic/intents-basic.d.ts +195 -0
- package/dist/resolution/basic/presets-basic.d.ts +96 -0
- package/dist/resolution/basic/resolver-basic.d.ts +127 -0
- package/dist/resolution/basic/shorthands-basic.d.ts +88 -0
- package/dist/resolution/core/groups-core.d.ts +160 -0
- package/dist/resolution/core/index.d.ts +21 -0
- package/dist/resolution/core/intents-core.d.ts +355 -0
- package/dist/resolution/core/presets-core.d.ts +160 -0
- package/dist/resolution/core/resolver-core.d.ts +207 -0
- package/dist/resolution/core/shorthands-core.d.ts +144 -0
- package/dist/resolution/core/types-core.d.ts +167 -0
- package/dist/resolution/debugger.d.ts +183 -0
- package/dist/resolution/demo.d.ts +57 -0
- package/dist/resolution/enterprise/index.d.ts +22 -0
- package/dist/resolution/enterprise/metrics.d.ts +152 -0
- package/dist/resolution/enterprise/resolver-enterprise.d.ts +108 -0
- package/dist/resolution/examples.d.ts +486 -0
- package/dist/resolution/groups/experience-group.d.ts +197 -0
- package/dist/resolution/groups/index.d.ts +196 -0
- package/dist/resolution/groups/layout-group.d.ts +192 -0
- package/dist/resolution/groups/motion-group.d.ts +127 -0
- package/dist/resolution/groups/visual-group.d.ts +146 -0
- package/dist/resolution/index.d.ts +41 -0
- package/dist/resolution/intents/button-intents.d.ts +231 -0
- package/dist/resolution/intents/card-intents.d.ts +177 -0
- package/dist/resolution/intents/feedback-intents.d.ts +222 -0
- package/dist/resolution/intents/index.d.ts +189 -0
- package/dist/resolution/intents/input-intents.d.ts +231 -0
- package/dist/resolution/intents/mood-modifiers.d.ts +154 -0
- package/dist/resolution/performance.d.ts +264 -0
- package/dist/resolution/presets/button-presets.d.ts +243 -0
- package/dist/resolution/presets/card-presets.d.ts +216 -0
- package/dist/resolution/presets/data-display-presets.d.ts +290 -0
- package/dist/resolution/presets/feedback-presets.d.ts +335 -0
- package/dist/resolution/presets/form-presets.d.ts +308 -0
- package/dist/resolution/presets/index.d.ts +22 -0
- package/dist/resolution/presets/input-presets.d.ts +207 -0
- package/dist/resolution/presets/nav-presets.d.ts +235 -0
- package/dist/resolution/presets/overlay-presets.d.ts +216 -0
- package/dist/resolution/presets/preset-registry.d.ts +212 -0
- package/dist/resolution/resolveProps.d.ts +235 -0
- package/dist/resolution/shorthand/feel-mappings.d.ts +140 -0
- package/dist/resolution/shorthand/index.d.ts +172 -0
- package/dist/resolution/shorthand/look-mappings.d.ts +107 -0
- package/dist/resolution/shorthand/spacing-mappings.d.ts +164 -0
- package/dist/resolution/shorthand/surface-mappings.d.ts +139 -0
- package/dist/resolution/standard/groups-standard.d.ts +98 -0
- package/dist/resolution/standard/index.d.ts +28 -0
- package/dist/resolution/standard/intents-standard.d.ts +232 -0
- package/dist/resolution/standard/presets-standard.d.ts +123 -0
- package/dist/resolution/standard/resolver-standard.d.ts +204 -0
- package/dist/resolution/standard/shorthands-standard.d.ts +98 -0
- package/dist/resolution/standard/validators.d.ts +141 -0
- package/dist/resolution/types.d.ts +461 -0
- package/dist/resolution/validators/factor24-validator.d.ts +418 -0
- package/dist/resolution/validators/index.d.ts +14 -0
- package/dist/scripts/generate-react-library.d.ts +15 -0
- package/dist/scripts/write-react-library.d.ts +18 -0
- package/dist/storage/cloud-sync.d.ts +182 -0
- package/dist/storage/index.d.ts +69 -0
- package/dist/storage/local-storage.d.ts +131 -0
- package/dist/storage/section-storage.d.ts +191 -0
- package/dist/styling/StyleGenerator.d.ts +76 -0
- package/dist/styling/TokenStyleResolver.d.ts +163 -0
- package/dist/styling/factor-migration.d.ts +192 -0
- package/dist/styling/factor-validators.d.ts +327 -0
- package/dist/styling/factors-1-6.d.ts +674 -0
- package/dist/styling/factors-12-16.d.ts +700 -0
- package/dist/styling/factors-17-24.d.ts +668 -0
- package/dist/styling/factors-all.d.ts +348 -0
- package/dist/styling/factors.d.ts +291 -0
- package/dist/styling/index.d.ts +31 -0
- package/dist/styling/types.d.ts +400 -0
- package/dist/tokens/schema.d.ts +486 -0
- package/dist/types/Option.d.ts +178 -0
- package/dist/types/Result.d.ts +148 -0
- package/dist/types/algorithm-engine.types.d.ts +298 -0
- package/dist/types/granularity/base.types.d.ts +268 -0
- package/dist/types/granularity/config.types.d.ts +177 -0
- package/dist/types/granularity/factors.types.d.ts +194 -0
- package/dist/types/granularity/index.d.ts +57 -0
- package/dist/types/granularity/slot.types.d.ts +128 -0
- package/dist/types/granularity/template.types.d.ts +179 -0
- package/dist/types/granularity-levels/atom.config.d.ts +151 -0
- package/dist/types/granularity-levels/component.config.d.ts +175 -0
- package/dist/types/granularity-levels/index.d.ts +47 -0
- package/dist/types/granularity-levels/layout.config.d.ts +278 -0
- package/dist/types/granularity-levels/page.config.d.ts +210 -0
- package/dist/types/granularity-levels/section.config.d.ts +188 -0
- package/dist/types/granularity-levels/template.config.d.ts +340 -0
- package/dist/types/index.d.ts +152 -0
- package/dist/types/section-slot.types.d.ts +169 -0
- package/dist/types/section-storage.types.d.ts +298 -0
- package/dist/types/section-template.types.d.ts +170 -0
- package/dist/types/section.types.d.ts +326 -0
- package/dist/ui-studio/ComponentGenerator.d.ts +219 -0
- package/dist/ui-studio/composition/FactorPropagator.d.ts +268 -0
- package/dist/ui-studio/composition/PageGenerator.d.ts +176 -0
- package/dist/ui-studio/composition/SectionGenerator.d.ts +312 -0
- package/dist/ui-studio/composition/SlotResolver.d.ts +295 -0
- package/dist/ui-studio/composition/section-orchestrator.d.ts +306 -0
- package/dist/ui-studio/granularity/FactorCascade.d.ts +328 -0
- package/dist/ui-studio/granularity/GranularityGenerator.d.ts +266 -0
- package/dist/ui-studio/granularity/RecursiveGenerator.d.ts +328 -0
- package/dist/ui-studio/index.d.ts +94 -0
- package/dist/ui-studio/matrix/ClassMapper.d.ts +128 -0
- package/dist/ui-studio/matrix/MatrixResolver.d.ts +203 -0
- package/dist/ui-studio/matrix/types.d.ts +96 -0
- package/dist/ui-studio/presets/IndustryDetector.d.ts +183 -0
- package/dist/ui-studio/presets/component-registry.d.ts +213 -0
- package/dist/ui-studio/presets/factor-registry.d.ts +364 -0
- package/dist/ui-studio/presets/granularity-registry.d.ts +252 -0
- package/dist/ui-studio/presets/index.d.ts +32 -0
- package/dist/ui-studio/presets/industries.d.ts +143 -0
- package/dist/ui-studio/presets/layout-registry.d.ts +21 -0
- package/dist/ui-studio/presets/matrix-groups.d.ts +195 -0
- package/dist/ui-studio/presets/page-registry.d.ts +24 -0
- package/dist/ui-studio/presets/registry.constants.d.ts +69 -0
- package/dist/ui-studio/presets/registry.types.d.ts +166 -0
- package/dist/ui-studio/presets/section-defaults.d.ts +175 -0
- package/dist/ui-studio/presets/section-registry.d.ts +83 -0
- package/dist/ui-studio/presets/section-registry.defaults.d.ts +106 -0
- package/dist/ui-studio/presets/section-registry.helpers.d.ts +112 -0
- package/dist/ui-studio/presets/section-registry.types.d.ts +181 -0
- package/dist/ui-studio/presets/template-registry.d.ts +23 -0
- package/dist/ui-studio/presets/variants.d.ts +1038 -0
- package/dist/ui-studio/registries/components-registry.d.ts +193 -0
- package/dist/ui-studio/registries/design-systems-registry.d.ts +153 -0
- package/dist/ui-studio/registries/factors-registry.d.ts +145 -0
- package/dist/ui-studio/registries/tiers-registry.d.ts +150 -0
- package/dist/ui-studio/resolution/FactorResolver.d.ts +201 -0
- package/dist/ui-studio/templates/TestGenerator.d.ts +55 -0
- package/dist/ui-studio/templates/TierGenerator.d.ts +153 -0
- package/dist/ui-studio/templates/TypesGenerator.d.ts +51 -0
- package/dist/ui-studio/types/granularity/base.types.d.ts +268 -0
- package/dist/ui-studio/types/granularity/config.types.d.ts +177 -0
- package/dist/ui-studio/types/granularity/factors.types.d.ts +194 -0
- package/dist/ui-studio/types/granularity/index.d.ts +57 -0
- package/dist/ui-studio/types/granularity/slot.types.d.ts +128 -0
- package/dist/ui-studio/types/granularity/template.types.d.ts +179 -0
- package/dist/ui-studio/types/granularity-levels/atom.config.d.ts +151 -0
- package/dist/ui-studio/types/granularity-levels/component.config.d.ts +175 -0
- package/dist/ui-studio/types/granularity-levels/index.d.ts +47 -0
- package/dist/ui-studio/types/granularity-levels/layout.config.d.ts +278 -0
- package/dist/ui-studio/types/granularity-levels/page.config.d.ts +210 -0
- package/dist/ui-studio/types/granularity-levels/section.config.d.ts +188 -0
- package/dist/ui-studio/types/granularity-levels/template.config.d.ts +340 -0
- package/dist/ui-studio/types.d.ts +323 -0
- package/dist/utils/CodeUtils.d.ts +103 -0
- package/dist/utils/GenerateComponentValidator.d.ts +35 -0
- package/dist/utils/Logger.d.ts +101 -0
- package/dist/utils/StringUtils.d.ts +120 -0
- package/dist/utils/ValidationUtils.d.ts +71 -0
- package/dist/utils/errors/BaseError.d.ts +23 -0
- package/dist/utils/errors/GenerationError.d.ts +14 -0
- package/dist/utils/errors/TemplateNotFoundError.d.ts +13 -0
- package/dist/utils/errors/ValidationError.d.ts +13 -0
- package/dist/utils/errors/index.d.ts +12 -0
- package/dist/utils/factor-resolver.d.ts +294 -0
- package/dist/utils/granularity-helpers.d.ts +359 -0
- package/dist/utils/index.d.ts +20 -0
- package/dist/utils/performance.d.ts +26 -0
- package/dist/utils/stringify.d.ts +28 -0
- package/dist/validators/component-validator.d.ts +86 -0
- package/dist/validators/design-system-validator.d.ts +95 -0
- package/dist/validators/factor-validator.d.ts +101 -0
- package/dist/validators/index.d.ts +263 -0
- package/dist/validators/section-validator.d.ts +120 -0
- package/dist/validators/slot-validator.d.ts +161 -0
- package/dist/validators/tier-validator.d.ts +102 -0
- package/package.json +67 -0
- package/tests/16-factor-integration.test.d.ts +14 -0
- package/tests/16-factor-visual.test.d.ts +14 -0
- package/tests/5-level-integration.test.d.ts +14 -0
- package/tests/CodeUtils.test.d.ts +7 -0
- package/tests/DesignSystems.test.d.ts +7 -0
- package/tests/GenerateComponentValidator.test.d.ts +7 -0
- package/tests/Logger.test.d.ts +7 -0
- package/tests/StringUtils.test.d.ts +7 -0
- package/tests/StyleGenerator.test.d.ts +13 -0
- package/tests/Tiers.test.d.ts +7 -0
- package/tests/TokenRegistry.test.d.ts +14 -0
- package/tests/TokenStyleResolver.test.d.ts +13 -0
- package/tests/ValidationUtils.test.d.ts +7 -0
- package/tests/_pending_fix/Accordion.test.d.ts +13 -0
- package/tests/_pending_fix/Alert.test.d.ts +13 -0
- package/tests/_pending_fix/AlertDialog.test.d.ts +13 -0
- package/tests/_pending_fix/AspectRatio.test.d.ts +13 -0
- package/tests/_pending_fix/Autocomplete.test.d.ts +13 -0
- package/tests/_pending_fix/Avatar.test.d.ts +13 -0
- package/tests/_pending_fix/Badge.test.d.ts +13 -0
- package/tests/_pending_fix/Banner.test.d.ts +13 -0
- package/tests/_pending_fix/Box.test.d.ts +13 -0
- package/tests/_pending_fix/Breadcrumb.test.d.ts +13 -0
- package/tests/_pending_fix/Callout.test.d.ts +13 -0
- package/tests/_pending_fix/Card.test.d.ts +13 -0
- package/tests/_pending_fix/Center.test.d.ts +13 -0
- package/tests/_pending_fix/Checkbox.test.d.ts +13 -0
- package/tests/_pending_fix/Chip.test.d.ts +13 -0
- package/tests/_pending_fix/ColorPicker.test.d.ts +13 -0
- package/tests/_pending_fix/Combobox.test.d.ts +13 -0
- package/tests/_pending_fix/CommandPalette.test.d.ts +13 -0
- package/tests/_pending_fix/ConfirmationModal.test.d.ts +13 -0
- package/tests/_pending_fix/Container.test.d.ts +13 -0
- package/tests/_pending_fix/DataTable.test.d.ts +13 -0
- package/tests/_pending_fix/DatePicker.test.d.ts +13 -0
- package/tests/_pending_fix/DateRangePicker.test.d.ts +13 -0
- package/tests/_pending_fix/DateTimePicker.test.d.ts +13 -0
- package/tests/_pending_fix/Divider.test.d.ts +13 -0
- package/tests/_pending_fix/Drawer.test.d.ts +13 -0
- package/tests/_pending_fix/Dropdown.test.d.ts +13 -0
- package/tests/_pending_fix/EmptyState.test.d.ts +13 -0
- package/tests/_pending_fix/ErrorState.test.d.ts +13 -0
- package/tests/_pending_fix/FileDropzone.test.d.ts +13 -0
- package/tests/_pending_fix/FileUpload.test.d.ts +13 -0
- package/tests/_pending_fix/Flex.test.d.ts +13 -0
- package/tests/_pending_fix/Grid.test.d.ts +13 -0
- package/tests/_pending_fix/GridItem.test.d.ts +13 -0
- package/tests/_pending_fix/HStack.test.d.ts +13 -0
- package/tests/_pending_fix/Input.test.d.ts +13 -0
- package/tests/_pending_fix/InputCurrency.test.d.ts +13 -0
- package/tests/_pending_fix/InputGroup.test.d.ts +13 -0
- package/tests/_pending_fix/InputOTP.test.d.ts +13 -0
- package/tests/_pending_fix/InputPassword.test.d.ts +13 -0
- package/tests/_pending_fix/InputPhone.test.d.ts +13 -0
- package/tests/_pending_fix/InputSearch.test.d.ts +13 -0
- package/tests/_pending_fix/Link.test.d.ts +13 -0
- package/tests/_pending_fix/List.test.d.ts +13 -0
- package/tests/_pending_fix/LoadingOverlay.test.d.ts +13 -0
- package/tests/_pending_fix/Menu.test.d.ts +13 -0
- package/tests/_pending_fix/Modal.test.d.ts +13 -0
- package/tests/_pending_fix/MultiSelect.test.d.ts +13 -0
- package/tests/_pending_fix/NavGroup.test.d.ts +13 -0
- package/tests/_pending_fix/NavItem.test.d.ts +13 -0
- package/tests/_pending_fix/NavLink.test.d.ts +13 -0
- package/tests/_pending_fix/Navbar.test.d.ts +13 -0
- package/tests/_pending_fix/Notification.test.d.ts +13 -0
- package/tests/_pending_fix/NotificationBadge.test.d.ts +13 -0
- package/tests/_pending_fix/NumberInput.test.d.ts +13 -0
- package/tests/_pending_fix/Pagination.test.d.ts +13 -0
- package/tests/_pending_fix/Popover.test.d.ts +13 -0
- package/tests/_pending_fix/Progress.test.d.ts +13 -0
- package/tests/_pending_fix/ProgressCircle.test.d.ts +13 -0
- package/tests/_pending_fix/ProgressSteps.test.d.ts +13 -0
- package/tests/_pending_fix/Radio.test.d.ts +13 -0
- package/tests/_pending_fix/RangeSlider.test.d.ts +13 -0
- package/tests/_pending_fix/ResizablePanel.test.d.ts +13 -0
- package/tests/_pending_fix/ResultState.test.d.ts +13 -0
- package/tests/_pending_fix/ScrollArea.test.d.ts +13 -0
- package/tests/_pending_fix/Select.test.d.ts +14 -0
- package/tests/_pending_fix/Sheet.test.d.ts +13 -0
- package/tests/_pending_fix/Sidebar.test.d.ts +13 -0
- package/tests/_pending_fix/SimpleGrid.test.d.ts +13 -0
- package/tests/_pending_fix/Skeleton.test.d.ts +13 -0
- package/tests/_pending_fix/Slider.test.d.ts +13 -0
- package/tests/_pending_fix/Spacer.test.d.ts +13 -0
- package/tests/_pending_fix/Spinner.test.d.ts +13 -0
- package/tests/_pending_fix/Stack.test.d.ts +13 -0
- package/tests/_pending_fix/Stat.test.d.ts +13 -0
- package/tests/_pending_fix/Stepper.test.d.ts +14 -0
- package/tests/_pending_fix/Switch.test.d.ts +13 -0
- package/tests/_pending_fix/Table.test.d.ts +13 -0
- package/tests/_pending_fix/Tabs.test.d.ts +13 -0
- package/tests/_pending_fix/Textarea.test.d.ts +13 -0
- package/tests/_pending_fix/Timeline.test.d.ts +13 -0
- package/tests/_pending_fix/Toast.test.d.ts +14 -0
- package/tests/_pending_fix/Tooltip.test.d.ts +14 -0
- package/tests/_pending_fix/VStack.test.d.ts +13 -0
- package/tests/alert.test.d.ts +13 -0
- package/tests/badge.test.d.ts +13 -0
- package/tests/benchmarks/factor-resolution.bench.d.ts +41 -0
- package/tests/button.test.d.ts +16 -0
- package/tests/card.test.d.ts +19 -0
- package/tests/checkbox.test.d.ts +13 -0
- package/tests/component-16-factor-types.test.d.ts +13 -0
- package/tests/component-5level-integration.test.d.ts +14 -0
- package/tests/component-registry-ui.test.d.ts +13 -0
- package/tests/e2e/16-factor-visual.test.d.ts +14 -0
- package/tests/edge-cases.test.d.ts +14 -0
- package/tests/factor-17-24-integration.test.d.ts +14 -0
- package/tests/factor-17-24-performance.test.d.ts +14 -0
- package/tests/factor-validators.test.d.ts +13 -0
- package/tests/factors-1-6.test.d.ts +13 -0
- package/tests/factors-12-16.test.d.ts +13 -0
- package/tests/factors-17-24.test.d.ts +21 -0
- package/tests/factors-all.test.d.ts +13 -0
- package/tests/factors-registry.test.d.ts +11 -0
- package/tests/factors.test.d.ts +13 -0
- package/tests/granularity-types.test.d.ts +18 -0
- package/tests/groups.test.d.ts +14 -0
- package/tests/input.test.d.ts +16 -0
- package/tests/intents.test.d.ts +14 -0
- package/tests/memory-leak.test.d.ts +14 -0
- package/tests/modal.test.d.ts +19 -0
- package/tests/presets.test.d.ts +14 -0
- package/tests/radio.test.d.ts +13 -0
- package/tests/resolution-intents.test.d.ts +13 -0
- package/tests/resolution-presets.test.d.ts +13 -0
- package/tests/resolveProps.test.d.ts +14 -0
- package/tests/section-integration.test.d.ts +16 -0
- package/tests/section-types.test.d.ts +11 -0
- package/tests/setup.d.ts +13 -0
- package/tests/shorthands.test.d.ts +14 -0
- package/tests/switch.test.d.ts +13 -0
- package/tests/tabs.test.d.ts +13 -0
- package/tests/tiers-registry.test.d.ts +11 -0
- package/tests/useComponentStyles.test.d.ts +11 -0
- package/tests/useFactors.test.d.ts +13 -0
- package/tests/validators-invalid-input.test.d.ts +13 -0
- package/tsup.config.d.ts +11 -0
- package/vitest.config.d.ts +3 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot Validator - Validates SlotConfig objects
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* @module validators/slot-validator
|
|
6
|
+
* @since 4.0.0
|
|
7
|
+
*
|
|
8
|
+
* Powered by Nikkory
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationResult } from '../types/algorithm-engine.types';
|
|
11
|
+
import type { ComponentType } from '../types/index';
|
|
12
|
+
import type { SlotConfig, SlotPosition, StoredComponentInSlot } from '../types/section.types';
|
|
13
|
+
/**
|
|
14
|
+
* Validate a SlotConfig object
|
|
15
|
+
*
|
|
16
|
+
* @param config - The SlotConfig to validate
|
|
17
|
+
* @returns ValidationResult indicating success or failure with error messages
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const result = validateSlotConfig({
|
|
22
|
+
* slotId: 'header-slot',
|
|
23
|
+
* position: 'header',
|
|
24
|
+
* allowedComponents: ['button', 'badge'],
|
|
25
|
+
* maxComponents: 5,
|
|
26
|
+
* defaultComponent: 'button',
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* if (result.valid) {
|
|
30
|
+
* console.log('Slot config is valid');
|
|
31
|
+
* } else {
|
|
32
|
+
* console.log('Errors:', result.errors);
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateSlotConfig(config: unknown): ValidationResult;
|
|
37
|
+
/**
|
|
38
|
+
* Validate multiple SlotConfig objects
|
|
39
|
+
*
|
|
40
|
+
* @param slots - Array of SlotConfig objects to validate
|
|
41
|
+
* @returns ValidationResult with aggregated errors and warnings
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const result = validateSlotConfigs([
|
|
46
|
+
* { slotId: 'header', position: 'header', ... },
|
|
47
|
+
* { slotId: 'content', position: 'content', ... },
|
|
48
|
+
* ]);
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function validateSlotConfigs(slots: unknown): ValidationResult;
|
|
52
|
+
/**
|
|
53
|
+
* Validate a StoredComponentInSlot object
|
|
54
|
+
*
|
|
55
|
+
* @param component - The StoredComponentInSlot to validate
|
|
56
|
+
* @returns ValidationResult indicating success or failure
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const result = validateStoredComponent({
|
|
61
|
+
* componentRef: 'button',
|
|
62
|
+
* instanceId: 'btn-1',
|
|
63
|
+
* propOverrides: { variant: 'primary' },
|
|
64
|
+
* order: 0,
|
|
65
|
+
* visible: true,
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function validateStoredComponent(component: unknown): ValidationResult;
|
|
70
|
+
/**
|
|
71
|
+
* Validate StoredComponentInSlot against its SlotConfig
|
|
72
|
+
*
|
|
73
|
+
* @param component - The StoredComponentInSlot to validate
|
|
74
|
+
* @param slotConfig - The SlotConfig to validate against
|
|
75
|
+
* @returns ValidationResult indicating success or failure
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const result = validateComponentInSlot(
|
|
80
|
+
* { componentRef: 'button', ... },
|
|
81
|
+
* { allowedComponents: ['button', 'badge'], maxComponents: 5, ... }
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function validateComponentInSlot(component: StoredComponentInSlot, slotConfig: SlotConfig): ValidationResult;
|
|
86
|
+
/**
|
|
87
|
+
* Validate multiple components in a slot
|
|
88
|
+
*
|
|
89
|
+
* @param components - Array of StoredComponentInSlot to validate
|
|
90
|
+
* @param slotConfig - The SlotConfig to validate against
|
|
91
|
+
* @returns ValidationResult with aggregated errors
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const result = validateComponentsInSlot(
|
|
96
|
+
* [{ componentRef: 'button', ... }, { componentRef: 'badge', ... }],
|
|
97
|
+
* { allowedComponents: ['button', 'badge'], maxComponents: 5, ... }
|
|
98
|
+
* );
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export declare function validateComponentsInSlot(components: readonly StoredComponentInSlot[], slotConfig: SlotConfig): ValidationResult;
|
|
102
|
+
/**
|
|
103
|
+
* Create a validated SlotConfig
|
|
104
|
+
*
|
|
105
|
+
* @param config - Slot config to validate and return
|
|
106
|
+
* @returns The validated SlotConfig or throws on invalid
|
|
107
|
+
* @throws Error if validation fails
|
|
108
|
+
*/
|
|
109
|
+
export declare function createValidatedSlotConfig(config: unknown): SlotConfig;
|
|
110
|
+
/**
|
|
111
|
+
* Create a validated StoredComponentInSlot
|
|
112
|
+
*
|
|
113
|
+
* @param component - Component to validate and return
|
|
114
|
+
* @returns The validated StoredComponentInSlot or throws on invalid
|
|
115
|
+
* @throws Error if validation fails
|
|
116
|
+
*/
|
|
117
|
+
export declare function createValidatedStoredComponent(component: unknown): StoredComponentInSlot;
|
|
118
|
+
/**
|
|
119
|
+
* Type guard to check if a value is a valid SlotPosition
|
|
120
|
+
*/
|
|
121
|
+
export declare function isSlotPosition(value: unknown): value is SlotPosition;
|
|
122
|
+
/**
|
|
123
|
+
* Type guard to check if a value is a valid ComponentType
|
|
124
|
+
*/
|
|
125
|
+
export declare function isComponentType(value: unknown): value is ComponentType;
|
|
126
|
+
/**
|
|
127
|
+
* Check if a SlotConfig is valid
|
|
128
|
+
*/
|
|
129
|
+
export declare function isValidSlotConfig(config: unknown): config is SlotConfig;
|
|
130
|
+
/**
|
|
131
|
+
* Check if a StoredComponentInSlot is valid
|
|
132
|
+
*/
|
|
133
|
+
export declare function isValidStoredComponent(component: unknown): component is StoredComponentInSlot;
|
|
134
|
+
/**
|
|
135
|
+
* Default slot configuration for header position
|
|
136
|
+
*/
|
|
137
|
+
export declare const DEFAULT_HEADER_SLOT: SlotConfig;
|
|
138
|
+
/**
|
|
139
|
+
* Default slot configuration for content position
|
|
140
|
+
*/
|
|
141
|
+
export declare const DEFAULT_CONTENT_SLOT: SlotConfig;
|
|
142
|
+
/**
|
|
143
|
+
* Default slot configuration for footer position
|
|
144
|
+
*/
|
|
145
|
+
export declare const DEFAULT_FOOTER_SLOT: SlotConfig;
|
|
146
|
+
/**
|
|
147
|
+
* Default slot configuration for sidebar position
|
|
148
|
+
*/
|
|
149
|
+
export declare const DEFAULT_SIDEBAR_SLOT: SlotConfig;
|
|
150
|
+
/**
|
|
151
|
+
* Default slot configuration for overlay position
|
|
152
|
+
*/
|
|
153
|
+
export declare const DEFAULT_OVERLAY_SLOT: SlotConfig;
|
|
154
|
+
/**
|
|
155
|
+
* Get default slot config for a position
|
|
156
|
+
*
|
|
157
|
+
* @param position - The slot position
|
|
158
|
+
* @returns Default SlotConfig for the position
|
|
159
|
+
*/
|
|
160
|
+
export declare function getDefaultSlotConfig(position: SlotPosition): SlotConfig;
|
|
161
|
+
//# sourceMappingURL=slot-validator.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier Validator
|
|
3
|
+
* Input validation for tier parameters
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module validators/tier-validator
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* Powered by Nikkory
|
|
10
|
+
*/
|
|
11
|
+
import type { Tier } from '../types';
|
|
12
|
+
import type { ValidationResult } from '../types/algorithm-engine.types';
|
|
13
|
+
/**
|
|
14
|
+
* Valid tier values
|
|
15
|
+
*/
|
|
16
|
+
export declare const VALID_TIERS: readonly Tier[];
|
|
17
|
+
/**
|
|
18
|
+
* Check if a value is a valid tier
|
|
19
|
+
*
|
|
20
|
+
* @param value - Value to check
|
|
21
|
+
* @returns True if value is a valid tier
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* isValidTier('basic') // true
|
|
26
|
+
* isValidTier('enterprise') // true
|
|
27
|
+
* isValidTier('invalid') // false
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function isValidTier(value: unknown): value is Tier;
|
|
31
|
+
/**
|
|
32
|
+
* Validate tier input
|
|
33
|
+
*
|
|
34
|
+
* @param tier - Tier to validate
|
|
35
|
+
* @returns Validation result with errors and warnings
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* validateTier('basic')
|
|
40
|
+
* // { valid: true, errors: [], warnings: [] }
|
|
41
|
+
*
|
|
42
|
+
* validateTier('invalid')
|
|
43
|
+
* // { valid: false, errors: ['Invalid tier...'], warnings: [] }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function validateTier(tier: unknown): ValidationResult;
|
|
47
|
+
/**
|
|
48
|
+
* Assert that a value is a valid tier
|
|
49
|
+
*
|
|
50
|
+
* @param value - Value to check
|
|
51
|
+
* @throws Error if value is not a valid tier
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* assertValidTier('basic') // OK
|
|
56
|
+
* assertValidTier('invalid') // throws Error
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function assertValidTier(value: unknown): asserts value is Tier;
|
|
60
|
+
/**
|
|
61
|
+
* Parse and validate tier, returning undefined for invalid values
|
|
62
|
+
*
|
|
63
|
+
* @param value - Value to parse
|
|
64
|
+
* @returns Valid tier or undefined
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* parseTier('basic') // 'basic'
|
|
69
|
+
* parseTier('invalid') // undefined
|
|
70
|
+
* parseTier(123) // undefined
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseTier(value: unknown): Tier | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Get tier with fallback to default
|
|
76
|
+
*
|
|
77
|
+
* @param value - Value to check
|
|
78
|
+
* @param defaultTier - Default tier if invalid
|
|
79
|
+
* @returns Valid tier
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* getTierOrDefault('basic', 'standard') // 'basic'
|
|
84
|
+
* getTierOrDefault('invalid', 'standard') // 'standard'
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function getTierOrDefault(value: unknown, defaultTier: Tier): Tier;
|
|
88
|
+
/**
|
|
89
|
+
* Suggest correct tier for typos
|
|
90
|
+
*
|
|
91
|
+
* @param input - User input
|
|
92
|
+
* @returns Suggested tier or undefined
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* suggestTier('basci') // 'basic'
|
|
97
|
+
* suggestTier('enterprise') // 'enterprise'
|
|
98
|
+
* suggestTier('xyz') // undefined
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export declare function suggestTier(input: string): Tier | undefined;
|
|
102
|
+
//# sourceMappingURL=tier-validator.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nikkory/vibe-engine",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Framework-agnostic code generation engine for Nikkory Vibe - Zero-token UI/UX code generation",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"vibe": "bin/vibe.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./browser": {
|
|
18
|
+
"types": "./dist/browser.d.ts",
|
|
19
|
+
"import": "./dist/browser.mjs",
|
|
20
|
+
"require": "./dist/browser.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup && tsc --emitDeclarationOnly --declaration",
|
|
25
|
+
"dev": "tsup --watch",
|
|
26
|
+
"lint": "eslint src --ext .ts",
|
|
27
|
+
"type-check": "tsc --noEmit",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"test:coverage": "vitest run --coverage"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"code-generation",
|
|
34
|
+
"ui-components",
|
|
35
|
+
"design-systems",
|
|
36
|
+
"zero-token",
|
|
37
|
+
"clean-architecture",
|
|
38
|
+
"framework-agnostic",
|
|
39
|
+
"24-factor",
|
|
40
|
+
"composition-engine"
|
|
41
|
+
],
|
|
42
|
+
"author": "Nikkory <dev@nikkory.com>",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/kemonra/nikkory-vibe.git",
|
|
47
|
+
"directory": "packages/engine"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"class-variance-authority": "^0.7.0",
|
|
51
|
+
"zod": "^3.25.76"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@eslint/js": "^9.39.1",
|
|
55
|
+
"@types/node": "^25.0.0",
|
|
56
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
57
|
+
"eslint": "^9.39.1",
|
|
58
|
+
"globals": "^16.5.0",
|
|
59
|
+
"tsup": "^8.5.1",
|
|
60
|
+
"typescript": "^5.9.3",
|
|
61
|
+
"typescript-eslint": "^8.49.0",
|
|
62
|
+
"vitest": "^4.0.15"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 16-Factor Integration Tests
|
|
3
|
+
*
|
|
4
|
+
* Integration tests for the complete 16-factor system in StyleGenerator.
|
|
5
|
+
* Tests factor combinations and ensures all factors work together correctly.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module tests/generator/16-factor-integration
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=16-factor-integration.test.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 16-Factor Visual E2E Tests
|
|
3
|
+
*
|
|
4
|
+
* End-to-end tests for visual verification of 16-Factor system.
|
|
5
|
+
* These tests verify that factor props correctly apply visual styles.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module __tests__/e2e/16-factor-visual
|
|
9
|
+
* @since 2.1.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=16-factor-visual.test.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 5-Level Abstraction Integration Tests
|
|
3
|
+
*
|
|
4
|
+
* Integration tests for the 5-Level Abstraction API with component props.
|
|
5
|
+
* Tests that MultiLevelProps works correctly across all levels.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module tests/resolution/5-level-integration
|
|
9
|
+
* @since 2.1.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=5-level-integration.test.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StyleGenerator Unit Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests for the core style generation engine.
|
|
5
|
+
* These tests verify that StyleGenerator correctly generates component styles
|
|
6
|
+
* from design tokens.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
* @module tests/StyleGenerator
|
|
10
|
+
* @since 2.0.0
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=StyleGenerator.test.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TokenRegistry Unit Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests for the Token Registry - central registry for design system tokens.
|
|
5
|
+
* Verifies singleton pattern, token retrieval, registration, and utility functions.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module tests/TokenRegistry
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=TokenRegistry.test.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TokenStyleResolver Unit Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests for the Token Style Resolver - converting design tokens to Tailwind classes.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module tests/TokenStyleResolver
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* Powered by Nikkory
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=TokenStyleResolver.test.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accordion Component Tests
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated by Code Doctor v4.0
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module tests/components/Accordion
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* Powered by Nikkory
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Accordion.test.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AlertDialog Component Tests
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated by Code Doctor v4.0
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module tests/components/AlertDialog
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* Powered by Nikkory
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=AlertDialog.test.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AspectRatio Component Tests
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated by Code Doctor v4.0
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module tests/components/AspectRatio
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* Powered by Nikkory
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=AspectRatio.test.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autocomplete Component Tests
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated by Code Doctor v4.0
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module tests/components/Autocomplete
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* Powered by Nikkory
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Autocomplete.test.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breadcrumb Component Tests
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated by Code Doctor v4.0
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module tests/components/Breadcrumb
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* Powered by Nikkory
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Breadcrumb.test.d.ts.map
|