@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,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factor Resolver
|
|
3
|
+
* 3-Layer resolution engine: Tier → Component → Design System
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module generators/FactorResolver
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* Powered by Nikkory
|
|
10
|
+
*/
|
|
11
|
+
import type { DesignSystem, ComponentType } from '../types';
|
|
12
|
+
import type { FactorId, FactorValue, ResolvedFactors, FactorResolverInput } from '../../types/algorithm-engine.types';
|
|
13
|
+
/**
|
|
14
|
+
* Factor Resolver
|
|
15
|
+
*
|
|
16
|
+
* Resolves factors through a 3-layer system:
|
|
17
|
+
* - Layer 1: Tier defines factor RANGE (1-6, 1-14, 1-24)
|
|
18
|
+
* - Layer 2: Component defines factor APPLICABILITY (null = skip)
|
|
19
|
+
* - Layer 3: Design System defines factor VALUES (Tailwind classes)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const resolver = new FactorResolver();
|
|
24
|
+
* const resolved = resolver.resolve({
|
|
25
|
+
* componentType: 'button',
|
|
26
|
+
* designSystem: 'material-design',
|
|
27
|
+
* tier: 'enterprise',
|
|
28
|
+
* factorOverrides: { 2: 'lg' }, // Override size to large
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // resolved.appliedFactors contains Map of FactorId -> FactorValue
|
|
32
|
+
* // resolved.skippedFactors contains FactorIds that don't apply to button
|
|
33
|
+
* // resolved.overriddenFactors contains FactorIds that were overridden
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class FactorResolver {
|
|
37
|
+
/**
|
|
38
|
+
* Resolve factors through 3-layer system
|
|
39
|
+
*
|
|
40
|
+
* @param input - Resolution input with component, design system, tier, and overrides
|
|
41
|
+
* @returns Resolved factors with applied, skipped, and overridden lists
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Resolution flow:
|
|
45
|
+
* 1. Get factors enabled for the tier (1-6, 1-14, or 1-24)
|
|
46
|
+
* 2. Filter by component applicability (null factors are skipped)
|
|
47
|
+
* 3. Get values from design system registry
|
|
48
|
+
* 4. Apply any user overrides
|
|
49
|
+
*/
|
|
50
|
+
resolve(input: FactorResolverInput): ResolvedFactors;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve a single factor for a design system
|
|
53
|
+
*
|
|
54
|
+
* @param designSystem - Design system to get value from
|
|
55
|
+
* @param factorId - Factor ID to resolve
|
|
56
|
+
* @returns Factor value or undefined
|
|
57
|
+
*/
|
|
58
|
+
resolveSingleFactor(designSystem: DesignSystem, factorId: FactorId): FactorValue | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a factor is applicable for a component
|
|
61
|
+
*
|
|
62
|
+
* @param componentType - Component type to check
|
|
63
|
+
* @param factorId - Factor ID to check
|
|
64
|
+
* @returns True if factor is applicable
|
|
65
|
+
*/
|
|
66
|
+
isFactorApplicableForComponent(componentType: ComponentType, factorId: FactorId): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Get the applicability type for a factor on a component
|
|
69
|
+
*
|
|
70
|
+
* @param componentType - Component type to check
|
|
71
|
+
* @param factorId - Factor ID to check
|
|
72
|
+
* @returns 'not-applicable', 'default', or 'override'
|
|
73
|
+
*/
|
|
74
|
+
getApplicabilityType(componentType: ComponentType, factorId: FactorId): 'not-applicable' | 'default' | 'override';
|
|
75
|
+
/**
|
|
76
|
+
* Get all factors that will be applied for a given configuration
|
|
77
|
+
*
|
|
78
|
+
* @param input - Resolution input
|
|
79
|
+
* @returns Array of factor IDs that will be applied
|
|
80
|
+
*/
|
|
81
|
+
getApplicableFactorIds(input: Omit<FactorResolverInput, 'factorOverrides'>): FactorId[];
|
|
82
|
+
/**
|
|
83
|
+
* Validate that all overrides are valid
|
|
84
|
+
*
|
|
85
|
+
* @param factorOverrides - Overrides to validate
|
|
86
|
+
* @returns Object with valid flag and any error messages
|
|
87
|
+
*/
|
|
88
|
+
validateOverrides(factorOverrides: Partial<Record<FactorId, string>>): {
|
|
89
|
+
valid: boolean;
|
|
90
|
+
errors: string[];
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Create a summary of resolved factors
|
|
94
|
+
*
|
|
95
|
+
* @param resolved - Resolved factors from resolve()
|
|
96
|
+
* @returns Summary object with counts and lists
|
|
97
|
+
*/
|
|
98
|
+
createResolutionSummary(resolved: ResolvedFactors): {
|
|
99
|
+
totalFactors: number;
|
|
100
|
+
appliedCount: number;
|
|
101
|
+
skippedCount: number;
|
|
102
|
+
overriddenCount: number;
|
|
103
|
+
appliedFactorNames: string[];
|
|
104
|
+
skippedFactorNames: string[];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Generate combined Tailwind classes from resolved factors
|
|
108
|
+
*
|
|
109
|
+
* @param resolved - Resolved factors from resolve()
|
|
110
|
+
* @returns Combined Tailwind class string
|
|
111
|
+
*/
|
|
112
|
+
generateTailwindClasses(resolved: ResolvedFactors): string;
|
|
113
|
+
/**
|
|
114
|
+
* Generate combined CSS variables from resolved factors
|
|
115
|
+
*
|
|
116
|
+
* @param resolved - Resolved factors from resolve()
|
|
117
|
+
* @returns Combined CSS variables object
|
|
118
|
+
*/
|
|
119
|
+
generateCssVariables(resolved: ResolvedFactors): Record<string, string>;
|
|
120
|
+
/**
|
|
121
|
+
* Create a FactorValue from an override value string
|
|
122
|
+
*
|
|
123
|
+
* @param factorId - Factor ID
|
|
124
|
+
* @param value - Override value
|
|
125
|
+
* @returns FactorValue with mapped Tailwind classes
|
|
126
|
+
*/
|
|
127
|
+
private createOverrideValue;
|
|
128
|
+
/**
|
|
129
|
+
* Map a factor value to Tailwind classes
|
|
130
|
+
*
|
|
131
|
+
* @param factorId - Factor ID
|
|
132
|
+
* @param value - Value to map
|
|
133
|
+
* @returns Tailwind class string
|
|
134
|
+
*/
|
|
135
|
+
private mapValueToTailwind;
|
|
136
|
+
/**
|
|
137
|
+
* Generate CSS variables for an override value
|
|
138
|
+
*
|
|
139
|
+
* @param factorId - Factor ID
|
|
140
|
+
* @param value - Override value
|
|
141
|
+
* @returns CSS variables object
|
|
142
|
+
*/
|
|
143
|
+
private generateCssVariablesForOverride;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Create a new FactorResolver instance
|
|
147
|
+
*
|
|
148
|
+
* @returns New FactorResolver instance
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const resolver = createFactorResolver();
|
|
153
|
+
* const resolved = resolver.resolve({
|
|
154
|
+
* componentType: 'button',
|
|
155
|
+
* designSystem: 'material-design',
|
|
156
|
+
* tier: 'enterprise',
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export declare function createFactorResolver(): FactorResolver;
|
|
161
|
+
/**
|
|
162
|
+
* Resolve factors with a single function call (convenience wrapper)
|
|
163
|
+
*
|
|
164
|
+
* @param input - Resolution input
|
|
165
|
+
* @returns Resolved factors
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* const resolved = resolveFactors({
|
|
170
|
+
* componentType: 'card',
|
|
171
|
+
* designSystem: 'glassmorphism',
|
|
172
|
+
* tier: 'standard',
|
|
173
|
+
* });
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
export declare function resolveFactors(input: FactorResolverInput): ResolvedFactors;
|
|
177
|
+
/**
|
|
178
|
+
* Get Tailwind classes for a component configuration
|
|
179
|
+
*
|
|
180
|
+
* @param input - Resolution input
|
|
181
|
+
* @returns Tailwind class string
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const classes = getTailwindClassesForComponent({
|
|
186
|
+
* componentType: 'button',
|
|
187
|
+
* designSystem: 'brutalism',
|
|
188
|
+
* tier: 'enterprise',
|
|
189
|
+
* });
|
|
190
|
+
* // Returns combined Tailwind classes for all applied factors
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare function getTailwindClassesForComponent(input: FactorResolverInput): string;
|
|
194
|
+
/**
|
|
195
|
+
* Get CSS variables for a component configuration
|
|
196
|
+
*
|
|
197
|
+
* @param input - Resolution input
|
|
198
|
+
* @returns CSS variables object
|
|
199
|
+
*/
|
|
200
|
+
export declare function getCssVariablesForComponent(input: FactorResolverInput): Record<string, string>;
|
|
201
|
+
//# sourceMappingURL=FactorResolver.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Generator
|
|
3
|
+
* Generates Vitest test files for components
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module ui-studio/templates/TestGenerator
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* Powered by Nikkory
|
|
10
|
+
*/
|
|
11
|
+
import type { ResolvedComponentConfig } from '../matrix/types';
|
|
12
|
+
/**
|
|
13
|
+
* TestGenerator
|
|
14
|
+
*
|
|
15
|
+
* Generates Vitest test files for components
|
|
16
|
+
* LOC breakdown by tier:
|
|
17
|
+
* - Basic: ~40 LOC (basic rendering tests)
|
|
18
|
+
* - Standard: ~70 LOC (+ variant/size tests)
|
|
19
|
+
* - Enterprise: ~100-150 LOC (+ analytics, accessibility, state tests)
|
|
20
|
+
*/
|
|
21
|
+
export declare class TestGenerator {
|
|
22
|
+
/**
|
|
23
|
+
* Generate test file from resolved component configuration
|
|
24
|
+
*
|
|
25
|
+
* @param resolved - Resolved component configuration from Matrix
|
|
26
|
+
* @returns Vitest test code
|
|
27
|
+
*/
|
|
28
|
+
generateFromResolvedConfig(resolved: ResolvedComponentConfig): string;
|
|
29
|
+
/**
|
|
30
|
+
* Generate Basic tier tests
|
|
31
|
+
* - Rendering test
|
|
32
|
+
* - Children test
|
|
33
|
+
* - ClassName test
|
|
34
|
+
*/
|
|
35
|
+
private generateBasicTests;
|
|
36
|
+
/**
|
|
37
|
+
* Generate Standard tier tests
|
|
38
|
+
* - All Basic tests
|
|
39
|
+
* - Variant tests
|
|
40
|
+
* - Size tests
|
|
41
|
+
* - Ref forwarding test
|
|
42
|
+
*/
|
|
43
|
+
private generateStandardTests;
|
|
44
|
+
/**
|
|
45
|
+
* Generate Enterprise tier tests
|
|
46
|
+
* - All Standard tests
|
|
47
|
+
* - Analytics tests
|
|
48
|
+
* - Event handler tests
|
|
49
|
+
* - Accessibility tests
|
|
50
|
+
* - Loading state tests
|
|
51
|
+
* - Memoization tests
|
|
52
|
+
*/
|
|
53
|
+
private generateEnterpriseTests;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=TestGenerator.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TierGenerator - Generates React components with A+a+b incremental pattern
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* @module generators/TierGenerator
|
|
5
|
+
* @since 4.0.0
|
|
6
|
+
*
|
|
7
|
+
* Pattern:
|
|
8
|
+
* - Basic (A): Core functionality (30-50 LOC)
|
|
9
|
+
* - Standard (A+a): + forwardRef, displayName, variants (50-150 LOC)
|
|
10
|
+
* - Enterprise (A+a+b): + memo, useCallback, analytics, ARIA (150-300 LOC)
|
|
11
|
+
*
|
|
12
|
+
* Powered by Nikkory
|
|
13
|
+
*/
|
|
14
|
+
import type { TierGenerationConfig, GenerationResult, BatchGenerationConfig, BatchGenerationResult } from '../types';
|
|
15
|
+
/**
|
|
16
|
+
* TierGenerator - Main component generation engine
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const generator = new TierGenerator();
|
|
21
|
+
* const result = await generator.generate({
|
|
22
|
+
* definition: BUTTON_DEFINITION,
|
|
23
|
+
* designSystem: 'material-design',
|
|
24
|
+
* tier: 'enterprise',
|
|
25
|
+
* outputDir: './src/components',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class TierGenerator {
|
|
30
|
+
/**
|
|
31
|
+
* Generate a single component
|
|
32
|
+
*
|
|
33
|
+
* @param config - Generation configuration
|
|
34
|
+
* @returns Generation result with file paths and metadata
|
|
35
|
+
*/
|
|
36
|
+
generate(config: TierGenerationConfig): GenerationResult;
|
|
37
|
+
/**
|
|
38
|
+
* Generate multiple components in batch
|
|
39
|
+
*
|
|
40
|
+
* @param config - Batch generation configuration
|
|
41
|
+
* @returns Batch generation result with statistics
|
|
42
|
+
*/
|
|
43
|
+
generateBatch(config: BatchGenerationConfig): BatchGenerationResult;
|
|
44
|
+
/**
|
|
45
|
+
* Build template data from registry definition
|
|
46
|
+
*/
|
|
47
|
+
private buildTemplateData;
|
|
48
|
+
/**
|
|
49
|
+
* Generate component code from ResolvedComponentConfig (for ComponentGenerator)
|
|
50
|
+
*
|
|
51
|
+
* @param config - Resolved component configuration from MatrixResolver
|
|
52
|
+
* @returns Generated TypeScript component code
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const generator = new TierGenerator();
|
|
57
|
+
* const code = generator.generateFromResolvedConfig({
|
|
58
|
+
* componentName: 'MaterialButtonEnterprise',
|
|
59
|
+
* elementType: 'button',
|
|
60
|
+
* tier: 'enterprise',
|
|
61
|
+
* designSystem: 'material-design',
|
|
62
|
+
* classNames: ['rounded-lg', 'shadow-md'],
|
|
63
|
+
* imports: ["import { memo, forwardRef } from 'react';"],
|
|
64
|
+
* wrappers: ['memo', 'forwardRef'],
|
|
65
|
+
* features: ['displayName', 'analytics']
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
generateFromResolvedConfig(config: {
|
|
70
|
+
readonly componentName: string;
|
|
71
|
+
readonly elementType: string;
|
|
72
|
+
readonly tier: string;
|
|
73
|
+
readonly designSystem: string;
|
|
74
|
+
readonly classNames: readonly string[];
|
|
75
|
+
readonly imports: readonly string[];
|
|
76
|
+
readonly wrappers: readonly string[];
|
|
77
|
+
readonly features: readonly string[];
|
|
78
|
+
}): string;
|
|
79
|
+
/**
|
|
80
|
+
* Generate component code based on tier (A, A+a, A+a+b pattern)
|
|
81
|
+
*/
|
|
82
|
+
private generateComponentCode;
|
|
83
|
+
/**
|
|
84
|
+
* Generate Basic tier component (A pattern)
|
|
85
|
+
* - Core functionality only
|
|
86
|
+
* - React.FC with basic props
|
|
87
|
+
* - 30-50 LOC
|
|
88
|
+
*/
|
|
89
|
+
private generateBasicTier;
|
|
90
|
+
/**
|
|
91
|
+
* Generate Standard tier component (A+a pattern)
|
|
92
|
+
* - Basic functionality + enhancements
|
|
93
|
+
* - forwardRef, displayName, variants
|
|
94
|
+
* - 50-150 LOC
|
|
95
|
+
*/
|
|
96
|
+
private generateStandardTier;
|
|
97
|
+
/**
|
|
98
|
+
* Generate Enterprise tier component (A+a+b pattern)
|
|
99
|
+
* - Standard functionality + advanced features
|
|
100
|
+
* - memo, useCallback, analytics, ARIA
|
|
101
|
+
* - 150-300 LOC
|
|
102
|
+
*/
|
|
103
|
+
private generateEnterpriseTier;
|
|
104
|
+
/**
|
|
105
|
+
* Generate TypeScript types file
|
|
106
|
+
*/
|
|
107
|
+
private generateTypesFile;
|
|
108
|
+
/**
|
|
109
|
+
* Generate test file
|
|
110
|
+
*/
|
|
111
|
+
private generateTestFile;
|
|
112
|
+
/**
|
|
113
|
+
* Generate Storybook story file
|
|
114
|
+
*/
|
|
115
|
+
private generateStoryFile;
|
|
116
|
+
/**
|
|
117
|
+
* Get component name from definition ID, design system, and tier
|
|
118
|
+
*/
|
|
119
|
+
private getComponentName;
|
|
120
|
+
/**
|
|
121
|
+
* Get component file name
|
|
122
|
+
*/
|
|
123
|
+
private getComponentFileName;
|
|
124
|
+
/**
|
|
125
|
+
* Get HTML element type from definition
|
|
126
|
+
*/
|
|
127
|
+
private getElementType;
|
|
128
|
+
/**
|
|
129
|
+
* Get base CSS classes
|
|
130
|
+
*/
|
|
131
|
+
private getBaseClasses;
|
|
132
|
+
/**
|
|
133
|
+
* Get variant definitions
|
|
134
|
+
*/
|
|
135
|
+
private getVariants;
|
|
136
|
+
/**
|
|
137
|
+
* Get default prop values
|
|
138
|
+
*/
|
|
139
|
+
private getDefaults;
|
|
140
|
+
/**
|
|
141
|
+
* Get imports based on features
|
|
142
|
+
*/
|
|
143
|
+
private getImports;
|
|
144
|
+
/**
|
|
145
|
+
* Get ARIA attributes
|
|
146
|
+
*/
|
|
147
|
+
private getAriaAttributes;
|
|
148
|
+
/**
|
|
149
|
+
* Capitalize first letter of string
|
|
150
|
+
*/
|
|
151
|
+
private capitalizeFirst;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=TierGenerator.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types Generator
|
|
3
|
+
* Generates TypeScript type definitions for components
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module ui-studio/templates/TypesGenerator
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* Powered by Nikkory
|
|
10
|
+
*/
|
|
11
|
+
import type { ResolvedComponentConfig } from '../matrix/types';
|
|
12
|
+
/**
|
|
13
|
+
* TypesGenerator
|
|
14
|
+
*
|
|
15
|
+
* Generates TypeScript type definition files for components
|
|
16
|
+
* LOC breakdown by tier:
|
|
17
|
+
* - Basic: ~20 LOC (basic interface only)
|
|
18
|
+
* - Standard: ~35 LOC (+ variant/size types)
|
|
19
|
+
* - Enterprise: ~50-80 LOC (+ event types, analytics types, state types)
|
|
20
|
+
*/
|
|
21
|
+
export declare class TypesGenerator {
|
|
22
|
+
/**
|
|
23
|
+
* Generate types file from resolved component configuration
|
|
24
|
+
*
|
|
25
|
+
* @param resolved - Resolved component configuration from Matrix
|
|
26
|
+
* @returns TypeScript type definitions code
|
|
27
|
+
*/
|
|
28
|
+
generateFromResolvedConfig(resolved: ResolvedComponentConfig): string;
|
|
29
|
+
/**
|
|
30
|
+
* Generate Basic tier types
|
|
31
|
+
* - Basic props interface
|
|
32
|
+
* - Children and className only
|
|
33
|
+
*/
|
|
34
|
+
private generateBasicTypes;
|
|
35
|
+
/**
|
|
36
|
+
* Generate Standard tier types
|
|
37
|
+
* - Props interface with variants
|
|
38
|
+
* - Variant and size type unions
|
|
39
|
+
*/
|
|
40
|
+
private generateStandardTypes;
|
|
41
|
+
/**
|
|
42
|
+
* Generate Enterprise tier types
|
|
43
|
+
* - Comprehensive props interface
|
|
44
|
+
* - Event handler types
|
|
45
|
+
* - Analytics types
|
|
46
|
+
* - State types
|
|
47
|
+
* - Accessibility types
|
|
48
|
+
*/
|
|
49
|
+
private generateEnterpriseTypes;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=TypesGenerator.d.ts.map
|