@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,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section Converter - Bridge from Registry to SectionConfig
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* @module converters/section-converter
|
|
6
|
+
* @since 4.1.0
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This module provides the bridge function `toSectionConfig()` that converts
|
|
10
|
+
* a `RegistrySectionDefinition` (from section-registry) to a `SectionConfig`
|
|
11
|
+
* (used by generators and storage).
|
|
12
|
+
*
|
|
13
|
+
* Field Name Unification:
|
|
14
|
+
* - Registry `id` → SectionConfig `sectionId`
|
|
15
|
+
* - Registry `category` → SectionConfig `sectionType`
|
|
16
|
+
* - Registry `sectionLayout` → SectionConfig `layout`
|
|
17
|
+
*
|
|
18
|
+
* Powered by Nikkory
|
|
19
|
+
*/
|
|
20
|
+
import type { RegistrySectionDefinition } from '../ui-studio/presets/registry.types';
|
|
21
|
+
import type { DesignSystem, Tier } from '../types';
|
|
22
|
+
import type { SectionConfig, SectionCategory, LayoutType, SpacingLevel } from '../types/section.types';
|
|
23
|
+
/**
|
|
24
|
+
* User-provided overrides for section configuration
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* These are the fields that users can customize when using a section template.
|
|
28
|
+
* All fields are optional - if not provided, the registry defaults are used.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const overrides: SectionUserOverrides = {
|
|
33
|
+
* title: 'My Custom Hero',
|
|
34
|
+
* subtitle: 'Welcome to our platform',
|
|
35
|
+
* designSystem: 'brutalism',
|
|
36
|
+
* tier: 'enterprise',
|
|
37
|
+
* columns: 2,
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* const config = toSectionConfig(registryDefinition, overrides);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export interface SectionUserOverrides {
|
|
44
|
+
/** Custom section title */
|
|
45
|
+
readonly title?: string;
|
|
46
|
+
/** Custom section subtitle */
|
|
47
|
+
readonly subtitle?: string;
|
|
48
|
+
/** Override design system */
|
|
49
|
+
readonly designSystem?: DesignSystem;
|
|
50
|
+
/** Override quality tier */
|
|
51
|
+
readonly tier?: Tier;
|
|
52
|
+
/** Override layout type */
|
|
53
|
+
readonly layout?: LayoutType;
|
|
54
|
+
/** Override number of columns */
|
|
55
|
+
readonly columns?: 1 | 2 | 3 | 4 | 6;
|
|
56
|
+
/** Override spacing level */
|
|
57
|
+
readonly spacing?: SpacingLevel;
|
|
58
|
+
/** Override item count (for list-based sections) */
|
|
59
|
+
readonly itemCount?: number;
|
|
60
|
+
/** Override show CTA */
|
|
61
|
+
readonly showCta?: boolean;
|
|
62
|
+
/** Override show media */
|
|
63
|
+
readonly showMedia?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Convert a RegistrySectionDefinition to SectionConfig
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* This is the primary bridge function between the registry (UI/filtering) and
|
|
70
|
+
* the generation system. It handles:
|
|
71
|
+
*
|
|
72
|
+
* 1. **Field Name Unification**: Maps legacy field names to unified names
|
|
73
|
+
* - `id` → `sectionId`
|
|
74
|
+
* - `category` → `sectionType`
|
|
75
|
+
* - `sectionLayout` → `layout`
|
|
76
|
+
*
|
|
77
|
+
* 2. **User Overrides**: Applies user-provided customizations
|
|
78
|
+
* - Override priority: userOverrides > registry definition > category defaults
|
|
79
|
+
*
|
|
80
|
+
* 3. **Type Safety**: Ensures the returned SectionConfig is valid
|
|
81
|
+
*
|
|
82
|
+
* @param registry - The registry section definition to convert
|
|
83
|
+
* @param overrides - Optional user overrides for customization
|
|
84
|
+
* @returns A valid SectionConfig for use in generation
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* import { toSectionConfig } from './converters';
|
|
89
|
+
* import { ALL_SECTIONS } from './section-registry';
|
|
90
|
+
*
|
|
91
|
+
* // Find a section by id
|
|
92
|
+
* const heroSection = ALL_SECTIONS.find(s => s.id === 'hero-centered');
|
|
93
|
+
*
|
|
94
|
+
* // Convert to SectionConfig
|
|
95
|
+
* const config = toSectionConfig(heroSection);
|
|
96
|
+
*
|
|
97
|
+
* // Or with user overrides
|
|
98
|
+
* const customConfig = toSectionConfig(heroSection, {
|
|
99
|
+
* title: 'Welcome to Nikkory',
|
|
100
|
+
* designSystem: 'brutalism',
|
|
101
|
+
* tier: 'enterprise',
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare function toSectionConfig(registry: RegistrySectionDefinition, overrides?: SectionUserOverrides): SectionConfig;
|
|
106
|
+
/**
|
|
107
|
+
* Convert multiple registry definitions to SectionConfigs
|
|
108
|
+
*
|
|
109
|
+
* @param sections - Array of registry definitions
|
|
110
|
+
* @param overrides - Optional map of overrides keyed by section id
|
|
111
|
+
* @returns Array of SectionConfigs
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const heroSections = ALL_SECTIONS.filter(s => s.category === 'hero');
|
|
116
|
+
* const configs = toSectionConfigs(heroSections);
|
|
117
|
+
*
|
|
118
|
+
* // With per-section overrides
|
|
119
|
+
* const configs = toSectionConfigs(heroSections, {
|
|
120
|
+
* 'hero-centered': { title: 'Custom Hero' },
|
|
121
|
+
* 'hero-split': { tier: 'enterprise' },
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare function toSectionConfigs(sections: readonly RegistrySectionDefinition[], overrides?: Record<string, SectionUserOverrides>): readonly SectionConfig[];
|
|
126
|
+
/**
|
|
127
|
+
* Find a section by ID and convert to SectionConfig
|
|
128
|
+
*
|
|
129
|
+
* @param sections - Array of registry definitions to search
|
|
130
|
+
* @param sectionId - The section ID to find
|
|
131
|
+
* @param overrides - Optional user overrides
|
|
132
|
+
* @returns SectionConfig if found, undefined otherwise
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* const config = findAndConvertSection(ALL_SECTIONS, 'hero-centered', {
|
|
137
|
+
* title: 'My Hero',
|
|
138
|
+
* });
|
|
139
|
+
*
|
|
140
|
+
* if (config) {
|
|
141
|
+
* console.log(config.sectionId); // 'hero-centered'
|
|
142
|
+
* console.log(config.title); // 'My Hero'
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export declare function findAndConvertSection(sections: readonly RegistrySectionDefinition[], sectionId: string, overrides?: SectionUserOverrides): SectionConfig | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Find sections by category and convert to SectionConfigs
|
|
149
|
+
*
|
|
150
|
+
* @param sections - Array of registry definitions to search
|
|
151
|
+
* @param category - The section category to filter by
|
|
152
|
+
* @param overrides - Optional map of overrides keyed by section id
|
|
153
|
+
* @returns Array of SectionConfigs for the category
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* const heroConfigs = findAndConvertByCategory(ALL_SECTIONS, 'hero');
|
|
158
|
+
* console.log(heroConfigs.length); // 10 hero sections
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare function findAndConvertByCategory(sections: readonly RegistrySectionDefinition[], category: SectionCategory, overrides?: Record<string, SectionUserOverrides>): readonly SectionConfig[];
|
|
162
|
+
/**
|
|
163
|
+
* Validate that a SectionConfig has all required fields
|
|
164
|
+
*
|
|
165
|
+
* @param config - The SectionConfig to validate
|
|
166
|
+
* @returns Validation result with errors if any
|
|
167
|
+
*/
|
|
168
|
+
export declare function validateSectionConfig(config: SectionConfig): {
|
|
169
|
+
valid: boolean;
|
|
170
|
+
errors: readonly string[];
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Check if a value is a valid SectionUserOverrides object
|
|
174
|
+
*/
|
|
175
|
+
export declare function isSectionUserOverrides(value: unknown): value is SectionUserOverrides;
|
|
176
|
+
//# sourceMappingURL=section-converter.d.ts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nikkory Vibe Engine - Framework-Agnostic Code Generation
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* @module engine
|
|
6
|
+
* @since 4.0.0
|
|
7
|
+
*
|
|
8
|
+
* Powered by Nikkory
|
|
9
|
+
*/
|
|
10
|
+
export { cn, generateStyles } from './styling';
|
|
11
|
+
export type { StyleConfig, GeneratedStyles, StyleGeneratorFn } from './styling/types';
|
|
12
|
+
export * from './ui-studio/presets/variants';
|
|
13
|
+
export { UI_COMPONENTS as ALL_COMPONENTS, getStableComponents, searchUIComponents as searchComponents, } from './ui-studio';
|
|
14
|
+
export type { RegistryComponentDefinition } from './ui-studio';
|
|
15
|
+
export { ALL_SECTIONS } from './ui-studio';
|
|
16
|
+
export { ALL_PAGES } from './ui-studio';
|
|
17
|
+
export { ALL_LAYOUTS } from './ui-studio';
|
|
18
|
+
export { ALL_TEMPLATES } from './ui-studio';
|
|
19
|
+
export { DESIGN_SYSTEM_DEFAULTS, MATERIAL_DESIGN_DEFAULTS, IOS_HIG_DEFAULTS, GLASSMORPHISM_DEFAULTS, NEUMORPHISM_DEFAULTS, BRUTALISM_DEFAULTS, MINIMALISM_DEFAULTS, CYBERPUNK_DEFAULTS, FLAT_DESIGN_DEFAULTS, RETRO_VINTAGE_DEFAULTS, FLUENT_DESIGN_DEFAULTS, CARBON_DESIGN_DEFAULTS, ANT_DESIGN_DEFAULTS, getDefaultFactors, mergeWithDefaults, getAvailableDesignSystems, isDesignSystemSupported, } from './ui-studio/presets/section-defaults';
|
|
20
|
+
export type { RegistrySectionDefinition, RegistryPageDefinition, RegistryLayoutDefinition, RegistryTemplateDefinition, BaseRegistryDefinition, SectionCategory, PageCategory, LayoutCategory, TemplateCategory, PageType, } from './ui-studio';
|
|
21
|
+
export * from './ui-studio/presets/registry.constants';
|
|
22
|
+
export { TierGenerator } from './ui-studio';
|
|
23
|
+
export { PageGenerator } from './ui-studio';
|
|
24
|
+
export type { CompositionConfig, CompositionStrategy, SlotDefinition, } from './ui-studio/composition/PageGenerator';
|
|
25
|
+
export type { TierGenerationConfig, GenerationResult, BatchGenerationConfig, BatchGenerationResult, GenerationOptions, ComponentTemplateData, TierFeatures, SectionGenerationConfig, PageGenerationConfig, LayoutGenerationConfig, TemplateGenerationConfig, GeneratorStats, } from './ui-studio/types';
|
|
26
|
+
export { getTierFeatures } from './ui-studio/types';
|
|
27
|
+
export { SectionGenerator as SectionConfigGenerator, createSectionGenerator as createSectionConfigGenerator, generateSection as generateSectionFromConfig, } from './ui-studio/composition/SectionGenerator';
|
|
28
|
+
export type { SectionGenerationInput as SectionConfigGenerationInput, SectionGenerationResult as SectionConfigGenerationResult, SectionGeneratorOptions as SectionConfigGeneratorOptions, GeneratedSlot, SectionGenerationMetadata as SectionConfigGenerationMetadata, } from './ui-studio/composition/SectionGenerator';
|
|
29
|
+
export { SlotResolver, createSlotResolver, resolveSlots, resolveSlot, } from './ui-studio';
|
|
30
|
+
export type { SlotResolutionInput, SlotResolutionResult, ResolvedSlot, ResolvedComponent, } from './ui-studio/composition/SlotResolver';
|
|
31
|
+
export { FactorPropagator, createFactorPropagator, propagateFactors, getFactorTailwindClasses, getFactorCssVariables, mapFactorsToProps, SECTION_FACTOR_MAPPINGS, } from './ui-studio';
|
|
32
|
+
export type { FactorPropagationInput, FactorPropagationResult, FactorPropMapping, PropagatedFactor, FactorPropagatorOptions, } from './ui-studio/composition/FactorPropagator';
|
|
33
|
+
export { SectionGenerator, createSectionGenerator, generateSectionComponents, } from './ui-studio/composition/section-orchestrator';
|
|
34
|
+
export type { SectionGenerationInput, SectionGenerationOptions, SectionGenerationResult, SectionGenerationMetadata, GeneratedSlotComponent, GeneratedComponentMetadata, } from './ui-studio/composition/section-orchestrator';
|
|
35
|
+
export { toSectionConfig, toSectionConfigs, findAndConvertSection, findAndConvertByCategory, validateSectionConfig as validateSectionConfigConverter, isSectionUserOverrides, } from './converters';
|
|
36
|
+
export type { SectionUserOverrides } from './converters';
|
|
37
|
+
export { FactorResolver, createFactorResolver, resolveFactors, getTailwindClassesForComponent, getCssVariablesForComponent, } from './ui-studio/resolution/FactorResolver';
|
|
38
|
+
export { ComponentGenerator, createComponentGenerator, generateComponent, generateComponentOutput, } from './ui-studio';
|
|
39
|
+
export type { StyleOutput, CodeOutput, ComponentGenerationResult, } from './ui-studio/ComponentGenerator';
|
|
40
|
+
export { TIER_REGISTRY, getTierEntry, getFactorsForTier, getCodeFeaturesForTier, getLocRangeForTier, isFactorEnabledForTier, getMinimumTierForFactor, getTiersSupportingFactor, compareTierLevels, getAllTiers, getTierDisplayName, ALGORITHM_FACTOR_REGISTRY as FACTOR_REGISTRY, getFactorDefinition, getAllFactorDefinitions, getFactorsByGroup, getFactorIdsByGroup, getFactorName, getFactorDefaultValue, getFactorPossibleValues, isValidFactorValue, getFactorCssProperty, getFactorDataAttribute, getAllFactorGroups, getFactorCountByGroup, getFactorsInRange, searchFactors, } from './ui-studio';
|
|
41
|
+
export { VALID_TIERS, isValidTier, assertValidTier, parseTier, getTierOrDefault, suggestTier, isValidFactorId, validateFactorId, validateFactorValueInput, validateFactorOverrides, assertValidFactorId, parseFactorId, VALID_COMPONENT_TYPES, isValidComponentType, validateComponentType, assertValidComponentType, parseComponentType, getComponentTypeOrDefault, suggestComponentType, getComponentTypesByCategory, getAllComponentCategories, VALID_DESIGN_SYSTEMS, isValidDesignSystem, assertValidDesignSystem, parseDesignSystem, getDesignSystemOrDefault, suggestDesignSystem, getDesignSystemDisplayName, getDesignSystemOrigin, getAllDesignSystems, validateSectionConfig, validateSectionFactors, createValidatedConfig, createValidatedFactors, isSectionCategory, isLayoutType, isSpacingLevel, isSectionDesignSystem, isSectionTier, validateSlotConfig, validateSlotConfigs, validateStoredComponent, validateComponentInSlot, validateComponentsInSlot, createValidatedSlotConfig, createValidatedStoredComponent, isSlotPosition, isComponentType, isValidSlotConfig, isValidStoredComponent, DEFAULT_HEADER_SLOT, DEFAULT_CONTENT_SLOT, DEFAULT_FOOTER_SLOT, DEFAULT_SIDEBAR_SLOT, DEFAULT_OVERLAY_SLOT, getDefaultSlotConfig, } from './validators';
|
|
42
|
+
export type { FactorId, FactorGroup, FactorDefinition, FactorValue, TierCodeFeatures, LocRange, FactorRange, TierRegistryEntry, FactorApplicability, ComponentRegistryEntry, DesignSystemRegistryEntry, ValidatorFn, } from './types/algorithm-engine.types';
|
|
43
|
+
export { main } from './cli/index';
|
|
44
|
+
export { generateCommand, parseGenerateArgs } from './cli/generate-command';
|
|
45
|
+
export type { GenerateCommandOptions, GenerateCommandResult } from './cli/generate-command';
|
|
46
|
+
export { BatchCommand, createBatchCommand, executeBatch, getBatchEstimate, parseBatchArgs, } from './cli/batch-command';
|
|
47
|
+
export type { BatchCommandOptions, BatchProgressCallback } from './cli/batch-command';
|
|
48
|
+
export type { Factor24Config, ResolutionResult, SemanticIntent, SemanticMood, } from './resolution/types';
|
|
49
|
+
export type { Tier, DesignSystem, ComponentType, ComponentGranularity, Framework, FactorConfig, GenerationConfig, ComponentRegistryDefinition, } from './types';
|
|
50
|
+
export * from './types/Result';
|
|
51
|
+
export * from './types/Option';
|
|
52
|
+
export { CURRENT_COMPONENT_TYPES, ALL_COMPONENT_TYPES, COMPONENT_CATEGORIES, getComponentCategory, CURRENT_DESIGN_SYSTEMS, DESIGN_SYSTEM_INFO, TIERS, TIER_INFO, CURRENT_FRAMEWORKS, } from './constants';
|
|
53
|
+
export * from './utils';
|
|
54
|
+
export { MatrixResolver, ClassMapper, } from './ui-studio';
|
|
55
|
+
export type { IMatrixResolver, IClassMapper, MatrixResolverInput, ResolvedComponentConfig, Matrix1Result, Matrix2Result, Matrix3Result, Matrix4Result, } from './ui-studio/matrix/types';
|
|
56
|
+
export { TFCGAdapter, getTFCGAdapter, convertLegacyOptions, convertLegacyBatch, } from './adapters';
|
|
57
|
+
export type { LegacyMatrixOptions } from './adapters';
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|