@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,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factor Propagator
|
|
3
|
+
* Propagates 13 section factors to child components
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module generators/FactorPropagator
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* The FactorPropagator:
|
|
10
|
+
* 1. Takes 13 SectionFactors
|
|
11
|
+
* 2. Maps factors to component props
|
|
12
|
+
* 3. Filters factors by tier availability
|
|
13
|
+
* 4. Generates CSS variables and data attributes
|
|
14
|
+
*
|
|
15
|
+
* Powered by Nikkory
|
|
16
|
+
*/
|
|
17
|
+
import type { Tier } from '../../types';
|
|
18
|
+
import type { FactorId } from '../../types/algorithm-engine.types';
|
|
19
|
+
import type { SectionFactors } from '../../types/section.types';
|
|
20
|
+
/**
|
|
21
|
+
* Factor to prop mapping definition
|
|
22
|
+
*/
|
|
23
|
+
export interface FactorPropMapping {
|
|
24
|
+
/** Factor name (from SectionFactors) */
|
|
25
|
+
readonly factorName: keyof SectionFactors;
|
|
26
|
+
/** Component prop name */
|
|
27
|
+
readonly propName: string;
|
|
28
|
+
/** CSS variable name */
|
|
29
|
+
readonly cssVariable: string;
|
|
30
|
+
/** Data attribute name */
|
|
31
|
+
readonly dataAttribute: string;
|
|
32
|
+
/** Tailwind class prefix */
|
|
33
|
+
readonly tailwindPrefix?: string;
|
|
34
|
+
/** Factor ID (1-24) for tier filtering */
|
|
35
|
+
readonly factorId: FactorId;
|
|
36
|
+
/** Factor category */
|
|
37
|
+
readonly category: 'visual' | 'layout' | 'behavior';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Propagated factor result
|
|
41
|
+
*/
|
|
42
|
+
export interface PropagatedFactor {
|
|
43
|
+
/** Factor name */
|
|
44
|
+
readonly name: string;
|
|
45
|
+
/** Factor value */
|
|
46
|
+
readonly value: string;
|
|
47
|
+
/** Mapped prop name */
|
|
48
|
+
readonly propName: string;
|
|
49
|
+
/** CSS variable */
|
|
50
|
+
readonly cssVariable: string;
|
|
51
|
+
/** Data attribute */
|
|
52
|
+
readonly dataAttribute: string;
|
|
53
|
+
/** Generated Tailwind class (if applicable) */
|
|
54
|
+
readonly tailwindClass?: string;
|
|
55
|
+
/** Whether factor is enabled for the tier */
|
|
56
|
+
readonly enabledForTier: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Factor propagation result
|
|
60
|
+
*/
|
|
61
|
+
export interface FactorPropagationResult {
|
|
62
|
+
/** All propagated factors */
|
|
63
|
+
readonly factors: readonly PropagatedFactor[];
|
|
64
|
+
/** Factors enabled for tier */
|
|
65
|
+
readonly enabledFactors: readonly PropagatedFactor[];
|
|
66
|
+
/** Factors disabled for tier */
|
|
67
|
+
readonly disabledFactors: readonly PropagatedFactor[];
|
|
68
|
+
/** Props object for component */
|
|
69
|
+
readonly props: Record<string, unknown>;
|
|
70
|
+
/** CSS variables object */
|
|
71
|
+
readonly cssVariables: Record<string, string>;
|
|
72
|
+
/** Data attributes array */
|
|
73
|
+
readonly dataAttributes: readonly string[];
|
|
74
|
+
/** Tailwind classes string */
|
|
75
|
+
readonly tailwindClasses: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Factor propagation input
|
|
79
|
+
*/
|
|
80
|
+
export interface FactorPropagationInput {
|
|
81
|
+
/** Section factors (13 factors) */
|
|
82
|
+
readonly factors: SectionFactors;
|
|
83
|
+
/** Quality tier for filtering */
|
|
84
|
+
readonly tier: Tier;
|
|
85
|
+
/** Component type (for specific mappings) */
|
|
86
|
+
readonly componentType?: string;
|
|
87
|
+
/** Override specific factor mappings */
|
|
88
|
+
readonly mappingOverrides?: Partial<Record<keyof SectionFactors, string>>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Factor propagator options
|
|
92
|
+
*/
|
|
93
|
+
export interface FactorPropagatorOptions {
|
|
94
|
+
/** Include disabled factors in output */
|
|
95
|
+
readonly includeDisabled?: boolean;
|
|
96
|
+
/** Prefix for CSS variables */
|
|
97
|
+
readonly cssVariablePrefix?: string;
|
|
98
|
+
/** Prefix for data attributes */
|
|
99
|
+
readonly dataAttributePrefix?: string;
|
|
100
|
+
/** Generate Tailwind classes */
|
|
101
|
+
readonly generateTailwind?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Complete mapping of 13 section factors to component props
|
|
105
|
+
*
|
|
106
|
+
* @remarks
|
|
107
|
+
* Each section factor maps to:
|
|
108
|
+
* - Component prop name
|
|
109
|
+
* - CSS variable
|
|
110
|
+
* - Data attribute
|
|
111
|
+
* - Optional Tailwind prefix
|
|
112
|
+
*/
|
|
113
|
+
export declare const SECTION_FACTOR_MAPPINGS: readonly FactorPropMapping[];
|
|
114
|
+
/**
|
|
115
|
+
* Factor Propagator
|
|
116
|
+
*
|
|
117
|
+
* Propagates 13 section factors to child components with tier-based filtering.
|
|
118
|
+
* Maps factors to props, CSS variables, data attributes, and Tailwind classes.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const propagator = new FactorPropagator();
|
|
123
|
+
*
|
|
124
|
+
* const result = propagator.propagate({
|
|
125
|
+
* factors: {
|
|
126
|
+
* colorPrimary: '#2196f3',
|
|
127
|
+
* colorText: '#1a1a1a',
|
|
128
|
+
* colorBackground: '#ffffff',
|
|
129
|
+
* typography: 'default',
|
|
130
|
+
* borderRadius: 'md',
|
|
131
|
+
* elevation: 'sm',
|
|
132
|
+
* padding: 'lg',
|
|
133
|
+
* gap: 'md',
|
|
134
|
+
* alignment: 'center',
|
|
135
|
+
* maxWidth: 'xl',
|
|
136
|
+
* animation: 'smooth',
|
|
137
|
+
* responsive: { mobile: 'stack', tablet: 'grid', desktop: 'grid' },
|
|
138
|
+
* a11yLevel: 'enhanced',
|
|
139
|
+
* },
|
|
140
|
+
* tier: 'enterprise',
|
|
141
|
+
* });
|
|
142
|
+
*
|
|
143
|
+
* console.log(result.props);
|
|
144
|
+
* console.log(result.tailwindClasses);
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
export declare class FactorPropagator {
|
|
148
|
+
private readonly options;
|
|
149
|
+
/**
|
|
150
|
+
* Create a new FactorPropagator instance
|
|
151
|
+
*
|
|
152
|
+
* @param options - Propagator options
|
|
153
|
+
*/
|
|
154
|
+
constructor(options?: FactorPropagatorOptions);
|
|
155
|
+
/**
|
|
156
|
+
* Propagate factors to component props
|
|
157
|
+
*
|
|
158
|
+
* @param input - Factor propagation input
|
|
159
|
+
* @returns Factor propagation result
|
|
160
|
+
*/
|
|
161
|
+
propagate(input: FactorPropagationInput): FactorPropagationResult;
|
|
162
|
+
/**
|
|
163
|
+
* Get factors enabled for a specific tier
|
|
164
|
+
*
|
|
165
|
+
* @param tier - Quality tier
|
|
166
|
+
* @returns Factor IDs enabled for tier
|
|
167
|
+
*/
|
|
168
|
+
getFactorsForTier(tier: Tier): readonly FactorId[];
|
|
169
|
+
/**
|
|
170
|
+
* Check if a factor is enabled for a tier
|
|
171
|
+
*
|
|
172
|
+
* @param factorName - Factor name
|
|
173
|
+
* @param tier - Quality tier
|
|
174
|
+
* @returns Whether factor is enabled
|
|
175
|
+
*/
|
|
176
|
+
isFactorEnabled(factorName: keyof SectionFactors, tier: Tier): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Get all factor mappings
|
|
179
|
+
*
|
|
180
|
+
* @returns All 13 factor mappings
|
|
181
|
+
*/
|
|
182
|
+
getAllMappings(): readonly FactorPropMapping[];
|
|
183
|
+
/**
|
|
184
|
+
* Get mappings by category
|
|
185
|
+
*
|
|
186
|
+
* @param category - Factor category
|
|
187
|
+
* @returns Factor mappings in category
|
|
188
|
+
*/
|
|
189
|
+
getMappingsByCategory(category: 'visual' | 'layout' | 'behavior'): readonly FactorPropMapping[];
|
|
190
|
+
/**
|
|
191
|
+
* Get Tailwind class for a factor value
|
|
192
|
+
*
|
|
193
|
+
* @param factorName - Factor name
|
|
194
|
+
* @param value - Factor value
|
|
195
|
+
* @returns Tailwind class or undefined
|
|
196
|
+
*/
|
|
197
|
+
getTailwindClass(factorName: keyof SectionFactors, value: unknown): string | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Map a single factor to component prop
|
|
200
|
+
*
|
|
201
|
+
* @param factorName - Factor name
|
|
202
|
+
* @param value - Factor value
|
|
203
|
+
* @returns Mapped prop object
|
|
204
|
+
*/
|
|
205
|
+
mapFactorToProp(factorName: keyof SectionFactors, value: unknown): {
|
|
206
|
+
propName: string;
|
|
207
|
+
value: unknown;
|
|
208
|
+
} | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* Convert a value to string representation
|
|
211
|
+
*/
|
|
212
|
+
private valueToString;
|
|
213
|
+
/**
|
|
214
|
+
* Build props object from propagated factors
|
|
215
|
+
*/
|
|
216
|
+
private buildPropsObject;
|
|
217
|
+
/**
|
|
218
|
+
* Build CSS variables object
|
|
219
|
+
*/
|
|
220
|
+
private buildCssVariables;
|
|
221
|
+
/**
|
|
222
|
+
* Build data attributes array
|
|
223
|
+
*/
|
|
224
|
+
private buildDataAttributes;
|
|
225
|
+
/**
|
|
226
|
+
* Build Tailwind classes string
|
|
227
|
+
*/
|
|
228
|
+
private buildTailwindClasses;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Create a new FactorPropagator instance
|
|
232
|
+
*
|
|
233
|
+
* @param options - Propagator options
|
|
234
|
+
* @returns New FactorPropagator instance
|
|
235
|
+
*/
|
|
236
|
+
export declare function createFactorPropagator(options?: FactorPropagatorOptions): FactorPropagator;
|
|
237
|
+
/**
|
|
238
|
+
* Propagate factors (convenience wrapper)
|
|
239
|
+
*
|
|
240
|
+
* @param input - Factor propagation input
|
|
241
|
+
* @returns Factor propagation result
|
|
242
|
+
*/
|
|
243
|
+
export declare function propagateFactors(input: FactorPropagationInput): FactorPropagationResult;
|
|
244
|
+
/**
|
|
245
|
+
* Get Tailwind classes for section factors (convenience wrapper)
|
|
246
|
+
*
|
|
247
|
+
* @param factors - Section factors
|
|
248
|
+
* @param tier - Quality tier
|
|
249
|
+
* @returns Tailwind classes string
|
|
250
|
+
*/
|
|
251
|
+
export declare function getFactorTailwindClasses(factors: SectionFactors, tier: Tier): string;
|
|
252
|
+
/**
|
|
253
|
+
* Get CSS variables for section factors (convenience wrapper)
|
|
254
|
+
*
|
|
255
|
+
* @param factors - Section factors
|
|
256
|
+
* @param tier - Quality tier
|
|
257
|
+
* @returns CSS variables object
|
|
258
|
+
*/
|
|
259
|
+
export declare function getFactorCssVariables(factors: SectionFactors, tier: Tier): Record<string, string>;
|
|
260
|
+
/**
|
|
261
|
+
* Map factors to component props (convenience wrapper)
|
|
262
|
+
*
|
|
263
|
+
* @param factors - Section factors
|
|
264
|
+
* @param tier - Quality tier
|
|
265
|
+
* @returns Props object
|
|
266
|
+
*/
|
|
267
|
+
export declare function mapFactorsToProps(factors: SectionFactors, tier: Tier): Record<string, unknown>;
|
|
268
|
+
//# sourceMappingURL=FactorPropagator.d.ts.map
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageGenerator - Composes pages from sections, layouts from pages
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* @module generators/PageGenerator
|
|
5
|
+
* @since 4.0.0
|
|
6
|
+
*
|
|
7
|
+
* Pattern:
|
|
8
|
+
* - Slot Composition: Pages compose sections via named slots
|
|
9
|
+
* - Children Composition: Layouts compose pages via children prop
|
|
10
|
+
* - Template Composition: Templates compose multiple pages
|
|
11
|
+
*
|
|
12
|
+
* Powered by Nikkory
|
|
13
|
+
*/
|
|
14
|
+
import type { GenerationResult } from '../types';
|
|
15
|
+
import type { RegistrySectionDefinition, RegistryPageDefinition, RegistryLayoutDefinition, RegistryTemplateDefinition } from '../presets/registry.types';
|
|
16
|
+
import type { DesignSystem, Tier } from '../types';
|
|
17
|
+
/**
|
|
18
|
+
* Composition strategy types
|
|
19
|
+
*/
|
|
20
|
+
export type CompositionStrategy = 'slots' | 'children' | 'template';
|
|
21
|
+
/**
|
|
22
|
+
* Configuration for composition generation
|
|
23
|
+
*/
|
|
24
|
+
export interface CompositionConfig {
|
|
25
|
+
/**
|
|
26
|
+
* Parent component (page, layout, or template)
|
|
27
|
+
*/
|
|
28
|
+
readonly parent: RegistryPageDefinition | RegistryLayoutDefinition | RegistryTemplateDefinition;
|
|
29
|
+
/**
|
|
30
|
+
* Child components to compose
|
|
31
|
+
*/
|
|
32
|
+
readonly children: ReadonlyArray<RegistrySectionDefinition | RegistryPageDefinition>;
|
|
33
|
+
/**
|
|
34
|
+
* Composition strategy
|
|
35
|
+
*/
|
|
36
|
+
readonly strategy: CompositionStrategy;
|
|
37
|
+
/**
|
|
38
|
+
* Design system to apply
|
|
39
|
+
*/
|
|
40
|
+
readonly designSystem: DesignSystem;
|
|
41
|
+
/**
|
|
42
|
+
* Quality tier to generate
|
|
43
|
+
*/
|
|
44
|
+
readonly tier: Tier;
|
|
45
|
+
/**
|
|
46
|
+
* Output directory for generated files
|
|
47
|
+
*/
|
|
48
|
+
readonly outputDir: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Slot definition for slot-based composition
|
|
52
|
+
*/
|
|
53
|
+
export interface SlotDefinition {
|
|
54
|
+
/**
|
|
55
|
+
* Slot name (e.g., 'hero', 'features', 'footer')
|
|
56
|
+
*/
|
|
57
|
+
readonly name: string;
|
|
58
|
+
/**
|
|
59
|
+
* Component to render in this slot
|
|
60
|
+
*/
|
|
61
|
+
readonly component: RegistrySectionDefinition;
|
|
62
|
+
/**
|
|
63
|
+
* Whether slot is required
|
|
64
|
+
*/
|
|
65
|
+
readonly required: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Default component if slot is empty
|
|
68
|
+
*/
|
|
69
|
+
readonly defaultComponent?: RegistrySectionDefinition;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* PageGenerator - Main page composition engine
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const generator = new PageGenerator();
|
|
77
|
+
* const result = generator.generateComposition({
|
|
78
|
+
* parent: LANDING_PAGE_DEFINITION,
|
|
79
|
+
* children: [HERO_SECTION, FEATURES_SECTION, CTA_SECTION],
|
|
80
|
+
* strategy: 'slots',
|
|
81
|
+
* designSystem: 'material-design',
|
|
82
|
+
* tier: 'enterprise',
|
|
83
|
+
* outputDir: './src/pages',
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare class PageGenerator {
|
|
88
|
+
/**
|
|
89
|
+
* Generate a composition (page from sections, layout from pages, etc.)
|
|
90
|
+
*
|
|
91
|
+
* @param config - Composition configuration
|
|
92
|
+
* @returns Generation result with file paths and metadata
|
|
93
|
+
*/
|
|
94
|
+
generateComposition(config: CompositionConfig): GenerationResult;
|
|
95
|
+
/**
|
|
96
|
+
* Generate page from sections (slot-based composition)
|
|
97
|
+
*
|
|
98
|
+
* @param page - Page definition
|
|
99
|
+
* @param sections - Section definitions to compose
|
|
100
|
+
* @param designSystem - Design system to apply
|
|
101
|
+
* @param tier - Quality tier
|
|
102
|
+
* @param outputDir - Output directory
|
|
103
|
+
* @param features - Tier-specific features
|
|
104
|
+
* @returns Generation result
|
|
105
|
+
*/
|
|
106
|
+
private generateSlotComposition;
|
|
107
|
+
/**
|
|
108
|
+
* Generate layout from pages (children-based composition)
|
|
109
|
+
*
|
|
110
|
+
* @param layout - Layout definition
|
|
111
|
+
* @param pages - Page definitions to compose
|
|
112
|
+
* @param designSystem - Design system to apply
|
|
113
|
+
* @param tier - Quality tier
|
|
114
|
+
* @param outputDir - Output directory
|
|
115
|
+
* @param features - Tier-specific features
|
|
116
|
+
* @returns Generation result
|
|
117
|
+
*/
|
|
118
|
+
private generateChildrenComposition;
|
|
119
|
+
/**
|
|
120
|
+
* Generate template from multiple pages (template composition)
|
|
121
|
+
*
|
|
122
|
+
* @param template - Template definition
|
|
123
|
+
* @param pages - Page definitions to include
|
|
124
|
+
* @param designSystem - Design system to apply
|
|
125
|
+
* @param tier - Quality tier
|
|
126
|
+
* @param outputDir - Output directory
|
|
127
|
+
* @param features - Tier-specific features
|
|
128
|
+
* @returns Generation result
|
|
129
|
+
*/
|
|
130
|
+
private generateTemplateComposition;
|
|
131
|
+
/**
|
|
132
|
+
* Build slots from page and sections
|
|
133
|
+
*/
|
|
134
|
+
private buildSlots;
|
|
135
|
+
/**
|
|
136
|
+
* Generate component code for slot-based composition
|
|
137
|
+
*/
|
|
138
|
+
private generateSlotComponentCode;
|
|
139
|
+
/**
|
|
140
|
+
* Generate component code for children-based composition
|
|
141
|
+
*/
|
|
142
|
+
private generateChildrenComponentCode;
|
|
143
|
+
/**
|
|
144
|
+
* Generate component code for template composition
|
|
145
|
+
*/
|
|
146
|
+
private generateTemplateComponentCode;
|
|
147
|
+
/**
|
|
148
|
+
* Build template data for page composition
|
|
149
|
+
*/
|
|
150
|
+
private buildPageTemplateData;
|
|
151
|
+
/**
|
|
152
|
+
* Build template data for layout composition
|
|
153
|
+
*/
|
|
154
|
+
private buildLayoutTemplateData;
|
|
155
|
+
/**
|
|
156
|
+
* Build template data for template composition
|
|
157
|
+
*/
|
|
158
|
+
private buildTemplateTemplateData;
|
|
159
|
+
/**
|
|
160
|
+
* Build imports based on features
|
|
161
|
+
*/
|
|
162
|
+
private buildImports;
|
|
163
|
+
/**
|
|
164
|
+
* Get component name from definition ID, design system, and tier
|
|
165
|
+
*/
|
|
166
|
+
private getComponentName;
|
|
167
|
+
/**
|
|
168
|
+
* Get component file name
|
|
169
|
+
*/
|
|
170
|
+
private getComponentFileName;
|
|
171
|
+
/**
|
|
172
|
+
* Capitalize first letter of string
|
|
173
|
+
*/
|
|
174
|
+
private capitalizeFirst;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=PageGenerator.d.ts.map
|